diff --git a/apps/AEPSampleAppNewArchEnabled/app/ContentCardsView.tsx b/apps/AEPSampleAppNewArchEnabled/app/ContentCardsView.tsx index 0133c833..725afb89 100644 --- a/apps/AEPSampleAppNewArchEnabled/app/ContentCardsView.tsx +++ b/apps/AEPSampleAppNewArchEnabled/app/ContentCardsView.tsx @@ -16,6 +16,8 @@ import { ThemeProvider, useContentCardUI, Pagination, + Messaging, + ContentCardContainerProvider, } from "@adobe/react-native-aepmessaging"; import React, { memo, useCallback, useEffect, useState } from "react"; import { @@ -102,7 +104,90 @@ const Header = ({ const colors = colorScheme === "dark" ? Colors.dark : Colors.light; - return {}} />; + return ( + + {/* View Picker */} + + Select View Type + setShowPicker(true)} + > + {selectedView} + + + + {/* Track Action Input */} + + Track Action + + + + + {isLoading ? 'Loading...' : 'Track'} + + + + + + {/* Theme Switcher */} + + Theme + + {THEME_OPTIONS.map(({ label, value }) => ( + handleThemeChange(label, value)} + > + + {label} + + + ))} + + + + {/* View Picker Modal */} + + setShowPicker(false)}> + + {VIEW_OPTIONS.map((option) => ( + { + setSelectedView(option); + setShowPicker(false); + }} + > + {option} + + ))} + setShowPicker(false)}> + Cancel + + + + + + ); }; const MemoHeader = memo(Header); @@ -110,6 +195,7 @@ const MemoHeader = memo(Header); const ContentCardsView = () => { const [selectedView, setSelectedView] = useState('Remote'); const [trackInput, setTrackInput] = useState(''); + const [containerSettings, setContainerSettings] = useState(null); const colorScheme = useColorScheme(); const [currentPage, setCurrentPage] = useState(1); @@ -119,6 +205,25 @@ const ContentCardsView = () => { : "rn/ios/remote_image"; const { content, isLoading, refetch } = useContentCardUI(surface); + // Load container settings for unread icon configuration + useEffect(() => { + const loadContainerSettings = async () => { + try { + const settings = await Messaging.getContentCardContainer(surface); + setContainerSettings(settings); + // Debug logging + // console.log('Container settings loaded:', JSON.stringify(settings, null, 2)); + // console.log('isUnreadEnabled:', settings?.content?.isUnreadEnabled); + // console.log('unread_indicator:', settings?.content?.unread_indicator); + // console.log('unread_icon image URL:', settings?.content?.unread_indicator?.unread_icon?.image?.url); + // console.log('unread_icon darkUrl:', settings?.content?.unread_indicator?.unread_icon?.image?.darkUrl); + } catch (error) { + console.error('Failed to load container settings:', error); + } + }; + loadContainerSettings(); + }, [surface]); + const items = ITEMS_BY_VIEW[selectedView]; const colors = colorScheme === "dark" ? Colors.dark : Colors.light; @@ -127,36 +232,110 @@ const ContentCardsView = () => { MobileCore.trackAction("small_image"); }, []); - return ( + const renderContentCard = (item: any, isRemote: boolean) => { + const cardView = ; + + if (!isRemote) { + return ( + + + {item.customThemes ? ( + + {cardView} + + ) : ( + cardView + )} + + ); + } + return cardView; + }; + + // Debug logging + // console.log('Rendering with containerSettings:', !!containerSettings); + // console.log('Selected view:', selectedView); + // console.log('Items count:', selectedView !== 'Remote' ? (items?.length || 0) : (content?.length || 0)); + + const content_with_provider = containerSettings ? ( + + + selectedView !== 'Remote' ? item.key : item.id + } + renderItem={({ item }: any) => + renderContentCard(item, selectedView === 'Remote') + } + ListHeaderComponent={ + + } + ListEmptyComponent={() => + selectedView === 'Remote' && ( + + + No Content Cards Available + + + Content cards will appear here when they are configured in Adobe + Journey Optimizer for surface: "rn/ios/remote_image" + + + Try tracking an action above to refresh content cards. + + + ) + } + contentContainerStyle={styles.listContent} + /> + + ) : null; + + return content_with_provider || ( selectedView !== 'Remote' ? item.key : item.id } - renderItem={({ item }: any) => { - if (selectedView !== 'Remote') { - const node = ( - - ); - return ( - - - {item.customThemes ? ( - - {node} - - ) : ( - node - )} - - ); - } - return ; - }} + renderItem={({ item }: any) => + renderContentCard(item, selectedView === 'Remote') + } ListHeaderComponent={ Promise; - getCachedMessages: () => Message[]; - getLatestMessage: () => Message; - getContentCardUI: (surface: string) => Promise; - getPropositionsForSurfaces: (surfaces: string[]) => Record; - refreshInAppMessages: () => void; - setMessagingDelegate: (delegate?: MessagingDelegate) => void; - setMessageSettings: (shouldShowMessage: boolean, shouldSaveMessage: boolean) => void; - updatePropositionsForSurfaces: (surfaces: string[]) => Promise; - trackContentCardDisplay: (proposition: MessagingProposition, contentCard: ContentCard) => void; - trackContentCardInteraction: (proposition: MessagingProposition, contentCard: ContentCard) => void; - trackPropositionItem: (itemId: string, interaction: string | null, eventType: number, tokens: string[] | null) => void; -} -declare class Messaging { - /** - * Returns the version of the AEPMessaging extension - * @returns {string} Promise a promise that resolves with the extension version - */ - static extensionVersion(): Promise; - /** - * Initiates a network call to retrieve remote In-App Message definitions. - */ - static refreshInAppMessages(): void; - /** - * Retrieves the list of messages which have been cached using the `shouldSaveMessage` - * method of the messaging delegate. - * Note: Messages should be cached before trying to use any of the methods on the message class - * @returns An array of messages that have been cached - */ - static getCachedMessages(): Promise; - /** - * Retrieves the last message that has been shown in the UI - * @returns The latest message to have been displayed - */ - static getLatestMessage(): Promise; - /** - * Retrieves the previously fetched (and cached) feeds content from the SDK for the provided surfaces. - * If the feeds content for one or more surfaces isn't previously cached in the SDK, it will not be retrieved from Adobe Journey Optimizer via the Experience Edge network. - * @param surfaces A list of surfaces to fetch - * @returns A record of surface names with their corresponding propositions - */ - static getPropositionsForSurfaces(surfaces: string[]): Promise>; - /** - * @deprecated Use PropositionItem.track(...) instead. - */ - static trackContentCardDisplay(proposition: MessagingProposition, contentCard: ContentCard): void; - /** - * @deprecated Use PropositionItem.track(...) instead. - */ - static trackContentCardInteraction(proposition: MessagingProposition, contentCard: ContentCard): void; - /** - * Tracks interactions with a PropositionItem using the provided interaction and event type. - * This method is used internally by the PropositionItem.track() method. - * - * @param {string} itemId - The unique identifier of the PropositionItem - * @param {string | null} interaction - A custom string value to be recorded in the interaction - * @param {number} eventType - The MessagingEdgeEventType numeric value - * @param {string[] | null} tokens - Array containing the sub-item tokens for recording interaction - */ - static trackPropositionItem(itemId: string, interaction: string | null, eventType: number, tokens: string[] | null): void; - /** - * Function to set the UI Message delegate to listen the Message lifecycle events. - * @returns A function to unsubscribe from all event listeners - */ - static setMessagingDelegate(delegate: MessagingDelegate): () => void; - /** - * Sets global settings for messages being shown and cached - * Note: This method is also used by MessagingDelegate.shouldShowMessage, - * which allows finer-grained control over setting these settings - * @param shouldShowMessage Whether or not a message should be displayed - * @param shouldSaveMessage Whether or not a message should be cached - */ - static setMessageSettings(shouldShowMessage: boolean, shouldSaveMessage: boolean): void; - /** - * Dispatches an event to fetch propositions for the provided surfaces from remote. - * @param surfaces A list of surface names to update - */ - static updatePropositionsForSurfaces(surfaces: string[]): Promise; - /** - * @experimental - * Retrieves the content card UI data for a given surface. - * @param surface The surface to get the content card UI data for - * @returns The content card UI data for the given surface - */ - static getContentCardUI(surface: string): Promise; -} -export default Messaging; diff --git a/packages/messaging/dist/Messaging.js b/packages/messaging/dist/Messaging.js deleted file mode 100644 index e0c9bfc4..00000000 --- a/packages/messaging/dist/Messaging.js +++ /dev/null @@ -1,180 +0,0 @@ -"use strict"; -/* -Copyright 2024 Adobe. All rights reserved. -This file is licensed to you under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. You may obtain a copy -of the License at http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed under -the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS -OF ANY KIND, either express or implied. See the License for the specific language -governing permissions and limitations under the License. -*/ -Object.defineProperty(exports, "__esModule", { value: true }); -const tslib_1 = require("tslib"); -const react_native_1 = require("react-native"); -const Message_1 = tslib_1.__importDefault(require("./models/Message")); -const MessagingProposition_1 = require("./models/MessagingProposition"); -const PersonalizationSchema_1 = require("./models/PersonalizationSchema"); -const Templates_1 = require("./ui/types/Templates"); -const RCTAEPMessaging = react_native_1.NativeModules.AEPMessaging; -var messagingDelegate; -class Messaging { - /** - * Returns the version of the AEPMessaging extension - * @returns {string} Promise a promise that resolves with the extension version - */ - static extensionVersion() { - return Promise.resolve(RCTAEPMessaging.extensionVersion()); - } - /** - * Initiates a network call to retrieve remote In-App Message definitions. - */ - static refreshInAppMessages() { - RCTAEPMessaging.refreshInAppMessages(); - } - /** - * Retrieves the list of messages which have been cached using the `shouldSaveMessage` - * method of the messaging delegate. - * Note: Messages should be cached before trying to use any of the methods on the message class - * @returns An array of messages that have been cached - */ - static getCachedMessages() { - return tslib_1.__awaiter(this, void 0, void 0, function* () { - const messages = yield RCTAEPMessaging.getCachedMessages(); - return messages.map((msg) => new Message_1.default(msg)); - }); - } - /** - * Retrieves the last message that has been shown in the UI - * @returns The latest message to have been displayed - */ - static getLatestMessage() { - return tslib_1.__awaiter(this, void 0, void 0, function* () { - const message = yield RCTAEPMessaging.getLatestMessage(); - return message ? new Message_1.default(message) : undefined; - }); - } - /** - * Retrieves the previously fetched (and cached) feeds content from the SDK for the provided surfaces. - * If the feeds content for one or more surfaces isn't previously cached in the SDK, it will not be retrieved from Adobe Journey Optimizer via the Experience Edge network. - * @param surfaces A list of surfaces to fetch - * @returns A record of surface names with their corresponding propositions - */ - static getPropositionsForSurfaces(surfaces) { - return tslib_1.__awaiter(this, void 0, void 0, function* () { - return yield RCTAEPMessaging.getPropositionsForSurfaces(surfaces); - }); - } - /** - * @deprecated Use PropositionItem.track(...) instead. - */ - static trackContentCardDisplay(proposition, contentCard) { - RCTAEPMessaging.trackContentCardDisplay(proposition, contentCard); - } - /** - * @deprecated Use PropositionItem.track(...) instead. - */ - static trackContentCardInteraction(proposition, contentCard) { - RCTAEPMessaging.trackContentCardInteraction(proposition, contentCard); - } - /** - * Tracks interactions with a PropositionItem using the provided interaction and event type. - * This method is used internally by the PropositionItem.track() method. - * - * @param {string} itemId - The unique identifier of the PropositionItem - * @param {string | null} interaction - A custom string value to be recorded in the interaction - * @param {number} eventType - The MessagingEdgeEventType numeric value - * @param {string[] | null} tokens - Array containing the sub-item tokens for recording interaction - */ - static trackPropositionItem(itemId, interaction, eventType, tokens) { - RCTAEPMessaging.trackPropositionItem(itemId, interaction, eventType, tokens); - } - /** - * Function to set the UI Message delegate to listen the Message lifecycle events. - * @returns A function to unsubscribe from all event listeners - */ - static setMessagingDelegate(delegate) { - messagingDelegate = delegate; - const eventEmitter = new react_native_1.NativeEventEmitter(RCTAEPMessaging); - eventEmitter.addListener('onShow', (message) => { var _a; return (_a = messagingDelegate === null || messagingDelegate === void 0 ? void 0 : messagingDelegate.onShow) === null || _a === void 0 ? void 0 : _a.call(messagingDelegate, new Message_1.default(message)); }); - eventEmitter.addListener('onDismiss', (message) => { - var _a; - const messageInstance = new Message_1.default(message); - messageInstance._clearJavascriptMessageHandlers(); - (_a = messagingDelegate === null || messagingDelegate === void 0 ? void 0 : messagingDelegate.onDismiss) === null || _a === void 0 ? void 0 : _a.call(messagingDelegate, messageInstance); - }); - eventEmitter.addListener('shouldShowMessage', (message) => { - var _a, _b, _c, _d; - const messageInstance = new Message_1.default(message); - const shouldShowMessage = (_b = (_a = messagingDelegate === null || messagingDelegate === void 0 ? void 0 : messagingDelegate.shouldShowMessage) === null || _a === void 0 ? void 0 : _a.call(messagingDelegate, messageInstance)) !== null && _b !== void 0 ? _b : true; - const shouldSaveMessage = (_d = (_c = messagingDelegate === null || messagingDelegate === void 0 ? void 0 : messagingDelegate.shouldSaveMessage) === null || _c === void 0 ? void 0 : _c.call(messagingDelegate, messageInstance)) !== null && _d !== void 0 ? _d : false; - RCTAEPMessaging.setMessageSettings(shouldShowMessage, shouldSaveMessage); - }); - if (react_native_1.Platform.OS === 'ios') { - eventEmitter.addListener('urlLoaded', (event) => { var _a; return (_a = messagingDelegate === null || messagingDelegate === void 0 ? void 0 : messagingDelegate.urlLoaded) === null || _a === void 0 ? void 0 : _a.call(messagingDelegate, event.url, new Message_1.default(event.message)); }); - } - if (react_native_1.Platform.OS === 'android') { - eventEmitter.addListener('onContentLoaded', (event) => { var _a; return (_a = messagingDelegate === null || messagingDelegate === void 0 ? void 0 : messagingDelegate.onContentLoaded) === null || _a === void 0 ? void 0 : _a.call(messagingDelegate, new Message_1.default(event.message)); }); - } - RCTAEPMessaging.setMessagingDelegate(); - return () => { - eventEmitter.removeAllListeners('onDismiss'); - eventEmitter.removeAllListeners('onShow'); - eventEmitter.removeAllListeners('shouldShowMessage'); - if (react_native_1.Platform.OS === 'ios') { - eventEmitter.removeAllListeners('urlLoaded'); - } - if (react_native_1.Platform.OS === 'android') { - eventEmitter.removeAllListeners('onContentLoaded'); - } - }; - } - /** - * Sets global settings for messages being shown and cached - * Note: This method is also used by MessagingDelegate.shouldShowMessage, - * which allows finer-grained control over setting these settings - * @param shouldShowMessage Whether or not a message should be displayed - * @param shouldSaveMessage Whether or not a message should be cached - */ - static setMessageSettings(shouldShowMessage, shouldSaveMessage) { - RCTAEPMessaging.setMessageSettings(shouldShowMessage, shouldSaveMessage); - } - /** - * Dispatches an event to fetch propositions for the provided surfaces from remote. - * @param surfaces A list of surface names to update - */ - static updatePropositionsForSurfaces(surfaces) { - return tslib_1.__awaiter(this, void 0, void 0, function* () { - return yield RCTAEPMessaging.updatePropositionsForSurfaces(surfaces); - }); - } - /** - * @experimental - * Retrieves the content card UI data for a given surface. - * @param surface The surface to get the content card UI data for - * @returns The content card UI data for the given surface - */ - static getContentCardUI(surface) { - return tslib_1.__awaiter(this, void 0, void 0, function* () { - const messages = yield Messaging.getPropositionsForSurfaces([surface]); - const propositions = messages[surface]; - if (!(propositions === null || propositions === void 0 ? void 0 : propositions.length)) { - return []; - } - const contentCards = propositions - .map((proposition) => new MessagingProposition_1.MessagingProposition(proposition)) - .flatMap((proposition) => proposition.items.filter((item) => item.schema === PersonalizationSchema_1.PersonalizationSchema.CONTENT_CARD)); - if (!(contentCards === null || contentCards === void 0 ? void 0 : contentCards.length)) { - return []; - } - return contentCards.map((card) => { - var _a, _b, _c, _d; - const type = (_d = (_c = (_b = (_a = card.data) === null || _a === void 0 ? void 0 : _a.meta) === null || _b === void 0 ? void 0 : _b.adobe) === null || _c === void 0 ? void 0 : _c.template) !== null && _d !== void 0 ? _d : 'SmallImage'; - return new Templates_1.ContentTemplate(card, type); - }); - }); - } -} -exports.default = Messaging; -//# sourceMappingURL=Messaging.js.map \ No newline at end of file diff --git a/packages/messaging/dist/Messaging.js.map b/packages/messaging/dist/Messaging.js.map deleted file mode 100644 index 19a0e10c..00000000 --- a/packages/messaging/dist/Messaging.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Messaging.js","sourceRoot":"","sources":["../src/Messaging.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE;;;AAEF,+CAKsB;AACtB,uEAAuC;AAEvC,wEAAqE;AAErE,0EAAuE;AACvE,oDAAuD;AAiCvD,MAAM,eAAe,GACnB,4BAAa,CAAC,YAAY,CAAC;AAG7B,IAAI,iBAAoC,CAAC;AAEzC,MAAM,SAAS;IACb;;;OAGG;IACH,MAAM,CAAC,gBAAgB;QACrB,OAAO,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,oBAAoB;QACzB,eAAe,CAAC,oBAAoB,EAAE,CAAC;IACzC,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAO,iBAAiB;;YAC5B,MAAM,QAAQ,GAAG,MAAM,eAAe,CAAC,iBAAiB,EAAE,CAAC;YAC3D,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,iBAAO,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;IAED;;;OAGG;IACH,MAAM,CAAO,gBAAgB;;YAC3B,MAAM,OAAO,GAAG,MAAM,eAAe,CAAC,gBAAgB,EAAE,CAAC;YACzD,OAAO,OAAO,CAAC,CAAC,CAAC,IAAI,iBAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACpD,CAAC;KAAA;IAED;;;;;OAKG;IACH,MAAM,CAAO,0BAA0B,CACrC,QAAkB;;YAElB,OAAO,MAAM,eAAe,CAAC,0BAA0B,CAAC,QAAQ,CAAC,CAAC;QACpE,CAAC;KAAA;IACD;;OAEG;IACH,MAAM,CAAC,uBAAuB,CAC5B,WAAiC,EACjC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,MAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,IAAI,0CAAE,KAAK,0CAAE,QAAQ,mCAAI,YAAY,CAAC;gBAC9D,OAAO,IAAI,2BAAe,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACzC,CAAC,CAAC,CAAC;QACL,CAAC;KAAA;CACF;AAED,kBAAe,SAAS,CAAC"} \ No newline at end of file diff --git a/packages/messaging/dist/index.d.ts b/packages/messaging/dist/index.d.ts deleted file mode 100644 index 2d707f13..00000000 --- a/packages/messaging/dist/index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import Messaging from './Messaging'; -import { ContentCard, ContentCardData } from './models/ContentCard'; -import { InAppMessage } from './models/InAppMessage'; -import { HTMLProposition, HTMLPropositionData } from './models/HTMLProposition'; -import { JSONPropositionItem, JSONPropositionData } from './models/JSONProposition'; -import Message from './models/Message'; -import { MessagingDelegate } from './models/MessagingDelegate'; -import MessagingEdgeEventType from './models/MessagingEdgeEventType'; -import { MessagingProposition } from './models/MessagingProposition'; -import { MessagingPropositionItem } from './models/MessagingPropositionItem'; -import { PersonalizationSchema } from './models/PersonalizationSchema'; -import { PropositionItem, PropositionItemData } from './models/PropositionItem'; -import { Activity, Characteristics } from './models/ScopeDetails'; -export * from './models/ContentCard'; -export * from './ui'; -export { Activity, Characteristics, ContentCard, ContentCardData, InAppMessage, Messaging, Message, MessagingDelegate, MessagingEdgeEventType, MessagingProposition, MessagingPropositionItem, PersonalizationSchema, PropositionItem, PropositionItemData, HTMLProposition, HTMLPropositionData, JSONPropositionItem, JSONPropositionData, }; diff --git a/packages/messaging/dist/index.js b/packages/messaging/dist/index.js deleted file mode 100644 index 9650c064..00000000 --- a/packages/messaging/dist/index.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -/* -Copyright 2023 Adobe. All rights reserved. -This file is licensed to you under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. You may obtain a copy -of the License at http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed under -the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS -OF ANY KIND, either express or implied. See the License for the specific language -governing permissions and limitations under the License. -*/ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.JSONPropositionItem = exports.HTMLProposition = exports.PropositionItem = exports.PersonalizationSchema = exports.MessagingProposition = exports.MessagingEdgeEventType = exports.Message = exports.Messaging = exports.ContentCard = void 0; -const tslib_1 = require("tslib"); -const Messaging_1 = tslib_1.__importDefault(require("./Messaging")); -exports.Messaging = Messaging_1.default; -const ContentCard_1 = require("./models/ContentCard"); -Object.defineProperty(exports, "ContentCard", { enumerable: true, get: function () { return ContentCard_1.ContentCard; } }); -const HTMLProposition_1 = require("./models/HTMLProposition"); -Object.defineProperty(exports, "HTMLProposition", { enumerable: true, get: function () { return HTMLProposition_1.HTMLProposition; } }); -const JSONProposition_1 = require("./models/JSONProposition"); -Object.defineProperty(exports, "JSONPropositionItem", { enumerable: true, get: function () { return JSONProposition_1.JSONPropositionItem; } }); -const Message_1 = tslib_1.__importDefault(require("./models/Message")); -exports.Message = Message_1.default; -const MessagingEdgeEventType_1 = tslib_1.__importDefault(require("./models/MessagingEdgeEventType")); -exports.MessagingEdgeEventType = MessagingEdgeEventType_1.default; -const MessagingProposition_1 = require("./models/MessagingProposition"); -Object.defineProperty(exports, "MessagingProposition", { enumerable: true, get: function () { return MessagingProposition_1.MessagingProposition; } }); -const PersonalizationSchema_1 = require("./models/PersonalizationSchema"); -Object.defineProperty(exports, "PersonalizationSchema", { enumerable: true, get: function () { return PersonalizationSchema_1.PersonalizationSchema; } }); -const PropositionItem_1 = require("./models/PropositionItem"); -Object.defineProperty(exports, "PropositionItem", { enumerable: true, get: function () { return PropositionItem_1.PropositionItem; } }); -tslib_1.__exportStar(require("./models/ContentCard"), exports); -tslib_1.__exportStar(require("./ui"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/messaging/dist/index.js.map b/packages/messaging/dist/index.js.map deleted file mode 100644 index 4e44d82b..00000000 --- a/packages/messaging/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE;;;;AAEF,oEAAoC;AAyBlC,oBAzBK,mBAAS,CAyBL;AAxBX,sDAAoE;AAqBlE,4FArBO,yBAAW,OAqBP;AAlBb,8DAAgF;AA8B9E,gGA9BO,iCAAe,OA8BP;AA7BjB,8DAAoF;AA+BlF,oGA/BO,qCAAmB,OA+BP;AA7BrB,uEAAuC;AAmBrC,kBAnBK,iBAAO,CAmBL;AAjBT,qGAAqE;AAmBnE,iCAnBK,gCAAsB,CAmBL;AAlBxB,wEAAqE;AAmBnE,qGAnBO,2CAAoB,OAmBP;AAjBtB,0EAAuE;AAmBrE,sGAnBO,6CAAqB,OAmBP;AAlBvB,8DAAgF;AAmB9E,gGAnBO,iCAAe,OAmBP;AAhBjB,+DAAqC;AACrC,+CAAqB"} \ No newline at end of file diff --git a/packages/messaging/dist/models/ContentCard.d.ts b/packages/messaging/dist/models/ContentCard.d.ts deleted file mode 100644 index 41a53324..00000000 --- a/packages/messaging/dist/models/ContentCard.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { PersonalizationSchema } from './PersonalizationSchema'; -import { PropositionItem, PropositionItemData } from './PropositionItem'; -export type ContentCardTemplate = 'SmallImage' | 'LargeImage' | 'ImageOnly'; -export type DismissButtonStyle = 'circle' | 'none' | 'simple'; -export interface ContentCardButton { - readonly interactId: string; - readonly actionUrl?: string; - readonly id?: string; - readonly text: { - readonly content: string; - }; -} -export interface ContentCardContent { - readonly image?: { - readonly alt?: string; - readonly url: string; - readonly darkUrl?: string; - }; - readonly buttons?: readonly ContentCardButton[]; - readonly dismissBtn?: { - readonly style: DismissButtonStyle; - }; - readonly actionUrl?: string; - readonly body?: { - readonly content: string; - }; - readonly title: { - readonly content: string; - }; -} -export type ImageOnlyContent = Pick; -export type LargeImageContentData = ContentCardContent; -export type SmallImageContentData = ContentCardContent; -export interface ContentCardMeta { - [key: string]: any; - adobe: { - template: ContentCardTemplate; - }; - surface?: string; -} -export interface ContentCardData extends PropositionItemData { - id: string; - schema: PersonalizationSchema.CONTENT_CARD; - data: { - contentType: 'application/json'; - expiryDate: number; - publishedDate: number; - meta: ContentCardMeta; - content: SmallImageContentData | LargeImageContentData | ImageOnlyContent; - }; -} -export declare class ContentCard extends PropositionItem { - data: ContentCardData['data']; - constructor(contentCardData: ContentCardData); -} diff --git a/packages/messaging/dist/models/ContentCard.js b/packages/messaging/dist/models/ContentCard.js deleted file mode 100644 index b5fdccf7..00000000 --- a/packages/messaging/dist/models/ContentCard.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; -/* - Copyright 2024 Adobe. All rights reserved. - This file is licensed to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law - or agreed to in writing, software distributed under the License is - distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF - ANY KIND, either express or implied. See the License for the specific - language governing permissions and limitations under the License. -*/ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ContentCard = void 0; -const PropositionItem_1 = require("./PropositionItem"); -class ContentCard extends PropositionItem_1.PropositionItem { - constructor(contentCardData) { - super(contentCardData); - this.data = contentCardData.data; - } -} -exports.ContentCard = ContentCard; -//# sourceMappingURL=ContentCard.js.map \ No newline at end of file diff --git a/packages/messaging/dist/models/ContentCard.js.map b/packages/messaging/dist/models/ContentCard.js.map deleted file mode 100644 index 2694ee53..00000000 --- a/packages/messaging/dist/models/ContentCard.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ContentCard.js","sourceRoot":"","sources":["../../src/models/ContentCard.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE;;;AAGF,uDAAyE;AA2DzE,MAAa,WAAY,SAAQ,iCAAe;IAG9C,YAAY,eAAgC;QAC1C,KAAK,CAAC,eAAe,CAAC,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC;IACnC,CAAC;CACF;AAPD,kCAOC"} \ No newline at end of file diff --git a/packages/messaging/dist/models/HTMLProposition.d.ts b/packages/messaging/dist/models/HTMLProposition.d.ts deleted file mode 100644 index 47f594e4..00000000 --- a/packages/messaging/dist/models/HTMLProposition.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { PersonalizationSchema } from './PersonalizationSchema'; -import { PropositionItem, PropositionItemData } from './PropositionItem'; -export interface HTMLPropositionData extends PropositionItemData { - data: { - content: string; - }; - schema: PersonalizationSchema.HTML_CONTENT; -} -export declare class HTMLProposition extends PropositionItem { - data: HTMLPropositionData['data']; - constructor(htmlData: HTMLPropositionData); -} diff --git a/packages/messaging/dist/models/HTMLProposition.js b/packages/messaging/dist/models/HTMLProposition.js deleted file mode 100644 index 317915f1..00000000 --- a/packages/messaging/dist/models/HTMLProposition.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; -/* - Copyright 2024 Adobe. All rights reserved. - This file is licensed to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law - or agreed to in writing, software distributed under the License is - distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF - ANY KIND, either express or implied. See the License for the specific - language governing permissions and limitations under the License. -*/ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.HTMLProposition = void 0; -const PropositionItem_1 = require("./PropositionItem"); -class HTMLProposition extends PropositionItem_1.PropositionItem { - constructor(htmlData) { - super(htmlData); - this.data = htmlData.data; - } -} -exports.HTMLProposition = HTMLProposition; -//# sourceMappingURL=HTMLProposition.js.map \ No newline at end of file diff --git a/packages/messaging/dist/models/HTMLProposition.js.map b/packages/messaging/dist/models/HTMLProposition.js.map deleted file mode 100644 index 9e7e00fb..00000000 --- a/packages/messaging/dist/models/HTMLProposition.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"HTMLProposition.js","sourceRoot":"","sources":["../../src/models/HTMLProposition.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE;;;AAGF,uDAAyE;AASzE,MAAa,eAAgB,SAAQ,iCAAe;IAGnD,YAAY,QAA6B;QACxC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;IAC3B,CAAC;CACD;AAPD,0CAOC"} \ No newline at end of file diff --git a/packages/messaging/dist/models/InAppMessage.d.ts b/packages/messaging/dist/models/InAppMessage.d.ts deleted file mode 100644 index dd820500..00000000 --- a/packages/messaging/dist/models/InAppMessage.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { PersonalizationSchema } from './PersonalizationSchema'; -export interface InAppMessage { - id: string; - schema: PersonalizationSchema.IN_APP; - data: { - content: string; - contentType: 'text/html'; - expiryDate: number; - publishedDate: number; - meta?: Record; - mobileParameters?: Record; - webParameters?: Record; - remoteAssets?: string[]; - }; -} diff --git a/packages/messaging/dist/models/InAppMessage.js b/packages/messaging/dist/models/InAppMessage.js deleted file mode 100644 index 5a1f9b58..00000000 --- a/packages/messaging/dist/models/InAppMessage.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -/* - Copyright 2024 Adobe. All rights reserved. - This file is licensed to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law - or agreed to in writing, software distributed under the License is - distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF - ANY KIND, either express or implied. See the License for the specific - language governing permissions and limitations under the License. -*/ -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=InAppMessage.js.map \ No newline at end of file diff --git a/packages/messaging/dist/models/InAppMessage.js.map b/packages/messaging/dist/models/InAppMessage.js.map deleted file mode 100644 index 69800a69..00000000 --- a/packages/messaging/dist/models/InAppMessage.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"InAppMessage.js","sourceRoot":"","sources":["../../src/models/InAppMessage.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE"} \ No newline at end of file diff --git a/packages/messaging/dist/models/JSONProposition.d.ts b/packages/messaging/dist/models/JSONProposition.d.ts deleted file mode 100644 index 5f0703bc..00000000 --- a/packages/messaging/dist/models/JSONProposition.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { PersonalizationSchema } from './PersonalizationSchema'; -import { PropositionItem, PropositionItemData } from './PropositionItem'; -export interface JSONPropositionData extends PropositionItemData { - data: { - content: any; - }; - schema: PersonalizationSchema.JSON_CONTENT; -} -export declare class JSONPropositionItem extends PropositionItem { - data: JSONPropositionData['data']; - constructor(jsonData: JSONPropositionData); -} diff --git a/packages/messaging/dist/models/JSONProposition.js b/packages/messaging/dist/models/JSONProposition.js deleted file mode 100644 index 24b20788..00000000 --- a/packages/messaging/dist/models/JSONProposition.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; -/* - Copyright 2024 Adobe. All rights reserved. - This file is licensed to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law - or agreed to in writing, software distributed under the License is - distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF - ANY KIND, either express or implied. See the License for the specific - language governing permissions and limitations under the License. -*/ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.JSONPropositionItem = void 0; -const PropositionItem_1 = require("./PropositionItem"); -class JSONPropositionItem extends PropositionItem_1.PropositionItem { - constructor(jsonData) { - super(jsonData); - this.data = jsonData.data; - } -} -exports.JSONPropositionItem = JSONPropositionItem; -//# sourceMappingURL=JSONProposition.js.map \ No newline at end of file diff --git a/packages/messaging/dist/models/JSONProposition.js.map b/packages/messaging/dist/models/JSONProposition.js.map deleted file mode 100644 index 2a39f0b0..00000000 --- a/packages/messaging/dist/models/JSONProposition.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"JSONProposition.js","sourceRoot":"","sources":["../../src/models/JSONProposition.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE;;;AAGF,uDAAyE;AASzE,MAAa,mBAAoB,SAAQ,iCAAe;IAGvD,YAAY,QAA6B;QACxC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;IAC3B,CAAC;CACD;AAPD,kDAOC"} \ No newline at end of file diff --git a/packages/messaging/dist/models/Message.d.ts b/packages/messaging/dist/models/Message.d.ts deleted file mode 100644 index fa293a81..00000000 --- a/packages/messaging/dist/models/Message.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -declare class Message { - id: string; - autoTrack: boolean; - constructor({ id, autoTrack }: { - id: string; - autoTrack: boolean; - }); - /** - * Update the value of property "autoTrack" - * This function works only for the Message objects that were saved by calling "Messaging.saveMessage" - * @param {boolean} autoTrack: New value of property autoTrack. - */ - setAutoTrack(autoTrack: boolean): void; - /** - * Signals to the UIServices that the message should be shown. - * If autoTrack is true, calling this method will result in an "inapp.display" Edge Event being dispatched. - */ - show(): void; - /** - * Signals to the UIServices that the message should be dismissed. - * If `autoTrack` is true, calling this method will result in an "inapp.dismiss" Edge Event being dispatched. - * @param {boolean?} suppressAutoTrack: if set to true, the inapp.dismiss Edge Event will not be sent regardless - * of the autoTrack setting. - */ - dismiss(suppressAutoTrack?: boolean): void; - /** - * Generates an Edge Event for the provided interaction and eventType. - * @param {string?} interaction: a custom String value to be recorded in the interaction - * @param {MessagingEdgeEventType} eventType: the MessagingEdgeEventType to be used for the ensuing Edge Event - */ - track(interaction: string, eventType: number): void; - /** - * Clears the cached reference to the Message object. - * This function must be called if Message was saved by calling "MessagingDelegate.shouldSaveMessage" but no longer needed. - * Failure to call this function leads to memory leaks. - */ - clear(): void; - /** - * Adds a handler for named JavaScript messages sent from the message's WebView. - * The parameter passed to handler will contain the body of the message passed from the WebView's JavaScript. - * @param {string} handlerName: The name of the message that should be handled by the handler - * @param {function} handler: The method or closure to be called with the body of the message created in the Message's JavaScript - */ - handleJavascriptMessage(handlerName: string, handler: (content: string) => void): void; - /** - * @internal - For internal use only. - * Clears all the javascript message handlers for the message. - * This function must be called if the callbacks registered in handleJavascriptMessage are no longer needed. - * Failure to call this function may lead to memory leaks. - */ - _clearJavascriptMessageHandlers(): void; -} -export default Message; diff --git a/packages/messaging/dist/models/Message.js b/packages/messaging/dist/models/Message.js deleted file mode 100644 index 0da6a47f..00000000 --- a/packages/messaging/dist/models/Message.js +++ /dev/null @@ -1,107 +0,0 @@ -"use strict"; -/* -Copyright 2023 Adobe. All rights reserved. -This file is licensed to you under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. You may obtain a copy -of the License at http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed under -the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS -OF ANY KIND, either express or implied. See the License for the specific language -governing permissions and limitations under the License. -*/ -Object.defineProperty(exports, "__esModule", { value: true }); -const react_native_1 = require("react-native"); -const RCTAEPMessaging = react_native_1.NativeModules.AEPMessaging; -// Registery to store inAppMessage callbacks for each message in Message.handleJavascriptMessage -// Record - {messageId : {handlerName : callback}} -const jsMessageHandlers = {}; -const handleJSMessageEventEmitter = new react_native_1.NativeEventEmitter(RCTAEPMessaging); -// invokes the callback registered in Message.handleJavascriptMessage with the content received from the inAppMessage webview -handleJSMessageEventEmitter.addListener('onJavascriptMessage', (event) => { - const { messageId, handlerName, content } = event; - if (jsMessageHandlers[messageId] && jsMessageHandlers[messageId][handlerName]) { - jsMessageHandlers[messageId][handlerName](content); - } -}); -class Message { - constructor({ id, autoTrack = false }) { - this.id = id; - this.autoTrack = autoTrack; - } - /** - * Update the value of property "autoTrack" - * This function works only for the Message objects that were saved by calling "Messaging.saveMessage" - * @param {boolean} autoTrack: New value of property autoTrack. - */ - setAutoTrack(autoTrack) { - this.autoTrack = autoTrack; - RCTAEPMessaging.setAutoTrack(this.id, autoTrack); - } - /** - * Signals to the UIServices that the message should be shown. - * If autoTrack is true, calling this method will result in an "inapp.display" Edge Event being dispatched. - */ - show() { - RCTAEPMessaging.show(this.id); - } - /** - * Signals to the UIServices that the message should be dismissed. - * If `autoTrack` is true, calling this method will result in an "inapp.dismiss" Edge Event being dispatched. - * @param {boolean?} suppressAutoTrack: if set to true, the inapp.dismiss Edge Event will not be sent regardless - * of the autoTrack setting. - */ - dismiss(suppressAutoTrack) { - RCTAEPMessaging.dismiss(this.id, suppressAutoTrack ? true : false); - } - /** - * Generates an Edge Event for the provided interaction and eventType. - * @param {string?} interaction: a custom String value to be recorded in the interaction - * @param {MessagingEdgeEventType} eventType: the MessagingEdgeEventType to be used for the ensuing Edge Event - */ - track(interaction, eventType) { - RCTAEPMessaging.track(this.id, interaction, eventType); - } - /** - * Clears the cached reference to the Message object. - * This function must be called if Message was saved by calling "MessagingDelegate.shouldSaveMessage" but no longer needed. - * Failure to call this function leads to memory leaks. - */ - clear() { - RCTAEPMessaging.clear(this.id); - } - /** - * Adds a handler for named JavaScript messages sent from the message's WebView. - * The parameter passed to handler will contain the body of the message passed from the WebView's JavaScript. - * @param {string} handlerName: The name of the message that should be handled by the handler - * @param {function} handler: The method or closure to be called with the body of the message created in the Message's JavaScript - */ - handleJavascriptMessage(handlerName, handler) { - // Validate parameters - if (!handlerName) { - console.warn('[AEP Messaging] handleJavascriptMessage: handlerName is required'); - return; - } - if (typeof handler !== 'function') { - console.warn('[AEP Messaging] handleJavascriptMessage: handler must be a function'); - return; - } - // cache the callback - if (!jsMessageHandlers[this.id]) { - jsMessageHandlers[this.id] = {}; - } - jsMessageHandlers[this.id][handlerName] = handler; - RCTAEPMessaging.handleJavascriptMessage(this.id, handlerName); - } - /** - * @internal - For internal use only. - * Clears all the javascript message handlers for the message. - * This function must be called if the callbacks registered in handleJavascriptMessage are no longer needed. - * Failure to call this function may lead to memory leaks. - */ - _clearJavascriptMessageHandlers() { - delete jsMessageHandlers[this.id]; - } -} -exports.default = Message; -//# sourceMappingURL=Message.js.map \ No newline at end of file diff --git a/packages/messaging/dist/models/Message.js.map b/packages/messaging/dist/models/Message.js.map deleted file mode 100644 index 8eb99d7c..00000000 --- a/packages/messaging/dist/models/Message.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Message.js","sourceRoot":"","sources":["../../src/models/Message.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE;;AAEF,+CAAiE;AAEjE,MAAM,eAAe,GAAG,4BAAa,CAAC,YAAY,CAAC;AAEnD,gGAAgG;AAChG,kDAAkD;AAClD,MAAM,iBAAiB,GAA8D,EAAE,CAAC;AACxF,MAAM,2BAA2B,GAAG,IAAI,iCAAkB,CAAC,eAAe,CAAC,CAAC;AAE5E,6HAA6H;AAC7H,2BAA2B,CAAC,WAAW,CAAC,qBAAqB,EAAE,CAAC,KAAK,EAAE,EAAE;IACvE,MAAM,EAAC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAC,GAAG,KAAK,CAAC;IAChD,IAAI,iBAAiB,CAAC,SAAS,CAAC,IAAI,iBAAiB,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,EAAE;QAC7E,iBAAiB,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC;KACpD;AACH,CAAC,CAAC,CAAC;AAEH,MAAM,OAAO;IAIX,YAAY,EAAE,EAAE,EAAE,SAAS,GAAG,KAAK,EAAsC;QACvE,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACH,YAAY,CAAC,SAAkB;QAC7B,IAAI,CAAC,SAAS,GAAG,SAAS,C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AAO,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC;CACF;AAED,kBAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/packages/messaging/dist/models/MessagingDelegate.d.ts b/packages/messaging/dist/models/MessagingDelegate.d.ts deleted file mode 100644 index b43634cf..00000000 --- a/packages/messaging/dist/models/MessagingDelegate.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import Message from './Message'; -export interface MessagingDelegate { - /** - * Invoked when the any message is displayed - * @param {Message} message: Message that is being displayed. - */ - onShow?(message: Message): void; - /** - * Invoked when any message is dismissed - * @param {Message} message: Message that is being dismissed - */ - onDismiss?(message: Message): void; - /** - * Used to determine whether a message should be cached, so it can be used later. Return true if the message should be cached. - * Note: Message must be cached in order to call any of the functions of the message object - */ - shouldSaveMessage?(message: Message): boolean; - /** - * Used to find whether messages should be shown or not - * @param {Message} message: Message that is about to get displayed - * @returns {boolean}: true if the message should be shown else false - */ - shouldShowMessage?(message: Message): boolean; - /** - * IOS Only - Called when message loads a URL - * @param {string} url: the URL being loaded by the message - * @param {Message} message: the Message loading a URL - */ - urlLoaded?(url: string, message: Message): void; - /** - * Android Only - Called when message loads - * @param {Message} message: the Message loaded - */ - onContentLoaded?(message: Message): void; -} diff --git a/packages/messaging/dist/models/MessagingDelegate.js b/packages/messaging/dist/models/MessagingDelegate.js deleted file mode 100644 index 3456c437..00000000 --- a/packages/messaging/dist/models/MessagingDelegate.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -/* -Copyright 2023 Adobe. All rights reserved. -This file is licensed to you under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. You may obtain a copy -of the License at http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed under -the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS -OF ANY KIND, either express or implied. See the License for the specific language -governing permissions and limitations under the License. -*/ -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=MessagingDelegate.js.map \ No newline at end of file diff --git a/packages/messaging/dist/models/MessagingDelegate.js.map b/packages/messaging/dist/models/MessagingDelegate.js.map deleted file mode 100644 index 43824c87..00000000 --- a/packages/messaging/dist/models/MessagingDelegate.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MessagingDelegate.js","sourceRoot":"","sources":["../../src/models/MessagingDelegate.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE"} \ No newline at end of file diff --git a/packages/messaging/dist/models/MessagingEdgeEventType.d.ts b/packages/messaging/dist/models/MessagingEdgeEventType.d.ts deleted file mode 100644 index ce609532..00000000 --- a/packages/messaging/dist/models/MessagingEdgeEventType.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -declare enum MessagingEdgeEventType { - DISMISS = 0, - INTERACT = 1, - TRIGGER = 2, - DISPLAY = 3, - PUSH_APPLICATION_OPENED = 4, - PUSH_CUSTOM_ACTION = 5 -} -export default MessagingEdgeEventType; diff --git a/packages/messaging/dist/models/MessagingEdgeEventType.js b/packages/messaging/dist/models/MessagingEdgeEventType.js deleted file mode 100644 index c62d50d5..00000000 --- a/packages/messaging/dist/models/MessagingEdgeEventType.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -/* -Copyright 2023 Adobe. All rights reserved. -This file is licensed to you under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. You may obtain a copy -of the License at http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed under -the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS -OF ANY KIND, either express or implied. See the License for the specific language -governing permissions and limitations under the License. -*/ -Object.defineProperty(exports, "__esModule", { value: true }); -var MessagingEdgeEventType; -(function (MessagingEdgeEventType) { - MessagingEdgeEventType[MessagingEdgeEventType["DISMISS"] = 0] = "DISMISS"; - MessagingEdgeEventType[MessagingEdgeEventType["INTERACT"] = 1] = "INTERACT"; - MessagingEdgeEventType[MessagingEdgeEventType["TRIGGER"] = 2] = "TRIGGER"; - MessagingEdgeEventType[MessagingEdgeEventType["DISPLAY"] = 3] = "DISPLAY"; - MessagingEdgeEventType[MessagingEdgeEventType["PUSH_APPLICATION_OPENED"] = 4] = "PUSH_APPLICATION_OPENED"; - MessagingEdgeEventType[MessagingEdgeEventType["PUSH_CUSTOM_ACTION"] = 5] = "PUSH_CUSTOM_ACTION"; -})(MessagingEdgeEventType || (MessagingEdgeEventType = {})); -exports.default = MessagingEdgeEventType; -//# sourceMappingURL=MessagingEdgeEventType.js.map \ No newline at end of file diff --git a/packages/messaging/dist/models/MessagingEdgeEventType.js.map b/packages/messaging/dist/models/MessagingEdgeEventType.js.map deleted file mode 100644 index 1fe365c4..00000000 --- a/packages/messaging/dist/models/MessagingEdgeEventType.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MessagingEdgeEventType.js","sourceRoot":"","sources":["../../src/models/MessagingEdgeEventType.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE;;AAEF,IAAK,sBAOJ;AAPD,WAAK,sBAAsB;IACzB,yEAAW,CAAA;IACX,2EAAY,CAAA;IACZ,yEAAW,CAAA;IACX,yEAAW,CAAA;IACX,yGAA2B,CAAA;IAC3B,+FAAsB,CAAA;AACxB,CAAC,EAPI,sBAAsB,KAAtB,sBAAsB,QAO1B;AAED,kBAAe,sBAAsB,CAAC"} \ No newline at end of file diff --git a/packages/messaging/dist/models/MessagingProposition.d.ts b/packages/messaging/dist/models/MessagingProposition.d.ts deleted file mode 100644 index 4dd8e8d3..00000000 --- a/packages/messaging/dist/models/MessagingProposition.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { ScopeDetails } from './ScopeDetails'; -import { PropositionItem } from './PropositionItem'; -export declare class MessageProposition { - id: string; - scope: string; - scopeDetails: ScopeDetails; - items: PropositionItem[]; - constructor(raw: { - id: string; - scope: string; - scopeDetails: ScopeDetails; - items?: any[]; - }); -} -export { MessageProposition as MessagingProposition }; diff --git a/packages/messaging/dist/models/MessagingProposition.js b/packages/messaging/dist/models/MessagingProposition.js deleted file mode 100644 index ec015602..00000000 --- a/packages/messaging/dist/models/MessagingProposition.js +++ /dev/null @@ -1,59 +0,0 @@ -"use strict"; -/* - Copyright 2024 Adobe. All rights reserved. - This file is licensed to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law - or agreed to in writing, software distributed under the License is - distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF - ANY KIND, either express or implied. See the License for the specific - language governing permissions and limitations under the License. -*/ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MessagingProposition = exports.MessageProposition = void 0; -const PersonalizationSchema_1 = require("./PersonalizationSchema"); -const ContentCard_1 = require("./ContentCard"); -const HTMLProposition_1 = require("./HTMLProposition"); -const JSONProposition_1 = require("./JSONProposition"); -const PropositionItem_1 = require("./PropositionItem"); -class MessageProposition { - constructor(raw) { - var _a, _b, _c, _d, _e, _f, _g; - this.id = (_a = raw === null || raw === void 0 ? void 0 : raw.id) !== null && _a !== void 0 ? _a : ''; - this.scope = (_b = raw === null || raw === void 0 ? void 0 : raw.scope) !== null && _b !== void 0 ? _b : ''; - this.scopeDetails = (_c = raw === null || raw === void 0 ? void 0 : raw.scopeDetails) !== null && _c !== void 0 ? _c : {}; - // Mirror activity.id into activity.activityID for convenience - const activityIdFromScope = (_f = (_e = (_d = this.scopeDetails) === null || _d === void 0 ? void 0 : _d.activity) === null || _e === void 0 ? void 0 : _e.id) !== null && _f !== void 0 ? _f : ''; - if ((_g = this.scopeDetails) === null || _g === void 0 ? void 0 : _g.activity) { - this.scopeDetails.activity.activityID = activityIdFromScope; - } - const rawItems = Array.isArray(raw === null || raw === void 0 ? void 0 : raw.items) ? raw.items : []; - this.items = rawItems.map((itemData) => { - var _a, _b, _c; - const activityId = (_c = (_b = (_a = this.scopeDetails) === null || _a === void 0 ? void 0 : _a.activity) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : ''; - let instance; - switch (itemData === null || itemData === void 0 ? void 0 : itemData.schema) { - case PersonalizationSchema_1.PersonalizationSchema.CONTENT_CARD: - instance = new ContentCard_1.ContentCard(itemData); - instance.activityID = activityId; - return instance; - case PersonalizationSchema_1.PersonalizationSchema.HTML_CONTENT: - instance = new HTMLProposition_1.HTMLProposition(itemData); - instance.activityID = activityId; - return instance; - case PersonalizationSchema_1.PersonalizationSchema.JSON_CONTENT: - instance = new JSONProposition_1.JSONPropositionItem(itemData); - instance.activityID = activityId; - return instance; - default: - instance = new PropositionItem_1.PropositionItem(itemData); - instance.activityID = activityId; - return instance; - } - }); - } -} -exports.MessageProposition = MessageProposition; -exports.MessagingProposition = MessageProposition; -//# sourceMappingURL=MessagingProposition.js.map \ No newline at end of file diff --git a/packages/messaging/dist/models/MessagingProposition.js.map b/packages/messaging/dist/models/MessagingProposition.js.map deleted file mode 100644 index 31e41b97..00000000 --- a/packages/messaging/dist/models/MessagingProposition.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MessagingProposition.js","sourceRoot":"","sources":["../../src/models/MessagingProposition.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE;;;AAGF,mEAAgE;AAChE,+CAA4C;AAC5C,uDAAoD;AACpD,uDAAwD;AACxD,uDAAoD;AAEpD,MAAa,kBAAkB;IAM7B,YAAY,GAA6E;;QACvF,IAAI,CAAC,EAAE,GAAG,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,EAAE,mCAAI,EAAE,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,KAAK,mCAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,YAAY,GAAG,MAAC,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,YAA6B,mCAAK,EAAmB,CAAC;QAEhF,8DAA8D;QAC9D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C,CAAC;oBAC/C,QAAgB,CAAC,UAAU,GAAG,UAAU,CAAC;oBAC1C,OAAO,QAAQ,CAAC;aACnB;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAzCD,gDAyCC;AAE8B,kDAAoB"} \ No newline at end of file diff --git a/packages/messaging/dist/models/MessagingPropositionItem.d.ts b/packages/messaging/dist/models/MessagingPropositionItem.d.ts deleted file mode 100644 index 99eacc4e..00000000 --- a/packages/messaging/dist/models/MessagingPropositionItem.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { ContentCard } from './ContentCard'; -import { HTMLProposition } from './HTMLProposition'; -import { JSONPropositionItem } from './JSONProposition'; -import { InAppMessage } from './InAppMessage'; -import { PropositionItem } from './PropositionItem'; -export type MessagingPropositionItem = ContentCard | HTMLProposition | InAppMessage | JSONPropositionItem | PropositionItem; diff --git a/packages/messaging/dist/models/MessagingPropositionItem.js b/packages/messaging/dist/models/MessagingPropositionItem.js deleted file mode 100644 index 4d3da402..00000000 --- a/packages/messaging/dist/models/MessagingPropositionItem.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -/* - Copyright 2023 Adobe. All rights reserved. - This file is licensed to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law - or agreed to in writing, software distributed under the License is - distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF - ANY KIND, either express or implied. See the License for the specific - language governing permissions and limitations under the License. -*/ -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=MessagingPropositionItem.js.map \ No newline at end of file diff --git a/packages/messaging/dist/models/MessagingPropositionItem.js.map b/packages/messaging/dist/models/MessagingPropositionItem.js.map deleted file mode 100644 index ca4c62a5..00000000 --- a/packages/messaging/dist/models/MessagingPropositionItem.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MessagingPropositionItem.js","sourceRoot":"","sources":["../../src/models/MessagingPropositionItem.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE"} \ No newline at end of file diff --git a/packages/messaging/dist/models/PersonalizationSchema.d.ts b/packages/messaging/dist/models/PersonalizationSchema.d.ts deleted file mode 100644 index bb778d14..00000000 --- a/packages/messaging/dist/models/PersonalizationSchema.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export declare enum PersonalizationSchema { - CONTENT_CARD = "https://ns.adobe.com/personalization/message/content-card", - DEFAULT_CONTENT = "https://ns.adobe.com/personalization/default-content-item", - HTML_CONTENT = "https://ns.adobe.com/personalization/html-content-item", - IN_APP = "https://ns.adobe.com/personalization/message/in-app", - JSON_CONTENT = "https://ns.adobe.com/personalization/json-content-item", - NATIVE_ALERT = "https://ns.adobe.com/personalization/message/native-alert", - RULESET_ITEM = "https://ns.adobe.com/personalization/ruleset-item" -} diff --git a/packages/messaging/dist/models/PersonalizationSchema.js b/packages/messaging/dist/models/PersonalizationSchema.js deleted file mode 100644 index 46ca5c22..00000000 --- a/packages/messaging/dist/models/PersonalizationSchema.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; -/* - Copyright 2024 Adobe. All rights reserved. - This file is licensed to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law - or agreed to in writing, software distributed under the License is - distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF - ANY KIND, either express or implied. See the License for the specific - language governing permissions and limitations under the License. -*/ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.PersonalizationSchema = void 0; -var PersonalizationSchema; -(function (PersonalizationSchema) { - PersonalizationSchema["CONTENT_CARD"] = "https://ns.adobe.com/personalization/message/content-card"; - PersonalizationSchema["DEFAULT_CONTENT"] = "https://ns.adobe.com/personalization/default-content-item"; - PersonalizationSchema["HTML_CONTENT"] = "https://ns.adobe.com/personalization/html-content-item"; - PersonalizationSchema["IN_APP"] = "https://ns.adobe.com/personalization/message/in-app"; - PersonalizationSchema["JSON_CONTENT"] = "https://ns.adobe.com/personalization/json-content-item"; - PersonalizationSchema["NATIVE_ALERT"] = "https://ns.adobe.com/personalization/message/native-alert"; - PersonalizationSchema["RULESET_ITEM"] = "https://ns.adobe.com/personalization/ruleset-item"; -})(PersonalizationSchema = exports.PersonalizationSchema || (exports.PersonalizationSchema = {})); -//# sourceMappingURL=PersonalizationSchema.js.map \ No newline at end of file diff --git a/packages/messaging/dist/models/PersonalizationSchema.js.map b/packages/messaging/dist/models/PersonalizationSchema.js.map deleted file mode 100644 index 895c6664..00000000 --- a/packages/messaging/dist/models/PersonalizationSchema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"PersonalizationSchema.js","sourceRoot":"","sources":["../../src/models/PersonalizationSchema.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE;;;AAEF,IAAY,qBAQX;AARD,WAAY,qBAAqB;IAC/B,mGAA0E,CAAA;IAC1E,sGAA6E,CAAA;IAC7E,gGAAuE,CAAA;IACvE,uFAA8D,CAAA;IAC9D,gGAAuE,CAAA;IACvE,mGAA0E,CAAA;IAC1E,2FAAkE,CAAA;AACpE,CAAC,EARW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAQhC"} \ No newline at end of file diff --git a/packages/messaging/dist/models/PropositionItem.d.ts b/packages/messaging/dist/models/PropositionItem.d.ts deleted file mode 100644 index 9e395892..00000000 --- a/packages/messaging/dist/models/PropositionItem.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { PersonalizationSchema } from './PersonalizationSchema'; -import MessagingEdgeEventType from './MessagingEdgeEventType'; -/** - * Base PropositionItem interface that all proposition items implement - */ -export interface PropositionItemData { - id: string; - uuid: string; - schema: PersonalizationSchema; - activityID: string; - data: { - [key: string]: any; - }; -} -/** - * A PropositionItem represents a personalization JSON object returned by Konductor. - * This is the base class that provides tracking functionality for all proposition items - * including ContentCards, InApp messages, and code-based experiences. - * - * This mirrors the native Android PropositionItem class functionality. - */ -export declare class PropositionItem { - id: string; - uuid: string; - activityID: string; - schema: PersonalizationSchema; - data: { - [key: string]: any; - }; - constructor(propositionItemData: PropositionItemData); - /** - * Gets the PropositionItem identifier. - * - * @returns {string} The PropositionItem identifier - */ - getItemId(): string; - /** - * Gets the PropositionItem content schema. - * - * @returns {PersonalizationSchema} The PropositionItem content schema - */ - getSchema(): PersonalizationSchema; - /** - * Gets the PropositionItem data. - * - * @returns {object} The PropositionItem data - */ - getItemData(): { - [key: string]: any; - }; - /** - * Tracks interaction with this proposition item. - * This is the core tracking method that all proposition items use. - * - * @param {MessagingEdgeEventType} eventType - The MessagingEdgeEventType specifying event type for the interaction - * - * @example - * propositionItem.track(MessagingEdgeEventType.DISPLAY); - */ - track(eventType: MessagingEdgeEventType): void; - /** - * Tracks interaction with this proposition item. - * - * @param {string | null} interaction - String describing the interaction - * @param {MessagingEdgeEventType} eventType - The MessagingEdgeEventType specifying event type for the interaction - * @param {string[] | null} tokens - Array containing the sub-item tokens for recording interaction - * - * @example - * // Track display - * propositionItem.track(null, MessagingEdgeEventType.DISPLAY, null); - * - * // Track interaction - * propositionItem.track("button_clicked", MessagingEdgeEventType.INTERACT, null); - * - * // Track with tokens - * propositionItem.track("click", MessagingEdgeEventType.INTERACT, ["token1", "token2"]); - */ - track(interaction: string | null, eventType: MessagingEdgeEventType, tokens: string[] | null): void; - /** - * Internal method that performs the actual tracking - */ - private trackWithDetails; -} diff --git a/packages/messaging/dist/models/PropositionItem.js b/packages/messaging/dist/models/PropositionItem.js deleted file mode 100644 index 0ef3f3f3..00000000 --- a/packages/messaging/dist/models/PropositionItem.js +++ /dev/null @@ -1,78 +0,0 @@ -"use strict"; -/* - Copyright 2025 Adobe. All rights reserved. - This file is licensed to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law - or agreed to in writing, software distributed under the License is - distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF - ANY KIND, either express or implied. See the License for the specific - language governing permissions and limitations under the License. -*/ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.PropositionItem = void 0; -const react_native_1 = require("react-native"); -const RCTAEPMessaging = react_native_1.NativeModules.AEPMessaging; -/** - * A PropositionItem represents a personalization JSON object returned by Konductor. - * This is the base class that provides tracking functionality for all proposition items - * including ContentCards, InApp messages, and code-based experiences. - * - * This mirrors the native Android PropositionItem class functionality. - */ -class PropositionItem { - constructor(propositionItemData) { - this.id = propositionItemData.id; - this.schema = propositionItemData.schema; - this.data = propositionItemData.data; - this.uuid = propositionItemData.uuid; - this.activityID = propositionItemData.activityID; - } - /** - * Gets the PropositionItem identifier. - * - * @returns {string} The PropositionItem identifier - */ - getItemId() { - return this.id; - } - /** - * Gets the PropositionItem content schema. - * - * @returns {PersonalizationSchema} The PropositionItem content schema - */ - getSchema() { - return this.schema; - } - /** - * Gets the PropositionItem data. - * - * @returns {object} The PropositionItem data - */ - getItemData() { - return this.data; - } - // Implementation - track(interactionOrEventType, eventType, tokens) { - // Handle overloaded method signatures - if (typeof interactionOrEventType === 'number' && eventType === undefined) { - // First overload: track(eventType) - this.trackWithDetails(null, interactionOrEventType, null); - } - else if (typeof interactionOrEventType === 'string' || interactionOrEventType === null) { - // Second overload: track(interaction, eventType, tokens) - this.trackWithDetails(interactionOrEventType, eventType, tokens || null); - } - } - /** - * Internal method that performs the actual tracking - */ - trackWithDetails(interaction, eventType, tokens) { - var _a; - const nativeIdentifier = (_a = this.activityID) !== null && _a !== void 0 ? _a : null; - RCTAEPMessaging.trackPropositionItem(nativeIdentifier, interaction, eventType, tokens); - } -} -exports.PropositionItem = PropositionItem; -//# sourceMappingURL=PropositionItem.js.map \ No newline at end of file diff --git a/packages/messaging/dist/models/PropositionItem.js.map b/packages/messaging/dist/models/PropositionItem.js.map deleted file mode 100644 index 72ee6193..00000000 --- a/packages/messaging/dist/models/PropositionItem.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"PropositionItem.js","sourceRoot":"","sources":["../../src/models/PropositionItem.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE;;;AAEF,+CAA6C;AAI7C,MAAM,eAAe,GAAG,4BAAa,CAAC,YAAY,CAAC;AAenD;;;;;;GAMG;AACH,MAAa,eAAe;IAO1B,YAAY,mBAAwC;QAClD,IAAI,CAAC,EAAE,GAAG,mBAAmB,CAAC,EAAE,CAAC;QACjC,IAAI,CAAC,MAAM,GAAG,mBAAmB,CAAC,MAAM,CAAC;QACzC,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC,IAAI,CAAC;QACrC,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC,IAAI,CAAC;QACrC,IAAI,CAAC,UAAU,GAAG,mBAAmB,CAAC,UAAU,CAAC;IACnD,CAAC;IAED;;;;OAIG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,EAAE,CAAC;IACjB,CAAC;IAED;;;;OAIG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED;;;;OAIG;IACH,WAAW;QACT,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAgCD,iBAAiB;IACjB,KAAK,CACH,sBAA8D,EAC9D,SAAkC,EAClC,MAAwB;QAExB,sCAAsC;QACtC,IAAI,OAAO,sBAAsB,KAAK,QAAQ,IAAI,SAAS,KAAK,SAAS,EAAE;YACzE,mCAAmC;YACnC,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,sBAAsB,EAAE,IAAI,CAAC,CAAC;SAC3D;aAAM,IAAI,OAAO,sBAAsB,KAAK,QAAQ,IAAI,sBAAsB,KAAK,IAAI,EAAE;YACxF,yDAAyD;YACzD,IAAI,CAAC,gBAAgB,CAAC,sBAAsB,EAAE,SAAU,EAAE,MAAM,IAAI,IAAI,CAAC,CAAC;SAC3E;IACH,CAAC;IAED;;OAEG;IACK,gBAAgB,CAAC,WAA0B,EAAE,SAAiC,EAAE,MAAuB;;QAC7G,MAAM,gBAAgB,GAAG,MAAA,IAAI,CAAC,UAAU,mCAAI,IAAI,CAAC;QACjD,eAAe,CAAC,oBAAoB,CAAC,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IACzF,CAAC;CAEF;AAhGD,0CAgGC"} \ No newline at end of file diff --git a/packages/messaging/dist/models/ScopeDetails.d.ts b/packages/messaging/dist/models/ScopeDetails.d.ts deleted file mode 100644 index ee6689fa..00000000 --- a/packages/messaging/dist/models/ScopeDetails.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -export interface Activity { - matchedSurfaces: string[]; - id: string; -} -export interface Characteristics { - eventToken: string; -} -export interface ScopeDetails { - activity: Activity; - characteristics: Characteristics; - correlationID: string; - decisionProvider: string; -} diff --git a/packages/messaging/dist/models/ScopeDetails.js b/packages/messaging/dist/models/ScopeDetails.js deleted file mode 100644 index 2ffb4b02..00000000 --- a/packages/messaging/dist/models/ScopeDetails.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -/* - Copyright 2024 Adobe. All rights reserved. - This file is licensed to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law - or agreed to in writing, software distributed under the License is - distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF - ANY KIND, either express or implied. See the License for the specific - language governing permissions and limitations under the License. -*/ -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=ScopeDetails.js.map \ No newline at end of file diff --git a/packages/messaging/dist/models/ScopeDetails.js.map b/packages/messaging/dist/models/ScopeDetails.js.map deleted file mode 100644 index ce9662af..00000000 --- a/packages/messaging/dist/models/ScopeDetails.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ScopeDetails.js","sourceRoot":"","sources":["../../src/models/ScopeDetails.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE"} \ No newline at end of file diff --git a/packages/messaging/dist/models/index.d.ts b/packages/messaging/dist/models/index.d.ts deleted file mode 100644 index 2dfc8c71..00000000 --- a/packages/messaging/dist/models/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export * from './ContentCard'; -export * from './InAppMessage'; -export * from './JSONProposition'; -export * from './Message'; -export * from './MessagingDelegate'; -export * from './MessagingEdgeEventType'; -export * from './MessagingProposition'; -export * from './MessagingPropositionItem'; -export * from './PersonalizationSchema'; -export * from './ScopeDetails'; diff --git a/packages/messaging/dist/models/index.js b/packages/messaging/dist/models/index.js deleted file mode 100644 index ea1d5340..00000000 --- a/packages/messaging/dist/models/index.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const tslib_1 = require("tslib"); -tslib_1.__exportStar(require("./ContentCard"), exports); -tslib_1.__exportStar(require("./InAppMessage"), exports); -tslib_1.__exportStar(require("./JSONProposition"), exports); -tslib_1.__exportStar(require("./Message"), exports); -tslib_1.__exportStar(require("./MessagingDelegate"), exports); -tslib_1.__exportStar(require("./MessagingEdgeEventType"), exports); -tslib_1.__exportStar(require("./MessagingProposition"), exports); -tslib_1.__exportStar(require("./MessagingPropositionItem"), exports); -tslib_1.__exportStar(require("./PersonalizationSchema"), exports); -tslib_1.__exportStar(require("./ScopeDetails"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/messaging/dist/models/index.js.map b/packages/messaging/dist/models/index.js.map deleted file mode 100644 index 33916134..00000000 --- a/packages/messaging/dist/models/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;AAAA,wDAA8B;AAC9B,yDAA+B;AAC/B,4DAAkC;AAClC,oDAA0B;AAC1B,8DAAoC;AACpC,mEAAyC;AACzC,iEAAuC;AACvC,qEAA2C;AAC3C,kEAAwC;AACxC,yDAA+B"} \ No newline at end of file diff --git a/packages/messaging/dist/module/Messaging.js b/packages/messaging/dist/module/Messaging.js index 5389598c..7122c260 100644 --- a/packages/messaging/dist/module/Messaging.js +++ b/packages/messaging/dist/module/Messaging.js @@ -172,8 +172,13 @@ class Messaging { return []; } return contentCards.map(card => { + //TODO Clean up mock for Testing: mark first card as already read + //return contentCards.map((card: any, index: number) => { const type = card.data?.meta?.adobe?.template ?? "SmallImage"; - return new ContentTemplate(card, type); + const isRead = card.data?.read ?? false; + // Test: To mark first 2 cards as read, uncomment line above (with index) and change isRead to: + // const isRead = card.data?.read ?? (index < 2); + return new ContentTemplate(card, type, isRead); }); } static async getContentCardContainer(surface) { @@ -196,19 +201,21 @@ class Messaging { unread_indicator: { unread_bg: { clr: { - light: "#000000", - dark: "#000000" + light: "#FFF3E0", + // Light orange background for unread cards + dark: "#2D1B0E" // Dark orange background for unread cards } }, unread_icon: { placement: "topright", image: { - url: "https://www.adobe.com", - darkUrl: "https://www.adobe.com" + url: "https://icons.veryicon.com/png/o/leisure/crisp-app-icon-library-v3/notification-5.png", + // Image in light mode + darkUrl: "" // Empty URL = shows dot in dark mode } } }, - isUnreadEnabled: false + isUnreadEnabled: true // Enable unread features! }, showPagination: false }; diff --git a/packages/messaging/dist/module/Messaging.js.map b/packages/messaging/dist/module/Messaging.js.map index 7c639e71..37f7dc17 100644 --- a/packages/messaging/dist/module/Messaging.js.map +++ b/packages/messaging/dist/module/Messaging.js.map @@ -1 +1 @@ -{"version":3,"names":["NativeModules","NativeEventEmitter","Platform","Message","MessagingProposition","PersonalizationSchema","ContentTemplate","RCTAEPMessaging","AEPMessaging","messagingDelegate","Messaging","extensionVersion","Promise","resolve","refreshInAppMessages","getCachedMessages","messages","map","msg","getLatestMessage","message","undefined","getPropositionsForSurfaces","surfaces","propositionsList","messagingPropositionsForSurfaces","surface","propositions","Object","entries","proposition","trackContentCardDisplay","contentCard","trackContentCardInteraction","trackPropositionItem","itemId","interaction","eventType","tokens","setMessagingDelegate","delegate","eventEmitter","addListener","onShow","messageInstance","_clearJavascriptMessageHandlers","onDismiss","shouldShowMessage","shouldSaveMessage","setMessageSettings","OS","event","urlLoaded","url","onContentLoaded","removeAllListeners","updatePropositionsForSurfaces","getContentCardUI","length","contentCards","flatMap","items","filter","item","schema","CONTENT_CARD","card","type","data","meta","adobe","template","getContentCardContainer","console","log","templateType","content","heading","layout","orientation","capacity","emptyStateSettings","unread_indicator","unread_bg","clr","light","dark","unread_icon","placement","image","darkUrl","isUnreadEnabled","showPagination"],"sourceRoot":"../../src","sources":["Messaging.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,aAAa,EACbC,kBAAkB,EAElBC,QAAQ,QACH,cAAc;AACrB,OAAOC,OAAO,MAAM,qBAAkB;AAEtC,SAASC,oBAAoB,QAAQ,kCAA+B;AAEpE,SAASC,qBAAqB,QAAQ,mCAAgC;AACtE,SAASC,eAAe,QAAQ,yBAAsB;AAkCtD,MAAMC,eAAqD,GACzDP,aAAa,CAACQ,YAAY;AAG5B,IAAIC,iBAAoC;AAExC,MAAMC,SAAS,CAAC;EACd;AACF;AACA;AACA;EACE,OAAOC,gBAAgBA,CAAA,EAAoB;IACzC,OAAOC,OAAO,CAACC,OAAO,CAACN,eAAe,CAACI,gBAAgB,CAAC,CAAC,CAAC;EAC5D;;EAEA;AACF;AACA;EACE,OAAOG,oBAAoBA,CAAA,EAAG;IAC5BP,eAAe,CAACO,oBAAoB,CAAC,CAAC;EACxC;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,aAAaC,iBAAiBA,CAAA,EAAuB;IACnD,MAAMC,QAAQ,GAAG,MAAMT,eAAe,CAACQ,iBAAiB,CAAC,CAAC;IAC1D,OAAOC,QAAQ,CAACC,GAAG,CAAEC,GAAG,IAAK,IAAIf,OAAO,CAACe,GAAG,CAAC,CAAC;EAChD;;EAEA;AACF;AACA;AACA;EACE,aAAaC,gBAAgBA,CAA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AAO,EAAE;IACX;IAEA,OAAOC,YAAY,CAAC1C,GAAG,CAAEiD,IAAS,IAAK;MACrC,MAAMC,IAAI,GAAGD,IAAI,CAACE,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAEC,QAAQ,IAAI,YAAY;MAC7D,OAAO,IAAIjE,eAAe,CAAC4D,IAAI,EAAEC,IAAI,CAAC;IACxC,CAAC,CAAC;EACJ;EAEA,aAAaK,uBAAuBA,CAClC9C,OAAe,EACa;IAC5B+C,OAAO,CAACC,GAAG,CAAC,yBAAyB,EAAEhD,OAAO,CAAC;IAC/C,OAAO;MACLiD,YAAY,EAAE,OAAO;MACrBC,OAAO,EAAE;QACPC,OAAO,EAAE;UACPD,OAAO,EAAE;QACX,CAAC;QACDE,MAAM,EAAE;UACNC,WAAW,EAAE;QACf,CAAC;QACDC,QAAQ,EAAE,EAAE;QACZC,kBAAkB,EAAE;UAClB7D,OAAO,EAAE;YACPwD,OAAO,EAAE;UACX;QACF,CAAC;QACDM,gBAAgB,EAAE;UAChBC,SAAS,EAAE;YACTC,GAAG,EAAE;cACHC,KAAK,EAAE,SAAS;cAChBC,IAAI,EAAE;YACR;UACF,CAAC;UACDC,WAAW,EAAE;YACXC,SAAS,EAAE,UAAU;YACrBC,KAAK,EAAE;cACLpC,GAAG,EAAE,uBAAuB;cAC5BqC,OAAO,EAAE;YACX;UACF;QACF,CAAC;QACDC,eAAe,EAAE;MACnB,CAAC;MACDC,cAAc,EAAE;IAClB,CAAC;EACH;AACF;AAEA,eAAelF,SAAS","ignoreList":[]} +{"version":3,"names":["NativeModules","NativeEventEmitter","Platform","Message","MessagingProposition","PersonalizationSchema","ContentTemplate","RCTAEPMessaging","AEPMessaging","messagingDelegate","Messaging","extensionVersion","Promise","resolve","refreshInAppMessages","getCachedMessages","messages","map","msg","getLatestMessage","message","undefined","getPropositionsForSurfaces","surfaces","propositionsList","messagingPropositionsForSurfaces","surface","propositions","Object","entries","proposition","trackContentCardDisplay","contentCard","trackContentCardInteraction","trackPropositionItem","itemId","interaction","eventType","tokens","setMessagingDelegate","delegate","eventEmitter","addListener","onShow","messageInstance","_clearJavascriptMessageHandlers","onDismiss","shouldShowMessage","shouldSaveMessage","setMessageSettings","OS","event","urlLoaded","url","onContentLoaded","removeAllListeners","updatePropositionsForSurfaces","getContentCardUI","length","contentCards","flatMap","items","filter","item","schema","CONTENT_CARD","card","type","data","meta","adobe","template","isRead","read","getContentCardContainer","console","log","templateType","content","heading","layout","orientation","capacity","emptyStateSettings","unread_indicator","unread_bg","clr","light","dark","unread_icon","placement","image","darkUrl","isUnreadEnabled","showPagination"],"sourceRoot":"../../src","sources":["Messaging.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,aAAa,EACbC,kBAAkB,EAElBC,QAAQ,QACH,cAAc;AACrB,OAAOC,OAAO,MAAM,qBAAkB;AAEtC,SAASC,oBAAoB,QAAQ,kCAA+B;AAEpE,SAASC,qBAAqB,QAAQ,mCAAgC;AACtE,SAASC,eAAe,QAAQ,yBAAsB;AAkCtD,MAAMC,eAAqD,GACzDP,aAAa,CAACQ,YAAY;AAG5B,IAAIC,iBAAoC;AAExC,MAAMC,SAAS,CAAC;EACd;AACF;AACA;AACA;EACE,OAAOC,gBAAgBA,CAAA,EAAoB;IACzC,OAAOC,OAAO,CAACC,OAAO,CAACN,eAAe,CAACI,gBAAgB,CAAC,CAAC,CAAC;EAC5D;;EAEA;AACF;AACA;EACE,OAAOG,oBAAoBA,CAAA,EAAG;IAC5BP,eAAe,CAACO,oBAAoB,CAAC,CAAC;EACxC;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,aAAaC,iBAAiBA,CAAA,EAAuB;IACnD,MAAMC,QAAQ,GAAG,MAAMT,eAAe,CAACQ,iBAAiB,CAAC,CAAC;IAC1D,OAAOC,QAAQ,CAACC,GAAG,CAAEC,GAAG,IAAK,IAAIf,OAAO,CAACe,GAAG,CAAC,CAAC;EAChD;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EH,IAAI,CAACN,YAAY,EAAED,MAAM,EAAE;MACzB,OAAO,EAAE;IACX;IAEA,OAAOC,YAAY,CAAC1C,GAAG,CAAEiD,IAAS,IAAK;MACvC;MACA;MACE,MAAMC,IAAI,GAAGD,IAAI,CAACE,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAEC,QAAQ,IAAI,YAAY;MAC7D,MAAMC,MAAM,GAAGN,IAAI,CAACE,IAAI,EAAEK,IAAI,IAAI,KAAK;MACvC;MACA;MACA,OAAO,IAAInE,eAAe,CAAC4D,IAAI,EAAEC,IAAI,EAAEK,MAAM,CAAC;IAChD,CAAC,CAAC;EACJ;EAEA,aAAaE,uBAAuBA,CAClChD,OAAe,EACa;IAC5BiD,OAAO,CAACC,GAAG,CAAC,yBAAyB,EAAElD,OAAO,CAAC;IAC/C,OAAO;MACLmD,YAAY,EAAE,OAAO;MACrBC,OAAO,EAAE;QACPC,OAAO,EAAE;UACPD,OAAO,EAAE;QACX,CAAC;QACDE,MAAM,EAAE;UACNC,WAAW,EAAE;QACf,CAAC;QACDC,QAAQ,EAAE,EAAE;QACZC,kBAAkB,EAAE;UAClB/D,OAAO,EAAE;YACP0D,OAAO,EAAE;UACX;QACF,CAAC;QACDM,gBAAgB,EAAE;UAChBC,SAAS,EAAE;YACTC,GAAG,EAAE;cACHC,KAAK,EAAE,SAAS;cAAG;cACnBC,IAAI,EAAE,SAAS,CAAI;YACrB;UACF,CAAC;UACDC,WAAW,EAAE;YACXC,SAAS,EAAE,UAAU;YACrBC,KAAK,EAAE;cACLtC,GAAG,EAAE,uFAAuF;cAAG;cAC/FuC,OAAO,EAAE,EAAE,CAAG;YAChB;UACF;QACF,CAAC;QACDC,eAAe,EAAE,IAAI,CAAG;MAC1B,CAAC;MACDC,cAAc,EAAE;IAClB,CAAC;EACH;AACF;AAEA,eAAepF,SAAS","ignoreList":[]} diff --git a/packages/messaging/dist/module/models/ContentCard.js b/packages/messaging/dist/module/models/ContentCard.js index b7d9da60..645f3905 100644 --- a/packages/messaging/dist/module/models/ContentCard.js +++ b/packages/messaging/dist/module/models/ContentCard.js @@ -14,9 +14,11 @@ import { PropositionItem } from "./PropositionItem.js"; export class ContentCard extends PropositionItem { - constructor(contentCardData) { + isRead = false; + constructor(contentCardData, isRead = false) { super(contentCardData); this.data = contentCardData.data; + this.isRead = isRead; } } //# sourceMappingURL=ContentCard.js.map \ No newline at end of file diff --git a/packages/messaging/dist/module/models/ContentCard.js.map b/packages/messaging/dist/module/models/ContentCard.js.map index d7a9cdd7..4373b992 100644 --- a/packages/messaging/dist/module/models/ContentCard.js.map +++ b/packages/messaging/dist/module/models/ContentCard.js.map @@ -1 +1 @@ -{"version":3,"names":["PropositionItem","ContentCard","constructor","contentCardData","data"],"sourceRoot":"../../../src","sources":["models/ContentCard.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,eAAe,QAA6B,sBAAmB;AA2DxE,OAAO,MAAMC,WAAW,SAASD,eAAe,CAAC;EAG/CE,WAAWA,CAACC,eAAgC,EAAE;IAC5C,KAAK,CAACA,eAAe,CAAC;IACtB,IAAI,CAACC,IAAI,GAAGD,eAAe,CAACC,IAAI;EAClC;AACF","ignoreList":[]} +{"version":3,"names":["PropositionItem","ContentCard","isRead","constructor","contentCardData","data"],"sourceRoot":"../../../src","sources":["models/ContentCard.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,eAAe,QAA6B,sBAAmB;AA2DxE,OAAO,MAAMC,WAAW,SAASD,eAAe,CAAC;EAE/CE,MAAM,GAAY,KAAK;EAEvBC,WAAWA,CAACC,eAAgC,EAAEF,MAAe,GAAG,KAAK,EAAE;IACrE,KAAK,CAACE,eAAe,CAAC;IACtB,IAAI,CAACC,IAAI,GAAGD,eAAe,CAACC,IAAI;IAChC,IAAI,CAACH,MAAM,GAAGA,MAAM;EACtB;AACF","ignoreList":[]} diff --git a/packages/messaging/dist/module/ui/components/Button/Button.spec.js b/packages/messaging/dist/module/ui/components/Button/Button.spec.js index 49cd5c16..df2c7061 100644 --- a/packages/messaging/dist/module/ui/components/Button/Button.spec.js +++ b/packages/messaging/dist/module/ui/components/Button/Button.spec.js @@ -1,2 +1,442 @@ "use strict"; + +/* + Copyright 2025 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law + or agreed to in writing, software distributed under the License is + distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF + ANY KIND, either express or implied. See the License for the specific + language governing permissions and limitations under the License. +*/ +import React from 'react'; +import { render, screen, fireEvent } from '@testing-library/react-native'; +import { Linking } from 'react-native'; +import Button from "./Button.js"; +import { ThemeProvider } from "../../theme/ThemeProvider.js"; + +// Mock Linking.openURL +jest.spyOn(Linking, 'openURL'); + +// Helper to render with theme +const renderWithTheme = (component, customThemes) => { + return render(/*#__PURE__*/React.createElement(ThemeProvider, { + customThemes: customThemes + }, component)); +}; +describe('Button', () => { + const mockOnPress = jest.fn(); + beforeEach(() => { + jest.clearAllMocks(); + }); + afterEach(() => { + jest.clearAllMocks(); + }); + describe('Basic rendering', () => { + it('should render a button with the provided title', () => { + render(/*#__PURE__*/React.createElement(Button, { + title: "Click Me" + })); + const button = screen.getByText('Click Me'); + expect(button).toBeTruthy(); + }); + it('should render with different title text', () => { + render(/*#__PURE__*/React.createElement(Button, { + title: "Submit" + })); + expect(screen.getByText('Submit')).toBeTruthy(); + }); + it('should render button as Pressable component', () => { + const { + getByTestId + } = render(/*#__PURE__*/React.createElement(Button, { + title: "Test", + testID: "test-button" + })); + const button = getByTestId('test-button'); + expect(button.type).toBe('View'); // Pressable renders as View + }); + }); + describe('Press handling', () => { + it('should call onPress when the button is pressed', () => { + render(/*#__PURE__*/React.createElement(Button, { + title: "Press Me", + onPress: mockOnPress + })); + const button = screen.getByText('Press Me'); + fireEvent.press(button); + expect(mockOnPress).toHaveBeenCalledTimes(1); + }); + it('should call onPress with interactId when provided', () => { + render(/*#__PURE__*/React.createElement(Button, { + title: "Press Me", + onPress: mockOnPress, + interactId: "test-interact-id" + })); + const button = screen.getByText('Press Me'); + fireEvent.press(button); + expect(mockOnPress).toHaveBeenCalledWith('test-interact-id'); + }); + it('should call onPress multiple times when pressed multiple times', () => { + render(/*#__PURE__*/React.createElement(Button, { + title: "Press Me", + onPress: mockOnPress + })); + const button = screen.getByText('Press Me'); + fireEvent.press(button); + fireEvent.press(button); + fireEvent.press(button); + expect(mockOnPress).toHaveBeenCalledTimes(3); + }); + it('should not throw error when onPress is not provided', () => { + render(/*#__PURE__*/React.createElement(Button, { + title: "Press Me" + })); + const button = screen.getByText('Press Me'); + expect(() => fireEvent.press(button)).not.toThrow(); + }); + }); + describe('actionUrl handling', () => { + it('should open URL when actionUrl is provided and button is pressed', () => { + const testUrl = 'https://example.com'; + render(/*#__PURE__*/React.createElement(Button, { + title: "Link", + actionUrl: testUrl + })); + const button = screen.getByText('Link'); + fireEvent.press(button); + expect(Linking.openURL).toHaveBeenCalledWith(testUrl); + }); + it('should call both onPress and open URL when both are provided', () => { + const testUrl = 'https://example.com'; + render(/*#__PURE__*/React.createElement(Button, { + title: "Link", + actionUrl: testUrl, + onPress: mockOnPress + })); + const button = screen.getByText('Link'); + fireEvent.press(button); + expect(mockOnPress).toHaveBeenCalledTimes(1); + expect(Linking.openURL).toHaveBeenCalledWith(testUrl); + }); + it('should call onPress with interactId and open URL', () => { + const testUrl = 'https://example.com'; + render(/*#__PURE__*/React.createElement(Button, { + title: "Link", + actionUrl: testUrl, + onPress: mockOnPress, + interactId: "link-interact-id" + })); + const button = screen.getByText('Link'); + fireEvent.press(button); + expect(mockOnPress).toHaveBeenCalledWith('link-interact-id'); + expect(Linking.openURL).toHaveBeenCalledWith(testUrl); + }); + it('should call openURL even if it might fail', () => { + const testUrl = 'https://example.com'; + render(/*#__PURE__*/React.createElement(Button, { + title: "Link", + actionUrl: testUrl + })); + const button = screen.getByText('Link'); + fireEvent.press(button); + + // Verify the URL opening was attempted + expect(Linking.openURL).toHaveBeenCalledWith(testUrl); + }); + it('should not try to open URL when actionUrl is not provided', () => { + render(/*#__PURE__*/React.createElement(Button, { + title: "No Link", + onPress: mockOnPress + })); + const button = screen.getByText('No Link'); + fireEvent.press(button); + expect(Linking.openURL).not.toHaveBeenCalled(); + }); + }); + describe('Theme support', () => { + it('should apply theme button text color when theme is provided', () => { + const customThemes = { + light: { + colors: { + buttonTextColor: '#FF5733' + } + }, + dark: { + colors: { + buttonTextColor: '#FF5733' + } + } + }; + renderWithTheme(/*#__PURE__*/React.createElement(Button, { + title: "Themed" + }), customThemes); + const text = screen.getByText('Themed'); + expect(text.props.style).toEqual(expect.arrayContaining([expect.objectContaining({ + color: '#FF5733' + })])); + }); + it('should handle theme with undefined buttonTextColor', () => { + const customThemes = { + light: { + colors: {} + }, + dark: { + colors: {} + } + }; + renderWithTheme(/*#__PURE__*/React.createElement(Button, { + title: "Default" + }), customThemes); + const text = screen.getByText('Default'); + expect(text).toBeTruthy(); + }); + it('should render without theme provider', () => { + expect(() => { + render(/*#__PURE__*/React.createElement(Button, { + title: "No Theme" + })); + }).not.toThrow(); + }); + }); + describe('Custom styles', () => { + it('should accept and apply custom textStyle', () => { + const customTextStyle = { + fontSize: 20, + fontWeight: 'bold' + }; + render(/*#__PURE__*/React.createElement(Button, { + title: "Styled", + textStyle: customTextStyle + })); + const text = screen.getByText('Styled'); + expect(text.props.style).toEqual(expect.arrayContaining([expect.objectContaining({ + fontSize: 20, + fontWeight: 'bold' + })])); + }); + it('should accept and apply array of textStyles', () => { + const textStyles = [{ + fontSize: 16 + }, { + fontWeight: 'bold' + }, { + color: 'blue' + }]; + render(/*#__PURE__*/React.createElement(Button, { + title: "Multi Style", + textStyle: textStyles + })); + const text = screen.getByText('Multi Style'); + const styles = JSON.stringify(text.props.style); + expect(styles).toContain('"fontSize":16'); + expect(styles).toContain('"fontWeight":"bold"'); + expect(styles).toContain('"color":"blue"'); + }); + it('should accept and apply custom Pressable style', () => { + const customStyle = { + padding: 10, + backgroundColor: 'red' + }; + const { + getByTestId + } = render(/*#__PURE__*/React.createElement(Button, { + title: "Styled Button", + style: customStyle, + testID: "button" + })); + const button = getByTestId('button'); + expect(button.props.style).toEqual(customStyle); + }); + it('should merge theme color with custom textStyle', () => { + const customThemes = { + light: { + colors: { + buttonTextColor: '#FF5733' + } + }, + dark: { + colors: { + buttonTextColor: '#FF5733' + } + } + }; + const customTextStyle = { + fontSize: 18 + }; + renderWithTheme(/*#__PURE__*/React.createElement(Button, { + title: "Merged", + textStyle: customTextStyle + }), customThemes); + const text = screen.getByText('Merged'); + expect(text.props.style).toEqual(expect.arrayContaining([expect.objectContaining({ + color: '#FF5733' + }), expect.objectContaining({ + fontSize: 18 + })])); + }); + }); + describe('Additional Pressable props', () => { + it('should accept disabled prop', () => { + const { + getByTestId + } = render(/*#__PURE__*/React.createElement(Button, { + title: "Disabled", + disabled: true, + testID: "button" + })); + const button = getByTestId('button'); + expect(button.props.accessibilityState.disabled).toBe(true); + }); + it('should accept accessibility props', () => { + const { + getByTestId + } = render(/*#__PURE__*/React.createElement(Button, { + title: "Accessible", + testID: "button", + accessibilityLabel: "Submit form", + accessibilityHint: "Double tap to submit the form" + })); + const button = getByTestId('button'); + expect(button.props.accessibilityLabel).toBe('Submit form'); + expect(button.props.accessibilityHint).toBe('Double tap to submit the form'); + }); + it('should accept testID prop', () => { + const { + getByTestId + } = render(/*#__PURE__*/React.createElement(Button, { + title: "Test ID", + testID: "my-button" + })); + const button = getByTestId('my-button'); + expect(button).toBeTruthy(); + }); + it('should spread additional Pressable props', () => { + const { + getByTestId + } = render(/*#__PURE__*/React.createElement(Button, { + title: "Extended", + testID: "button", + hitSlop: 10, + accessibilityRole: "button" + })); + const button = getByTestId('button'); + expect(button.props.hitSlop).toBe(10); + expect(button.props.accessibilityRole).toBe('button'); + }); + }); + describe('ID prop', () => { + it('should accept id prop without error', () => { + expect(() => { + render(/*#__PURE__*/React.createElement(Button, { + title: "With ID", + id: "button-123" + })); + }).not.toThrow(); + }); + it('should render correctly with id prop', () => { + render(/*#__PURE__*/React.createElement(Button, { + title: "ID Button", + id: "unique-id" + })); + const button = screen.getByText('ID Button'); + expect(button).toBeTruthy(); + }); + }); + describe('Edge cases', () => { + it('should handle empty title string', () => { + render(/*#__PURE__*/React.createElement(Button, { + title: "" + })); + + // Should not throw, but may not be visible + expect(() => screen.getByText('')).not.toThrow(); + }); + it('should handle very long title text', () => { + const longTitle = 'A'.repeat(1000); + render(/*#__PURE__*/React.createElement(Button, { + title: longTitle + })); + const button = screen.getByText(longTitle); + expect(button).toBeTruthy(); + }); + it('should handle special characters in title', () => { + const specialTitle = '!@#$%^&*()_+-={}[]|:;<>?,./~`'; + render(/*#__PURE__*/React.createElement(Button, { + title: specialTitle + })); + const button = screen.getByText(specialTitle); + expect(button).toBeTruthy(); + }); + it('should handle undefined interactId', () => { + render(/*#__PURE__*/React.createElement(Button, { + title: "Test", + onPress: mockOnPress, + interactId: undefined + })); + const button = screen.getByText('Test'); + fireEvent.press(button); + expect(mockOnPress).toHaveBeenCalledWith(undefined); + }); + it('should handle empty string as actionUrl', () => { + render(/*#__PURE__*/React.createElement(Button, { + title: "Empty URL", + actionUrl: "" + })); + const button = screen.getByText('Empty URL'); + fireEvent.press(button); + + // Empty string is falsy, so openURL should not be called + expect(Linking.openURL).not.toHaveBeenCalled(); + }); + }); + describe('Callback stability', () => { + it('should maintain stable callback reference', () => { + const { + rerender + } = render(/*#__PURE__*/React.createElement(Button, { + title: "Stable", + onPress: mockOnPress, + actionUrl: "https://example.com" + })); + const button = screen.getByText('Stable'); + fireEvent.press(button); + expect(mockOnPress).toHaveBeenCalledTimes(1); + expect(Linking.openURL).toHaveBeenCalledTimes(1); + + // Rerender with same props + rerender(/*#__PURE__*/React.createElement(Button, { + title: "Stable", + onPress: mockOnPress, + actionUrl: "https://example.com" + })); + fireEvent.press(button); + expect(mockOnPress).toHaveBeenCalledTimes(2); + expect(Linking.openURL).toHaveBeenCalledTimes(2); + }); + it('should update callback when dependencies change', () => { + const { + rerender + } = render(/*#__PURE__*/React.createElement(Button, { + title: "Dynamic", + onPress: mockOnPress, + interactId: "id-1" + })); + const button = screen.getByText('Dynamic'); + fireEvent.press(button); + expect(mockOnPress).toHaveBeenCalledWith('id-1'); + + // Rerender with different interactId + rerender(/*#__PURE__*/React.createElement(Button, { + title: "Dynamic", + onPress: mockOnPress, + interactId: "id-2" + })); + fireEvent.press(button); + expect(mockOnPress).toHaveBeenCalledWith('id-2'); + }); + }); +}); //# sourceMappingURL=Button.spec.js.map \ No newline at end of file diff --git a/packages/messaging/dist/module/ui/components/Button/Button.spec.js.map b/packages/messaging/dist/module/ui/components/Button/Button.spec.js.map index 26a9ce45..de79bdd5 100644 --- a/packages/messaging/dist/module/ui/components/Button/Button.spec.js.map +++ b/packages/messaging/dist/module/ui/components/Button/Button.spec.js.map @@ -1 +1 @@ -{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["ui/components/Button/Button.spec.tsx"],"mappings":"","ignoreList":[]} +{"version":3,"names":["React","render","screen","fireEvent","Linking","Button","ThemeProvider","jest","spyOn","renderWithTheme","component","customThemes","createElement","describe","mockOnPress","fn","beforeEach","clearAllMocks","afterEach","it","title","button","getByText","expect","toBeTruthy","getByTestId","testID","type","toBe","onPress","press","toHaveBeenCalledTimes","interactId","toHaveBeenCalledWith","not","toThrow","testUrl","actionUrl","openURL","toHaveBeenCalled","light","colors","buttonTextColor","dark","text","props","style","toEqual","arrayContaining","objectContaining","color","customTextStyle","fontSize","fontWeight","textStyle","textStyles","styles","JSON","stringify","toContain","customStyle","padding","backgroundColor","disabled","accessibilityState","accessibilityLabel","accessibilityHint","hitSlop","accessibilityRole","id","longTitle","repeat","specialTitle","undefined","rerender"],"sourceRoot":"../../../../../src","sources":["ui/components/Button/Button.spec.t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AC,CAACmB,oBAAoB,CAAC,MAAM,CAAC;;MAEhD;MACAyC,QAAQ,cACN1E,KAAA,CAAAY,aAAA,CAACP,MAAM;QAACe,KAAK,EAAC,SAAS;QAACS,OAAO,EAAEf,WAAY;QAACkB,UAAU,EAAC;MAAM,CAAE,CACnE,CAAC;MAED7B,SAAS,CAAC2B,KAAK,CAACT,MAAM,CAAC;MAEvBE,MAAM,CAACT,WAAW,CAAC,CAACmB,oBAAoB,CAAC,MAAM,CAAC;IAClD,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]} diff --git a/packages/messaging/dist/module/ui/components/ContentCardView/ContentCardView.js b/packages/messaging/dist/module/ui/components/ContentCardView/ContentCardView.js index 4b881cb2..179d93a0 100644 --- a/packages/messaging/dist/module/ui/components/ContentCardView/ContentCardView.js +++ b/packages/messaging/dist/module/ui/components/ContentCardView/ContentCardView.js @@ -13,13 +13,25 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f language governing permissions and limitations under the License. */ -import React, { useEffect, useCallback, useState, useRef, useMemo } from 'react'; +import React, { useEffect, useCallback, useState, useRef, useMemo } from "react"; import { Image, Linking, Pressable, StyleSheet, Text, useColorScheme, View } from 'react-native'; import MessagingEdgeEventType from "../../../models/MessagingEdgeEventType.js"; import DismissButton from "../DismissButton/DismissButton.js"; +import UnreadIcon from "../UnreadIcon/UnreadIcon.js"; import { useTheme } from "../../theme/index.js"; import useAspectRatio from "../../hooks/useAspectRatio.js"; import Button from "../Button/Button.js"; +import useContainerSettings from "../../hooks/useContainerSettings.js"; + +/** + * Callback function that is called when a content card event occurs. + */ + +/** Props for the ContentCardView component */ + +/** Renders a content card view + * @param {ContentViewProps} props - The props for the ContentCardView component + */ export const ContentCardView = ({ template, listener, @@ -42,19 +54,43 @@ export const ContentCardView = ({ const [isVisible, setIsVisible] = useState(true); const isDisplayedRef = useRef(false); const theme = useTheme(); - const cardVariant = useMemo(() => variant ?? template.type ?? 'SmallImage', [variant, template.type]); + const containerSettings = useContainerSettings(); + // Track read state in component state + const [isRead, setIsRead] = useState(template.isRead); + + // Sync state when template changes + useEffect(() => { + setIsRead(template.isRead); + }, [template.isRead]); + + // Default to true if not specified + const isUnreadEnabled = containerSettings?.content?.isUnreadEnabled ?? true; + + // Get unread background color based on theme + const unreadBackgroundColor = useMemo(() => { + if (!isUnreadEnabled || isRead || !containerSettings?.content?.unread_indicator?.unread_bg) { + return undefined; + } + const unreadBg = containerSettings.content.unread_indicator.unread_bg; + return colorScheme === 'dark' ? unreadBg.clr.dark : unreadBg.clr.light; + }, [isUnreadEnabled, isRead, containerSettings, colorScheme]); + const cardVariant = useMemo(() => variant ?? template.type ?? "SmallImage", [variant, template.type]); const onDismiss = useCallback(() => { - listener?.('onDismiss', template); + listener?.("onDismiss", template); // Track dismiss event using propositionItem template.track?.(MessagingEdgeEventType.DISMISS); setIsVisible(false); }, [listener, template]); const onPress = useCallback(() => { - listener?.('onInteract', template); + listener?.("onInteract", template); // Track interaction event using propositionItem - template.track?.('content_clicked', MessagingEdgeEventType.INTERACT, null); + template.track?.("content_clicked", MessagingEdgeEventType.INTERACT, null); + + // Mark as read when interacted with + template.isRead = true; + setIsRead(true); if (template.data?.content?.actionUrl) { try { Linking.openURL(template.data.content.actionUrl); @@ -62,9 +98,9 @@ export const ContentCardView = ({ console.warn(`Failed to open URL: ${template.data.content.actionUrl}`, error); } } - }, [template]); + }, [template, listener]); const imageUri = useMemo(() => { - if (colorScheme === 'dark' && template.data?.content?.image?.darkUrl) { + if (colorScheme === "dark" && template.data?.content?.image?.darkUrl) { return template.data.content.image.darkUrl; } return template.data.content.image?.url; @@ -72,11 +108,11 @@ export const ContentCardView = ({ const imageAspectRatio = useAspectRatio(imageUri); const styleOverrides = useMemo(() => { switch (cardVariant) { - case 'SmallImage': + case "SmallImage": return _styleOverrides?.smallImageStyle; - case 'LargeImage': + case "LargeImage": return _styleOverrides?.largeImageStyle; - case 'ImageOnly': + case "ImageOnly": return _styleOverrides?.imageOnlyStyle; default: return null; @@ -86,7 +122,7 @@ export const ContentCardView = ({ // Call listener on mount to signal view display (only once to prevent duplicates) useEffect(() => { if (!isDisplayedRef.current) { - listener?.('onDisplay', template); + listener?.("onDisplay", template); // Track display event using propositionItem template.track?.(MessagingEdgeEventType.DISPLAY); isDisplayedRef.current = true; @@ -102,20 +138,22 @@ export const ContentCardView = ({ if (!content) return null; return /*#__PURE__*/React.createElement(Pressable, _extends({ onPress: onPress, - style: state => [styles.card, styleOverrides?.card, typeof style === 'function' ? style(state) : style] + style: state => [styles.card, styleOverrides?.card, typeof style === "function" ? style(state) : style] }, props), /*#__PURE__*/React.createElement(View, _extends({ - style: [cardVariant === 'SmallImage' ? smallImageStyles.container : styles.container, styleOverrides?.container] + style: [cardVariant === "SmallImage" ? smallImageStyles.container : styles.container, styleOverrides?.container, unreadBackgroundColor && { + backgroundColor: unreadBackgroundColor + }] }, ContainerProps), imageUri && /*#__PURE__*/React.createElement(View, _extends({ - style: [cardVariant === 'SmallImage' ? smallImageStyles.imageContainer : styles.imageContainer, styleOverrides?.imageContainer] + style: [cardVariant === "SmallImage" ? smallImageStyles.imageContainer : styles.imageContainer, styleOverrides?.imageContainer] }, ImageContainerProps), /*#__PURE__*/React.createElement(Image, _extends({ source: { uri: imageUri }, - style: [cardVariant === 'SmallImage' ? smallImageStyles.image : styles.image, { + style: [cardVariant === "SmallImage" ? smallImageStyles.image : styles.image, { aspectRatio: imageAspectRatio }, styleOverrides?.image], resizeMode: "contain" - }, ImageProps))), cardVariant !== 'ImageOnly' && /*#__PURE__*/React.createElement(View, _extends({ + }, ImageProps))), cardVariant !== "ImageOnly" && /*#__PURE__*/React.createElement(View, _extends({ style: [styles.contentContainer, styleOverrides?.contentContainer] }, ContentContainerProps), content?.title?.content && /*#__PURE__*/React.createElement(Text, _extends({ style: [styles.title, { @@ -134,10 +172,10 @@ export const ContentCardView = ({ onPress: onPress, style: styleOverrides?.button, textStyle: [styleOverrides?.text, styleOverrides?.buttonText] - }, ButtonProps))))), content?.dismissBtn && content.dismissBtn?.style !== 'none' && /*#__PURE__*/React.createElement(DismissButton, _extends({ + }, ButtonProps))))), content?.dismissBtn && content.dismissBtn?.style !== "none" && /*#__PURE__*/React.createElement(DismissButton, _extends({ onPress: onDismiss, type: content.dismissBtn.style - }, DismissButtonProps)))); + }, DismissButtonProps)), isUnreadEnabled && !isRead && /*#__PURE__*/React.createElement(UnreadIcon, null))); }; const styles = StyleSheet.create({ card: { @@ -145,31 +183,31 @@ const styles = StyleSheet.create({ flex: 1 }, container: { - flexDirection: 'column' + flexDirection: "column" }, imageContainer: { - alignItems: 'center', + alignItems: "center", borderRadius: 12, - backgroundColor: '#f0f0f0' + backgroundColor: "#f0f0f0" }, image: { - width: '100%', - resizeMode: 'contain' + width: "100%", + resizeMode: "contain" }, contentContainer: { flex: 1, paddingVertical: 16, paddingHorizontal: 16, - justifyContent: 'flex-start' + justifyContent: "flex-start" }, textContent: { flex: 1, - justifyContent: 'flex-start', + justifyContent: "flex-start", marginBottom: 16 }, title: { fontSize: 16, - fontWeight: '600', + fontWeight: "600", marginBottom: 8, marginRight: 16 }, @@ -178,9 +216,9 @@ const styles = StyleSheet.create({ lineHeight: 18 }, buttonContainer: { - flexDirection: 'row', - justifyContent: 'flex-start', - flexWrap: 'wrap', + flexDirection: "row", + justifyContent: "flex-start", + flexWrap: "wrap", paddingTop: 8, gap: 8 }, @@ -191,60 +229,23 @@ const styles = StyleSheet.create({ const smallImageStyles = StyleSheet.create({ card: { borderRadius: 12, - flexDirection: 'row', + flexDirection: "row", gap: 8, - maxWidth: '100%', - alignItems: 'center' + maxWidth: "100%", + alignItems: "center" }, container: { - flexDirection: 'row' + flexDirection: "row" }, imageContainer: { borderRadius: 12, - maxWidth: '35%', - alignSelf: 'center' + maxWidth: "35%", + alignSelf: "center" }, image: { - resizeMode: 'contain', - width: '100%', - maxWidth: '100%' + resizeMode: "contain", + width: "100%", + maxWidth: "100%" } }); - -// const largeImageStyles = StyleSheet.create({ -// card: { -// ...styles.card, -// borderRadius: 12, -// gap: 8 -// }, -// container: { -// flexDirection: 'row' -// }, -// imageContainer: { -// alignItems: 'center', -// borderRadius: 12, -// backgroundColor: '#f0f0f0' -// }, -// image: { -// width: '100%', -// resizeMode: 'contain' -// }, -// contentContainer: styles.contentContainer, -// textContent: styles.textContent, -// title: styles.title, -// body: styles.body, -// buttonContainer: styles.buttonContainer, -// button: styles.button -// }); - -// const imageOnlyStyles = StyleSheet.create({ -// card: styles.card, -// imageContainer: { -// backgroundColor: '#f0f0f0' -// }, -// image: { -// width: '100%', -// resizeMode: 'contain' -// } -// }); //# sourceMappingURL=ContentCardView.js.map \ No newline at end of file diff --git a/packages/messaging/dist/module/ui/components/ContentCardView/ContentCardView.js.map b/packages/messaging/dist/module/ui/components/ContentCardView/ContentCardView.js.map index 9fb1d0c5..b55daaaa 100644 --- a/packages/messaging/dist/module/ui/components/ContentCardView/ContentCardView.js.map +++ b/packages/messaging/dist/module/ui/components/ContentCardView/ContentCardView.js.map @@ -1 +1 @@ -{"version":3,"names":["React","useEffect","useCallback","useState","useRef","useMemo","Image","Linking","Pressable","StyleSheet","Text","useColorScheme","View","MessagingEdgeEventType","DismissButton","useTheme","useAspectRatio","Button","ContentCardView","template","listener","variant","styleOverrides","_styleOverrides","style","ContainerProps","ImageContainerProps","ImageProps","ContentContainerProps","TextProps","TitleProps","BodyProps","ButtonContainerProps","ButtonProps","DismissButtonProps","props","colorScheme","isVisible","setIsVisible","isDisplayedRef","theme","cardVariant","type","onDismiss","track","DISMISS","onPress","INTERACT","data","content","actionUrl","openURL","error","console","warn","imageUri","image","darkUrl","url","imageAspectRatio","smallImageStyle","largeImageStyle","imageOnlyStyle","current","DISPLAY","createElement","_extends","state","styles","card","smallImageStyles","container","imageContainer","source","uri","aspectRatio","resizeMode","contentContainer","title","color","colors","textPrimary","text","body","buttonContainer","buttons","length","map","button","key","id","textStyle","buttonText","dismissBtn","create","margin","flex","flexDirection","alignItems","borderRadius","backgroundColor","width","paddingVertical","paddingHorizontal","justifyContent","textContent","marginBottom","fontSize","fontWeight","marginRight","lineHeight","flexWrap","paddingTop","gap","marginHorizontal","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,cAAc,EACdC,IAAI,QACC,cAAc;AACrB,OAAOC,sBAAsB,MAAM,2CAAwC;AAC3E,OAAOC,aAAa,MAAM,mCAAgC;AAC1D,SAASC,QAAQ,QAAQ,sBAAa;AACtC,OAAOC,cAAc,MAAM,+BAA4B;AAEvD,OAAOC,MAAM,MAAM,qBAAkB;AAqBrC,OAAO,MAAMC,eAA2C,GAAGA,CAAC;EAC1DC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC,cAAc,EAAEC,eAAe;EAC/BC,KAAK;EACLC,cAAc;EACdC,mBAAmB;EACnBC,UAAU;EACVC,qBAAqB;EACrBC,SAAS;EACTC,UAAU;EACVC,SAAS;EACTC,oBAAoB;EACpBC,WAAW;EACXC,kBAAkB;EAClB,GAAGC;AACL,CAAC,KAAK;EACJ,MAAMC,WAAW,GAAGzB,cAAc,CAAC,CAAC;EACpC,MAAM,CAAC0B,SAAS,EAAEC,YAAY,CAAC,GAAGnC,QAAQ,CAAC,IAAI,CAAC;EAChD,MAAMoC,cAAc,GAAGnC,MAAM,CAAC,KAAK,CAAC;EACpC,MAAMoC,KAAK,GAAGzB,QAAQ,CAAC,CAAC;EAExB,MAAM0B,WAAW,GAAGpC,OAAO,CACzB,MAAMgB,OAAO,IAAIF,QAAQ,CAACuB,IAAI,IAAI,YAAY,EAC9C,CAACrB,OAAO,E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AACqF,MAAM,CAAC;EACzCzB,IAAI,EAAE;IACJ8B,YAAY,EAAE,EAAE;IAChBF,aAAa,EAAE,KAAK;IACpBgB,GAAG,EAAE,CAAC;IACNE,QAAQ,EAAE,MAAM;IAChBjB,UAAU,EAAE;EACd,CAAC;EACD3B,SAAS,EAAE;IACT0B,aAAa,EAAE;EACjB,CAAC;EACDzB,cAAc,EAAE;IACd2B,YAAY,EAAE,EAAE;IAChBgB,QAAQ,EAAE,KAAK;IACfC,SAAS,EAAE;EACb,CAAC;EACD5D,KAAK,EAAE;IACLoB,UAAU,EAAE,SAAS;IACrByB,KAAK,EAAE,MAAM;IACbc,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]} +{"version":3,"names":["React","useEffect","useCallback","useState","useRef","useMemo","Image","Linking","Pressable","StyleSheet","Text","useColorScheme","View","MessagingEdgeEventType","DismissButton","UnreadIcon","useTheme","useAspectRatio","Button","useContainerSettings","ContentCardView","template","listener","variant","styleOverrides","_styleOverrides","style","ContainerProps","ImageContainerProps","ImageProps","ContentContainerProps","TextProps","TitleProps","BodyProps","ButtonContainerProps","ButtonProps","DismissButtonProps","props","colorScheme","isVisible","setIsVisible","isDisplayedRef","theme","containerSettings","isRead","setIsRead","isUnreadEnabled","content","unreadBackgroundColor","unread_indicator","unread_bg","undefined","unreadBg","clr","dark","light","cardVariant","type","onDismiss","track","DISMISS","onPress","INTERACT","data","actionUrl","openURL","error","console","warn","imageUri","image","darkUrl","url","imageAspectRatio","smallImageStyle","largeImageStyle","imageOnlyStyle","current","DISPLAY","createElement","_extends","state","styles","card","smallImageStyles","container","backgroundColor","imageContainer","source","uri","aspectRatio","resizeMode","contentContainer","title","color","colors","textPrimary","text","body","buttonContainer","buttons","length","map","button","key","id","textStyle","buttonText","dismissBtn","create","margin","flex","flexDirection","alignItems","borderRadius","width","paddingVertical","paddingHorizontal","justifyContent","textContent","marginBottom","fontSize","fontWeight","marginRight","lineHeight","flexWrap","paddingTop","gap","marginHorizontal","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,cAAc,EACdC,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,oBAAoB,MAAM,qCAAkC;;AAEnE;AACA;AACA;;AAUA;;AAqBA;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;EACnBC,UAAU;EACVC,qBAAqB;EACrBC,SAAS;EACTC,UAAU;EACVC,SAAS;EACTC,oBAAoB;EACpBC,WAAW;EACXC,kBAAkB;EAClB,GAAGC;AACL,CAAC,KAAK;EACJ,MAAMC,WAAW,GAAG3B,cAAc,CAAC,CAAC;EACpC,MAAM,CAAC4B,SAAS,EAAEC,YAAY,CAAC,GAAGrC,QAAQ,CAAC,IAAI,CAAC;EAChD,MAAMsC,cAAc,GAAGrC,MAAM,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5C,gBAAgB,GAAG3E,UAAU,CAACoG,MAAM,CAAC;EACzC1B,IAAI,EAAE;IACJ+B,YAAY,EAAE,EAAE;IAChBF,aAAa,EAAE,KAAK;IACpBe,GAAG,EAAE,CAAC;IACNE,QAAQ,EAAE,MAAM;IAChBhB,UAAU,EAAE;EACd,CAAC;EACD5B,SAAS,EAAE;IACT2B,aAAa,EAAE;EACjB,CAAC;EACDzB,cAAc,EAAE;IACd2B,YAAY,EAAE,EAAE;IAChBe,QAAQ,EAAE,KAAK;IACfC,SAAS,EAAE;EACb,CAAC;EACD5D,KAAK,EAAE;IACLqB,UAAU,EAAE,SAAS;IACrBwB,KAAK,EAAE,MAAM;IACbc,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]} diff --git a/packages/messaging/dist/module/ui/components/DismissButton/DismissButton.js b/packages/messaging/dist/module/ui/components/DismissButton/DismissButton.js index 213c49e0..47fe26ed 100644 --- a/packages/messaging/dist/module/ui/components/DismissButton/DismissButton.js +++ b/packages/messaging/dist/module/ui/components/DismissButton/DismissButton.js @@ -12,7 +12,10 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import { Pressable, StyleSheet, Text, useColorScheme } from 'react-native'; +import { Pressable, StyleSheet, Text, useColorScheme } from "react-native"; + +/** Props for the DismissButton component. Extends the PressableProps from react-native. */ + const DismissButton = ({ onPress, type, @@ -23,24 +26,24 @@ const DismissButton = ({ const colorScheme = useColorScheme(); return /*#__PURE__*/React.createElement(Pressable, _extends({ onPress: onPress, - style: state => [styles.container, type === 'simple' && styles.simple, type === 'circle' && [styles.circle, { - backgroundColor: colorScheme === 'dark' ? 'rgba(255,255,255,0.1)' : 'rgba(0,0,0,0.1)' - }], state.pressed && styles.pressed, typeof style === 'function' ? style(state) : style] + style: state => [styles.container, type === "simple" && styles.simple, type === "circle" && [styles.circle, { + backgroundColor: colorScheme === "dark" ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)" + }], state.pressed && styles.pressed, typeof style === "function" ? style(state) : style] }, props), /*#__PURE__*/React.createElement(Text, { style: [styles.text, { - color: colorScheme === 'dark' ? 'white' : 'black' + color: colorScheme === "dark" ? "white" : "black" }, textStyle] }, "x")); }; export default DismissButton; const styles = StyleSheet.create({ container: { - position: 'absolute', + position: "absolute", top: 6, right: 6, zIndex: 1000, - justifyContent: 'center', - alignItems: 'center', + justifyContent: "center", + alignItems: "center", minWidth: 18, minHeight: 18 }, @@ -48,7 +51,7 @@ const styles = StyleSheet.create({ opacity: 0.7 }, simple: { - backgroundColor: 'transparent' + backgroundColor: "transparent" }, circle: { borderRadius: 10, @@ -57,8 +60,8 @@ const styles = StyleSheet.create({ }, text: { fontSize: 14, - fontWeight: 'bold', - textAlign: 'center' + fontWeight: "bold", + textAlign: "center" } }); //# sourceMappingURL=DismissButton.js.map \ No newline at end of file diff --git a/packages/messaging/dist/module/ui/components/DismissButton/DismissButton.js.map b/packages/messaging/dist/module/ui/components/DismissButton/DismissButton.js.map index c9ad4493..f9c755b3 100644 --- a/packages/messaging/dist/module/ui/components/DismissButton/DismissButton.js.map +++ b/packages/messaging/dist/module/ui/components/DismissButton/DismissButton.js.map @@ -1 +1 @@ -{"version":3,"names":["Pressable","StyleSheet","Text","useColorScheme","DismissButton","onPress","type","textStyle","style","props","colorScheme","React","createElement","_extends","state","styles","container","simple","circle","backgroundColor","pressed","text","color","create","position","top","right","zIndex","justifyContent","alignItems","minWidth","minHeight","opacity","borderRadius","width","height","fontSize","fontWeight","textAlign"],"sourceRoot":"../../../../../src","sources":["ui/components/DismissButton/DismissButton.tsx"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SACEA,SAAS,EAETC,UAAU,EACVC,IAAI,EAEJC,cAAc,QACT,cAAc;AAQrB,MAAMC,aAAa,GAAGA,CAAC;EACrBC,OAAO;EACPC,IAAI;EACJC,SAAS;EACTC,KAAK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M,EAAE;EACV,CAAC;EACDd,IAAI,EAAE;IACJe,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,MAAM;IAClBC,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]} +{"version":3,"names":["Pressable","StyleSheet","Text","useColorScheme","DismissButton","onPress","type","textStyle","style","props","colorScheme","React","createElement","_extends","state","styles","container","simple","circle","backgroundColor","pressed","text","color","create","position","top","right","zIndex","justifyContent","alignItems","minWidth","minHeight","opacity","borderRadius","width","height","fontSize","fontWeight","textAlign"],"sourceRoot":"../../../../../src","sources":["ui/components/DismissButton/DismissButton.tsx"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SACEA,SAAS,EAETC,UAAU,EACVC,IAAI,EAEJC,cAAc,QACT,cAAc;;AAErB;;AAUA,MAAMC,aAAa,GAAGA,CAAC;EACrBC,OAAO;EACPC,IAAI;EACJC,SAAS;EACTC,KAAK;EACL,GAAGC;AACe,CAAC,KAAK;EACxB,MAAMC,WAAW,GAAGP,cAAc,CAAC,CAAC;EAEpC,oBACEQ,KAAA,CAAAC,aAAA,CAACZ,SAAS,EAAAa,QAAA;IACRR,OAAO,EAAEA,OAAQ;IACjBG,KAAK,EAAGM,KAAK,IAAK,CAChBC,MAAM,CAACC,SAAS,EAChBV,IAAI,KAAK,QAAQ,IAAIS,MAAM,CAACE,MAAM,EAClCX,IAAI,KAAK,QAAQ,IAAI,CACnBS,MAAM,CAACG,MAAM,EACb;MACEC,eAAe,EACbT,WAAW,KAAK,MAAM,GAClB,uBAAuB,GACvB;IACR,CAAC,CACF,EACDI,KAAK,CAACM,OAAO,IAAIL,MAAM,CAACK,OAAO,EAC/B,OAAOZ,KAAK,KAAK,UAAU,GAAGA,KAAK,CAACM,KAAK,CAAC,GAAGN,KAAK;EAClD,GACEC,KAAK,gBAETE,KAAA,CAAAC,aAAA,CAACV,IAAI;IACHM,KAAK,EAAE,CACLO,MAAM,CAACM,IAAI,EACX;MAAEC,KAAK,EAAEZ,WAAW,KAAK,MAAM,GAAG,OAAO,GAAG;IAAQ,CAAC,EACrDH,SAAS;EACT,GACH,GAEK,CACG,CAAC;AAEhB,CAAC;AAED,eAAeH,aAAa;AAE5B,MAAMW,MAAM,GAAGd,UAAU,CAACsB,MAAM,CAAC;EAC/BP,SAAS,EAAE;IACTQ,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,IAAI;IACZC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBC,QAAQ,EAAE,EAAE;IACZC,SAAS,EAAE;EACb,CAAC;EACDX,OAAO,EAAE;IACPY,OAAO,EAAE;EACX,CAAC;EACDf,MAAM,EAAE;IACNE,eAAe,EAAE;EACnB,CAAC;EACDD,MAAM,EAAE;IACNe,YAAY,EAAE,EAAE;IAChBC,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE;EACV,CAAC;EACDd,IAAI,EAAE;IACJe,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,MAAM;IAClBC,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]} diff --git a/packages/messaging/dist/module/ui/components/DismissButton/DismissButton.spec.js b/packages/messaging/dist/module/ui/components/DismissButton/DismissButton.spec.js index 1756df37..575bfda5 100644 --- a/packages/messaging/dist/module/ui/components/DismissButton/DismissButton.spec.js +++ b/packages/messaging/dist/module/ui/components/DismissButton/DismissButton.spec.js @@ -11,19 +11,12 @@ ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import React from 'react'; import { render, screen, fireEvent } from '@testing-library/react-native'; import { useColorScheme } from 'react-native'; import DismissButton from "./DismissButton.js"; // Mock useColorScheme -jest.mock('react-native', () => { - const RN = jest.requireActual('react-native'); - return { - ...RN, - useColorScheme: jest.fn() - }; -}); +jest.mock('react-native/Libraries/Utilities/useColorScheme'); const mockUseColorScheme = useColorScheme; describe('DismissButton', () => { const mockOnPress = jest.fn(); @@ -111,9 +104,8 @@ describe('DismissButton', () => { testID: "dismiss-button" })); const button = getByTestId('dismiss-button'); - expect(button.props.style).toEqual(expect.arrayContaining([expect.objectContaining({ - backgroundColor: 'rgba(0,0,0,0.1)' - })])); + const styles = JSON.stringify(button.props.style); + expect(styles).toContain('rgba(0,0,0,0.1)'); }); it('should apply correct background color for circle type in dark mode', () => { mockUseColorScheme.mockReturnValue('dark'); @@ -125,9 +117,8 @@ describe('DismissButton', () => { testID: "dismiss-button" })); const button = getByTestId('dismiss-button'); - expect(button.props.style).toEqual(expect.arrayContaining([expect.objectContaining({ - backgroundColor: 'rgba(255,255,255,0.1)' - })])); + const styles = JSON.stringify(button.props.style); + expect(styles).toContain('rgba(255,255,255,0.1)'); }); }); describe('Type variations', () => { @@ -153,11 +144,10 @@ describe('DismissButton', () => { testID: "dismiss-button" })); const button = getByTestId('dismiss-button'); - expect(button.props.style).toEqual(expect.arrayContaining([expect.objectContaining({ - borderRadius: 10, - width: 18, - height: 18 - })])); + const styles = JSON.stringify(button.props.style); + expect(styles).toContain('"borderRadius":10'); + expect(styles).toContain('"width":18'); + expect(styles).toContain('"height":18'); }); }); describe('Custom props and styles', () => { @@ -207,7 +197,7 @@ describe('DismissButton', () => { accessibilityLabel: "Close button" })); const button = getByTestId('dismiss-button'); - expect(button.props.disabled).toBe(true); + expect(button.props.accessibilityState?.disabled).toBe(true); expect(button.props.accessibilityLabel).toBe('Close button'); }); }); diff --git a/packages/messaging/dist/module/ui/components/DismissButton/DismissButton.spec.js.map b/packages/messaging/dist/module/ui/components/DismissButton/DismissButton.spec.js.map index 2092f3f6..1978892c 100644 --- a/packages/messaging/dist/module/ui/components/DismissButton/DismissButton.spec.js.map +++ b/packages/messaging/dist/module/ui/components/DismissButton/DismissButton.spec.js.map @@ -1 +1 @@ -{"version":3,"names":["React","render","screen","fireEvent","useColorScheme","DismissButton","jest","mock","RN","requireActual","fn","mockUseColorScheme","describe","mockOnPress","beforeEach","clearAllMocks","mockReturnValue","it","createElement","onPress","type","button","getByText","expect","toBeTruthy","press","toHaveBeenCalledTimes","text","props","style","toEqual","arrayContaining","objectContaining","color","getByTestId","testID","backgroundColor","borderRadius","width","height","customStyle","opacity","styleFn","toHaveBeenCalled","disabled","accessibilityLabel","toBe","accessibilityHint","position","top","right","zIndex","minWidth","minHeight","undefined","not","toThrow"],"sourceRoot":"../../../../../src","sources":["ui/components/DismissButton/DismissButton.spec.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,EAAEC,MAAM,EAAEC,SAAS,QAAQ,+BAA+B;AACzE,SAASC,cAAc,QAAQ,cAAc;AAC7C,OAAOC,aAAa,MAAM,oBAAiB;;AAE3C;AACAC,IAAI,CAACC,IAAI,CAAC,cAAc,EAAE,MAAM;EAC9B,MAAMC,EAAE,GAAGF,IAAI,CAACG,aAAa,CAAC,cAAc,CAAC;EAC7C,OAAO;IACL,GAAGD,EAAE;IACLJ,cAAc,EAAEE,IAAI,CAACI,EAAE,CAAC;EAC1B,CAAC;AACH,CAAC,CAAC;AAEF,MAAMC,kBAAkB,GAAGP,cAE1B;AAEDQ,QAAQ,CAAC,eAAe,EAAE,MAAM;EAC9B,MAAMC,WAAW,GAAGP,IAAI,CAACI,EAAE,CAAC,CAAC;EAE7BI,UAAU,CAAC,MAAM;IACfR,IAAI,CAACS,aAAa,CAAC,CAAC;IACpBJ,kBAAkB,CAACK,eAAe,CAAC,OAAO,CAAC;EAC7C,CAAC,CAAC;EAEFJ,QAAQ,CAAC,iBAAiB,EAAE,MAAM;IAChCK,EAAE,CAAC,mDAAmD,EAAE,MAAM;MAC5DhB,MAAM,cAACD,KAAA,CAAAkB,aAAA,CAACb,aAAa;QAACc,OAAO,EAAEN,WAAY;QAACO,IAAI,EAAC;MAAQ,CAAE,CAAC,CAAC;MAE7D,MAAMC,MAAM,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,CAAC,YAAY,EAAE,MAAM;IAC3BK,EAAE,CAAC,iDAAiD,EAAE,MAAM;MAC1DN,kBAAkB,CAACK,eAAe,CAACsC,SAAgB,CAAC;MAEpD/B,MAAM,CAAC,MAAM;QACXtB,MAAM,cAACD,KAAA,CAAAkB,aAAA,CAACb,aAAa;UAACc,OAAO,EAAEN,WAAY;UAACO,IAAI,EAAC;QAAQ,CAAE,CAAC,CAAC;MAC/D,CAAC,CAAC,CAACmC,GAAG,CAACC,OAAO,CAAC,CAAC;IAClB,CAAC,CAAC;IAEFvC,EAAE,CAAC,4CAA4C,EAAE,MAAM;MACrDN,kBAAkB,CAACK,eAAe,CAAC,IAAW,CAAC;MAE/CO,MAAM,CAAC,MAAM;QACXtB,MAAM,cAACD,KAAA,CAAAkB,aAAA,CAACb,aAAa;UAACc,OAAO,EAAEN,WAAY;UAACO,IAAI,EAAC;QAAQ,CAAE,CAAC,CAAC;MAC/D,CAAC,CAAC,CAACmC,GAAG,CAACC,OAAO,CAAC,CAAC;IAClB,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]} +{"version":3,"names":["render","screen","fireEvent","useColorScheme","DismissButton","jest","mock","mockUseColorScheme","describe","mockOnPress","fn","beforeEach","clearAllMocks","mockReturnValue","it","React","createElement","onPress","type","button","getByText","expect","toBeTruthy","press","toHaveBeenCalledTimes","text","props","style","toEqual","arrayContaining","objectContaining","color","getByTestId","testID","styles","JSON","stringify","toContain","backgroundColor","customStyle","opacity","styleFn","toHaveBeenCalled","disabled","accessibilityLabel","accessibilityState","toBe","accessibilityHint","position","top","right","zIndex","minWidth","minHeight","undefined","not","toThrow"],"sourceRoot":"../../../../../src","sources":["ui/components/DismissButton/DismissButton.spec.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,MAAM,EAAEC,SAAS,QAAQ,+BAA+B;AACzE,SAASC,cAAc,QAAQ,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List":[]} diff --git a/packages/messaging/dist/module/ui/components/UnreadIcon/UnreadIcon.js b/packages/messaging/dist/module/ui/components/UnreadIcon/UnreadIcon.js index d23becc6..a590ba83 100644 --- a/packages/messaging/dist/module/ui/components/UnreadIcon/UnreadIcon.js +++ b/packages/messaging/dist/module/ui/components/UnreadIcon/UnreadIcon.js @@ -1,8 +1,185 @@ "use strict"; -import { Text, View } from "react-native"; -function UnreadIcon() { - return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Text, null, "UnreadIcon")); -} +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); } +/* + Copyright 2025 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law + or agreed to in writing, software distributed under the License is + distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF + ANY KIND, either express or implied. See the License for the specific + language governing permissions and limitations under the License. +*/ +import React, { useState, useMemo, useEffect } from 'react'; +import { Image, StyleSheet, View, useColorScheme } from 'react-native'; +import useContainerSettings from "../../hooks/useContainerSettings.js"; +const Dot = ({ + size, + backgroundColor +}) => /*#__PURE__*/React.createElement(View, { + style: [styles.dot, { + width: size, + height: size, + borderRadius: size / 2, + backgroundColor + }] +}); +const UnreadIcon = ({ + imageStyle, + containerStyle, + source, + darkSource, + size = 20, + position = 'topright', + type = 'dot', + style, + ...props +}) => { + const colorScheme = useColorScheme(); + const settings = useContainerSettings(); + const [imageLoadError, setImageLoadError] = useState(false); + + // Get unread indicator settings from context + const unreadSettings = settings?.content.unread_indicator; + + // Use settings from context with fallbacks to props + const displayPosition = unreadSettings?.unread_icon?.placement ?? position; + const imageSource = unreadSettings?.unread_icon?.image?.url ? { + uri: unreadSettings.unread_icon.image.url + } : source; + const darkImageSource = unreadSettings?.unread_icon?.image?.darkUrl ? { + uri: unreadSettings.unread_icon.image.darkUrl + } : darkSource; + + // Determine if we should render as image type (only if we have valid URLs) + const hasImageUrl = Boolean(unreadSettings?.unread_icon?.image?.url || unreadSettings?.unread_icon?.image?.darkUrl || imageSource || darkImageSource); + const renderType = hasImageUrl ? 'image' : type; + + // Reset error state when image source changes + useEffect(() => { + setImageLoadError(false); + }, [imageSource, darkImageSource]); + const positionStyle = useMemo(() => { + switch (displayPosition) { + case 'topleft': + return styles.positionTopLeft; + case 'topright': + return styles.positionTopRight; + case 'bottomleft': + return styles.positionBottomLeft; + case 'bottomright': + return styles.positionBottomRight; + default: + return styles.positionTopRight; + } + }, [displayPosition]); + + // Use default contrasting colors for visibility + // Note: unread_bg.clr is for the card background, not the dot + const dotColor = useMemo(() => colorScheme === 'dark' ? '#FF6B6B' : '#FF4444', [colorScheme]); + const finalImageSource = useMemo(() => colorScheme === 'dark' && darkImageSource ? darkImageSource : imageSource, [colorScheme, darkImageSource, imageSource]); + const content = useMemo(() => { + // Check if we should show dot instead of image based on URL availability + const isEmptyUrlForCurrentMode = () => { + const imageSettings = unreadSettings?.unread_icon?.image; + if (!imageSettings) return false; + if (colorScheme === 'dark') { + // In dark mode, show dot if darkUrl is empty string or if both darkUrl doesn't exist and url is empty + return imageSettings.darkUrl === '' || !imageSettings.darkUrl && imageSettings.url === ''; + } + + // In light mode, show dot if url is empty string + return imageSettings.url === ''; + }; + + // If URL is explicitly empty string for current mode, show dot + if (isEmptyUrlForCurrentMode()) { + return /*#__PURE__*/React.createElement(Dot, { + size: size, + backgroundColor: dotColor + }); + } + + // If image failed to load, fallback to dot + if (renderType === 'image' && imageLoadError) { + return /*#__PURE__*/React.createElement(Dot, { + size: size, + backgroundColor: dotColor + }); + } + if (renderType === 'image' && (imageSource || darkImageSource)) { + return /*#__PURE__*/React.createElement(Image, { + source: finalImageSource, + style: [styles.image, { + width: size, + height: size + }, imageStyle], + resizeMode: "contain", + onError: error => { + console.warn('Failed to load unread icon image:', error.nativeEvent.error); + setImageLoadError(true); + } + }); + } + + // Default dot type + return /*#__PURE__*/React.createElement(Dot, { + size: size, + backgroundColor: dotColor + }); + }, [colorScheme, unreadSettings?.unread_icon?.image, size, dotColor, renderType, imageLoadError, imageSource, darkImageSource, finalImageSource, imageStyle]); + return /*#__PURE__*/React.createElement(View, _extends({ + style: [styles.container, positionStyle, { + minWidth: size, + minHeight: size + }, containerStyle, style] + }, props), content); +}; export default UnreadIcon; +const styles = StyleSheet.create({ + container: { + position: 'absolute', + zIndex: 1000, + justifyContent: 'center', + alignItems: 'center' + }, + positionTopLeft: { + top: 6, + left: 6 + }, + positionTopRight: { + top: 6, + right: 6 + }, + positionBottomLeft: { + bottom: 6, + left: 6 + }, + positionBottomRight: { + bottom: 6, + right: 6 + }, + dot: { + shadowColor: '#000', + shadowOffset: { + width: 0, + height: 1 + }, + shadowOpacity: 0.22, + shadowRadius: 2.22, + elevation: 3 + }, + image: { + shadowColor: '#000', + shadowOffset: { + width: 0, + height: 1 + }, + shadowOpacity: 0.22, + shadowRadius: 2.22, + elevation: 3 + } +}); //# sourceMappingURL=UnreadIcon.js.map \ No newline at end of file diff --git a/packages/messaging/dist/module/ui/components/UnreadIcon/UnreadIcon.js.map b/packages/messaging/dist/module/ui/components/UnreadIcon/UnreadIcon.js.map index ec5d28d9..aabacc9b 100644 --- a/packages/messaging/dist/module/ui/components/UnreadIcon/UnreadIcon.js.map +++ b/packages/messaging/dist/module/ui/components/UnreadIcon/UnreadIcon.js.map @@ -1 +1 @@ -{"version":3,"names":["Text","View","UnreadIcon","React","createElement"],"sourceRoot":"../../../../../src","sources":["ui/components/UnreadIcon/UnreadIcon.tsx"],"mappings":";;AAAA,SAASA,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAEzC,SAASC,UAAUA,CAAA,EAAG;EACpB,oBACEC,KAAA,CAAAC,aAAA,CAACH,IAAI,qBACHE,KAAA,CAAAC,aAAA,CAACJ,IAAI,QAAC,YAAgB,CAClB,CAAC;AAEX;AAEA,eAAeE,UAAU","ignoreList":[]} +{"version":3,"names":["React","useState","useMemo","useEffect","Image","StyleSheet","View","useColorScheme","useContainerSettings","Dot","size","backgroundColor","createElement","style","styles","dot","width","height","borderRadius","UnreadIcon","imageStyle","containerStyle","source","darkSource","position","type","props","colorScheme","settings","imageLoadError","setImageLoadError","unreadSettings","content","unread_indicator","displayPosition","unread_icon","placement","imageSource","image","url","uri","darkImageSource","darkUrl","hasImageUrl","Boolean","renderType","positionStyle","positionTopLeft","positionTopRight","positionBottomLeft","positionBottomRight","dotColor","finalImageSource","isEmptyUrlForCurrentMode","imageSettings","resizeMode","onError","error","console","warn","nativeEvent","_extends","container","minWidth","minHeight","create","zIndex","justifyContent","alignItems","top","left","right","bottom","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation"],"sourceRoot":"../../../../../src","sources":["ui/components/UnreadIcon/UnreadIcon.tsx"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,OAAO,EAAEC,SAAS,QAAQ,OAAO;AAC3D,SACEC,KAAK,EAGLC,UAAU,EACVC,IAAI,EAGJC,cAAc,QACT,cAAc;AACrB,OAAOC,oBAAoB,MAAM,qCAAkC;AAkBnE,MAAMC,GAAG,GAAGA,CAAC;EAAEC,IAAI;EAAEC;AAA0B,CAAC,kBAC9CX,KAAA,CAAAY,aAAA,CAACN,IAAI;EACHO,KAAK,EAAE,CACLC,MAAM,CAACC,GAAG,EACV;IACEC,KAAK,EAAEN,IAAI;IACXO,MAAM,EAAEP,IAAI;IACZQ,YAAY,EAAER,IAAI,GAAG,CAAC;IACtBC;EACF,CAAC;AACD,CACH,CACF;AAED,MAAMQ,UAAU,GAAGA,CAAC;EAClBC,UAAU;EACVC,cAAc;EACdC,MAAM;EACNC,UAAU;EACVb,IAAI,GAAG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EAAE,UAAU;IACpB0C,MAAM,EAAE,IAAI;IACZC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd,CAAC;EACDrB,eAAe,EAAE;IACfsB,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE;EACR,CAAC;EACDtB,gBAAgB,EAAE;IAChBqB,GAAG,EAAE,CAAC;IACNE,KAAK,EAAE;EACT,CAAC;EACDtB,kBAAkB,EAAE;IAClBuB,MAAM,EAAE,CAAC;IACTF,IAAI,EAAE;EACR,CAAC;EACDpB,mBAAmB,EAAE;IACnBsB,MAAM,EAAE,CAAC;IACTD,KAAK,EAAE;EACT,CAAC;EACDxD,GAAG,EAAE;IACH0D,WAAW,EAAE,MAAM;IACnBC,YAAY,EAAE;MACZ1D,KAAK,EAAE,CAAC;MACRC,MAAM,EAAE;IACV,CAAC;IACD0D,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE,IAAI;IAClBC,SAAS,EAAE;EACb,CAAC;EACDvC,KAAK,EAAE;IACLmC,WAAW,EAAE,MAAM;IACnBC,YAAY,EAAE;MACZ1D,KAAK,EAAE,CAAC;MACRC,MAAM,EAAE;IACV,CAAC;IACD0D,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE,IAAI;IAClBC,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]} diff --git a/packages/messaging/dist/module/ui/components/UnreadIcon/UnreadIcon.spec.js b/packages/messaging/dist/module/ui/components/UnreadIcon/UnreadIcon.spec.js new file mode 100644 index 00000000..af672f79 --- /dev/null +++ b/packages/messaging/dist/module/ui/components/UnreadIcon/UnreadIcon.spec.js @@ -0,0 +1,689 @@ +"use strict"; + +/* + Copyright 2025 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law + or agreed to in writing, software distributed under the License is + distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF + ANY KIND, either express or implied. See the License for the specific + language governing permissions and limitations under the License. +*/ +import React from 'react'; +import { render } from '@testing-library/react-native'; +import { useColorScheme, Image } from 'react-native'; +import UnreadIcon from "./UnreadIcon.js"; +import ContentCardContainerProvider from "../../providers/ContentCardContainerProvider.js"; + +// Mock useColorScheme +jest.mock('react-native/Libraries/Utilities/useColorScheme'); +const mockUseColorScheme = useColorScheme; +describe('UnreadIcon', () => { + const mockContainerSettings = { + templateType: 'inbox', + content: { + heading: { + content: 'Test' + }, + layout: { + orientation: 'vertical' + }, + capacity: 10, + emptyStateSettings: { + message: { + content: 'Empty' + } + }, + unread_indicator: { + unread_bg: { + clr: { + light: '#FFF3E0', + dark: '#2D1B0E' + } + }, + unread_icon: { + placement: 'topright', + image: { + url: 'https://example.com/icon.png', + darkUrl: '' + } + } + }, + isUnreadEnabled: true + }, + showPagination: false + }; + beforeEach(() => { + jest.clearAllMocks(); + mockUseColorScheme.mockReturnValue('light'); + }); + afterEach(() => { + jest.clearAllMocks(); + }); + describe('Basic rendering', () => { + it('should render successfully with container settings', () => { + const { + getByTestId + } = render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: mockContainerSettings + }, /*#__PURE__*/React.createElement(UnreadIcon, { + testID: "unread-icon" + }))); + expect(getByTestId('unread-icon')).toBeTruthy(); + }); + it('should render with custom size', () => { + const { + getByTestId + } = render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: mockContainerSettings + }, /*#__PURE__*/React.createElement(UnreadIcon, { + testID: "unread-icon", + size: 30 + }))); + expect(getByTestId('unread-icon')).toBeTruthy(); + }); + it('should render without crashing when settings provide null', () => { + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: null + }, /*#__PURE__*/React.createElement(UnreadIcon, { + type: "dot" + }))); + }).not.toThrow(); + }); + }); + describe('Placement positions', () => { + it('should render with topright placement', () => { + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: mockContainerSettings + }, /*#__PURE__*/React.createElement(UnreadIcon, null))); + }).not.toThrow(); + }); + it('should render with topleft placement', () => { + const settings = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: { + ...mockContainerSettings.content.unread_indicator, + unread_icon: { + ...mockContainerSettings.content.unread_indicator.unread_icon, + placement: 'topleft' + } + } + } + }; + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: settings + }, /*#__PURE__*/React.createElement(UnreadIcon, null))); + }).not.toThrow(); + }); + it('should render with bottomright placement', () => { + const settings = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: { + ...mockContainerSettings.content.unread_indicator, + unread_icon: { + ...mockContainerSettings.content.unread_indicator.unread_icon, + placement: 'bottomright' + } + } + } + }; + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: settings + }, /*#__PURE__*/React.createElement(UnreadIcon, null))); + }).not.toThrow(); + }); + it('should render with bottomleft placement', () => { + const settings = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: { + ...mockContainerSettings.content.unread_indicator, + unread_icon: { + ...mockContainerSettings.content.unread_indicator.unread_icon, + placement: 'bottomleft' + } + } + } + }; + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: settings + }, /*#__PURE__*/React.createElement(UnreadIcon, null))); + }).not.toThrow(); + }); + }); + describe('Light mode rendering', () => { + beforeEach(() => { + mockUseColorScheme.mockReturnValue('light'); + }); + it('should render in light mode with image URL', () => { + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: mockContainerSettings + }, /*#__PURE__*/React.createElement(UnreadIcon, null))); + }).not.toThrow(); + }); + it('should render dot when URL is empty string in light mode', () => { + const settings = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: { + ...mockContainerSettings.content.unread_indicator, + unread_icon: { + ...mockContainerSettings.content.unread_indicator.unread_icon, + image: { + url: '', + darkUrl: '' + } + } + } + } + }; + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: settings + }, /*#__PURE__*/React.createElement(UnreadIcon, null))); + }).not.toThrow(); + }); + }); + describe('Dark mode rendering', () => { + beforeEach(() => { + mockUseColorScheme.mockReturnValue('dark'); + }); + it('should render in dark mode with darkUrl provided', () => { + const settings = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: { + ...mockContainerSettings.content.unread_indicator, + unread_icon: { + ...mockContainerSettings.content.unread_indicator.unread_icon, + image: { + url: 'https://example.com/light.png', + darkUrl: 'https://example.com/dark.png' + } + } + } + } + }; + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: settings + }, /*#__PURE__*/React.createElement(UnreadIcon, null))); + }).not.toThrow(); + }); + it('should render dot when darkUrl is empty string in dark mode', () => { + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: mockContainerSettings + }, /*#__PURE__*/React.createElement(UnreadIcon, null))); + }).not.toThrow(); + }); + it('should fallback to light mode image when no darkUrl provided', () => { + const settings = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: { + ...mockContainerSettings.content.unread_indicator, + unread_icon: { + placement: 'topright', + image: { + url: 'https://example.com/icon.png' + } + } + } + } + }; + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: settings + }, /*#__PURE__*/React.createElement(UnreadIcon, null))); + }).not.toThrow(); + }); + }); + describe('Props-based rendering', () => { + it('should render with custom source prop when no settings provided', () => { + const settingsWithoutImage = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: undefined + } + }; + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: settingsWithoutImage + }, /*#__PURE__*/React.createElement(UnreadIcon, { + source: { + uri: 'https://custom.com/icon.png' + } + }))); + }).not.toThrow(); + }); + it('should render with custom darkSource prop', () => { + mockUseColorScheme.mockReturnValue('dark'); + const settingsWithoutImage = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: undefined + } + }; + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: settingsWithoutImage + }, /*#__PURE__*/React.createElement(UnreadIcon, { + source: { + uri: 'https://custom.com/light.png' + }, + darkSource: { + uri: 'https://custom.com/dark.png' + } + }))); + }).not.toThrow(); + }); + it('should render with custom position prop', () => { + const settingsWithoutImage = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: undefined + } + }; + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: settingsWithoutImage + }, /*#__PURE__*/React.createElement(UnreadIcon, { + position: "bottomleft" + }))); + }).not.toThrow(); + }); + it('should render as dot when type prop is "dot"', () => { + const settingsWithoutImage = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: undefined + } + }; + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: settingsWithoutImage + }, /*#__PURE__*/React.createElement(UnreadIcon, { + type: "dot" + }))); + }).not.toThrow(); + }); + it('should render as image when type prop is "image"', () => { + const settingsWithoutImage = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: undefined + } + }; + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: settingsWithoutImage + }, /*#__PURE__*/React.createElement(UnreadIcon, { + type: "image", + source: { + uri: 'https://custom.com/icon.png' + } + }))); + }).not.toThrow(); + }); + }); + describe('Custom styles', () => { + it('should accept and apply custom imageStyle', () => { + const customImageStyle = { + opacity: 0.8 + }; + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: mockContainerSettings + }, /*#__PURE__*/React.createElement(UnreadIcon, { + imageStyle: customImageStyle + }))); + }).not.toThrow(); + }); + it('should accept and apply custom containerStyle', () => { + const customContainerStyle = { + padding: 5 + }; + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: mockContainerSettings + }, /*#__PURE__*/React.createElement(UnreadIcon, { + containerStyle: customContainerStyle + }))); + }).not.toThrow(); + }); + it('should handle both imageStyle and containerStyle together', () => { + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: mockContainerSettings + }, /*#__PURE__*/React.createElement(UnreadIcon, { + imageStyle: { + opacity: 0.8 + }, + containerStyle: { + padding: 5 + } + }))); + }).not.toThrow(); + }); + }); + describe('Size variations', () => { + it('should render with default size of 20', () => { + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: mockContainerSettings + }, /*#__PURE__*/React.createElement(UnreadIcon, null))); + }).not.toThrow(); + }); + it('should render with custom size of 30', () => { + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: mockContainerSettings + }, /*#__PURE__*/React.createElement(UnreadIcon, { + size: 30 + }))); + }).not.toThrow(); + }); + it('should render with custom size of 15', () => { + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: mockContainerSettings + }, /*#__PURE__*/React.createElement(UnreadIcon, { + size: 15 + }))); + }).not.toThrow(); + }); + it('should handle very large size', () => { + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: mockContainerSettings + }, /*#__PURE__*/React.createElement(UnreadIcon, { + size: 100 + }))); + }).not.toThrow(); + }); + it('should handle very small size', () => { + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: mockContainerSettings + }, /*#__PURE__*/React.createElement(UnreadIcon, { + size: 5 + }))); + }).not.toThrow(); + }); + }); + describe('Context settings priority', () => { + it('should prioritize context settings over props', () => { + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: mockContainerSettings + }, /*#__PURE__*/React.createElement(UnreadIcon, { + position: "bottomleft" + }))); + }).not.toThrow(); + }); + it('should use props when context settings are not available', () => { + const settingsWithoutImage = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: undefined + } + }; + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: settingsWithoutImage + }, /*#__PURE__*/React.createElement(UnreadIcon, { + position: "bottomleft", + source: { + uri: 'https://custom.com/icon.png' + } + }))); + }).not.toThrow(); + }); + }); + describe('Image error handling', () => { + it('should render without crashing when image URL is invalid', () => { + const settings = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: { + ...mockContainerSettings.content.unread_indicator, + unread_icon: { + ...mockContainerSettings.content.unread_indicator.unread_icon, + image: { + url: 'invalid-url', + darkUrl: '' + } + } + } + } + }; + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: settings + }, /*#__PURE__*/React.createElement(UnreadIcon, null))); + }).not.toThrow(); + }); + }); + describe('Edge cases', () => { + it('should handle undefined image URLs', () => { + const settings = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: { + ...mockContainerSettings.content.unread_indicator, + unread_icon: { + placement: 'topright', + image: { + url: undefined, + darkUrl: undefined + } + } + } + } + }; + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: settings + }, /*#__PURE__*/React.createElement(UnreadIcon, null))); + }).not.toThrow(); + }); + it('should handle zero size', () => { + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: mockContainerSettings + }, /*#__PURE__*/React.createElement(UnreadIcon, { + size: 0 + }))); + }).not.toThrow(); + }); + it('should handle negative size', () => { + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: mockContainerSettings + }, /*#__PURE__*/React.createElement(UnreadIcon, { + size: -10 + }))); + }).not.toThrow(); + }); + }); + describe('Color scheme switching', () => { + it('should adapt to color scheme changes from light to dark', () => { + mockUseColorScheme.mockReturnValue('light'); + const { + rerender + } = render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: mockContainerSettings + }, /*#__PURE__*/React.createElement(UnreadIcon, null))); + + // Switch to dark mode + mockUseColorScheme.mockReturnValue('dark'); + expect(() => { + rerender(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: mockContainerSettings + }, /*#__PURE__*/React.createElement(UnreadIcon, null))); + }).not.toThrow(); + }); + it('should handle null color scheme', () => { + mockUseColorScheme.mockReturnValue(null); + expect(() => { + render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: mockContainerSettings + }, /*#__PURE__*/React.createElement(UnreadIcon, null))); + }).not.toThrow(); + }); + }); + describe('Behavioral verification', () => { + it('should render an Image when valid URL is provided', () => { + const { + UNSAFE_getByType + } = render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: mockContainerSettings + }, /*#__PURE__*/React.createElement(UnreadIcon, null))); + + // Should render an Image component when URL is provided + expect(() => UNSAFE_getByType(Image)).not.toThrow(); + }); + it('should render dot when image URLs are empty', () => { + const settings = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: { + ...mockContainerSettings.content.unread_indicator, + unread_icon: { + ...mockContainerSettings.content.unread_indicator.unread_icon, + image: { + url: '', + darkUrl: '' + } + } + } + } + }; + const { + UNSAFE_queryByType + } = render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: settings + }, /*#__PURE__*/React.createElement(UnreadIcon, null))); + + // Should not render Image when URLs are empty + expect(UNSAFE_queryByType(Image)).toBeNull(); + }); + it('should render image when source is provided even with type="dot"', () => { + const settingsWithoutImage = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: undefined + } + }; + const { + UNSAFE_getByType + } = render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: settingsWithoutImage + }, /*#__PURE__*/React.createElement(UnreadIcon, { + type: "dot", + source: { + uri: 'https://example.com/icon.png' + } + }))); + + // Should render Image when source is provided, even if type is "dot" + // The presence of source overrides the type prop + expect(() => UNSAFE_getByType(Image)).not.toThrow(); + }); + it('should use darkUrl in dark mode when provided', () => { + mockUseColorScheme.mockReturnValue('dark'); + const settings = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: { + ...mockContainerSettings.content.unread_indicator, + unread_icon: { + placement: 'topright', + image: { + url: 'https://example.com/light.png', + darkUrl: 'https://example.com/dark.png' + } + } + } + } + }; + const { + UNSAFE_getByType + } = render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: settings + }, /*#__PURE__*/React.createElement(UnreadIcon, null))); + const imageComponent = UNSAFE_getByType(Image); + expect(imageComponent.props.source).toEqual({ + uri: 'https://example.com/dark.png' + }); + }); + it('should fallback to light URL when no darkUrl in dark mode', () => { + mockUseColorScheme.mockReturnValue('dark'); + const settings = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: { + ...mockContainerSettings.content.unread_indicator, + unread_icon: { + placement: 'topright', + image: { + url: 'https://example.com/light.png' + } + } + } + } + }; + const { + UNSAFE_getByType + } = render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: settings + }, /*#__PURE__*/React.createElement(UnreadIcon, null))); + const imageComponent = UNSAFE_getByType(Image); + expect(imageComponent.props.source).toEqual({ + uri: 'https://example.com/light.png' + }); + }); + it('should use light URL in light mode', () => { + mockUseColorScheme.mockReturnValue('light'); + const { + UNSAFE_getByType + } = render(/*#__PURE__*/React.createElement(ContentCardContainerProvider, { + settings: mockContainerSettings + }, /*#__PURE__*/React.createElement(UnreadIcon, null))); + const imageComponent = UNSAFE_getByType(Image); + expect(imageComponent.props.source).toEqual({ + uri: 'https://example.com/icon.png' + }); + }); + }); +}); +//# sourceMappingURL=UnreadIcon.spec.js.map \ No newline at end of file diff --git a/packages/messaging/dist/module/ui/components/UnreadIcon/UnreadIcon.spec.js.map b/packages/messaging/dist/module/ui/components/UnreadIcon/UnreadIcon.spec.js.map new file mode 100644 index 00000000..7414b1d0 --- /dev/null +++ b/packages/messaging/dist/module/ui/components/UnreadIcon/UnreadIcon.spec.js.map @@ -0,0 +1 @@ +{"version":3,"names":["React","render","useColorScheme","Image","UnreadIcon","ContentCardContainerProvider","jest","mock","mockUseColorScheme","describe","mockContainerSettings","templateType","content","heading","layout","orientation","capacity","emptyStateSettings","message","unread_indicator","unread_bg","clr","light","dark","unread_icon","placement","image","url","darkUrl","isUnreadEnabled","showPagination","beforeEach","clearAllMocks","mockReturnValue","afterEach","it","getByTestId","createElement","settings","testID","expect","toBeTruthy","size","type","not","toThrow","settingsWithoutImage","undefined","source","uri","darkSource","position","customImageStyle","opacity","imageStyle","customContainerStyle","padding","containerStyle","rerender","UNSAFE_getByType","UNSAFE_queryByType","toBeNull","imageComponent","props","toEqual"],"sourceRoot":"../../../../../src","sources":["ui/components/UnreadIcon/UnreadIcon.spec.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,QAAQ,+BAA+B;AACtD,SAASC,cAAc,EAAEC,KAAK,QAAQ,cAAc;AACpD,OAAOC,UAAU,MAAM,iBAAc;AACrC,OAAOC,4BAA4B,MAAM,iDAA8C;;AAEvF;AACAC,IAAI,CAACC,IAAI,CAAC,iDAAiD,CAAC;AAC5D,MAAMC,kBAAkB,GAAGN,cAE1B;AAEDO,QAAQ,CAAC,YAAY,EAAE,MAAM;EAC3B,MAAMC,qBAAqB,GAAG;IAC5BC,YAAY,EAAE,OAAgB;IAC9BC,OAAO,EAAE;MACPC,OAAO,EAAE;QAAED,OAAO,EAAE;MAAO,CAAC;MAC5BE,MAAM,EAAE;QAAEC,WAAW,EAAE;MAAoB,CAAC;MAC5CC,QAAQ,EAAE,EAAE;MACZC,kBAAkB,EAAE;QAAEC,OAAO,EAAE;UAAEN,OAAO,EAAE;QAAQ;MAAE,CAAC;MACrDO,gBAAgB,EAAE;QAChBC,SAAS,EAAE;UACTC,GAAG,EAAE;YACHC,KAAK,EAAE,SAAS;YAChBC,IAAI,EAAE;UACR;QAC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AA,CAAAqC,aAAA,CAACjC,UAAU,MAAE,CACe,CAChC,CAAC;MAED,MAAM0D,cAAc,GAAGH,gBAAgB,CAACxD,KAAK,CAAC;MAC9CqC,MAAM,CAACsB,cAAc,CAACC,KAAK,CAACf,MAAM,CAAC,CAACgB,OAAO,CAAC;QAAEf,GAAG,EAAE;MAAgC,CAAC,CAAC;IACvF,CAAC,CAAC;IAEFd,EAAE,CAAC,oCAAoC,EAAE,MAAM;MAC7C3B,kBAAkB,CAACyB,eAAe,CAAC,OAAO,CAAC;MAE3C,MAAM;QAAE0B;MAAiB,CAAC,GAAG1D,MAAM,cACjCD,KAAA,CAAAqC,aAAA,CAAChC,4BAA4B;QAACiC,QAAQ,EAAE5B;MAAsB,gBAC5DV,KAAA,CAAAqC,aAAA,CAACjC,UAAU,MAAE,CACe,CAChC,CAAC;MAED,MAAM0D,cAAc,GAAGH,gBAAgB,CAACxD,KAAK,CAAC;MAC9CqC,MAAM,CAACsB,cAAc,CAACC,KAAK,CAACf,MAAM,CAAC,CAACgB,OAAO,CAAC;QAAEf,GAAG,EAAE;MAA+B,CAAC,CAAC;IACtF,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]} diff --git a/packages/messaging/dist/module/ui/hooks/useContainerSettings.js b/packages/messaging/dist/module/ui/hooks/useContainerSettings.js index aa65d83d..0a01fc1c 100644 --- a/packages/messaging/dist/module/ui/hooks/useContainerSettings.js +++ b/packages/messaging/dist/module/ui/hooks/useContainerSettings.js @@ -4,9 +4,6 @@ import { useContext } from "react"; import { ContentCardContainerContext } from "../providers/ContentCardContainerProvider.js"; function useContainerSettings() { const settings = useContext(ContentCardContainerContext); - if (!settings) { - throw new Error("useContainerSettings must be used within a ContentCardContainerProvider"); - } return settings; } export default useContainerSettings; diff --git a/packages/messaging/dist/module/ui/hooks/useContainerSettings.js.map b/packages/messaging/dist/module/ui/hooks/useContainerSettings.js.map index 0a8bf785..83901b78 100644 --- a/packages/messaging/dist/module/ui/hooks/useContainerSettings.js.map +++ b/packages/messaging/dist/module/ui/hooks/useContainerSettings.js.map @@ -1 +1 @@ -{"version":3,"names":["useContext","ContentCardContainerContext","useContainerSettings","settings","Error"],"sourceRoot":"../../../../src","sources":["ui/hooks/useContainerSettings.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,2BAA2B,QAAQ,8CAA2C;AAEvF,SAASC,oBAAoBA,CAAA,EAAG;EAC9B,MAAMC,QAAQ,GAAGH,UAAU,CAACC,2BAA2B,CAAC;EACxD,IAAI,CAACE,QAAQ,EAAE;IACb,MAAM,IAAIC,KAAK,CAAC,yEAAyE,CAAC;EAC5F;EACA,OAAOD,QAAQ;AACjB;AAEA,eAAeD,oBAAoB","ignoreList":[]} +{"version":3,"names":["useContext","ContentCardContainerContext","useContainerSettings","settings"],"sourceRoot":"../../../../src","sources":["ui/hooks/useContainerSettings.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,2BAA2B,QAA2B,8CAA2C;AAE1G,SAASC,oBAAoBA,CAAA,EAA6B;EACxD,MAAMC,QAAQ,GAAGH,UAAU,CAACC,2BAA2B,CAAC;EACxD,OAAOE,QAAQ;AACjB;AAEA,eAAeD,oBAAoB","ignoreList":[]} diff --git a/packages/messaging/dist/module/ui/index.js b/packages/messaging/dist/module/ui/index.js index 53de06d5..c1d9e839 100644 --- a/packages/messaging/dist/module/ui/index.js +++ b/packages/messaging/dist/module/ui/index.js @@ -4,4 +4,6 @@ export * from "./components/index.js"; export * from "./hooks/index.js"; export * from "./theme/index.js"; export * from "./types/index.js"; +export * from "./providers/ContentCardContainerProvider.js"; +export { default as ContentCardContainerProvider } from "./providers/ContentCardContainerProvider.js"; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/messaging/dist/module/ui/index.js.map b/packages/messaging/dist/module/ui/index.js.map index 94e1d14d..aaf9aa85 100644 --- a/packages/messaging/dist/module/ui/index.js.map +++ b/packages/messaging/dist/module/ui/index.js.map @@ -1 +1 @@ -{"version":3,"names":[],"sourceRoot":"../../../src","sources":["ui/index.ts"],"mappings":";;AAAA,cAAc,uBAAc;AAC5B,cAAc,kBAAS;AACvB,cAAc,kBAAS;AACvB,cAAc,kBAAS","ignoreList":[]} +{"version":3,"names":["default","ContentCardContainerProvider"],"sourceRoot":"../../../src","sources":["ui/index.ts"],"mappings":";;AAAA,cAAc,uBAAc;AAC5B,cAAc,kBAAS;AACvB,cAAc,kBAAS;AACvB,cAAc,kBAAS;AACvB,cAAc,6CAA0C;AACxD,SAASA,OAAO,IAAIC,4BAA4B,QAAQ,6CAA0C","ignoreList":[]} diff --git a/packages/messaging/dist/module/ui/providers/ContentCardContainerProvider.js.map b/packages/messaging/dist/module/ui/providers/ContentCardContainerProvider.js.map index d74069ec..4664017e 100644 --- a/packages/messaging/dist/module/ui/providers/ContentCardContainerProvider.js.map +++ b/packages/messaging/dist/module/ui/providers/ContentCardContainerProvider.js.map @@ -1 +1 @@ -{"version":3,"names":["React","createContext","ContentCardContainerContext","ContentCardContainerProvider","children","settings","createElement","Provider","value"],"sourceRoot":"../../../../src","sources":["ui/providers/ContentCardContainerProvider.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAyC5C,OAAO,MAAMC,2BAA2B,gBACtCD,aAAa,CAA2B,IAAI,CAAC;AAO/C,SAASE,4BAA4BA,CAAC;EACpCC,QAAQ;EACRC;AACiC,CAAC,EAAE;EACpC,oBACEL,KAAA,CAAAM,aAAA,CAACJ,2BAA2B,CAACK,QAAQ;IAACC,KAAK,EAAEH;EAAS,GACnDD,QACmC,CAAC;AAE3C;AAEA,eAAeD,4BAA4B","ignoreList":[]} +{"version":3,"names":["React","createContext","ContentCardContainerContext","ContentCardContainerProvider","children","settings","createElement","Provider","value"],"sourceRoot":"../../../../src","sources":["ui/providers/ContentCardContainerProvider.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AA4C5C,OAAO,MAAMC,2BAA2B,gBACtCD,aAAa,CAA2B,IAAI,CAAC;AAO/C,SAASE,4BAA4BA,CAAC;EACpCC,QAAQ;EACRC;AACiC,CAAC,EAAE;EACpC,oBACEL,KAAA,CAAAM,aAAA,CAACJ,2BAA2B,CAACK,QAAQ;IAACC,KAAK,EAAEH;EAAS,GACnDD,QACmC,CAAC;AAE3C;AAEA,eAAeD,4BAA4B","ignoreList":[]} diff --git a/packages/messaging/dist/module/ui/theme/ThemeProvider.js b/packages/messaging/dist/module/ui/theme/ThemeProvider.js index 4aa1fb4d..33143220 100644 --- a/packages/messaging/dist/module/ui/theme/ThemeProvider.js +++ b/packages/messaging/dist/module/ui/theme/ThemeProvider.js @@ -13,7 +13,7 @@ language governing permissions and limitations under the License. */ -import React, { createContext, useContext, useMemo } from 'react'; +import { createContext, useContext, useMemo } from 'react'; import { useColorScheme } from 'react-native'; const defaultTheme = { light: { diff --git a/packages/messaging/dist/module/ui/theme/ThemeProvider.js.map b/packages/messaging/dist/module/ui/theme/ThemeProvider.js.map index a5166d9e..202edc25 100644 --- a/packages/messaging/dist/module/ui/theme/ThemeProvider.js.map +++ b/packages/messaging/dist/module/ui/theme/ThemeProvider.js.map @@ -1 +1 @@ -{"version":3,"names":["React","createContext","useContext","useMemo","useColorScheme","defaultTheme","light","colors","primary","secondary","background","textPrimary","textSecondary","imagePlaceholder","buttonTextColor","dark","ThemeContext","undefined","ThemeProvider","children","customThemes","systemColorScheme","mergedThemes","activeTheme","contextValue","createElement","Provider","value","useTheme","context"],"sourceRoot":"../../../../src","sources":["ui/theme/ThemeProvider.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,IAAIC,aAAa,EAAEC,UAAU,EAAaC,OAAO,QAAQ,OAAO;AAC5E,SAASC,cAAc,QAAQ,cAAc;AAQ7C,MAAMC,YAAoB,GAAG;EAC3BC,KAAK,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mB,GAAGrB,OAAO,CAAC,MAAMoB,WAAW,EAAE,CAACA,WAAW,CAAC,CAAC;EAErE,oBACEvB,KAAA,CAAAyB,aAAA,CAACT,YAAY,CAACU,QAAQ;IAACC,KAAK,EAAEH;EAAa,GACxCL,QACoB,CAAC;AAE5B,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMS,QAAQ,GAAGA,CAAA,KAAa;EACnC,MAAMC,OAAO,GAAG3B,UAAU,CAACc,YAAY,CAAC;EACxC,MAAMK,iBAAiB,GAAGjB,cAAc,CAAC,CAAC;EAC1C,IAAIyB,OAAO,KAAKZ,SAAS,EAAE;IACzB,OAAOZ,YAAY,CAACgB,iBAAiB,IAAI,OAAO,CAAC;EACnD;EACA,OAAOQ,OAAO;AAChB,CAAC","ignoreList":[]} +{"version":3,"names":["createContext","useContext","useMemo","useColorScheme","defaultTheme","light","colors","primary","secondary","background","textPrimary","textSecondary","imagePlaceholder","buttonTextColor","dark","ThemeContext","undefined","ThemeProvider","children","customThemes","systemColorScheme","mergedThemes","activeTheme","contextValue","React","createElement","Provider","value","useTheme","context"],"sourceRoot":"../../../../src","sources":["ui/theme/ThemeProvider.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,aAAa,EAAEC,UAAU,EAAaC,OAAO,QAAQ,OAAO;AACrE,SAASC,cAAc,QAAQ,cAAc;AAQ7C,MAAMC,YAAoB,GAAG;EAC3BC,KAAK,EAAE;IACLC,MAAM,EAAE;MACNC,OAAO,EAAE,SAAS;MAClBC,SAAS,EAAE,SAAS;MACpBC,UAAU,EAAE,SAAS;MACrBC,WAAW,EAAE,SAAS;MACtBC,aAAa,EAAE,SAAS;MACxBC,gBAAgB,EAAE,SAAS;MAC3BC,eAAe,EAAE;IACnB;EACF,CAAC;EACDC,IAAI,EAAE;IACJR,MAAM,EAAE;MACNC,OAAO,EAAE,SAAS;MAClBC,SAAS,EAAE,SAAS;MAC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EACxC,MAAMK,iBAAiB,GAAGjB,cAAc,CAAC,CAAC;EAC1C,IAAI0B,OAAO,KAAKb,SAAS,EAAE;IACzB,OAAOZ,YAAY,CAACgB,iBAAiB,IAAI,OAAO,CAAC;EACnD;EACA,OAAOS,OAAO;AAChB,CAAC","ignoreList":[]} diff --git a/packages/messaging/dist/module/ui/types/Templates.js b/packages/messaging/dist/module/ui/types/Templates.js index 1d1f0e3c..4f3371d2 100644 --- a/packages/messaging/dist/module/ui/types/Templates.js +++ b/packages/messaging/dist/module/ui/types/Templates.js @@ -2,8 +2,8 @@ import { ContentCard } from "../../models/ContentCard.js"; export class ContentTemplate extends ContentCard { - constructor(data, type) { - super(data); + constructor(data, type, isRead = false) { + super(data, isRead); this.type = type; } } diff --git a/packages/messaging/dist/module/ui/types/Templates.js.map b/packages/messaging/dist/module/ui/types/Templates.js.map index 4488889b..433b4dda 100644 --- a/packages/messaging/dist/module/ui/types/Templates.js.map +++ b/packages/messaging/dist/module/ui/types/Templates.js.map @@ -1 +1 @@ -{"version":3,"names":["ContentCard","ContentTemplate","constructor","data","type"],"sourceRoot":"../../../../src","sources":["ui/types/Templates.ts"],"mappings":";;AAUA,SACEA,WAAW,QAGN,6BAA0B;AAGjC,OAAO,MAAMC,eAAe,SAASD,WAAW,CAAC;EAG/CE,WAAWA,CAACC,IAAqB,EAAEC,IAAyB,EAAE;IAC5D,KAAK,CAACD,IAAI,CAAC;IACX,IAAI,CAACC,IAAI,GAAGA,IAAI;EAClB;AACF;;AAEA;;AAcA","ignoreList":[]} +{"version":3,"names":["ContentCard","ContentTemplate","constructor","data","type","isRead"],"sourceRoot":"../../../../src","sources":["ui/types/Templates.ts"],"mappings":";;AAUA,SACEA,WAAW,QAGN,6BAA0B;AAGjC,OAAO,MAAMC,eAAe,SAASD,WAAW,CAAC;EAG/CE,WAAWA,CAACC,IAAqB,EAAEC,IAAyB,EAAEC,MAAe,GAAG,KAAK,EAAE;IACrF,KAAK,CAACF,IAAI,EAAEE,MAAM,CAAC;IACnB,IAAI,CAACD,IAAI,GAAGA,IAAI;EAClB;AACF;;AAEA;;AAcA","ignoreList":[]} diff --git a/packages/messaging/dist/typescript/Messaging.d.ts.map b/packages/messaging/dist/typescript/Messaging.d.ts.map index 29e7ec63..05e8e676 100644 --- a/packages/messaging/dist/typescript/Messaging.d.ts.map +++ b/packages/messaging/dist/typescript/Messaging.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Messaging.d.ts","sourceRoot":"","sources":["../../src/Messaging.ts"],"names":[],"mappings":"AAkBA,OAAO,OAAO,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAEhF,MAAM,WAAW,qBAAqB;IACpC,gBAAgB,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACxC,iBAAiB,EAAE,MAAM,OAAO,EAAE,CAAC;IACnC,gBAAgB,EAAE,MAAM,OAAO,CAAC;IAChC,gBAAgB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;IAClE,0BAA0B,EAAE,CAC1B,QAAQ,EAAE,MAAM,EAAE,KACf,MAAM,CAAC,MAAM,EAAE,oBAAoB,EAAE,CAAC,CAAC;IAC5C,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC,oBAAoB,EAAE,CAAC,QAAQ,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC7D,kBAAkB,EAAE,CAClB,iBAAiB,EAAE,OAAO,EAC1B,iBAAiB,EAAE,OAAO,KACvB,IAAI,CAAC;IACV,6BAA6B,EAAE,CAAC,QAAQ,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C,oBAAoB,CACzB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,IAAI,EAC1B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,GACtB,IAAI;IASP;;;OAGG;IACH,MAAM,CAAC,oBAAoB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,MAAM,IAAI;IAuDpE;;;;;;OAMG;IACH,MAAM,CAAC,kBAAkB,CACvB,iBAAiB,EAAE,OAAO,EAC1B,iBAAiB,EAAE,OAAO;IAK5B;;;OAGG;WACU,6BAA6B,CACxC,QAAQ,EAAE,MAAM,EAAE,GACjB,OAAO,CAAC,IAAI,CAAC;IAIhB;;;;;OAKG;WACU,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;WA4B7D,uBAAuB,CAClC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,iBAAiB,CAAC;CAqC9B;AAED,eAAe,SAAS,CAAC"} \ No newline at end of file diff --git a/packages/messaging/dist/typescript/models/ContentCard.d.ts b/packages/messaging/dist/typescript/models/ContentCard.d.ts index 7f67b41f..877f9080 100644 --- a/packages/messaging/dist/typescript/models/ContentCard.d.ts +++ b/packages/messaging/dist/typescript/models/ContentCard.d.ts @@ -51,6 +51,7 @@ export interface ContentCardData extends PropositionItemData { } export declare class ContentCard extends PropositionItem { data: ContentCardData['data']; - constructor(contentCardData: ContentCardData); + isRead: boolean; + constructor(contentCardData: ContentCardData, isRead?: boolean); } //# sourceMappingURL=ContentCard.d.ts.map \ No newline at end of file diff --git a/packages/messaging/dist/typescript/models/ContentCard.d.ts.map b/packages/messaging/dist/typescript/models/ContentCard.d.ts.map index 58c63be4..dd39ef1d 100644 --- a/packages/messaging/dist/typescript/models/ContentCard.d.ts.map +++ b/packages/messaging/dist/typescript/models/ContentCard.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ContentCard.d.ts","sourceRoot":"","sources":["../../../src/models/ContentCard.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;QACJ,WAAW,EAAE,kBAAkB,CAAC;QAChC,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,EAAE,MAAM,CAAC;QACtB,IAAI,EAAE,eAAe,CAAC;QACtB,OAAO,EAAE,qBAAqB,GAAG,qBAAqB,GAAG,gBAAgB,CAAC;KAC3E,CAAC;CACH;AACD,qBAAa,WAAY,SAAQ,eAAe;IAC9C,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAC9B,MAAM,EAAE,OAAO,CAAS;gBAEZ,eAAe,EAAE,eAAe,EAAE,MAAM,GAAE,OAAe;CAKtE"} \ No newline at end of file diff --git a/packages/messaging/dist/typescript/ui/components/ContentCardView/ContentCardView.d.ts b/packages/messaging/dist/typescript/ui/components/ContentCardView/ContentCardView.d.ts index 1fd75bbb..7d2a2cdb 100644 --- a/packages/messaging/dist/typescript/ui/components/ContentCardView/ContentCardView.d.ts +++ b/packages/messaging/dist/typescript/ui/components/ContentCardView/ContentCardView.d.ts @@ -1,18 +1,38 @@ -import React from 'react'; -import { ComponentOverrideProps, ContentTemplate, ImageOnlyContentStyle, LargeImageContentStyle, SmallImageContentStyle } from '../../types/Templates'; -import { ContentViewEvent } from '../../types/ContentViewEvent'; +import React from "react"; +import { ComponentOverrideProps, ContentTemplate, ImageOnlyContentStyle, LargeImageContentStyle, SmallImageContentStyle } from "../../types/Templates"; +import { ContentViewEvent } from "../../types/ContentViewEvent"; import { PressableProps } from 'react-native'; import { ContentCardTemplate } from '../../../models'; -export type ContentCardEventListener = (event: ContentViewEvent, data?: ContentTemplate, nativeEvent?: any) => void; +/** + * Callback function that is called when a content card event occurs. + */ +export type ContentCardEventListener = ( +/** The event that occurred, one of "onDismiss", "onDisplay", "onInteract" */ +event?: ContentViewEvent, +/** The full content card data associated with the event */ +data?: ContentTemplate, +/** Any additional native event data that accompanies the event */ +nativeEvent?: any) => void; +/** Props for the ContentCardView component */ export interface ContentViewProps extends PressableProps, ComponentOverrideProps { + /** The content card data to display */ template: ContentTemplate; + /** Style overrides per template type for the content card */ styleOverrides?: { + /** Style overrides for the small image content card */ smallImageStyle?: SmallImageContentStyle; + /** Style overrides for the large image content card */ largeImageStyle?: LargeImageContentStyle; + /** Style overrides for the image only content card */ imageOnlyStyle?: ImageOnlyContentStyle; }; + /** The function to call when a content card event occurs */ listener?: ContentCardEventListener; + /** The variant of the content card to display */ variant?: ContentCardTemplate; } +/** Renders a content card view + * @param {ContentViewProps} props - The props for the ContentCardView component + */ export declare const ContentCardView: React.FC; //# sourceMappingURL=ContentCardView.d.ts.map \ No newline at end of file diff --git a/packages/messaging/dist/typescript/ui/components/ContentCardView/ContentCardView.d.ts.map b/packages/messaging/dist/typescript/ui/components/ContentCardView/ContentCardView.d.ts.map index f8136551..67c483b2 100644 --- a/packages/messaging/dist/typescript/ui/components/ContentCardView/ContentCardView.d.ts.map +++ b/packages/messaging/dist/typescript/ui/components/ContentCardView/ContentCardView.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ContentCardView.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/ContentCardView/ContentCardView.tsx"],"names":[],"mappings":"AAYA,OAAO,KAMN,MAAM,OAAO,CAAC;AACf,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAIL,cAAc,EAKf,MAAM,cAAc,CAAC;AAKtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAGtD,MAAM,MAAM,wBAAwB,GAAG,CACrC,KAAK,EAAE,gBAAgB,EACvB,IAAI,CAAC,EAAE,eAAe,EACtB,WAAW,CAAC,EAAE,GAAG,KACd,IAAI,CAAC;AAEV,MAAM,WAAW,gBACf,SAAQ,cAAc,EACpB,sBAAsB;IACxB,QAAQ,EAAE,eAAe,CAAC;IAC1B,cAAc,CAAC,EAAE;QACf,eAAe,CAAC,EAAE,sBAAsB,CAAC;QACzC,eAAe,CAAC,EAAE,sBAAsB,CAAC;QACzC,cAAc,CAAC,EAAE,qBAAqB,CAAC;KACxC,CAAC;IACF,QAAQ,CAAC,EAAE,wBAAwB,CAAC;IACpC,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAsNtD,CAAC"} \ No newline at end of file +{"version":3,"file":"ContentCardView.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/ContentCardView/ContentCardView.tsx"],"names":[],"mappings":"AAYA,OAAO,KAMN,MAAM,OAAO,CAAC;AACf,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAIL,cAAc,EAKf,MAAM,cAAc,CAAC;AAMtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAItD;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;AACrC,6EAA6E;AAC7E,KAAK,CAAC,EAAE,gBAAgB;AACxB,2DAA2D;AAC3D,IAAI,CAAC,EAAE,eAAe;AACtB,kEAAkE;AAClE,WAAW,CAAC,EAAE,GAAG,KACd,IAAI,CAAC;AAEV,8CAA8C;AAC9C,MAAM,WAAW,gBACf,SAAQ,cAAc,EACpB,sBAAsB;IACxB,uCAAuC;IACvC,QAAQ,EAAE,eAAe,CAAC;IAC1B,6DAA6D;IAC7D,cAAc,CAAC,EAAE;QACf,uDAAuD;QACvD,eAAe,CAAC,EAAE,sBAAsB,CAAC;QACzC,uDAAuD;QACvD,eAAe,CAAC,EAAE,sBAAsB,CAAC;QACzC,sDAAsD;QACtD,cAAc,CAAC,EAAE,qBAAqB,CAAC;KACxC,CAAC;IACF,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,wBAAwB,CAAC;IACpC,iDAAiD;IACjD,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAmPtD,CAAC"} \ No newline at end of file diff --git a/packages/messaging/dist/typescript/ui/components/DismissButton/DismissButton.d.ts b/packages/messaging/dist/typescript/ui/components/DismissButton/DismissButton.d.ts index 99a1c032..ea762abe 100644 --- a/packages/messaging/dist/typescript/ui/components/DismissButton/DismissButton.d.ts +++ b/packages/messaging/dist/typescript/ui/components/DismissButton/DismissButton.d.ts @@ -1,8 +1,12 @@ -import { PressableProps, TextStyle } from 'react-native'; +import { PressableProps, TextStyle } from "react-native"; +/** Props for the DismissButton component. Extends the PressableProps from react-native. */ export interface DismissButtonProps extends PressableProps { + /** The style of the text for the dismiss button */ textStyle?: TextStyle; + /** The function to call when the dismiss button is pressed */ onPress?: () => void; - type: 'simple' | 'circle'; + /** The style of the dismiss button */ + type: "simple" | "circle"; } declare const DismissButton: ({ onPress, type, textStyle, style, ...props }: DismissButtonProps) => import("react").JSX.Element; export default DismissButton; diff --git a/packages/messaging/dist/typescript/ui/components/DismissButton/DismissButton.d.ts.map b/packages/messaging/dist/typescript/ui/components/DismissButton/DismissButton.d.ts.map index df906c4b..8fc9452d 100644 --- a/packages/messaging/dist/typescript/ui/components/DismissButton/DismissButton.d.ts.map +++ b/packages/messaging/dist/typescript/ui/components/DismissButton/DismissButton.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"DismissButton.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/DismissButton/DismissButton.tsx"],"names":[],"mappings":"AAWA,OAAO,EAEL,cAAc,EAGd,SAAS,EAEV,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAC3B;AAED,QAAA,MAAM,aAAa,GAAI,+CAMpB,kBAAkB,gCAkCpB,CAAC;AAEF,eAAe,aAAa,CAAC"} \ No newline at end of file +{"version":3,"file":"DismissButton.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/DismissButton/DismissButton.tsx"],"names":[],"mappings":"AAWA,OAAO,EAEL,cAAc,EAGd,SAAS,EAEV,MAAM,cAAc,CAAC;AAEtB,2FAA2F;AAC3F,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD,mDAAmD;IACnD,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,sCAAsC;IACtC,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAC3B;AAED,QAAA,MAAM,aAAa,GAAI,+CAMpB,kBAAkB,gCAkCpB,CAAC;AAEF,eAAe,aAAa,CAAC"} \ No newline at end of file diff --git a/packages/messaging/dist/typescript/ui/components/UnreadIcon/UnreadIcon.d.ts b/packages/messaging/dist/typescript/ui/components/UnreadIcon/UnreadIcon.d.ts index 32f271bc..b7caf123 100644 --- a/packages/messaging/dist/typescript/ui/components/UnreadIcon/UnreadIcon.d.ts +++ b/packages/messaging/dist/typescript/ui/components/UnreadIcon/UnreadIcon.d.ts @@ -1,3 +1,15 @@ -declare function UnreadIcon(): import("react").JSX.Element; +import React from 'react'; +import { ImageProps, ImageStyle, ViewProps, ViewStyle } from 'react-native'; +import { SettingsPlacement } from '../../providers/ContentCardContainerProvider'; +export interface UnreadIconProps extends ViewProps { + imageStyle?: ImageStyle; + containerStyle?: ViewStyle; + source?: ImageProps['source']; + darkSource?: ImageProps['source']; + size?: number; + position?: SettingsPlacement; + type?: 'dot' | 'image'; +} +declare const UnreadIcon: ({ imageStyle, containerStyle, source, darkSource, size, position, type, style, ...props }: UnreadIconProps) => React.JSX.Element; export default UnreadIcon; //# sourceMappingURL=UnreadIcon.d.ts.map \ No newline at end of file diff --git a/packages/messaging/dist/typescript/ui/components/UnreadIcon/UnreadIcon.d.ts.map b/packages/messaging/dist/typescript/ui/components/UnreadIcon/UnreadIcon.d.ts.map index a0000d1b..d6f4f33c 100644 --- a/packages/messaging/dist/typescript/ui/components/UnreadIcon/UnreadIcon.d.ts.map +++ b/packages/messaging/dist/typescript/ui/components/UnreadIcon/UnreadIcon.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"UnreadIcon.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/UnreadIcon/UnreadIcon.tsx"],"names":[],"mappings":"AAEA,iBAAS,UAAU,gCAMlB;AAED,eAAe,UAAU,CAAC"} \ No newline at end of file +{"version":3,"file":"UnreadIcon.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/UnreadIcon/UnreadIcon.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAC5D,OAAO,EAEL,UAAU,EACV,UAAU,EAGV,SAAS,EACT,SAAS,EAEV,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AAEjF,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC9B,UAAU,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;CACxB;AAqBD,QAAA,MAAM,UAAU,GAAI,2FAUjB,eAAe,sBAkIjB,CAAC;AAEF,eAAe,UAAU,CAAC"} \ No newline at end of file diff --git a/packages/messaging/dist/typescript/ui/components/UnreadIcon/UnreadIcon.spec.d.ts b/packages/messaging/dist/typescript/ui/components/UnreadIcon/UnreadIcon.spec.d.ts new file mode 100644 index 00000000..5f377db0 --- /dev/null +++ b/packages/messaging/dist/typescript/ui/components/UnreadIcon/UnreadIcon.spec.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=UnreadIcon.spec.d.ts.map \ No newline at end of file diff --git a/packages/messaging/dist/typescript/ui/components/UnreadIcon/UnreadIcon.spec.d.ts.map b/packages/messaging/dist/typescript/ui/components/UnreadIcon/UnreadIcon.spec.d.ts.map new file mode 100644 index 00000000..41631610 --- /dev/null +++ b/packages/messaging/dist/typescript/ui/components/UnreadIcon/UnreadIcon.spec.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"UnreadIcon.spec.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/UnreadIcon/UnreadIcon.spec.tsx"],"names":[],"mappings":""} \ No newline at end of file diff --git a/packages/messaging/dist/typescript/ui/hooks/useContainerSettings.d.ts b/packages/messaging/dist/typescript/ui/hooks/useContainerSettings.d.ts index fec6fb9b..ac8aeffe 100644 --- a/packages/messaging/dist/typescript/ui/hooks/useContainerSettings.d.ts +++ b/packages/messaging/dist/typescript/ui/hooks/useContainerSettings.d.ts @@ -1,3 +1,4 @@ -declare function useContainerSettings(): import("../providers/ContentCardContainerProvider").ContainerSettings; +import { ContainerSettings } from "../providers/ContentCardContainerProvider"; +declare function useContainerSettings(): ContainerSettings | null; export default useContainerSettings; //# sourceMappingURL=useContainerSettings.d.ts.map \ No newline at end of file diff --git a/packages/messaging/dist/typescript/ui/hooks/useContainerSettings.d.ts.map b/packages/messaging/dist/typescript/ui/hooks/useContainerSettings.d.ts.map index da56306d..a1b49e5c 100644 --- a/packages/messaging/dist/typescript/ui/hooks/useContainerSettings.d.ts.map +++ b/packages/messaging/dist/typescript/ui/hooks/useContainerSettings.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"useContainerSettings.d.ts","sourceRoot":"","sources":["../../../../src/ui/hooks/useContainerSettings.ts"],"names":[],"mappings":"AAGA,iBAAS,oBAAoB,0EAM5B;AAED,eAAe,oBAAoB,CAAC"} \ No newline at end of file +{"version":3,"file":"useContainerSettings.d.ts","sourceRoot":"","sources":["../../../../src/ui/hooks/useContainerSettings.ts"],"names":[],"mappings":"AACA,OAAO,EAA+B,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAE3G,iBAAS,oBAAoB,IAAI,iBAAiB,GAAG,IAAI,CAGxD;AAED,eAAe,oBAAoB,CAAC"} \ No newline at end of file diff --git a/packages/messaging/dist/typescript/ui/index.d.ts b/packages/messaging/dist/typescript/ui/index.d.ts index 185bb314..876dbafa 100644 --- a/packages/messaging/dist/typescript/ui/index.d.ts +++ b/packages/messaging/dist/typescript/ui/index.d.ts @@ -2,4 +2,6 @@ export * from './components'; export * from './hooks'; export * from './theme'; export * from './types'; +export * from './providers/ContentCardContainerProvider'; +export { default as ContentCardContainerProvider } from './providers/ContentCardContainerProvider'; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/messaging/dist/typescript/ui/index.d.ts.map b/packages/messaging/dist/typescript/ui/index.d.ts.map index 3fc268cf..7a6c6519 100644 --- a/packages/messaging/dist/typescript/ui/index.d.ts.map +++ b/packages/messaging/dist/typescript/ui/index.d.ts.map @@ -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"} \ No newline at end of file +{"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,0CAA0C,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,4BAA4B,EAAE,MAAM,0CAA0C,CAAC"} \ No newline at end of file diff --git a/packages/messaging/dist/typescript/ui/providers/ContentCardContainerProvider.d.ts b/packages/messaging/dist/typescript/ui/providers/ContentCardContainerProvider.d.ts index 378e15a6..171dcdae 100644 --- a/packages/messaging/dist/typescript/ui/providers/ContentCardContainerProvider.d.ts +++ b/packages/messaging/dist/typescript/ui/providers/ContentCardContainerProvider.d.ts @@ -1,4 +1,5 @@ import React from "react"; +export type SettingsPlacement = 'topleft' | 'topright' | 'bottomleft' | 'bottomright'; export interface ContainerSettings { templateType: 'inbox' | 'banner' | 'custom'; content: { @@ -26,14 +27,15 @@ export interface ContainerSettings { }; }; unread_icon: { - placement: 'topleft' | 'topright' | 'bottomleft' | 'bottomright'; + placement: SettingsPlacement; image: { url: string; darkUrl?: string; }; }; }; - isUnreadEnabled: boolean; + /** Whether the unread feature is enabled. Defaults to true. */ + isUnreadEnabled?: boolean; }; showPagination?: boolean; } diff --git a/packages/messaging/dist/typescript/ui/providers/ContentCardContainerProvider.d.ts.map b/packages/messaging/dist/typescript/ui/providers/ContentCardContainerProvider.d.ts.map index 1f1e67c3..6c738977 100644 --- a/packages/messaging/dist/typescript/ui/providers/ContentCardContainerProvider.d.ts.map +++ b/packages/messaging/dist/typescript/ui/providers/ContentCardContainerProvider.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ContentCardContainerProvider.d.ts","sourceRoot":"","sources":["../../../../src/ui/providers/ContentCardContainerProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAE7C,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC5C,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,EAAE;YAClB,OAAO,EAAE;gBACP,OAAO,EAAE,MAAM,CAAC;aACjB,CAAC;YACF,KAAK,CAAC,EAAE;gBACN,GAAG,EAAE,MAAM,CAAC;gBACZ,OAAO,CAAC,EAAE,MAAM,CAAC;aAClB,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,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,aAAa,CAAC;gBACjE,KAAK,EAAE;oBACL,GAAG,EAAE,MAAM,CAAC;oBACZ,OAAO,CAAC,EAAE,MAAM,CAAC;iBAClB,CAAC;aACH,CAAC;SACH,CAAC;QACF,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;IACF,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,eAAO,MAAM,2BAA2B,yCACO,CAAC;AAEhD,MAAM,WAAW,iCAAiC;IAChD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,EAAE,iBAAiB,CAAC;CAC7B;AAED,iBAAS,4BAA4B,CAAC,EACpC,QAAQ,EACR,QAAQ,GACT,EAAE,iCAAiC,qBAMnC;AAED,eAAe,4BAA4B,CAAC"} \ No newline at end of file +{"version":3,"file":"ContentCardContainerProvider.d.ts","sourceRoot":"","sources":["../../../../src/ui/providers/ContentCardContainerProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAE7C,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,aAAa,CAAC;AAEtF,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC5C,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,EAAE;YAClB,OAAO,EAAE;gBACP,OAAO,EAAE,MAAM,CAAC;aACjB,CAAC;YACF,KAAK,CAAC,EAAE;gBACN,GAAG,EAAE,MAAM,CAAC;gBACZ,OAAO,CAAC,EAAE,MAAM,CAAC;aAClB,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,2BAA2B,yCACO,CAAC;AAEhD,MAAM,WAAW,iCAAiC;IAChD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,EAAE,iBAAiB,CAAC;CAC7B;AAED,iBAAS,4BAA4B,CAAC,EACpC,QAAQ,EACR,QAAQ,GACT,EAAE,iCAAiC,qBAMnC;AAED,eAAe,4BAA4B,CAAC"} \ No newline at end of file diff --git a/packages/messaging/dist/typescript/ui/theme/ThemeProvider.d.ts b/packages/messaging/dist/typescript/ui/theme/ThemeProvider.d.ts index e8c13086..c773ceb8 100644 --- a/packages/messaging/dist/typescript/ui/theme/ThemeProvider.d.ts +++ b/packages/messaging/dist/typescript/ui/theme/ThemeProvider.d.ts @@ -1,4 +1,4 @@ -import React, { ReactNode } from 'react'; +import { ReactNode } from 'react'; import { Theme, Themes } from './Theme'; interface ThemeProviderProps { children: ReactNode; @@ -11,7 +11,7 @@ interface ThemeProviderProps { * @param customThemes - The custom themes to override the default themes. * @returns The ThemeProvider component. */ -export declare const ThemeProvider: ({ children, customThemes }: ThemeProviderProps) => React.JSX.Element; +export declare const ThemeProvider: ({ children, customThemes }: ThemeProviderProps) => import("react").JSX.Element; /** * useTheme hook that returns the theme context. * @returns The theme context. diff --git a/packages/messaging/dist/typescript/ui/theme/ThemeProvider.d.ts.map b/packages/messaging/dist/typescript/ui/theme/ThemeProvider.d.ts.map index e09e64bd..2a4a27ec 100644 --- a/packages/messaging/dist/typescript/ui/theme/ThemeProvider.d.ts.map +++ b/packages/messaging/dist/typescript/ui/theme/ThemeProvider.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/ui/theme/ThemeProvider.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,EAA6B,SAAS,EAAW,MAAM,OAAO,CAAC;AAE7E,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAExC,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB;AA6BD;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GAAI,4BAG3B,kBAAkB,sBAoCpB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,QAAO,KAO3B,CAAC"} \ No newline at end of file +{"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;AA6BD;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GAAI,4BAG3B,kBAAkB,gCAoCpB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,QAAO,KAO3B,CAAC"} \ No newline at end of file diff --git a/packages/messaging/dist/typescript/ui/types/Templates.d.ts b/packages/messaging/dist/typescript/ui/types/Templates.d.ts index 4ce77785..cc7b98b7 100644 --- a/packages/messaging/dist/typescript/ui/types/Templates.d.ts +++ b/packages/messaging/dist/typescript/ui/types/Templates.d.ts @@ -4,7 +4,7 @@ import { ContentCard, ContentCardData, ContentCardTemplate } from '../../models/ import { DismissButtonProps } from '../components/DismissButton/DismissButton'; export declare class ContentTemplate extends ContentCard { readonly type: ContentCardTemplate; - constructor(data: ContentCardData, type: ContentCardTemplate); + constructor(data: ContentCardData, type: ContentCardTemplate, isRead?: boolean); } /** Overrides for the structural pieces of the content card */ export interface ComponentOverrideProps { diff --git a/packages/messaging/dist/typescript/ui/types/Templates.d.ts.map b/packages/messaging/dist/typescript/ui/types/Templates.d.ts.map index d4d41272..6c60475e 100644 --- a/packages/messaging/dist/typescript/ui/types/Templates.d.ts.map +++ b/packages/messaging/dist/typescript/ui/types/Templates.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Templates.d.ts","sourceRoot":"","sources":["../../../../src/ui/types/Templates.ts"],"names":[],"mappings":"AAAA,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,eA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,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"} \ No newline at end of file +{"version":3,"file":"Templates.d.ts","sourceRoot":"","sources":["../../../../src/ui/types/Templates.ts"],"names":[],"mappings":"AAAA,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"} \ No newline at end of file diff --git a/packages/messaging/dist/ui/components/Button/Button.d.ts b/packages/messaging/dist/ui/components/Button/Button.d.ts deleted file mode 100644 index 57b00871..00000000 --- a/packages/messaging/dist/ui/components/Button/Button.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; -import { GestureResponderEvent, PressableProps, TextStyle } from 'react-native'; -export interface ButtonProps extends Omit { - actionUrl?: string; - id?: string; - title: string; - onPress?: (interactId?: string, event?: GestureResponderEvent) => void; - interactId?: string; - textStyle?: (TextStyle | undefined) | (TextStyle | undefined)[]; -} -declare const Button: React.FC; -export default Button; diff --git a/packages/messaging/dist/ui/components/Button/Button.js b/packages/messaging/dist/ui/components/Button/Button.js deleted file mode 100644 index e2943b0d..00000000 --- a/packages/messaging/dist/ui/components/Button/Button.js +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const tslib_1 = require("tslib"); -/* - Copyright 2025 Adobe. All rights reserved. - This file is licensed to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law - or agreed to in writing, software distributed under the License is - distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF - ANY KIND, either express or implied. See the License for the specific - language governing permissions and limitations under the License. -*/ -const react_1 = tslib_1.__importStar(require("react")); -const react_native_1 = require("react-native"); -const ThemeProvider_1 = require("../../theme/ThemeProvider"); -const Button = (_a) => { - var _b; - var { actionUrl, id, title, onPress, interactId, textStyle, style } = _a, props = tslib_1.__rest(_a, ["actionUrl", "id", "title", "onPress", "interactId", "textStyle", "style"]); - const theme = (0, ThemeProvider_1.useTheme)(); - const handlePress = (0, react_1.useCallback)(() => { - onPress === null || onPress === void 0 ? void 0 : onPress(interactId); - if (actionUrl) { - try { - react_native_1.Linking.openURL(actionUrl); - } - catch (error) { - console.warn(`Failed to open URL: ${actionUrl}`, error); - } - } - }, [actionUrl, interactId, onPress]); - return ( - - {title} - - ); -}; -exports.default = Button; -//# sourceMappingURL=Button.js.map \ No newline at end of file diff --git a/packages/messaging/dist/ui/components/Button/Button.js.map b/packages/messaging/dist/ui/components/Button/Button.js.map deleted file mode 100644 index cc9f58a1..00000000 --- a/packages/messaging/dist/ui/components/Button/Button.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/ui/components/Button/Button.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;EAUE;AACF,uDAA2C;AAC3C,+CAOsB;AACtB,6DAAqD;AAWrD,MAAM,MAAM,GAA0B,CAAC,EAStC,EAAE,EAAE;;QATkC,EACrC,SAAS,EACT,EAAE,EACF,KAAK,EACL,OAAO,EACP,UAAU,EACV,SAAS,EACT,KAAK,OAEN,EADI,KAAK,sBAR6B,2EAStC,CADS;IAER,MAAM,KAAK,GAAG,IAAA,wBAAQ,GAAE,CAAC;IACzB,MAAM,WAAW,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QACnC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,UAAU,CAAC,CAAC;QACtB,IAAI,SAAS,EAAE;YACb,IAAI;gBACF,sBAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;aAC5B;YAAC,OAAO,KAAK,EAAE;gBACd,OAAO,CAAC,IAAI,CAAC,uBAAuB,SAAS,EAAE,EAAE,KAAK,CAAC,CAAC;aACzD;SACF;IACH,CAAC,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;IAErC,OAAO,CACL,CAAC,wBAAS,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CACvD;MAAA,CAAC,mBAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,0CAAE,eAAe,EAAE,EAAE,SAAS,CAAC,CAAC,CAClE;QAAA,CAAC,KAAK,CACR;MAAA,EAAE,mBAAI,CACR;IAAA,EAAE,wBAAS,CAAC,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/packages/messaging/dist/ui/components/Button/Button.spec.d.ts b/packages/messaging/dist/ui/components/Button/Button.spec.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/packages/messaging/dist/ui/components/Button/Button.spec.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/messaging/dist/ui/components/Button/Button.spec.js b/packages/messaging/dist/ui/components/Button/Button.spec.js deleted file mode 100644 index 866b255f..00000000 --- a/packages/messaging/dist/ui/components/Button/Button.spec.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=Button.spec.js.map \ No newline at end of file diff --git a/packages/messaging/dist/ui/components/Button/Button.spec.js.map b/packages/messaging/dist/ui/components/Button/Button.spec.js.map deleted file mode 100644 index 31e1bd5b..00000000 --- a/packages/messaging/dist/ui/components/Button/Button.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Button.spec.js","sourceRoot":"","sources":["../../../../src/ui/components/Button/Button.spec.tsx"],"names":[],"mappings":""} \ No newline at end of file diff --git a/packages/messaging/dist/ui/components/ContentCardView/ContentCardView.d.ts b/packages/messaging/dist/ui/components/ContentCardView/ContentCardView.d.ts deleted file mode 100644 index c355f228..00000000 --- a/packages/messaging/dist/ui/components/ContentCardView/ContentCardView.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import React from 'react'; -import { ComponentOverrideProps, ContentTemplate, ImageOnlyContentStyle, LargeImageContentStyle, SmallImageContentStyle } from '../../types/Templates'; -import { ContentViewEvent } from '../../types/ContentViewEvent'; -import { PressableProps } from 'react-native'; -import { ContentCardTemplate } from '../../../models'; -export type ContentCardEventListener = (event: ContentViewEvent, data?: ContentTemplate, nativeEvent?: any) => void; -export interface ContentViewProps extends PressableProps, ComponentOverrideProps { - template: ContentTemplate; - styleOverrides?: { - smallImageStyle?: SmallImageContentStyle; - largeImageStyle?: LargeImageContentStyle; - imageOnlyStyle?: ImageOnlyContentStyle; - }; - listener?: ContentCardEventListener; - variant?: ContentCardTemplate; -} -export declare const ContentCardView: React.FC; diff --git a/packages/messaging/dist/ui/components/ContentCardView/ContentCardView.js b/packages/messaging/dist/ui/components/ContentCardView/ContentCardView.js deleted file mode 100644 index ed0f3264..00000000 --- a/packages/messaging/dist/ui/components/ContentCardView/ContentCardView.js +++ /dev/null @@ -1,258 +0,0 @@ -"use strict"; -/* - Copyright 2025 Adobe. All rights reserved. - This file is licensed to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law - or agreed to in writing, software distributed under the License is - distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF - ANY KIND, either express or implied. See the License for the specific - language governing permissions and limitations under the License. -*/ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ContentCardView = void 0; -const tslib_1 = require("tslib"); -const react_1 = tslib_1.__importStar(require("react")); -const react_native_1 = require("react-native"); -const MessagingEdgeEventType_1 = tslib_1.__importDefault(require("../../../models/MessagingEdgeEventType")); -const DismissButton_1 = tslib_1.__importDefault(require("../DismissButton/DismissButton")); -const theme_1 = require("../../theme"); -const useAspectRatio_1 = tslib_1.__importDefault(require("../../hooks/useAspectRatio")); -const Button_1 = tslib_1.__importDefault(require("../Button/Button")); -const ContentCardView = (_a) => { - var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o; - var { template, listener, variant, styleOverrides: _styleOverrides, style, ContainerProps, ImageContainerProps, ImageProps, ContentContainerProps, TextProps, TitleProps, BodyProps, ButtonContainerProps, ButtonProps, DismissButtonProps } = _a, props = tslib_1.__rest(_a, ["template", "listener", "variant", "styleOverrides", "style", "ContainerProps", "ImageContainerProps", "ImageProps", "ContentContainerProps", "TextProps", "TitleProps", "BodyProps", "ButtonContainerProps", "ButtonProps", "DismissButtonProps"]); - console.log('ContentCardView', template); - const colorScheme = (0, react_native_1.useColorScheme)(); - const [isVisible, setIsVisible] = (0, react_1.useState)(true); - const isDisplayedRef = (0, react_1.useRef)(false); - const theme = (0, theme_1.useTheme)(); - const cardVariant = (0, react_1.useMemo)(() => { var _a; return (_a = variant !== null && variant !== void 0 ? variant : template.type) !== null && _a !== void 0 ? _a : 'SmallImage'; }, [variant, template.type]); - const onDismiss = (0, react_1.useCallback)(() => { - var _a; - listener === null || listener === void 0 ? void 0 : listener('onDismiss', template); - // Track dismiss event using propositionItem - (_a = template.track) === null || _a === void 0 ? void 0 : _a.call(template, MessagingEdgeEventType_1.default.DISMISS); - setIsVisible(false); - }, [listener, template]); - const onPress = (0, react_1.useCallback)(() => { - var _a, _b, _c; - listener === null || listener === void 0 ? void 0 : listener('onInteract', template); - // Track interaction event using propositionItem - (_a = template.track) === null || _a === void 0 ? void 0 : _a.call(template, 'content_clicked', MessagingEdgeEventType_1.default.INTERACT, null); - if ((_c = (_b = template.data) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.actionUrl) { - try { - react_native_1.Linking.openURL(template.data.content.actionUrl); - } - catch (error) { - console.warn(`Failed to open URL: ${template.data.content.actionUrl}`, error); - } - } - }, [template]); - // Call listener on mount to signal view display (only once to prevent duplicates) - (0, react_1.useEffect)(() => { - var _a; - if (!isDisplayedRef.current) { - listener === null || listener === void 0 ? void 0 : listener('onDisplay', template); - // Track display event using propositionItem - (_a = template.track) === null || _a === void 0 ? void 0 : _a.call(template, MessagingEdgeEventType_1.default.DISPLAY); - isDisplayedRef.current = true; - } - }, [listener, template]); - const imageUri = (0, react_1.useMemo)(() => { - var _a, _b, _c, _d; - if (colorScheme === 'dark' && ((_c = (_b = (_a = template.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.image) === null || _c === void 0 ? void 0 : _c.darkUrl)) { - return template.data.content.image.darkUrl; - } - return (_d = template.data.content.image) === null || _d === void 0 ? void 0 : _d.url; - }, [ - colorScheme, - (_d = (_c = (_b = template.data) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.image) === null || _d === void 0 ? void 0 : _d.darkUrl, - (_g = (_f = (_e = template.data) === null || _e === void 0 ? void 0 : _e.content) === null || _f === void 0 ? void 0 : _f.image) === null || _g === void 0 ? void 0 : _g.url - ]); - const imageAspectRatio = (0, useAspectRatio_1.default)(imageUri); - // If not visible, return null to hide the entire view - if (!isVisible) { - return null; - } - if (!template.data) - return null; - const content = (_h = template === null || template === void 0 ? void 0 : template.data) === null || _h === void 0 ? void 0 : _h.content; - if (!content) - return null; - const styleOverrides = (0, react_1.useMemo)(() => { - switch (cardVariant) { - case 'SmallImage': - return _styleOverrides === null || _styleOverrides === void 0 ? void 0 : _styleOverrides.smallImageStyle; - case 'LargeImage': - return _styleOverrides === null || _styleOverrides === void 0 ? void 0 : _styleOverrides.largeImageStyle; - case 'ImageOnly': - return _styleOverrides === null || _styleOverrides === void 0 ? void 0 : _styleOverrides.imageOnlyStyle; - default: - return null; - } - }, [_styleOverrides, cardVariant]); - return ( [ - styles.card, - styleOverrides === null || styleOverrides === void 0 ? void 0 : styleOverrides.card, - typeof style === 'function' ? style(state) : style - ]} {...props}> - - {imageUri && ( - - )} - {cardVariant !== 'ImageOnly' && ( - {((_j = content === null || content === void 0 ? void 0 : content.title) === null || _j === void 0 ? void 0 : _j.content) && ( - {content.title.content} - )} - {((_k = content === null || content === void 0 ? void 0 : content.body) === null || _k === void 0 ? void 0 : _k.content) && ( - {content.body.content} - )} - - {((_l = content === null || content === void 0 ? void 0 : content.buttons) === null || _l === void 0 ? void 0 : _l.length) && - ((_m = content === null || content === void 0 ? void 0 : content.buttons) === null || _m === void 0 ? void 0 : _m.length) > 0 && - content.buttons.map((button) => ())} - - )} - {(content === null || content === void 0 ? void 0 : content.dismissBtn) && ((_o = content.dismissBtn) === null || _o === void 0 ? void 0 : _o.style) !== 'none' && ()} - - ); -}; -exports.ContentCardView = ContentCardView; -const styles = react_native_1.StyleSheet.create({ - card: { - margin: 15, - flex: 1 - }, - container: { - flexDirection: 'column' - }, - imageContainer: { - alignItems: 'center', - borderRadius: 12, - backgroundColor: '#f0f0f0' - }, - image: { - width: '100%', - resizeMode: 'contain' - }, - contentContainer: { - flex: 1, - paddingVertical: 16, - paddingHorizontal: 16, - justifyContent: 'flex-start' - }, - textContent: { - flex: 1, - justifyContent: 'flex-start', - marginBottom: 16 - }, - title: { - fontSize: 16, - fontWeight: '600', - marginBottom: 8, - marginRight: 16 - }, - body: { - fontSize: 14, - lineHeight: 18 - }, - buttonContainer: { - flexDirection: 'row', - justifyContent: 'flex-start', - flexWrap: 'wrap', - paddingTop: 8, - gap: 8 - }, - button: { - marginHorizontal: 8 - } -}); -const smallImageStyles = react_native_1.StyleSheet.create({ - card: { - borderRadius: 12, - flexDirection: 'row', - gap: 8, - maxWidth: '100%', - alignItems: 'center' - }, - container: { - flexDirection: 'row' - }, - imageContainer: { - borderRadius: 12, - maxWidth: '35%', - alignSelf: 'center' - }, - image: { - resizeMode: 'contain', - width: '100%', - maxWidth: '100%' - } -}); -// const largeImageStyles = StyleSheet.create({ -// card: { -// ...styles.card, -// borderRadius: 12, -// gap: 8 -// }, -// container: { -// flexDirection: 'row' -// }, -// imageContainer: { -// alignItems: 'center', -// borderRadius: 12, -// backgroundColor: '#f0f0f0' -// }, -// image: { -// width: '100%', -// resizeMode: 'contain' -// }, -// contentContainer: styles.contentContainer, -// textContent: styles.textContent, -// title: styles.title, -// body: styles.body, -// buttonContainer: styles.buttonContainer, -// button: styles.button -// }); -// const imageOnlyStyles = StyleSheet.create({ -// card: styles.card, -// imageContainer: { -// backgroundColor: '#f0f0f0' -// }, -// image: { -// width: '100%', -// resizeMode: 'contain' -// } -// }); -//# sourceMappingURL=ContentCardView.js.map \ No newline at end of file diff --git a/packages/messaging/dist/ui/components/ContentCardView/ContentCardView.js.map b/packages/messaging/dist/ui/components/ContentCardView/ContentCardView.js.map deleted file mode 100644 index 35890a2e..00000000 --- a/packages/messaging/dist/ui/components/ContentCardView/ContentCardView.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ContentCardView.js","sourceRoot":"","sources":["../../../../src/ui/components/ContentCardView/ContentCardView.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;EA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MAAM;KACjB;CACF,CAAC,CAAC;AAEH,+CAA+C;AAC/C,YAAY;AACZ,sBAAsB;AACtB,wBAAwB;AACxB,aAAa;AACb,OAAO;AACP,iBAAiB;AACjB,2BAA2B;AAC3B,OAAO;AACP,sBAAsB;AACtB,4BAA4B;AAC5B,wBAAwB;AACxB,iCAAiC;AACjC,OAAO;AACP,aAAa;AACb,qBAAqB;AACrB,4BAA4B;AAC5B,OAAO;AACP,+CAA+C;AAC/C,qCAAqC;AACrC,yBAAyB;AACzB,uBAAuB;AACvB,6CAA6C;AAC7C,0BAA0B;AAC1B,MAAM;AAEN,8CAA8C;AAC9C,uBAAuB;AACvB,sBAAsB;AACtB,iCAAiC;AACjC,OAAO;AACP,aAAa;AACb,qBAAqB;AACrB,4BAA4B;AAC5B,MAAM;AACN,MAAM"} \ No newline at end of file diff --git a/packages/messaging/dist/ui/components/DismissButton/DismissButton.d.ts b/packages/messaging/dist/ui/components/DismissButton/DismissButton.d.ts deleted file mode 100644 index 402db70d..00000000 --- a/packages/messaging/dist/ui/components/DismissButton/DismissButton.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/// -import { PressableProps, TextStyle } from 'react-native'; -export interface DismissButtonProps extends PressableProps { - textStyle?: TextStyle; - onPress?: () => void; - type: 'simple' | 'circle'; -} -declare const DismissButton: ({ onPress, type, textStyle, style, ...props }: DismissButtonProps) => import("react").JSX.Element; -export default DismissButton; diff --git a/packages/messaging/dist/ui/components/DismissButton/DismissButton.js b/packages/messaging/dist/ui/components/DismissButton/DismissButton.js deleted file mode 100644 index 7405e267..00000000 --- a/packages/messaging/dist/ui/components/DismissButton/DismissButton.js +++ /dev/null @@ -1,71 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const tslib_1 = require("tslib"); -/* - Copyright 2025 Adobe. All rights reserved. - This file is licensed to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law - or agreed to in writing, software distributed under the License is - distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF - ANY KIND, either express or implied. See the License for the specific - language governing permissions and limitations under the License. -*/ -const react_native_1 = require("react-native"); -const DismissButton = (_a) => { - var { onPress, type, textStyle, style } = _a, props = tslib_1.__rest(_a, ["onPress", "type", "textStyle", "style"]); - const colorScheme = (0, react_native_1.useColorScheme)(); - return ( [ - styles.container, - type === 'simple' && styles.simple, - type === 'circle' && [ - styles.circle, - { - backgroundColor: colorScheme === 'dark' - ? 'rgba(255,255,255,0.1)' - : 'rgba(0,0,0,0.1)' - } - ], - state.pressed && styles.pressed, - typeof style === 'function' ? style(state) : style - ]} {...props}> - - x - - ); -}; -exports.default = DismissButton; -const styles = react_native_1.StyleSheet.create({ - container: { - position: 'absolute', - top: 6, - right: 6, - zIndex: 1000, - justifyContent: 'center', - alignItems: 'center', - minWidth: 18, - minHeight: 18, - }, - pressed: { - opacity: 0.7 - }, - simple: { - backgroundColor: 'transparent' - }, - circle: { - borderRadius: 10, - width: 18, - height: 18 - }, - text: { - fontSize: 14, - fontWeight: 'bold', - textAlign: 'center' - } -}); -//# sourceMappingURL=DismissButton.js.map \ No newline at end of file diff --git a/packages/messaging/dist/ui/components/DismissButton/DismissButton.js.map b/packages/messaging/dist/ui/components/DismissButton/DismissButton.js.map deleted file mode 100644 index 9eea470c..00000000 --- a/packages/messaging/dist/ui/components/DismissButton/DismissButton.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DismissButton.js","sourceRoot":"","sources":["../../../../src/ui/components/DismissButton/DismissButton.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;EAUE;AACF,+CAOsB;AAQtB,MAAM,aAAa,GAAG,CAAC,EAMF,EAAE,EAAE;QANF,EACrB,OAAO,EACP,IAAI,EACJ,SAAS,EACT,KAAK,OAEc,EADhB,KAAK,sBALa,yCAMtB,CADS;IAER,MAAM,WAAW,GAAG,IAAA,6BAAc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AY,EAAE,EAAE;QAChB,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;KACX;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;QAClB,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/messaging/dist/ui/components/DismissButton/DismissButton.spec.d.ts b/packages/messaging/dist/ui/components/DismissButton/DismissButton.spec.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/packages/messaging/dist/ui/components/DismissButton/DismissButton.spec.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/messaging/dist/ui/components/DismissButton/DismissButton.spec.js b/packages/messaging/dist/ui/components/DismissButton/DismissButton.spec.js deleted file mode 100644 index 47c2d415..00000000 --- a/packages/messaging/dist/ui/components/DismissButton/DismissButton.spec.js +++ /dev/null @@ -1,306 +0,0 @@ -"use strict"; -// /* -// Copyright 2025 Adobe. All rights reserved. -// This file is licensed to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law -// or agreed to in writing, software distributed under the License is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF -// ANY KIND, either express or implied. See the License for the specific -// language governing permissions and limitations under the License. -// */ -// import React from 'react'; -// import { render, screen, fireEvent } from '@testing-library/react-native'; -// import { useColorScheme } from 'react-native'; -// import DismissButton from './DismissButton'; -Object.defineProperty(exports, "__esModule", { value: true }); -// // Mock useColorScheme -// jest.mock('react-native', () => { -// const RN = jest.requireActual('react-native'); -// return { -// ...RN, -// useColorScheme: jest.fn() -// }; -// }); -// const mockUseColorScheme = useColorScheme as jest.MockedFunction< -// typeof useColorScheme -// >; -// describe('DismissButton', () => { -// const mockOnPress = jest.fn(); -// beforeEach(() => { -// jest.clearAllMocks(); -// mockUseColorScheme.mockReturnValue('light'); -// }); -// describe('Basic rendering', () => { -// it('should render a dismiss button with type "simple"', () => { -// render(); -// const button = screen.getByText('x'); -// expect(button).toBeTruthy(); -// }); -// it('should render a dismiss button with type "circle"', () => { -// render(); -// const button = screen.getByText('x'); -// expect(button).toBeTruthy(); -// }); -// it('should display "x" as the button text', () => { -// render(); -// expect(screen.getByText('x')).toBeTruthy(); -// }); -// }); -// describe('Press handling', () => { -// it('should call onPress when the button is pressed', () => { -// render(); -// const button = screen.getByText('x'); -// fireEvent.press(button); -// expect(mockOnPress).toHaveBeenCalledTimes(1); -// }); -// it('should call onPress multiple times when pressed multiple times', () => { -// render(); -// const button = screen.getByText('x'); -// fireEvent.press(button); -// fireEvent.press(button); -// fireEvent.press(button); -// expect(mockOnPress).toHaveBeenCalledTimes(3); -// }); -// }); -// describe('Color scheme handling', () => { -// it('should apply light color scheme styles', () => { -// mockUseColorScheme.mockReturnValue('light'); -// render(); -// const text = screen.getByText('x'); -// expect(text.props.style).toEqual( -// expect.arrayContaining([ -// expect.objectContaining({ -// color: 'black' -// }) -// ]) -// ); -// }); -// it('should apply dark color scheme styles', () => { -// mockUseColorScheme.mockReturnValue('dark'); -// render(); -// const text = screen.getByText('x'); -// expect(text.props.style).toEqual( -// expect.arrayContaining([ -// expect.objectContaining({ -// color: 'white' -// }) -// ]) -// ); -// }); -// it('should apply correct background color for circle type in light mode', () => { -// mockUseColorScheme.mockReturnValue('light'); -// const { getByTestId } = render( -// -// ); -// const button = getByTestId('dismiss-button'); -// expect(button.props.style).toEqual( -// expect.arrayContaining([ -// expect.objectContaining({ -// backgroundColor: 'rgba(0,0,0,0.1)' -// }) -// ]) -// ); -// }); -// it('should apply correct background color for circle type in dark mode', () => { -// mockUseColorScheme.mockReturnValue('dark'); -// const { getByTestId } = render( -// -// ); -// const button = getByTestId('dismiss-button'); -// expect(button.props.style).toEqual( -// expect.arrayContaining([ -// expect.objectContaining({ -// backgroundColor: 'rgba(255,255,255,0.1)' -// }) -// ]) -// ); -// }); -// }); -// describe('Type variations', () => { -// it('should apply simple type styles', () => { -// const { getByTestId } = render( -// -// ); -// const button = getByTestId('dismiss-button'); -// expect(button.props.style).toEqual( -// expect.arrayContaining([ -// expect.objectContaining({ -// backgroundColor: 'transparent' -// }) -// ]) -// ); -// }); -// it('should apply circle type styles', () => { -// const { getByTestId } = render( -// -// ); -// const button = getByTestId('dismiss-button'); -// expect(button.props.style).toEqual( -// expect.arrayContaining([ -// expect.objectContaining({ -// borderRadius: 10, -// width: 18, -// height: 18 -// }) -// ]) -// ); -// }); -// }); -// describe('Custom props and styles', () => { -// it('should accept and apply custom style props', () => { -// const customStyle = { opacity: 0.5 }; -// const { getByTestId } = render( -// -// ); -// const button = getByTestId('dismiss-button'); -// expect(button.props.style).toEqual( -// expect.arrayContaining([ -// expect.objectContaining({ -// opacity: 0.5 -// }) -// ]) -// ); -// }); -// it('should accept function-based style props', () => { -// const styleFn = jest.fn().mockReturnValue({ opacity: 0.8 }); -// const { getByTestId } = render( -// -// ); -// expect(styleFn).toHaveBeenCalled(); -// const button = getByTestId('dismiss-button'); -// expect(button.props.style).toEqual( -// expect.arrayContaining([ -// expect.objectContaining({ -// opacity: 0.8 -// }) -// ]) -// ); -// }); -// it('should accept additional Pressable props', () => { -// const { getByTestId } = render( -// -// ); -// const button = getByTestId('dismiss-button'); -// expect(button.props.disabled).toBe(true); -// expect(button.props.accessibilityLabel).toBe('Close button'); -// }); -// }); -// describe('Accessibility', () => { -// it('should be accessible by default', () => { -// const { getByTestId } = render( -// -// ); -// const button = getByTestId('dismiss-button'); -// expect(button).toBeTruthy(); -// }); -// it('should accept custom accessibility props', () => { -// const { getByTestId } = render( -// -// ); -// const button = getByTestId('dismiss-button'); -// expect(button.props.accessibilityLabel).toBe('Dismiss notification'); -// expect(button.props.accessibilityHint).toBe( -// 'Double tap to close this notification' -// ); -// }); -// }); -// describe('Positioning and layout', () => { -// it('should have absolute positioning styles', () => { -// const { getByTestId } = render( -// -// ); -// const button = getByTestId('dismiss-button'); -// expect(button.props.style).toEqual( -// expect.arrayContaining([ -// expect.objectContaining({ -// position: 'absolute', -// top: 6, -// right: 6, -// zIndex: 1000 -// }) -// ]) -// ); -// }); -// it('should have minimum dimensions', () => { -// const { getByTestId } = render( -// -// ); -// const button = getByTestId('dismiss-button'); -// expect(button.props.style).toEqual( -// expect.arrayContaining([ -// expect.objectContaining({ -// minWidth: 18, -// minHeight: 18 -// }) -// ]) -// ); -// }); -// }); -// describe('Edge cases', () => { -// it('should handle undefined color scheme gracefully', () => { -// mockUseColorScheme.mockReturnValue(undefined as any); -// expect(() => { -// render(); -// }).not.toThrow(); -// }); -// it('should handle null color scheme gracefully', () => { -// mockUseColorScheme.mockReturnValue(null as any); -// expect(() => { -// render(); -// }).not.toThrow(); -// }); -// }); -// }); -//# sourceMappingURL=DismissButton.spec.js.map \ No newline at end of file diff --git a/packages/messaging/dist/ui/components/DismissButton/DismissButton.spec.js.map b/packages/messaging/dist/ui/components/DismissButton/DismissButton.spec.js.map deleted file mode 100644 index 4c1447f9..00000000 --- a/packages/messaging/dist/ui/components/DismissButton/DismissButton.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DismissButton.spec.js","sourceRoot":"","sources":["../../../../src/ui/components/DismissButton/DismissButton.spec.tsx"],"names":[],"mappings":";AAAA,KAAK;AACL,iDAAiD;AACjD,8EAA8E;AAC9E,mFAAmF;AACnF,8CAA8C;AAC9C,mFAAmF;AACnF,yEAAyE;AACzE,gFAAgF;AAChF,4EAA4E;AAC5E,wEAAwE;AACxE,KAAK;AACL,6BAA6B;AAC7B,6EAA6E;AAC7E,iDAAiD;AACjD,+CAA+C;;AAE/C,yBAAyB;AACzB,oCAAoC;AACpC,mDAAmD;AACnD,aAAa;AACb,aAAa;AACb,gCAAgC;AAChC,OAAO;AACP,MAAM;AAEN,oEAAoE;AACpE,0BAA0B;AAC1B,KAAK;AAEL,oCAAoC;AACpC,mCAAmC;AAEnC,uBAAuB;AACvB,4BAA4B;AAC5B,mDAAmD;AAC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E,0BAA0B;AAC1B,UAAU;AACV,QAAQ;AACR,MAAM"} \ No newline at end of file diff --git a/packages/messaging/dist/ui/components/ImageOnlyCard/ImageOnlyCard.d.ts b/packages/messaging/dist/ui/components/ImageOnlyCard/ImageOnlyCard.d.ts deleted file mode 100644 index 03e7f733..00000000 --- a/packages/messaging/dist/ui/components/ImageOnlyCard/ImageOnlyCard.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import React from 'react'; -import { ImageStyle, PressableProps, ViewStyle } from 'react-native'; -import { ImageOnlyContent } from '../../../models/ContentCard'; -import { ComponentOverrideProps } from '../../types'; -export type ImageOnlyContentProps = Pick & { - content: ImageOnlyContent; - height?: number; - imageUri?: string; - styleOverrides?: ImageOnlyContentStyle; - onDismiss?: () => void; - onPress?: () => void; -}; -export interface ImageOnlyContentStyle { - card?: Partial; - imageContainer?: Partial; - image?: Partial; - dismissButton?: PressableProps['style']; -} -/** - * Renders an image only card component. - * - * @param props - an object of type [ImageOnlyContentProps], which contains the properties for the image only card component. - * @returns The rendered image only card component. - */ -declare const ImageOnlyCard: React.FC; -export default ImageOnlyCard; diff --git a/packages/messaging/dist/ui/components/ImageOnlyCard/ImageOnlyCard.js b/packages/messaging/dist/ui/components/ImageOnlyCard/ImageOnlyCard.js deleted file mode 100644 index d91bafe7..00000000 --- a/packages/messaging/dist/ui/components/ImageOnlyCard/ImageOnlyCard.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const tslib_1 = require("tslib"); -/* - Copyright 2025 Adobe. All rights reserved. - This file is licensed to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law - or agreed to in writing, software distributed under the License is - distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF - ANY KIND, either express or implied. See the License for the specific - language governing permissions and limitations under the License. -*/ -const react_1 = tslib_1.__importDefault(require("react")); -const react_native_1 = require("react-native"); -const DismissButton_1 = tslib_1.__importDefault(require("../DismissButton/DismissButton")); -const useAspectRatio_1 = tslib_1.__importDefault(require("../../hooks/useAspectRatio")); -/** - * Renders an image only card component. - * - * @param props - an object of type [ImageOnlyContentProps], which contains the properties for the image only card component. - * @returns The rendered image only card component. - */ -const ImageOnlyCard = ({ content, imageUri, onDismiss, onPress, styleOverrides, ContainerProps, ImageContainerProps, ImageProps, DismissButtonProps }) => { - var _a; - const imageAspectRatio = (0, useAspectRatio_1.default)(imageUri); - return ( - - - {((_a = content.dismissBtn) === null || _a === void 0 ? void 0 : _a.style) && content.dismissBtn.style !== 'none' && ()} - - ); -}; -exports.default = ImageOnlyCard; -const styles = react_native_1.StyleSheet.create({ - card: { - margin: 15, - flex: 1 - }, - imageContainer: { - backgroundColor: '#f0f0f0' - }, - image: { - width: '100%', - flex: 1 - } -}); -//# sourceMappingURL=ImageOnlyCard.js.map \ No newline at end of file diff --git a/packages/messaging/dist/ui/components/ImageOnlyCard/ImageOnlyCard.js.map b/packages/messaging/dist/ui/components/ImageOnlyCard/ImageOnlyCard.js.map deleted file mode 100644 index 68a4e1f5..00000000 --- a/packages/messaging/dist/ui/components/ImageOnlyCard/ImageOnlyCard.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ImageOnlyCard.js","sourceRoot":"","sources":["../../../../src/ui/components/ImageOnlyCard/ImageOnlyCard.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;EAUE;AACF,0DAA0B;AAC1B,+CAQsB;AACtB,2FAA2D;AAE3D,wFAAwD;AAqBxD;;;;;GAKG;AACH,MAAM,aAAa,GAAoC,CAAC,EACtD,OAAO,EACP,QAAQ,EACR,SAAS,EACT,OAAO,EACP,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,UAAU,EACV,kBAAkB,EACnB,EAAE,EAAE;;IACH,MAAM,gBAAgB,GAAG,IAAA,wBAAc,EAAC,QAAQ,CAAC,CAAC;IAElD,OAA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Ae,EAAE,SAAS;KAC3B;IACD,KAAK,EAAE;QACL,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,CAAC;KACR;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/messaging/dist/ui/components/ImageOnlyCard/ImageOnlyCard.spec.d.ts b/packages/messaging/dist/ui/components/ImageOnlyCard/ImageOnlyCard.spec.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/packages/messaging/dist/ui/components/ImageOnlyCard/ImageOnlyCard.spec.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/messaging/dist/ui/components/ImageOnlyCard/ImageOnlyCard.spec.js b/packages/messaging/dist/ui/components/ImageOnlyCard/ImageOnlyCard.spec.js deleted file mode 100644 index 6a0240bd..00000000 --- a/packages/messaging/dist/ui/components/ImageOnlyCard/ImageOnlyCard.spec.js +++ /dev/null @@ -1,623 +0,0 @@ -"use strict"; -// /* -// Copyright 2025 Adobe. All rights reserved. -// This file is licensed to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law -// or agreed to in writing, software distributed under the License is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF -// ANY KIND, either express or implied. See the License for the specific -// language governing permissions and limitations under the License. -// */ -Object.defineProperty(exports, "__esModule", { value: true }); -// import React from 'react'; -// import { render, screen, fireEvent } from '@testing-library/react-native'; -// import { Image } from 'react-native'; -// import ImageOnlyCard from './ImageOnlyCard'; -// import { ImageOnlyContent } from '../../../models/ContentCard'; -// // Mock dependencies -// jest.mock('react-native', () => { -// const RN = jest.requireActual('react-native'); -// return { -// ...RN, -// Image: { -// ...RN.Image, -// getSize: jest.fn() -// } -// }; -// }); -// jest.mock('../../hooks/useAspectRatio', () => { -// return jest.fn(() => 1.5); -// }); -// const mockImageGetSize = Image.getSize as jest.MockedFunction; -// describe('ImageOnlyCard', () => { -// const mockOnPress = jest.fn(); -// const mockOnDismiss = jest.fn(); -// const baseContent: ImageOnlyContent = { -// image: { -// url: 'https://example.com/image.jpg', -// alt: 'Test image' -// }, -// dismissBtn: { -// style: 'circle' -// }, -// actionUrl: 'https://example.com/action' -// }; -// beforeEach(() => { -// jest.clearAllMocks(); -// mockImageGetSize.mockImplementation((uri, success) => { -// success(400, 300); -// }); -// }); -// describe('Basic rendering', () => { -// it('should render the component with image', () => { -// const { UNSAFE_getByType } = render( -// -// ); -// const image = UNSAFE_getByType(Image); -// expect(image).toBeTruthy(); -// }); -// it('should render dismiss button when dismissBtn style is provided', () => { -// render( -// -// ); -// expect(screen.getByText('x')).toBeTruthy(); -// }); -// it('should not render dismiss button when dismissBtn style is "none"', () => { -// const contentWithNoDismiss = { -// ...baseContent, -// dismissBtn: { style: 'none' as const } -// }; -// render( -// -// ); -// expect(screen.queryByText('x')).toBeNull(); -// }); -// it('should not render dismiss button when dismissBtn is not provided', () => { -// const contentWithoutDismiss = { -// ...baseContent, -// dismissBtn: undefined -// }; -// render( -// -// ); -// expect(screen.queryByText('x')).toBeNull(); -// }); -// it('should render with default image placeholder background', () => { -// render( -// -// ); -// // Component renders successfully with default styling -// const { UNSAFE_getByType } = render( -// -// ); -// expect(UNSAFE_getByType(Image)).toBeTruthy(); -// }); -// }); -// describe('Content variations', () => { -// it('should handle content with only image', () => { -// const imageOnlyContent = { -// image: { -// url: 'https://example.com/image.jpg' -// } -// }; -// const { UNSAFE_getByType } = render( -// -// ); -// expect(UNSAFE_getByType(Image)).toBeTruthy(); -// expect(screen.queryByText('x')).toBeNull(); -// }); -// it('should handle content with image and action URL', () => { -// const contentWithAction = { -// ...baseContent, -// actionUrl: 'https://example.com/action' -// }; -// const { UNSAFE_getByType } = render( -// -// ); -// expect(UNSAFE_getByType(Image)).toBeTruthy(); -// }); -// it('should handle different dismiss button styles', () => { -// const contentWithSimpleDismiss = { -// ...baseContent, -// dismissBtn: { style: 'simple' as const } -// }; -// render( -// -// ); -// expect(screen.getByText('x')).toBeTruthy(); -// }); -// }); -// describe('Interaction handling', () => { -// it('should call onPress when the card is pressed', () => { -// const { getByTestId } = render( -// -// ); -// const card = getByTestId('image-only-card'); -// fireEvent.press(card); -// expect(mockOnPress).toHaveBeenCalledTimes(1); -// }); -// it('should call onDismiss when dismiss button is pressed', () => { -// render( -// -// ); -// const dismissButton = screen.getByText('x'); -// fireEvent.press(dismissButton); -// expect(mockOnDismiss).toHaveBeenCalledTimes(1); -// }); -// it('should handle missing onPress callback gracefully', () => { -// expect(() => { -// render( -// -// ); -// }).not.toThrow(); -// }); -// it('should handle missing onDismiss callback gracefully', () => { -// expect(() => { -// render( -// -// ); -// }).not.toThrow(); -// }); -// }); -// describe('Style overrides', () => { -// it('should apply custom card styles', () => { -// const customStyles = { -// card: { backgroundColor: 'green', margin: 30 } -// }; -// const { getByTestId } = render( -// -// ); -// const card = getByTestId('image-only-card'); -// expect(card.props.style).toEqual( -// expect.arrayContaining([ -// expect.objectContaining({ -// backgroundColor: 'green', -// margin: 30 -// }) -// ]) -// ); -// }); -// it('should apply custom image container styles', () => { -// const customStyles = { -// imageContainer: { backgroundColor: 'blue', borderRadius: 15 } -// }; -// render( -// -// ); -// // Image container styles are applied but harder to test directly -// // This ensures no errors are thrown when applying custom styles -// const { UNSAFE_getByType } = render( -// -// ); -// expect(UNSAFE_getByType(Image)).toBeTruthy(); -// }); -// it('should apply custom image styles', () => { -// const customStyles = { -// image: { opacity: 0.7, borderRadius: 10 } -// }; -// render( -// -// ); -// // Image styles are applied but harder to test directly -// // This ensures no errors are thrown when applying custom styles -// const { UNSAFE_getByType } = render( -// -// ); -// expect(UNSAFE_getByType(Image)).toBeTruthy(); -// }); -// it('should apply custom dismiss button styles', () => { -// const customStyles = { -// dismissButton: { backgroundColor: 'red', opacity: 0.8 } -// }; -// render( -// -// ); -// expect(screen.getByText('x')).toBeTruthy(); -// }); -// }); -// describe('Component props forwarding', () => { -// it('should forward ContainerProps', () => { -// const containerProps = { -// testID: 'custom-container', -// accessibilityLabel: 'Image only card container' -// }; -// const { getByTestId } = render( -// -// ); -// const container = getByTestId('custom-container'); -// expect(container.props.accessibilityLabel).toBe('Image only card container'); -// }); -// it('should forward ImageContainerProps', () => { -// const imageContainerProps = { -// testID: 'custom-image-container', -// accessibilityLabel: 'Image container' -// }; -// render( -// -// ); -// // Component renders without errors when props are forwarded -// const { UNSAFE_getByType } = render( -// -// ); -// expect(UNSAFE_getByType(Image)).toBeTruthy(); -// }); -// it('should forward ImageProps', () => { -// const imageProps = { -// testID: 'custom-image', -// accessibilityLabel: 'Custom image' -// }; -// render( -// -// ); -// // Component renders without errors when props are forwarded -// const { UNSAFE_getByType } = render( -// -// ); -// expect(UNSAFE_getByType(Image)).toBeTruthy(); -// }); -// it('should forward DismissButtonProps', () => { -// const dismissButtonProps = { -// testID: 'custom-dismiss-button', -// accessibilityLabel: 'Close image' -// }; -// render( -// -// ); -// expect(screen.getByText('x')).toBeTruthy(); -// }); -// }); -// describe('Accessibility', () => { -// it('should accept custom accessibility props through ContainerProps', () => { -// const containerProps = { -// testID: 'image-only-card', -// accessibilityLabel: 'Image only content card', -// accessibilityHint: 'Double tap to view full image' -// }; -// const { getByTestId } = render( -// -// ); -// const card = getByTestId('image-only-card'); -// expect(card.props.accessibilityLabel).toBe('Image only content card'); -// expect(card.props.accessibilityHint).toBe('Double tap to view full image'); -// }); -// it('should support disabled state through ContainerProps', () => { -// const containerProps = { -// testID: 'image-only-card', -// disabled: true -// }; -// const { getByTestId } = render( -// -// ); -// const card = getByTestId('image-only-card'); -// expect(card.props.disabled).toBe(true); -// }); -// }); -// describe('Props forwarding', () => { -// it('should forward additional Pressable props through ContainerProps', () => { -// const containerProps = { -// testID: 'image-only-card', -// hitSlop: 20, -// delayLongPress: 700 -// }; -// const { getByTestId } = render( -// -// ); -// const card = getByTestId('image-only-card'); -// expect(card.props.hitSlop).toBe(20); -// expect(card.props.delayLongPress).toBe(700); -// }); -// }); -// describe('Edge cases', () => { -// it('should handle undefined content gracefully', () => { -// expect(() => { -// render( -// -// ); -// }).not.toThrow(); -// }); -// it('should handle empty content object', () => { -// expect(() => { -// render( -// -// ); -// }).not.toThrow(); -// }); -// it('should handle missing imageUri gracefully', () => { -// expect(() => { -// render( -// -// ); -// }).not.toThrow(); -// }); -// it('should handle image loading errors gracefully', () => { -// mockImageGetSize.mockImplementation((uri, success, error) => { -// error(new Error('Image load failed')); -// }); -// expect(() => { -// render( -// -// ); -// }).not.toThrow(); -// }); -// it('should handle content with null dismissBtn', () => { -// const contentWithNullDismiss = { -// ...baseContent, -// dismissBtn: null as any -// }; -// expect(() => { -// render( -// -// ); -// }).not.toThrow(); -// }); -// }); -// describe('Layout and styling', () => { -// it('should apply aspect ratio to image when provided', () => { -// render( -// -// ); -// // useAspectRatio hook is mocked to return 1.5 -// // This ensures the component uses the hook correctly -// const { UNSAFE_getByType } = render( -// -// ); -// expect(UNSAFE_getByType(Image)).toBeTruthy(); -// }); -// it('should handle height prop', () => { -// expect(() => { -// render( -// -// ); -// }).not.toThrow(); -// }); -// it('should render image with contain resize mode', () => { -// const { UNSAFE_getByType } = render( -// -// ); -// const image = UNSAFE_getByType(Image); -// expect(image.props.resizeMode).toBe('contain'); -// }); -// it('should position dismiss button within image container', () => { -// render( -// -// ); -// // Dismiss button should be rendered within the image container -// expect(screen.getByText('x')).toBeTruthy(); -// }); -// }); -// describe('Image source handling', () => { -// it('should use provided imageUri as image source', () => { -// const testImageUri = 'https://example.com/test-image.jpg'; -// const { UNSAFE_getByType } = render( -// -// ); -// const image = UNSAFE_getByType(Image); -// expect(image.props.source).toEqual({ uri: testImageUri }); -// }); -// it('should handle undefined imageUri', () => { -// const { UNSAFE_getByType } = render( -// -// ); -// const image = UNSAFE_getByType(Image); -// expect(image.props.source).toEqual({ uri: undefined }); -// }); -// }); -// }); -//# sourceMappingURL=ImageOnlyCard.spec.js.map \ No newline at end of file diff --git a/packages/messaging/dist/ui/components/ImageOnlyCard/ImageOnlyCard.spec.js.map b/packages/messaging/dist/ui/components/ImageOnlyCard/ImageOnlyCard.spec.js.map deleted file mode 100644 index d56a74d7..00000000 --- a/packages/messaging/dist/ui/components/ImageOnlyCard/ImageOnlyCard.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ImageOnlyCard.spec.js","sourceRoot":"","sources":["../../../../src/ui/components/ImageOnlyCard/ImageOnlyCard.spec.tsx"],"names":[],"mappings":";AAAA,KAAK;AACL,iDAAiD;AACjD,8EAA8E;AAC9E,mFAAmF;AACnF,8CAA8C;AAC9C,mFAAmF;AACnF,yEAAyE;AACzE,gFAAgF;AAChF,4EAA4E;AAC5E,wEAAwE;AACxE,KAAK;;AAEL,6BAA6B;AAC7B,6EAA6E;AAC7E,wCAAwC;AACxC,+CAA+C;AAC/C,kEAAkE;AAElE,uBAAuB;AACvB,oCAAoC;AACpC,mDAAmD;AACnD,aAAa;AACb,aAAa;AACb,eAAe;AACf,qBAAqB;AACrB,2BAA2B;AAC3B,QAAQ;AACR,OAAO;AACP,MAAM;AAEN,kDAAkD;AAClD,+BAA+B;AAC/B,MAAM;AAEN,uFAAuF;AAEvF,oCAAoC;AACpC,mCAAmC;AACnC,qCAAqC;AAErC,4CAA4C;AAC5C,eAAe;AACf,8CAA8C;AAC9C,0BAA0B;AAC1B,SAAS;AACT,oBAAoB;AACpB,wBAAwB;AACxB,SAAS;AACT,8CAA8C;AAC9C,OAAO;AAEP,uBAAuB;AACvB,4BAA4B;AAC5B,8DAA8D;AAC9D,2BAA2B;AAC3B,UAAU;AACV,QAAQ;AAER,wCAAwC;AACxC,2DAA2D;AAC3D,6CAA6C;AAC7C,yBAAyB;AACzB,kCAAkC;AAClC,qDAAqD;AACrD,kCAAkC;AAClC,sCAAsC;AACtC,aAAa;AACb,WAAW;AAEX,+CAA+C;AAC/C,oCAAoC;AACpC,UAAU;AAEV,mFAAmF;AACnF,gBAAgB;AAChB,yBAAyB;AACzB,kCAAkC;AAClC,qDAAqD;AACrD,kCAAkC;AACl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aAAa;AACb,WAAW;AAEX,+CAA+C;AAC/C,mEAAmE;AACnE,UAAU;AAEV,qDAAqD;AACrD,6CAA6C;AAC7C,yBAAyB;AACzB,kCAAkC;AAClC,iCAAiC;AACjC,kCAAkC;AAClC,sCAAsC;AACtC,aAAa;AACb,WAAW;AAEX,+CAA+C;AAC/C,gEAAgE;AAChE,UAAU;AACV,QAAQ;AACR,MAAM"} \ No newline at end of file diff --git a/packages/messaging/dist/ui/components/LargeImageCard/LargeImageCard.d.ts b/packages/messaging/dist/ui/components/LargeImageCard/LargeImageCard.d.ts deleted file mode 100644 index dc6e9369..00000000 --- a/packages/messaging/dist/ui/components/LargeImageCard/LargeImageCard.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import React from 'react'; -import { ButtonProps, ImageProps, ImageStyle, PressableProps, TextProps, TextStyle, ViewProps, ViewStyle } from 'react-native'; -import { LargeImageContentData } from '../../../models/ContentCard'; -import { DismissButtonProps } from '../DismissButton/DismissButton'; -export interface LargeImageContentStyle { - card?: ViewStyle; - container?: ViewStyle; - imageContainer?: ViewStyle; - image?: ImageStyle; - contentContainer?: ViewStyle; - textContent?: ViewStyle; - title?: TextStyle; - body?: TextStyle; - buttonContainer?: ViewStyle; - button?: PressableProps['style']; - buttonText?: TextStyle; - dismissButton?: PressableProps['style']; -} -export interface LargeImageCardProps extends PressableProps { - content: LargeImageContentData; - imageUri?: string; - styleOverrides?: LargeImageContentStyle; - onDismiss?: () => void; - onPress?: () => void; - ContainerProps?: ViewProps; - ImageContainerProps?: ViewProps; - ImageProps?: ImageProps; - TextProps?: TextProps; - TitleProps?: TextProps; - BodyProps?: TextProps; - ButtonContainerProps?: ViewProps; - ButtonProps?: ButtonProps; - DismissButtonProps?: DismissButtonProps; -} -declare const LargeImageCard: React.FC; -export default LargeImageCard; diff --git a/packages/messaging/dist/ui/components/LargeImageCard/LargeImageCard.js b/packages/messaging/dist/ui/components/LargeImageCard/LargeImageCard.js deleted file mode 100644 index 7d76795f..00000000 --- a/packages/messaging/dist/ui/components/LargeImageCard/LargeImageCard.js +++ /dev/null @@ -1,106 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const tslib_1 = require("tslib"); -/* - Copyright 2025 Adobe. All rights reserved. - This file is licensed to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law - or agreed to in writing, software distributed under the License is - distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF - ANY KIND, either express or implied. See the License for the specific - language governing permissions and limitations under the License. -*/ -const react_1 = tslib_1.__importDefault(require("react")); -const react_native_1 = require("react-native"); -const Button_1 = tslib_1.__importDefault(require("../Button/Button")); -const DismissButton_1 = tslib_1.__importDefault(require("../DismissButton/DismissButton")); -const useAspectRatio_1 = tslib_1.__importDefault(require("../../hooks/useAspectRatio")); -const ThemeProvider_1 = require("../../theme/ThemeProvider"); -const LargeImageCard = (_a) => { - var _b, _c, _d, _e, _f; - var { BodyProps, ButtonContainerProps, ButtonProps, ContainerProps, DismissButtonProps, ImageContainerProps, ImageProps, TextProps, TitleProps, content, imageUri, styleOverrides, onDismiss, onPress } = _a, props = tslib_1.__rest(_a, ["BodyProps", "ButtonContainerProps", "ButtonProps", "ContainerProps", "DismissButtonProps", "ImageContainerProps", "ImageProps", "TextProps", "TitleProps", "content", "imageUri", "styleOverrides", "onDismiss", "onPress"]); - const theme = (0, ThemeProvider_1.useTheme)(); - const imageAspectRatio = (0, useAspectRatio_1.default)(imageUri); - return ( - {imageUri && ( - - )} - {((_b = content === null || content === void 0 ? void 0 : content.title) === null || _b === void 0 ? void 0 : _b.content) && ( - {content.title.content} - )} - {((_c = content === null || content === void 0 ? void 0 : content.body) === null || _c === void 0 ? void 0 : _c.content) && ( - {content.body.content} - )} - - {((_d = content === null || content === void 0 ? void 0 : content.buttons) === null || _d === void 0 ? void 0 : _d.length) && - ((_e = content === null || content === void 0 ? void 0 : content.buttons) === null || _e === void 0 ? void 0 : _e.length) > 0 && - content.buttons.map((button) => ())} - - {(content === null || content === void 0 ? void 0 : content.dismissBtn) && ((_f = content.dismissBtn) === null || _f === void 0 ? void 0 : _f.style) !== 'none' && ()} - ); -}; -exports.default = LargeImageCard; -const styles = react_native_1.StyleSheet.create({ - card: { - borderRadius: 12, - margin: 15, - flex: 1, - gap: 8 - }, - container: { - flexDirection: 'row' - }, - imageContainer: { - borderRadius: 12, - alignItems: 'center' - }, - image: { - width: '100%', - resizeMode: 'contain' - }, - contentContainer: { - flex: 1, - paddingVertical: 16, - paddingHorizontal: 16, - justifyContent: 'flex-start' - }, - textContent: { - flex: 1, - justifyContent: 'flex-start', - marginBottom: 16 - }, - title: { - fontSize: 16, - fontWeight: '600', - marginBottom: 8, - marginRight: 16 - }, - body: { - fontSize: 14, - lineHeight: 18 - }, - buttonContainer: { - flexDirection: 'row', - justifyContent: 'flex-start', - paddingTop: 8, - gap: 8 - }, - button: { - marginHorizontal: 8 - } -}); -//# sourceMappingURL=LargeImageCard.js.map \ No newline at end of file diff --git a/packages/messaging/dist/ui/components/LargeImageCard/LargeImageCard.js.map b/packages/messaging/dist/ui/components/LargeImageCard/LargeImageCard.js.map deleted file mode 100644 index 758f2367..00000000 --- a/packages/messaging/dist/ui/components/LargeImageCard/LargeImageCard.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"LargeImageCard.js","sourceRoot":"","sources":["../../../../src/ui/components/LargeImageCard/LargeImageCard.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;EAUE;AACF,0DAA0B;AAC1B,+CAcsB;AAEtB,sEAAsC;AACtC,2FAEwC;AACxC,wFAAwD;AACxD,6DAAqD;AAkCrD,MAAM,cAAc,GAAkC,CAAC,EAgBtD,EAAE,EAAE;;QAhBkD,EACrD,SAAS,EACT,oBAAoB,EACpB,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,EACV,SAAS,EACT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e,EAAE;QACf,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,YAAY;QAC5B,UAAU,EAAE,CAAC;QACb,GAAG,EAAE,CAAC;KACP;IACD,MAAM,EAAE;QACN,gBAAgB,EAAE,CAAC;KACpB;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/messaging/dist/ui/components/LargeImageCard/LargeImageCard.spec.d.ts b/packages/messaging/dist/ui/components/LargeImageCard/LargeImageCard.spec.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/packages/messaging/dist/ui/components/LargeImageCard/LargeImageCard.spec.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/messaging/dist/ui/components/LargeImageCard/LargeImageCard.spec.js b/packages/messaging/dist/ui/components/LargeImageCard/LargeImageCard.spec.js deleted file mode 100644 index 747b4308..00000000 --- a/packages/messaging/dist/ui/components/LargeImageCard/LargeImageCard.spec.js +++ /dev/null @@ -1,795 +0,0 @@ -"use strict"; -// /* -// Copyright 2025 Adobe. All rights reserved. -// This file is licensed to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law -// or agreed to in writing, software distributed under the License is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF -// ANY KIND, either express or implied. See the License for the specific -// language governing permissions and limitations under the License. -// */ -Object.defineProperty(exports, "__esModule", { value: true }); -// import React from 'react'; -// import { render, screen, fireEvent } from '@testing-library/react-native'; -// import { Image, useColorScheme } from 'react-native'; -// import LargeImageCard from './LargeImageCard'; -// import { LargeImageContentData } from '../../../models/ContentCard'; -// import { ThemeProvider } from '../../theme/ThemeProvider'; -// // Mock dependencies -// jest.mock('react-native', () => { -// const RN = jest.requireActual('react-native'); -// return { -// ...RN, -// useColorScheme: jest.fn(), -// Image: { -// ...RN.Image, -// getSize: jest.fn() -// } -// }; -// }); -// jest.mock('../../hooks/useAspectRatio', () => { -// return jest.fn(() => 1.5); -// }); -// const mockUseColorScheme = useColorScheme as jest.MockedFunction; -// const mockImageGetSize = Image.getSize as jest.MockedFunction; -// // Test wrapper component with theme provider -// const TestWrapper: React.FC<{ children: React.ReactNode }> = ({ children }) => ( -// {children} -// ); -// describe('LargeImageCard', () => { -// const mockOnPress = jest.fn(); -// const mockOnDismiss = jest.fn(); -// const baseContent: LargeImageContentData = { -// title: { -// content: 'Large Image Title' -// }, -// body: { -// content: 'Large image card body content' -// }, -// buttons: [ -// { -// id: 'button1', -// interactId: 'interact1', -// actionUrl: 'https://example.com', -// text: { -// content: 'Action Button' -// } -// } -// ], -// dismissBtn: { -// style: 'circle' -// } -// }; -// beforeEach(() => { -// jest.clearAllMocks(); -// mockUseColorScheme.mockReturnValue('light'); -// mockImageGetSize.mockImplementation((uri, success) => { -// success(400, 300); -// }); -// }); -// describe('Basic rendering', () => { -// it('should render the component with basic content', () => { -// render( -// -// -// -// ); -// expect(screen.getByText('Large Image Title')).toBeTruthy(); -// expect(screen.getByText('Large image card body content')).toBeTruthy(); -// expect(screen.getByText('Action Button')).toBeTruthy(); -// }); -// it('should render with image when imageUri is provided', () => { -// const { UNSAFE_getByType } = render( -// -// -// -// ); -// const images = UNSAFE_getByType(Image); -// expect(images).toBeTruthy(); -// }); -// it('should not render image container when imageUri is not provided', () => { -// const { UNSAFE_queryByType } = render( -// -// -// -// ); -// const images = UNSAFE_queryByType(Image); -// expect(images).toBeNull(); -// }); -// it('should render dismiss button when dismissBtn style is not "none"', () => { -// render( -// -// -// -// ); -// expect(screen.getByText('x')).toBeTruthy(); -// }); -// it('should not render dismiss button when dismissBtn style is "none"', () => { -// const contentWithNoDismiss = { -// ...baseContent, -// dismissBtn: { style: 'none' as const } -// }; -// render( -// -// -// -// ); -// expect(screen.queryByText('x')).toBeNull(); -// }); -// it('should not render dismiss button when dismissBtn is not provided', () => { -// const contentWithoutDismiss = { -// ...baseContent, -// dismissBtn: undefined -// }; -// render( -// -// -// -// ); -// expect(screen.queryByText('x')).toBeNull(); -// }); -// }); -// describe('Content variations', () => { -// it('should handle content with only title', () => { -// const titleOnlyContent = { -// title: { -// content: 'Title Only' -// } -// }; -// render( -// -// -// -// ); -// expect(screen.getByText('Title Only')).toBeTruthy(); -// expect(screen.queryByText('Large image card body content')).toBeNull(); -// }); -// it('should handle content with only body', () => { -// const bodyOnlyContent = { -// body: { -// content: 'Body Only' -// } -// }; -// render( -// -// -// -// ); -// expect(screen.getByText('Body Only')).toBeTruthy(); -// expect(screen.queryByText('Large Image Title')).toBeNull(); -// }); -// it('should handle content with no buttons', () => { -// const noButtonsContent = { -// ...baseContent, -// buttons: undefined -// }; -// render( -// -// -// -// ); -// expect(screen.getByText('Large Image Title')).toBeTruthy(); -// expect(screen.queryByText('Action Button')).toBeNull(); -// }); -// it('should handle content with empty buttons array', () => { -// const emptyButtonsContent = { -// ...baseContent, -// buttons: [] -// }; -// render( -// -// -// -// ); -// expect(screen.getByText('Large Image Title')).toBeTruthy(); -// expect(screen.queryByText('Action Button')).toBeNull(); -// }); -// it('should render multiple buttons', () => { -// const multiButtonContent = { -// ...baseContent, -// buttons: [ -// { -// id: 'button1', -// interactId: 'interact1', -// actionUrl: 'https://example.com', -// text: { content: 'Primary Action' } -// }, -// { -// id: 'button2', -// interactId: 'interact2', -// actionUrl: 'https://example2.com', -// text: { content: 'Secondary Action' } -// } -// ] -// }; -// render( -// -// -// -// ); -// expect(screen.getByText('Primary Action')).toBeTruthy(); -// expect(screen.getByText('Secondary Action')).toBeTruthy(); -// }); -// }); -// describe('Interaction handling', () => { -// it('should call onPress when the card is pressed', () => { -// const { getByTestId } = render( -// -// -// -// ); -// const card = getByTestId('large-image-card'); -// fireEvent.press(card); -// expect(mockOnPress).toHaveBeenCalledTimes(1); -// }); -// it('should call onDismiss when dismiss button is pressed', () => { -// render( -// -// -// -// ); -// const dismissButton = screen.getByText('x'); -// fireEvent.press(dismissButton); -// expect(mockOnDismiss).toHaveBeenCalledTimes(1); -// }); -// it('should call onPress when a button is pressed', () => { -// render( -// -// -// -// ); -// const button = screen.getByText('Action Button'); -// fireEvent.press(button); -// expect(mockOnPress).toHaveBeenCalledTimes(1); -// }); -// it('should handle missing onPress callback gracefully', () => { -// expect(() => { -// render( -// -// -// -// ); -// }).not.toThrow(); -// }); -// it('should handle missing onDismiss callback gracefully', () => { -// expect(() => { -// render( -// -// -// -// ); -// }).not.toThrow(); -// }); -// }); -// describe('Style overrides', () => { -// it('should apply custom card styles', () => { -// const customStyles = { -// card: { backgroundColor: 'blue', margin: 25 } -// }; -// const { getByTestId } = render( -// -// -// -// ); -// const card = getByTestId('large-image-card'); -// expect(card.props.style).toEqual( -// expect.arrayContaining([ -// expect.objectContaining({ -// backgroundColor: 'blue', -// margin: 25 -// }) -// ]) -// ); -// }); -// it('should apply custom text styles', () => { -// const customStyles = { -// title: { fontSize: 24, fontWeight: 'bold' as const }, -// body: { fontSize: 16, fontStyle: 'italic' as const } -// }; -// render( -// -// -// -// ); -// const title = screen.getByText('Large Image Title'); -// const body = screen.getByText('Large image card body content'); -// expect(title.props.style).toEqual( -// expect.arrayContaining([ -// expect.objectContaining({ -// fontSize: 24, -// fontWeight: 'bold' -// }) -// ]) -// ); -// expect(body.props.style).toEqual( -// expect.arrayContaining([ -// expect.objectContaining({ -// fontSize: 16, -// fontStyle: 'italic' -// }) -// ]) -// ); -// }); -// it('should apply custom image styles', () => { -// const customStyles = { -// imageContainer: { borderRadius: 25 }, -// image: { opacity: 0.9 } -// }; -// render( -// -// -// -// ); -// // Image styles are applied but harder to test directly -// // This ensures no errors are thrown when applying custom styles -// expect(screen.getByText('Large Image Title')).toBeTruthy(); -// }); -// }); -// describe('Component props forwarding', () => { -// it('should forward ContainerProps', () => { -// const containerProps = { -// testID: 'custom-container', -// accessibilityLabel: 'Custom container' -// }; -// render( -// -// -// -// ); -// // Component renders without errors when props are forwarded -// expect(screen.getByText('Large Image Title')).toBeTruthy(); -// }); -// it('should forward ImageContainerProps when image is present', () => { -// const imageContainerProps = { -// testID: 'custom-image-container', -// accessibilityLabel: 'Image container' -// }; -// render( -// -// -// -// ); -// expect(screen.getByText('Large Image Title')).toBeTruthy(); -// }); -// it('should forward ImageProps when image is present', () => { -// const imageProps = { -// testID: 'custom-image', -// accessibilityLabel: 'Large image' -// }; -// render( -// -// -// -// ); -// expect(screen.getByText('Large Image Title')).toBeTruthy(); -// }); -// it('should forward TextProps to title and body', () => { -// const textProps = { -// numberOfLines: 2, -// ellipsizeMode: 'tail' as const -// }; -// render( -// -// -// -// ); -// const title = screen.getByText('Large Image Title'); -// const body = screen.getByText('Large image card body content'); -// expect(title.props.numberOfLines).toBe(2); -// expect(body.props.numberOfLines).toBe(2); -// }); -// it('should forward TitleProps specifically to title', () => { -// const titleProps = { -// numberOfLines: 1, -// testID: 'custom-title' -// }; -// render( -// -// -// -// ); -// const title = screen.getByText('Large Image Title'); -// expect(title.props.numberOfLines).toBe(1); -// expect(title.props.testID).toBe('custom-title'); -// }); -// it('should forward BodyProps specifically to body', () => { -// const bodyProps = { -// numberOfLines: 3, -// testID: 'custom-body' -// }; -// render( -// -// -// -// ); -// const body = screen.getByText('Large image card body content'); -// expect(body.props.numberOfLines).toBe(3); -// expect(body.props.testID).toBe('custom-body'); -// }); -// it('should forward ButtonContainerProps', () => { -// const buttonContainerProps = { -// testID: 'custom-button-container' -// }; -// render( -// -// -// -// ); -// expect(screen.getByText('Action Button')).toBeTruthy(); -// }); -// it('should forward ButtonProps to buttons', () => { -// const buttonProps = { -// testID: 'custom-button' -// }; -// render( -// -// -// -// ); -// expect(screen.getByText('Action Button')).toBeTruthy(); -// }); -// it('should forward DismissButtonProps', () => { -// const dismissButtonProps = { -// testID: 'custom-dismiss-button' -// }; -// render( -// -// -// -// ); -// expect(screen.getByText('x')).toBeTruthy(); -// }); -// }); -// describe('Theme integration', () => { -// it('should apply light theme colors', () => { -// mockUseColorScheme.mockReturnValue('light'); -// render( -// -// -// -// ); -// const title = screen.getByText('Large Image Title'); -// const body = screen.getByText('Large image card body content'); -// expect(title.props.style).toEqual( -// expect.arrayContaining([ -// expect.objectContaining({ -// color: '#000000' // Default light theme primary text color -// }) -// ]) -// ); -// expect(body.props.style).toEqual( -// expect.arrayContaining([ -// expect.objectContaining({ -// color: '#000000' // Default light theme primary text color -// }) -// ]) -// ); -// }); -// it('should apply dark theme colors', () => { -// mockUseColorScheme.mockReturnValue('dark'); -// render( -// -// -// -// ); -// const title = screen.getByText('Large Image Title'); -// const body = screen.getByText('Large image card body content'); -// expect(title.props.style).toEqual( -// expect.arrayContaining([ -// expect.objectContaining({ -// color: '#FFFFFF' // Default dark theme primary text color -// }) -// ]) -// ); -// expect(body.props.style).toEqual( -// expect.arrayContaining([ -// expect.objectContaining({ -// color: '#FFFFFF' // Default dark theme primary text color -// }) -// ]) -// ); -// }); -// }); -// describe('Accessibility', () => { -// it('should accept custom accessibility props', () => { -// const { getByTestId } = render( -// -// -// -// ); -// const card = getByTestId('large-image-card'); -// expect(card.props.accessibilityLabel).toBe('Large content card'); -// expect(card.props.accessibilityHint).toBe('Double tap to interact'); -// }); -// it('should support disabled state', () => { -// const { getByTestId } = render( -// -// -// -// ); -// const card = getByTestId('large-image-card'); -// expect(card.props.disabled).toBe(true); -// }); -// }); -// describe('Props forwarding', () => { -// it('should forward additional Pressable props', () => { -// const { getByTestId } = render( -// -// -// -// ); -// const card = getByTestId('large-image-card'); -// expect(card.props.hitSlop).toBe(15); -// expect(card.props.delayLongPress).toBe(600); -// }); -// }); -// describe('Edge cases', () => { -// it('should handle undefined content gracefully', () => { -// expect(() => { -// render( -// -// -// -// ); -// }).not.toThrow(); -// }); -// it('should handle empty content object', () => { -// expect(() => { -// render( -// -// -// -// ); -// }).not.toThrow(); -// }); -// it('should handle content with empty strings', () => { -// const emptyStringContent = { -// title: { content: '' }, -// body: { content: '' } -// }; -// render( -// -// -// -// ); -// // Empty strings should not render the text components -// expect(screen.queryByText('')).toBeNull(); -// }); -// it('should handle image loading errors gracefully', () => { -// mockImageGetSize.mockImplementation((uri, success, error) => { -// error(new Error('Image load failed')); -// }); -// expect(() => { -// render( -// -// -// -// ); -// }).not.toThrow(); -// }); -// it('should handle undefined color scheme gracefully', () => { -// mockUseColorScheme.mockReturnValue(undefined as any); -// expect(() => { -// render( -// -// -// -// ); -// }).not.toThrow(); -// }); -// }); -// describe('Layout and styling', () => { -// it('should render button container even when no buttons are present', () => { -// const noButtonsContent = { -// ...baseContent, -// buttons: [] -// }; -// render( -// -// -// -// ); -// // Button container should still be rendered (but empty) -// expect(screen.getByText('Large Image Title')).toBeTruthy(); -// }); -// it('should apply aspect ratio to image when provided', () => { -// render( -// -// -// -// ); -// // useAspectRatio hook is mocked to return 1.5 -// // This ensures the component uses the hook correctly -// expect(screen.getByText('Large Image Title')).toBeTruthy(); -// }); -// }); -// }); -//# sourceMappingURL=LargeImageCard.spec.js.map \ No newline at end of file diff --git a/packages/messaging/dist/ui/components/LargeImageCard/LargeImageCard.spec.js.map b/packages/messaging/dist/ui/components/LargeImageCard/LargeImageCard.spec.js.map deleted file mode 100644 index e8dbc3b0..00000000 --- a/packages/messaging/dist/ui/components/LargeImageCard/LargeImageCard.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"LargeImageCard.spec.js","sourceRoot":"","sources":["../../../../src/ui/components/LargeImageCard/LargeImageCard.spec.tsx"],"names":[],"mappings":";AAAA,KAAK;AACL,iDAAiD;AACjD,8EAA8E;AAC9E,mFAAmF;AACnF,8CAA8C;AAC9C,mFAAmF;AACnF,yEAAyE;AACzE,gFAAgF;AAChF,4EAA4E;AAC5E,wEAAwE;AACxE,KAAK;;AAEL,6BAA6B;AAC7B,6EAA6E;AAC7E,wDAAwD;AACxD,iDAAiD;AACjD,uEAAuE;AACvE,6DAA6D;AAE7D,uBAAuB;AACvB,oCAAoC;AACpC,mDAAmD;AACnD,aAAa;AACb,aAAa;AACb,iCAAiC;AACjC,eAAe;AACf,qBAAqB;AACrB,2BAA2B;AAC3B,QAAQ;AACR,O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EAAgE;AAChE,sCAAsC;AACtC,0CAA0C;AAC1C,iBAAiB;AACjB,2BAA2B;AAC3B,aAAa;AACb,0BAA0B;AAC1B,UAAU;AAEV,oEAAoE;AACpE,8DAA8D;AAE9D,uBAAuB;AACvB,kBAAkB;AAClB,0BAA0B;AAC1B,8BAA8B;AAC9B,sCAAsC;AACtC,sCAAsC;AACtC,0CAA0C;AAC1C,iBAAiB;AACjB,2BAA2B;AAC3B,aAAa;AACb,0BAA0B;AAC1B,UAAU;AACV,QAAQ;AAER,2CAA2C;AAC3C,oFAAoF;AACpF,mCAAmC;AACnC,0BAA0B;AAC1B,sBAAsB;AACtB,WAAW;AAEX,gBAAgB;AAChB,wBAAwB;AACxB,4BAA4B;AAC5B,yCAAyC;AACzC,oCAAoC;AACpC,wCAAwC;AACxC,eAAe;AACf,yBAAyB;AACzB,WAAW;AAEX,iEAAiE;AACjE,oEAAoE;AACpE,UAAU;AAEV,qEAAqE;AACrE,gBAAgB;AAChB,wBAAwB;AACxB,4BAA4B;AAC5B,oCAAoC;AACpC,uDAAuD;AACvD,oCAAoC;AACpC,wCAAwC;AACxC,eAAe;AACf,yBAAyB;AACzB,WAAW;AAEX,uDAAuD;AACvD,8DAA8D;AAC9D,oEAAoE;AACpE,UAAU;AACV,QAAQ;AACR,MAAM"} \ No newline at end of file diff --git a/packages/messaging/dist/ui/components/SmallImageCard/SmallImageCard.d.ts b/packages/messaging/dist/ui/components/SmallImageCard/SmallImageCard.d.ts deleted file mode 100644 index d7db53af..00000000 --- a/packages/messaging/dist/ui/components/SmallImageCard/SmallImageCard.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { ImageStyle, PressableProps, TextStyle, ViewStyle } from 'react-native'; -import { SmallImageContentData } from '../../../models/ContentCard'; -import { ComponentOverrideProps } from '../../types'; -export interface SmallImageContentStyle { - /** Applies to the root of the content card */ - card?: ViewStyle; - /** Applies to the container inside the content card, applied inside the card Pressable */ - container?: ViewStyle; - imageContainer?: ViewStyle; - image?: ImageStyle; - contentContainer?: ViewStyle; - /** Applies to title and body properties, will be overridden by title and body styles */ - text?: TextStyle; - title?: TextStyle; - body?: TextStyle; - buttonContainer?: ViewStyle; - button?: PressableProps['style']; - buttonText?: TextStyle; - dismissButton?: PressableProps['style']; -} -export type SmallImageCardProps = PressableProps & ComponentOverrideProps & { - content: SmallImageContentData; - imageUri?: string; - height?: number; - styleOverrides?: SmallImageContentStyle; - onDismiss?: () => void; - onPress?: () => void; -}; -declare const SmallImageCard: React.FC; -export default SmallImageCard; diff --git a/packages/messaging/dist/ui/components/SmallImageCard/SmallImageCard.js b/packages/messaging/dist/ui/components/SmallImageCard/SmallImageCard.js deleted file mode 100644 index 799d289f..00000000 --- a/packages/messaging/dist/ui/components/SmallImageCard/SmallImageCard.js +++ /dev/null @@ -1,121 +0,0 @@ -"use strict"; -/* - Copyright 2025 Adobe. All rights reserved. - This file is licensed to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law - or agreed to in writing, software distributed under the License is - distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF - ANY KIND, either express or implied. See the License for the specific - language governing permissions and limitations under the License. -*/ -Object.defineProperty(exports, "__esModule", { value: true }); -const tslib_1 = require("tslib"); -const react_native_1 = require("react-native"); -const Button_1 = tslib_1.__importDefault(require("../Button/Button")); -const DismissButton_1 = tslib_1.__importDefault(require("../DismissButton/DismissButton")); -const ThemeProvider_1 = require("../../theme/ThemeProvider"); -const useAspectRatio_1 = tslib_1.__importDefault(require("../../hooks/useAspectRatio")); -const SmallImageCard = (_a) => { - var _b, _c, _d, _e, _f; - var { content, height, imageUri, styleOverrides, style, onDismiss, onPress, ContainerProps, ImageProps, ContentContainerProps, TextProps, TitleProps, BodyProps, ButtonContainerProps, ButtonProps, DismissButtonProps, ImageContainerProps } = _a, props = tslib_1.__rest(_a, ["content", "height", "imageUri", "styleOverrides", "style", "onDismiss", "onPress", "ContainerProps", "ImageProps", "ContentContainerProps", "TextProps", "TitleProps", "BodyProps", "ButtonContainerProps", "ButtonProps", "DismissButtonProps", "ImageContainerProps"]); - const theme = (0, ThemeProvider_1.useTheme)(); - const imageAspectRatio = (0, useAspectRatio_1.default)(imageUri); - return ( [ - styles.card, - styleOverrides === null || styleOverrides === void 0 ? void 0 : styleOverrides.card, - typeof style === 'function' ? style(state) : style - ]} {...props}> - - {imageUri && ( - - )} - - - {((_b = content === null || content === void 0 ? void 0 : content.title) === null || _b === void 0 ? void 0 : _b.content) && ( - {content.title.content} - )} - {((_c = content === null || content === void 0 ? void 0 : content.body) === null || _c === void 0 ? void 0 : _c.content) && ( - {content.body.content} - )} - - {((_d = content === null || content === void 0 ? void 0 : content.buttons) === null || _d === void 0 ? void 0 : _d.length) && - ((_e = content === null || content === void 0 ? void 0 : content.buttons) === null || _e === void 0 ? void 0 : _e.length) > 0 && - content.buttons.map((button) => ())} - - {(content === null || content === void 0 ? void 0 : content.dismissBtn) && ((_f = content.dismissBtn) === null || _f === void 0 ? void 0 : _f.style) !== 'none' && ()} - - - ); -}; -exports.default = SmallImageCard; -const styles = react_native_1.StyleSheet.create({ - card: { - borderRadius: 12, - margin: 15, - flex: 1, - flexDirection: 'row', - gap: 8, - maxWidth: '100%', - alignItems: 'center' - }, - container: { - flexDirection: 'row', - minHeight: 120 - }, - imageContainer: { - borderRadius: 12, - width: 'auto', - height: '100%' - }, - image: { - height: '100%', - resizeMode: 'contain' - }, - contentContainer: { - flex: 1, - paddingVertical: 16, - paddingHorizontal: 16, - justifyContent: 'flex-start' - }, - textContent: { - flex: 1, - justifyContent: 'flex-start', - marginBottom: 16 - }, - title: { - fontSize: 16, - fontWeight: '600', - marginBottom: 8, - marginRight: 16 - }, - body: { - fontSize: 14, - lineHeight: 18 - }, - buttonContainer: { - flexDirection: 'row', - justifyContent: 'flex-start', - paddingTop: 8, - gap: 8 - }, - button: { - marginHorizontal: 8 - } -}); -//# sourceMappingURL=SmallImageCard.js.map \ No newline at end of file diff --git a/packages/messaging/dist/ui/components/SmallImageCard/SmallImageCard.js.map b/packages/messaging/dist/ui/components/SmallImageCard/SmallImageCard.js.map deleted file mode 100644 index 82e83aed..00000000 --- a/packages/messaging/dist/ui/components/SmallImageCard/SmallImageCard.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"SmallImageCard.js","sourceRoot":"","sources":["../../../../src/ui/components/SmallImageCard/SmallImageCard.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE;;;AAEF,+CAUsB;AACtB,sEAAsC;AAEtC,2FAA2D;AAC3D,6DAAqD;AACrD,wFAAwD;AAgCxD,MAAM,cAAc,GAAkC,CAAC,EAmBtD,EAAE,EAAE;;QAnBkD,EACrD,OAAO,EACP,MAAM,EACN,QAAQ,EACR,cAAc,EACd,KAAK,EACL,SAAS,EACT,OAAO,EACP,cAAc,EACd,UAAU,EACV,qBAAqB,EACrB,SAAS,EACT,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,WAAW,EACX,kBAAkB,EAClB,mBAAmB,OAEpB,EADI,KAAK,sBAlB6C,yQAmBtD,CADS;IAER,MAAM,KAAK,GAAG,IAAA,wBAAQ,GAAE,CAAC;IACzB,MAAM,gBAAgB,GAAG,IAAA,wBAAc,EAAC,QAAQ,CAAC,CAAC;IAElD,OAAO,CACL,CAAC,wBAAS,CACR,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;YAChB,MAAM,CAAC,IAAI;YACX,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,IAAI;YACpB,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK;SACnD,CAAC,CACF,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,mBAAI,CACH,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,EA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AE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,EAAE;KAChB;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;KACf;IACD,eAAe,EAAE;QACf,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,YAAY;QAC5B,UAAU,EAAE,CAAC;QACb,GAAG,EAAE,CAAC;KACP;IACD,MAAM,EAAE;QACN,gBAAgB,EAAE,CAAC;KACpB;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/messaging/dist/ui/components/SmallImageCard/SmallImageCard.spec.d.ts b/packages/messaging/dist/ui/components/SmallImageCard/SmallImageCard.spec.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/packages/messaging/dist/ui/components/SmallImageCard/SmallImageCard.spec.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/messaging/dist/ui/components/SmallImageCard/SmallImageCard.spec.js b/packages/messaging/dist/ui/components/SmallImageCard/SmallImageCard.spec.js deleted file mode 100644 index 256fa22c..00000000 --- a/packages/messaging/dist/ui/components/SmallImageCard/SmallImageCard.spec.js +++ /dev/null @@ -1,704 +0,0 @@ -"use strict"; -// /* -// Copyright 2025 Adobe. All rights reserved. -// This file is licensed to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law -// or agreed to in writing, software distributed under the License is -// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF -// ANY KIND, either express or implied. See the License for the specific -// language governing permissions and limitations under the License. -// */ -Object.defineProperty(exports, "__esModule", { value: true }); -// import React from 'react'; -// import { render, screen, fireEvent } from '@testing-library/react-native'; -// import { Image, useColorScheme } from 'react-native'; -// import SmallImageCard from './SmallImageCard'; -// import { SmallImageContentData } from '../../../models/ContentCard'; -// import { ThemeProvider } from '../../theme/ThemeProvider'; -// // Mock dependencies -// jest.mock('react-native', () => { -// const RN = jest.requireActual('react-native'); -// return { -// ...RN, -// useColorScheme: jest.fn(), -// Image: { -// ...RN.Image, -// getSize: jest.fn() -// } -// }; -// }); -// jest.mock('../../hooks/useAspectRatio', () => { -// return jest.fn(() => 1.5); -// }); -// const mockUseColorScheme = useColorScheme as jest.MockedFunction; -// const mockImageGetSize = Image.getSize as jest.MockedFunction; -// // Test wrapper component with theme provider -// const TestWrapper: React.FC<{ children: React.ReactNode }> = ({ children }) => ( -// {children} -// ); -// describe('SmallImageCard', () => { -// const mockOnPress = jest.fn(); -// const mockOnDismiss = jest.fn(); -// const baseContent: SmallImageContentData = { -// title: { -// content: 'Test Title' -// }, -// body: { -// content: 'Test body content' -// }, -// buttons: [ -// { -// id: 'button1', -// interactId: 'interact1', -// actionUrl: 'https://example.com', -// text: { -// content: 'Click Me' -// } -// } -// ], -// dismissBtn: { -// style: 'simple' -// } -// }; -// beforeEach(() => { -// jest.clearAllMocks(); -// mockUseColorScheme.mockReturnValue('light'); -// mockImageGetSize.mockImplementation((uri, success) => { -// success(300, 200); -// }); -// }); -// describe('Basic rendering', () => { -// it('should render the component with basic content', () => { -// render( -// -// -// -// ); -// expect(screen.getByText('Test Title')).toBeTruthy(); -// expect(screen.getByText('Test body content')).toBeTruthy(); -// expect(screen.getByText('Click Me')).toBeTruthy(); -// }); -// it('should render with image when imageUri is provided', () => { -// const { UNSAFE_getByType } = render( -// -// -// -// ); -// const images = UNSAFE_getByType(Image); -// expect(images).toBeTruthy(); -// }); -// it('should not render image container when imageUri is not provided', () => { -// const { UNSAFE_queryByType } = render( -// -// -// -// ); -// const images = UNSAFE_queryByType(Image); -// expect(images).toBeNull(); -// }); -// it('should render dismiss button when dismissBtn style is not "none"', () => { -// render( -// -// -// -// ); -// expect(screen.getByText('x')).toBeTruthy(); -// }); -// it('should not render dismiss button when dismissBtn style is "none"', () => { -// const contentWithNoDismiss = { -// ...baseContent, -// dismissBtn: { style: 'none' as const } -// }; -// render( -// -// -// -// ); -// expect(screen.queryByText('x')).toBeNull(); -// }); -// it('should not render dismiss button when dismissBtn is not provided', () => { -// const contentWithoutDismiss = { -// ...baseContent, -// dismissBtn: undefined -// }; -// render( -// -// -// -// ); -// expect(screen.queryByText('x')).toBeNull(); -// }); -// }); -// describe('Content variations', () => { -// it('should handle content with only title', () => { -// const titleOnlyContent = { -// title: { -// content: 'Title Only' -// } -// }; -// render( -// -// -// -// ); -// expect(screen.getByText('Title Only')).toBeTruthy(); -// expect(screen.queryByText('Test body content')).toBeNull(); -// }); -// it('should handle content with only body', () => { -// const bodyOnlyContent = { -// body: { -// content: 'Body Only' -// } -// }; -// render( -// -// -// -// ); -// expect(screen.getByText('Body Only')).toBeTruthy(); -// expect(screen.queryByText('Test Title')).toBeNull(); -// }); -// it('should handle content with no buttons', () => { -// const noButtonsContent = { -// ...baseContent, -// buttons: undefined -// }; -// render( -// -// -// -// ); -// expect(screen.getByText('Test Title')).toBeTruthy(); -// expect(screen.queryByText('Click Me')).toBeNull(); -// }); -// it('should handle content with empty buttons array', () => { -// const emptyButtonsContent = { -// ...baseContent, -// buttons: [] -// }; -// render( -// -// -// -// ); -// expect(screen.getByText('Test Title')).toBeTruthy(); -// expect(screen.queryByText('Click Me')).toBeNull(); -// }); -// it('should render multiple buttons', () => { -// const multiButtonContent = { -// ...baseContent, -// buttons: [ -// { -// id: 'button1', -// interactId: 'interact1', -// actionUrl: 'https://example.com', -// text: { content: 'Button 1' } -// }, -// { -// id: 'button2', -// interactId: 'interact2', -// actionUrl: 'https://example2.com', -// text: { content: 'Button 2' } -// } -// ] -// }; -// render( -// -// -// -// ); -// expect(screen.getByText('Button 1')).toBeTruthy(); -// expect(screen.getByText('Button 2')).toBeTruthy(); -// }); -// }); -// describe('Interaction handling', () => { -// it('should call onPress when the card is pressed', () => { -// const { getByTestId } = render( -// -// -// -// ); -// const card = getByTestId('small-image-card'); -// fireEvent.press(card); -// expect(mockOnPress).toHaveBeenCalledTimes(1); -// }); -// it('should call onDismiss when dismiss button is pressed', () => { -// render( -// -// -// -// ); -// const dismissButton = screen.getByText('x'); -// fireEvent.press(dismissButton); -// expect(mockOnDismiss).toHaveBeenCalledTimes(1); -// }); -// it('should call onPress when a button is pressed', () => { -// render( -// -// -// -// ); -// const button = screen.getByText('Click Me'); -// fireEvent.press(button); -// expect(mockOnPress).toHaveBeenCalledTimes(1); -// }); -// it('should handle missing onPress callback gracefully', () => { -// expect(() => { -// render( -// -// -// -// ); -// }).not.toThrow(); -// }); -// it('should handle missing onDismiss callback gracefully', () => { -// expect(() => { -// render( -// -// -// -// ); -// }).not.toThrow(); -// }); -// }); -// describe('Style overrides', () => { -// it('should apply custom card styles', () => { -// const customStyles = { -// card: { backgroundColor: 'red', margin: 20 } -// }; -// const { getByTestId } = render( -// -// -// -// ); -// const card = getByTestId('small-image-card'); -// expect(card.props.style).toEqual( -// expect.arrayContaining([ -// expect.objectContaining({ -// backgroundColor: 'red', -// margin: 20 -// }) -// ]) -// ); -// }); -// it('should apply custom container styles', () => { -// const customStyles = { -// container: { padding: 20 } -// }; -// render( -// -// -// -// ); -// // Container styles are applied but harder to test directly -// // This ensures no errors are thrown when applying custom styles -// expect(screen.getByText('Test Title')).toBeTruthy(); -// }); -// it('should apply custom text styles', () => { -// const customStyles = { -// text: { fontSize: 20 }, -// title: { fontWeight: 'bold' as const }, -// body: { fontStyle: 'italic' as const } -// }; -// render( -// -// -// -// ); -// const title = screen.getByText('Test Title'); -// const body = screen.getByText('Test body content'); -// expect(title.props.style).toEqual( -// expect.arrayContaining([ -// expect.objectContaining({ -// fontSize: 20, -// fontWeight: 'bold' -// }) -// ]) -// ); -// expect(body.props.style).toEqual( -// expect.arrayContaining([ -// expect.objectContaining({ -// fontSize: 20, -// fontStyle: 'italic' -// }) -// ]) -// ); -// }); -// it('should apply custom image styles', () => { -// const customStyles = { -// imageContainer: { borderRadius: 20 }, -// image: { opacity: 0.8 } -// }; -// render( -// -// -// -// ); -// // Image styles are applied but harder to test directly -// // This ensures no errors are thrown when applying custom styles -// expect(screen.getByText('Test Title')).toBeTruthy(); -// }); -// it('should handle function-based style prop', () => { -// const styleFn = jest.fn().mockReturnValue({ opacity: 0.9 }); -// const { getByTestId } = render( -// -// -// -// ); -// expect(styleFn).toHaveBeenCalled(); -// const card = getByTestId('small-image-card'); -// expect(card.props.style).toEqual( -// expect.arrayContaining([ -// expect.objectContaining({ -// opacity: 0.9 -// }) -// ]) -// ); -// }); -// }); -// describe('Theme integration', () => { -// it('should apply light theme colors', () => { -// mockUseColorScheme.mockReturnValue('light'); -// render( -// -// -// -// ); -// const title = screen.getByText('Test Title'); -// const body = screen.getByText('Test body content'); -// expect(title.props.style).toEqual( -// expect.arrayContaining([ -// expect.objectContaining({ -// color: '#000000' // Default light theme primary text color -// }) -// ]) -// ); -// expect(body.props.style).toEqual( -// expect.arrayContaining([ -// expect.objectContaining({ -// color: '#000000' // Default light theme primary text color -// }) -// ]) -// ); -// }); -// it('should apply dark theme colors', () => { -// mockUseColorScheme.mockReturnValue('dark'); -// render( -// -// -// -// ); -// const title = screen.getByText('Test Title'); -// const body = screen.getByText('Test body content'); -// expect(title.props.style).toEqual( -// expect.arrayContaining([ -// expect.objectContaining({ -// color: '#FFFFFF' // Default dark theme primary text color -// }) -// ]) -// ); -// expect(body.props.style).toEqual( -// expect.arrayContaining([ -// expect.objectContaining({ -// color: '#FFFFFF' // Default dark theme primary text color -// }) -// ]) -// ); -// }); -// it('should work with custom theme colors', () => { -// const customThemes = { -// light: { -// colors: { -// primary: '#007AFF', -// secondary: '#5856D6', -// background: '#FFFFFF', -// textPrimary: '#FF0000', // Custom red text -// textSecondary: '#8E8E93', -// imagePlaceholder: '#C7C7CC', -// buttonTextColor: 'dodgerblue' -// } -// }, -// dark: { -// colors: { -// primary: '#0A84FF', -// secondary: '#5E5CE6', -// background: '#262626', -// textPrimary: '#00FF00', // Custom green text -// textSecondary: '#8E8E93', -// imagePlaceholder: '#48484A', -// buttonTextColor: 'dodgerblue' -// } -// } -// }; -// const CustomThemeWrapper: React.FC<{ children: React.ReactNode }> = ({ children }) => ( -// {children} -// ); -// mockUseColorScheme.mockReturnValue('light'); -// render( -// -// -// -// ); -// const title = screen.getByText('Test Title'); -// expect(title.props.style).toEqual( -// expect.arrayContaining([ -// expect.objectContaining({ -// color: '#FF0000' // Custom red text color -// }) -// ]) -// ); -// }); -// }); -// describe('Accessibility', () => { -// it('should accept custom accessibility props', () => { -// const { getByTestId } = render( -// -// -// -// ); -// const card = getByTestId('small-image-card'); -// expect(card.props.accessibilityLabel).toBe('Content card'); -// expect(card.props.accessibilityHint).toBe('Double tap to open'); -// }); -// it('should support disabled state', () => { -// const { getByTestId } = render( -// -// -// -// ); -// const card = getByTestId('small-image-card'); -// expect(card.props.disabled).toBe(true); -// }); -// }); -// describe('Props forwarding', () => { -// it('should forward additional Pressable props', () => { -// const { getByTestId } = render( -// -// -// -// ); -// const card = getByTestId('small-image-card'); -// expect(card.props.hitSlop).toBe(10); -// expect(card.props.delayLongPress).toBe(500); -// }); -// }); -// describe('Edge cases', () => { -// it('should handle undefined content gracefully', () => { -// expect(() => { -// render( -// -// -// -// ); -// }).not.toThrow(); -// }); -// it('should handle empty content object', () => { -// expect(() => { -// render( -// -// -// -// ); -// }).not.toThrow(); -// }); -// it('should handle content with empty strings', () => { -// const emptyStringContent = { -// title: { content: '' }, -// body: { content: '' } -// }; -// render( -// -// -// -// ); -// // Empty strings should not render the text components -// expect(screen.queryByText('')).toBeNull(); -// }); -// it('should handle image loading errors gracefully', () => { -// mockImageGetSize.mockImplementation((uri, success, error) => { -// error(new Error('Image load failed')); -// }); -// expect(() => { -// render( -// -// -// -// ); -// }).not.toThrow(); -// }); -// it('should handle undefined color scheme gracefully', () => { -// mockUseColorScheme.mockReturnValue(undefined as any); -// expect(() => { -// render( -// -// -// -// ); -// }).not.toThrow(); -// }); -// }); -// describe('Height prop', () => { -// it('should accept height prop', () => { -// expect(() => { -// render( -// -// -// -// ); -// }).not.toThrow(); -// }); -// }); -// }); -//# sourceMappingURL=SmallImageCard.spec.js.map \ No newline at end of file diff --git a/packages/messaging/dist/ui/components/SmallImageCard/SmallImageCard.spec.js.map b/packages/messaging/dist/ui/components/SmallImageCard/SmallImageCard.spec.js.map deleted file mode 100644 index cf1d7db1..00000000 --- a/packages/messaging/dist/ui/components/SmallImageCard/SmallImageCard.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"SmallImageCard.spec.js","sourceRoot":"","sources":["../../../../src/ui/components/SmallImageCard/SmallImageCard.spec.tsx"],"names":[],"mappings":";AAAA,KAAK;AACL,iDAAiD;AACjD,8EAA8E;AAC9E,mFAAmF;AACnF,8CAA8C;AAC9C,mFAAmF;AACnF,yEAAyE;AACzE,gFAAgF;AAChF,4EAA4E;AAC5E,wEAAwE;AACxE,KAAK;;AAEL,6BAA6B;AAC7B,6EAA6E;AAC7E,wDAAwD;AACxD,iDAAiD;AACjD,uEAAuE;AACvE,6DAA6D;AAE7D,uBAAuB;AACvB,oCAAoC;AACpC,mDAAmD;AACnD,aAAa;AACb,aAAa;AACb,iCAAiC;AACjC,eAAe;AACf,qBAAqB;AACrB,2BAA2B;AAC3B,QAAQ;AACR,OAAO;AACP,MAAM;AAEN,kDAAkD;AAClD,+BAA+B;AAC/B,MAAM;AAEN,2FAA2F;AAC3F,uFAAuF;AAEvF,gDAAgD;AAChD,mFAAmF;AACnF,gEAAgE;AAChE,KAAK;AAEL,qCAAqC;AACrC,mCAAmC;AACnC,qCAAqC;AAErC,iDAAiD;AACjD,eAAe;AACf,8BAA8B;AAC9B,SAAS;AACT,cAAc;AACd,qCAAqC;AACrC,SAAS;AACT,iBAAiB;AACjB,UAAU;AACV,yBAAyB;AACzB,mCAAmC;AACnC,4CAA4C;AAC5C,kBAAkB;AAClB,gCAAgC;AAChC,YAAY;AACZ,UAAU;AACV,SAAS;AACT,oBAAoB;AACpB,wBAAwB;AACxB,QAAQ;AACR,OAAO;AAEP,uBAAuB;AAC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B;AAC3B,aAAa;AACb,0BAA0B;AAC1B,UAAU;AACV,QAAQ;AAER,oCAAoC;AACpC,8CAA8C;AAC9C,uBAAuB;AACvB,kBAAkB;AAClB,0BAA0B;AAC1B,8BAA8B;AAC9B,sCAAsC;AACtC,6BAA6B;AAC7B,sCAAsC;AACtC,0CAA0C;AAC1C,iBAAiB;AACjB,2BAA2B;AAC3B,aAAa;AACb,0BAA0B;AAC1B,UAAU;AACV,QAAQ;AACR,MAAM"} \ No newline at end of file diff --git a/packages/messaging/dist/ui/components/index.d.ts b/packages/messaging/dist/ui/components/index.d.ts deleted file mode 100644 index 984ede58..00000000 --- a/packages/messaging/dist/ui/components/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './Button/Button'; -export * from './ContentCardView/ContentCardView'; -export * from '../types/ContentViewEvent'; -export { ThemeProvider } from '../theme/ThemeProvider'; -export type { Themes } from '../theme/Theme'; diff --git a/packages/messaging/dist/ui/components/index.js b/packages/messaging/dist/ui/components/index.js deleted file mode 100644 index cba0942c..00000000 --- a/packages/messaging/dist/ui/components/index.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; -/* - Copyright 2025 Adobe. All rights reserved. - This file is licensed to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law - or agreed to in writing, software distributed under the License is - distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF - ANY KIND, either express or implied. See the License for the specific - language governing permissions and limitations under the License. -*/ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ThemeProvider = void 0; -const tslib_1 = require("tslib"); -tslib_1.__exportStar(require("./Button/Button"), exports); -tslib_1.__exportStar(require("./ContentCardView/ContentCardView"), exports); -tslib_1.__exportStar(require("../types/ContentViewEvent"), exports); -var ThemeProvider_1 = require("../theme/ThemeProvider"); -Object.defineProperty(exports, "ThemeProvider", { enumerable: true, get: function () { return ThemeProvider_1.ThemeProvider; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/messaging/dist/ui/components/index.js.map b/packages/messaging/dist/ui/components/index.js.map deleted file mode 100644 index 4806fc57..00000000 --- a/packages/messaging/dist/ui/components/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/components/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE;;;;AAEF,0DAAgC;AAChC,4EAAkD;AAClD,oEAA0C;AAC1C,wDAAuD;AAA9C,8GAAA,aAAa,OAAA"} \ No newline at end of file diff --git a/packages/messaging/dist/ui/hooks/index.d.ts b/packages/messaging/dist/ui/hooks/index.d.ts deleted file mode 100644 index 68761ab2..00000000 --- a/packages/messaging/dist/ui/hooks/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './useContentCardUI'; diff --git a/packages/messaging/dist/ui/hooks/index.js b/packages/messaging/dist/ui/hooks/index.js deleted file mode 100644 index aab45b56..00000000 --- a/packages/messaging/dist/ui/hooks/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const tslib_1 = require("tslib"); -tslib_1.__exportStar(require("./useContentCardUI"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/messaging/dist/ui/hooks/index.js.map b/packages/messaging/dist/ui/hooks/index.js.map deleted file mode 100644 index 45b3b96a..00000000 --- a/packages/messaging/dist/ui/hooks/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/hooks/index.ts"],"names":[],"mappings":";;;AAAA,6DAAmC"} \ No newline at end of file diff --git a/packages/messaging/dist/ui/hooks/useAspectRatio.d.ts b/packages/messaging/dist/ui/hooks/useAspectRatio.d.ts deleted file mode 100644 index 04661f27..00000000 --- a/packages/messaging/dist/ui/hooks/useAspectRatio.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare function useAspectRatio(uri?: string): number; -export default useAspectRatio; diff --git a/packages/messaging/dist/ui/hooks/useAspectRatio.js b/packages/messaging/dist/ui/hooks/useAspectRatio.js deleted file mode 100644 index 54ceec8d..00000000 --- a/packages/messaging/dist/ui/hooks/useAspectRatio.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const react_1 = require("react"); -const react_native_1 = require("react-native"); -function useAspectRatio(uri) { - const [imageAspectRatio, setImageAspectRatio] = (0, react_1.useState)(1); - (0, react_1.useEffect)(() => { - if (!uri) { - return; - } - react_native_1.Image.getSize(uri, (width, height) => { - setImageAspectRatio(width / height); - }, (error) => { - console.log('Error getting image size:', error); - setImageAspectRatio(1); - }); - }, [uri]); - return imageAspectRatio; -} -exports.default = useAspectRatio; -//# sourceMappingURL=useAspectRatio.js.map \ No newline at end of file diff --git a/packages/messaging/dist/ui/hooks/useAspectRatio.js.map b/packages/messaging/dist/ui/hooks/useAspectRatio.js.map deleted file mode 100644 index 2c478e51..00000000 --- a/packages/messaging/dist/ui/hooks/useAspectRatio.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"useAspectRatio.js","sourceRoot":"","sources":["../../../src/ui/hooks/useAspectRatio.tsx"],"names":[],"mappings":";;AAAA,iCAA4C;AAC5C,+CAAqC;AAErC,SAAS,cAAc,CAAC,GAAY;IAClC,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,IAAA,gBAAQ,EAAS,CAAC,CAAC,CAAC;IAEpE,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,CAAC,GAAG,EAAE;YACR,OAAO;SACR;QAED,oBAAK,CAAC,OAAO,CACX,GAAG,EACH,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YAChB,mBAAmB,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC;QACtC,CAAC,EACD,CAAC,KAAK,EAAE,EAAE;YACR,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;YAChD,mBAAmB,CAAC,CAAC,CAAC,CAAC;QACzB,CAAC,CACF,CAAC;IACJ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAEV,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED,kBAAe,cAAc,CAAC"} \ No newline at end of file diff --git a/packages/messaging/dist/ui/hooks/useContentCardUI.d.ts b/packages/messaging/dist/ui/hooks/useContentCardUI.d.ts deleted file mode 100644 index 01ff2f3a..00000000 --- a/packages/messaging/dist/ui/hooks/useContentCardUI.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ContentTemplate } from '../types/Templates'; -/** - * Hook to fetch the content card UI for a given surface. - * @param surface - The surface to fetch the content card UI for. - * @returns An object containing the content card UI, error, loading state, and a refetch function. - */ -export declare const useContentCardUI: (surface: string) => { - content: ContentTemplate[]; - error: any; - isLoading: boolean; - refetch: () => Promise; -}; diff --git a/packages/messaging/dist/ui/hooks/useContentCardUI.js b/packages/messaging/dist/ui/hooks/useContentCardUI.js deleted file mode 100644 index 38f15110..00000000 --- a/packages/messaging/dist/ui/hooks/useContentCardUI.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.useContentCardUI = void 0; -const tslib_1 = require("tslib"); -const react_1 = require("react"); -const Messaging_1 = tslib_1.__importDefault(require("../../Messaging")); -/** - * Hook to fetch the content card UI for a given surface. - * @param surface - The surface to fetch the content card UI for. - * @returns An object containing the content card UI, error, loading state, and a refetch function. - */ -const useContentCardUI = (surface) => { - const [content, setContent] = (0, react_1.useState)([]); - const [error, setError] = (0, react_1.useState)(null); - const [isLoading, setIsLoading] = (0, react_1.useState)(false); - const fetchContent = (0, react_1.useCallback)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () { - try { - setIsLoading(true); - yield Messaging_1.default.updatePropositionsForSurfaces([surface]); - const content = yield Messaging_1.default.getContentCardUI(surface); - setContent(content); - setIsLoading(false); - } - catch (error) { - console.error(error); - setContent([]); - setError(error); - } - finally { - setIsLoading(false); - } - }), [surface]); - (0, react_1.useEffect)(() => { - fetchContent(); - }, [surface, fetchContent]); - return { content, error, isLoading, refetch: fetchContent }; -}; -exports.useContentCardUI = useContentCardUI; -//# sourceMappingURL=useContentCardUI.js.map \ No newline at end of file diff --git a/packages/messaging/dist/ui/hooks/useContentCardUI.js.map b/packages/messaging/dist/ui/hooks/useContentCardUI.js.map deleted file mode 100644 index b52ed7ad..00000000 --- a/packages/messaging/dist/ui/hooks/useContentCardUI.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"useContentCardUI.js","sourceRoot":"","sources":["../../../src/ui/hooks/useContentCardUI.ts"],"names":[],"mappings":";;;;AAAA,iCAAyD;AACzD,wEAAwC;AAGxC;;;;GAIG;AACI,MAAM,gBAAgB,GAAG,CAAC,OAAe,EAAE,EAAE;IAClD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAAoB,EAAE,CAAC,CAAC;IAC9D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAM,IAAI,CAAC,CAAC;IAC9C,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAElD,MAAM,YAAY,GAAG,IAAA,mBAAW,EAAC,GAAS,EAAE;QAC1C,IAAI;YACF,YAAY,CAAC,IAAI,CAAC,CAAC;YACnB,MAAM,mBAAS,CAAC,6BAA6B,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YACzD,MAAM,OAAO,GAAG,MAAM,mBAAS,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;YAC1D,UAAU,CAAC,OAAO,CAAC,CAAC;YACpB,YAAY,CAAC,KAAK,CAAC,CAAC;SACrB;QAAC,OAAO,KAAK,EAAE;YACd,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACrB,UAAU,CAAC,EAAE,CAAC,CAAC;YACf,QAAQ,CAAC,KAAK,CAAC,CAAC;SACjB;gBAAS;YACR,YAAY,CAAC,KAAK,CAAC,CAAC;SACrB;IACH,CAAC,CAAA,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,YAAY,EAAE,CAAC;IACjB,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;IAE5B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;AAC9D,CAAC,CAAC;AA1BW,QAAA,gBAAgB,oBA0B3B"} \ No newline at end of file diff --git a/packages/messaging/dist/ui/index.d.ts b/packages/messaging/dist/ui/index.d.ts deleted file mode 100644 index e246a6c0..00000000 --- a/packages/messaging/dist/ui/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from './components'; -export * from './hooks'; -export * from './theme'; -export * from './types'; diff --git a/packages/messaging/dist/ui/index.js b/packages/messaging/dist/ui/index.js deleted file mode 100644 index 68646891..00000000 --- a/packages/messaging/dist/ui/index.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const tslib_1 = require("tslib"); -tslib_1.__exportStar(require("./components"), exports); -tslib_1.__exportStar(require("./hooks"), exports); -tslib_1.__exportStar(require("./theme"), exports); -tslib_1.__exportStar(require("./types"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/messaging/dist/ui/index.js.map b/packages/messaging/dist/ui/index.js.map deleted file mode 100644 index 77f7563a..00000000 --- a/packages/messaging/dist/ui/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B;AAC7B,kDAAwB;AACxB,kDAAwB;AACxB,kDAAwB"} \ No newline at end of file diff --git a/packages/messaging/dist/ui/theme/Theme.d.ts b/packages/messaging/dist/ui/theme/Theme.d.ts deleted file mode 100644 index e2c1d685..00000000 --- a/packages/messaging/dist/ui/theme/Theme.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Represents the themes for the messaging UI. - * @interface Themes - * @property {Theme} light - The light theme. - * @property {Theme} dark - The dark theme. - */ -export interface Themes { - light: Theme; - dark: Theme; -} -/** - * Represents the theme for the messaging UI. - * @interface Theme - * @property {Colors} colors - The colors for the theme. - */ -export interface Theme { - colors: Colors; -} -/** - * Represents the colors for the theme. - * @interface Colors - * @property {string} primary - The primary color. - * @property {string} secondary - The secondary color. - * @property {string} background - The background color. - * @property {string} textPrimary - The primary text color. - * @property {string} textSecondary - The secondary text color. - * @property {string} imagePlaceholder - The image placeholder color. - * @property {string} buttonTextColor - The button text color. - */ -export interface Colors { - primary?: string; - secondary?: string; - background?: string; - textPrimary?: string; - textSecondary?: string; - imagePlaceholder?: string; - buttonTextColor?: string; -} diff --git a/packages/messaging/dist/ui/theme/Theme.js b/packages/messaging/dist/ui/theme/Theme.js deleted file mode 100644 index 19469521..00000000 --- a/packages/messaging/dist/ui/theme/Theme.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -/* - Copyright 2025 Adobe. All rights reserved. - This file is licensed to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law - or agreed to in writing, software distributed under the License is - distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF - ANY KIND, either express or implied. See the License for the specific - language governing permissions and limitations under the License. -*/ -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=Theme.js.map \ No newline at end of file diff --git a/packages/messaging/dist/ui/theme/Theme.js.map b/packages/messaging/dist/ui/theme/Theme.js.map deleted file mode 100644 index 80d36446..00000000 --- a/packages/messaging/dist/ui/theme/Theme.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Theme.js","sourceRoot":"","sources":["../../../src/ui/theme/Theme.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE"} \ No newline at end of file diff --git a/packages/messaging/dist/ui/theme/ThemeProvider.d.ts b/packages/messaging/dist/ui/theme/ThemeProvider.d.ts deleted file mode 100644 index 79762086..00000000 --- a/packages/messaging/dist/ui/theme/ThemeProvider.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import React, { ReactNode } from 'react'; -import { Theme, Themes } from './Theme'; -interface ThemeProviderProps { - children: ReactNode; - customThemes: Themes; -} -/** - * ThemeProvider component that provides the theme to the children components. - * - * @param children - The children components. - * @param customThemes - The custom themes to override the default themes. - * @returns The ThemeProvider component. - */ -export declare const ThemeProvider: ({ children, customThemes }: ThemeProviderProps) => React.JSX.Element; -/** - * useTheme hook that returns the theme context. - * @returns The theme context. - */ -export declare const useTheme: () => Theme; -export {}; diff --git a/packages/messaging/dist/ui/theme/ThemeProvider.js b/packages/messaging/dist/ui/theme/ThemeProvider.js deleted file mode 100644 index 541daf96..00000000 --- a/packages/messaging/dist/ui/theme/ThemeProvider.js +++ /dev/null @@ -1,87 +0,0 @@ -"use strict"; -/* - Copyright 2025 Adobe. All rights reserved. - This file is licensed to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law - or agreed to in writing, software distributed under the License is - distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF - ANY KIND, either express or implied. See the License for the specific - language governing permissions and limitations under the License. -*/ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.useTheme = exports.ThemeProvider = void 0; -const tslib_1 = require("tslib"); -const react_1 = tslib_1.__importStar(require("react")); -const react_native_1 = require("react-native"); -const defaultTheme = { - light: { - colors: { - primary: '#007AFF', - secondary: '#5856D6', - background: '#FFFFFF', - textPrimary: '#000000', - textSecondary: '#8E8E93', - imagePlaceholder: '#C7C7CC', - buttonTextColor: 'dodgerblue' - } - }, - dark: { - colors: { - primary: '#0A84FF', - secondary: '#5E5CE6', - background: '#262626', - textPrimary: '#FFFFFF', - textSecondary: '#8E8E93', - imagePlaceholder: '#48484A', - buttonTextColor: 'dodgerblue' - } - } -}; -const ThemeContext = (0, react_1.createContext)(undefined); -/** - * ThemeProvider component that provides the theme to the children components. - * - * @param children - The children components. - * @param customThemes - The custom themes to override the default themes. - * @returns The ThemeProvider component. - */ -const ThemeProvider = ({ children, customThemes }) => { - const systemColorScheme = (0, react_native_1.useColorScheme)(); - // Memoize the merged themes to avoid recreation on every render - const mergedThemes = (0, react_1.useMemo)(() => { - var _a, _b; - return ({ - light: { - colors: Object.assign(Object.assign({}, defaultTheme.light.colors), (((_a = customThemes === null || customThemes === void 0 ? void 0 : customThemes.light) === null || _a === void 0 ? void 0 : _a.colors) || {})) - }, - dark: { - colors: Object.assign(Object.assign({}, defaultTheme.dark.colors), (((_b = customThemes === null || customThemes === void 0 ? void 0 : customThemes.dark) === null || _b === void 0 ? void 0 : _b.colors) || {})) - } - }); - }, [customThemes]); - // Memoize the active theme - const activeTheme = (0, react_1.useMemo)(() => mergedThemes[systemColorScheme !== null && systemColorScheme !== void 0 ? systemColorScheme : 'light'], [mergedThemes, systemColorScheme]); - // Memoize the context value to prevent unnecessary re-renders - const contextValue = (0, react_1.useMemo)(() => activeTheme, [activeTheme]); - return ( - {children} - ); -}; -exports.ThemeProvider = ThemeProvider; -/** - * useTheme hook that returns the theme context. - * @returns The theme context. - */ -const useTheme = () => { - const context = (0, react_1.useContext)(ThemeContext); - const systemColorScheme = (0, react_native_1.useColorScheme)(); - if (context === undefined) { - return defaultTheme[systemColorScheme !== null && systemColorScheme !== void 0 ? systemColorScheme : 'light']; - } - return context; -}; -exports.useTheme = useTheme; -//# sourceMappingURL=ThemeProvider.js.map \ No newline at end of file diff --git a/packages/messaging/dist/ui/theme/ThemeProvider.js.map b/packages/messaging/dist/ui/theme/ThemeProvider.js.map deleted file mode 100644 index 6a46b2d6..00000000 --- a/packages/messaging/dist/ui/theme/ThemeProvider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ThemeProvider.js","sourceRoot":"","sources":["../../../src/ui/theme/ThemeProvider.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;EAWE;;;;AAEF,uDAA6E;AAC7E,+CAA8C;AAQ9C,MAAM,YAAY,GAAW;IAC3B,KAAK,EAAE;QACL,MAAM,EAAE;YACN,OAAO,EAAE,SAAS;YAClB,SAAS,EAAE,SAAS;YACpB,UAAU,EAAE,SAAS;YACrB,WAAW,EAAE,SAAS;YACtB,aAAa,EAAE,SAAS;YACxB,gBAAgB,EAAE,SAAS;YAC3B,eAAe,EAAE,YAAY;SAC9B;KACF;IACD,IAAI,EAAE;QACJ,MAAM,EAAE;YACN,OAAO,EAAE,SAAS;YAClB,SAAS,EAAE,SAAS;YACpB,UAAU,EAAE,SAAS;YACrB,WAAW,EAAE,SAAS;YACtB,aAAa,EAAE,SAAS;YACxB,gBAAgB,EAAE,SAAS;YAC3B,eAAe,EAAE,YAAY;SAC9B;KACF;CACF,CAAC;AAEF,MAAM,YAAY,GAAG,IAAA,qBAAa,EAAoB,SAAS,CAAC,CAAC;AAEjE;;;;;;GAMG;AACI,MAAM,aAAa,GAAG,CAAC,EAC5B,QAAQ,EACR,YAAY,EACO,EAAE,EAAE;IACvB,MAAM,iBAAiB,GAAG,IAAA,6BAAc,GAAE,CAAC;IAE3C,gEAAgE;IAChE,MAAM,YAAY,GAAW,IAAA,eAAO,EAClC,GAAG,EAAE;;QAAC,OAAA,CAAC;YACL,KAAK,EAAE;gBACL,MAAM,kCACD,YAAY,CAAC,KAAK,CAAC,MAAM,GACzB,CAAC,CAAA,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,KAAK,0CAAE,MAAM,KAAI,EAAE,CAAC,CACvC;aACF;YACD,IAAI,EAAE;gBACJ,MAAM,kCACD,YAAY,CAAC,IAAI,CAAC,MAAM,GACxB,CAAC,CAAA,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,0CAAE,MAAM,KAAI,EAAE,CAAC,CACtC;aACF;SACF,CAAC,CAAA;KAAA,EACF,CAAC,YAAY,CAAC,CACf,CAAC;IAEF,2BAA2B;IAC3B,MAAM,WAAW,GAAG,IAAA,eAAO,EACzB,GAAG,EAAE,CAAC,YAAY,CAAC,iBAAiB,aAAjB,iBAAiB,cAAjB,iBAAiB,GAAI,OAAO,CAAC,EAChD,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAClC,CAAC;IAEF,8DAA8D;IAC9D,MAAM,YAAY,GAAU,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAEtE,OAAO,CACL,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CACzC;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,YAAY,CAAC,QAAQ,CAAC,CACzB,CAAC;AACJ,CAAC,CAAC;AAvCW,QAAA,aAAa,iBAuCxB;AAEF;;;GAGG;AACI,MAAM,QAAQ,GAAG,GAAU,EAAE;IAClC,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,YAAY,CAAC,CAAC;IACzC,MAAM,iBAAiB,GAAG,IAAA,6BAAc,GAAE,CAAC;IAC3C,IAAI,OAAO,KAAK,SAAS,EAAE;QACzB,OAAO,YAAY,CAAC,iBAAiB,aAAjB,iBAAiB,cAAjB,iBAAiB,GAAI,OAAO,CAAC,CAAC;KACnD;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAPW,QAAA,QAAQ,YAOnB"} \ No newline at end of file diff --git a/packages/messaging/dist/ui/theme/index.d.ts b/packages/messaging/dist/ui/theme/index.d.ts deleted file mode 100644 index e306dfb6..00000000 --- a/packages/messaging/dist/ui/theme/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './Theme'; -export * from './ThemeProvider'; diff --git a/packages/messaging/dist/ui/theme/index.js b/packages/messaging/dist/ui/theme/index.js deleted file mode 100644 index d0aaba6a..00000000 --- a/packages/messaging/dist/ui/theme/index.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const tslib_1 = require("tslib"); -tslib_1.__exportStar(require("./Theme"), exports); -tslib_1.__exportStar(require("./ThemeProvider"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/messaging/dist/ui/theme/index.js.map b/packages/messaging/dist/ui/theme/index.js.map deleted file mode 100644 index db561502..00000000 --- a/packages/messaging/dist/ui/theme/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/theme/index.ts"],"names":[],"mappings":";;;AAAA,kDAAwB;AACxB,0DAAgC"} \ No newline at end of file diff --git a/packages/messaging/dist/ui/types/ContentViewEvent.d.ts b/packages/messaging/dist/ui/types/ContentViewEvent.d.ts deleted file mode 100644 index 987bb9ef..00000000 --- a/packages/messaging/dist/ui/types/ContentViewEvent.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * The event types for the ContentView component. - * - * @property {string} onDismiss - The event type for the onDismiss event when the dismiss button is pressed. - * @property {string} onDisplay - The event type for the onDisplay event when the content card is displayed. - * @property {string} onInteract - The event type for the interact event when the content is pressed. - */ -export type ContentViewEvent = 'onDismiss' | 'onDisplay' | 'onInteract'; diff --git a/packages/messaging/dist/ui/types/ContentViewEvent.js b/packages/messaging/dist/ui/types/ContentViewEvent.js deleted file mode 100644 index 81560eb1..00000000 --- a/packages/messaging/dist/ui/types/ContentViewEvent.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -/* - Copyright 2025 Adobe. All rights reserved. - This file is licensed to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law - or agreed to in writing, software distributed under the License is - distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF - ANY KIND, either express or implied. See the License for the specific - language governing permissions and limitations under the License. -*/ -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=ContentViewEvent.js.map \ No newline at end of file diff --git a/packages/messaging/dist/ui/types/ContentViewEvent.js.map b/packages/messaging/dist/ui/types/ContentViewEvent.js.map deleted file mode 100644 index b379414b..00000000 --- a/packages/messaging/dist/ui/types/ContentViewEvent.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ContentViewEvent.js","sourceRoot":"","sources":["../../../src/ui/types/ContentViewEvent.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE"} \ No newline at end of file diff --git a/packages/messaging/dist/ui/types/Templates.d.ts b/packages/messaging/dist/ui/types/Templates.d.ts deleted file mode 100644 index 05a3d8af..00000000 --- a/packages/messaging/dist/ui/types/Templates.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { ButtonProps, ImageProps, ImageStyle, PressableProps, TextProps, TextStyle, ViewStyle } from 'react-native'; -import { ViewProps } from 'react-native'; -import { ContentCard, ContentCardData, ContentCardTemplate } from '../../models/ContentCard'; -import { DismissButtonProps } from '../components/DismissButton/DismissButton'; -export declare class ContentTemplate extends ContentCard { - readonly type: ContentCardTemplate; - constructor(data: ContentCardData, type: ContentCardTemplate); -} -/** Overrides for the structural pieces of the content card */ -export interface ComponentOverrideProps { - BodyProps?: Partial; - ButtonContainerProps?: Partial; - ButtonProps?: Partial>; - ContainerProps?: Partial; - ContentContainerProps?: Partial; - DismissButtonProps?: DismissButtonProps; - ImageContainerProps?: Partial; - ImageProps?: Partial; - TextProps?: Partial; - TitleProps?: Partial; -} -/** The base style overrides available for content cards */ -export interface ContentCardStyles { - /** Applies to the root of the content card */ - card?: ViewStyle; - /** Applies to the container inside the content card, applied inside the card Pressable */ - container?: ViewStyle; - imageContainer?: ViewStyle; - image?: ImageStyle; - contentContainer?: ViewStyle; - /** Applies to title and body properties, will be overridden by title and body styles */ - text?: TextStyle; - title?: TextStyle; - body?: TextStyle; - buttonContainer?: ViewStyle; - button?: PressableProps['style']; - buttonText?: TextStyle; - dismissButton?: PressableProps['style']; -} -export type SmallImageContentStyle = ContentCardStyles; -export type LargeImageContentStyle = ContentCardStyles; -export type ImageOnlyContentStyle = Pick; diff --git a/packages/messaging/dist/ui/types/Templates.js b/packages/messaging/dist/ui/types/Templates.js deleted file mode 100644 index 2c07db77..00000000 --- a/packages/messaging/dist/ui/types/Templates.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ContentTemplate = void 0; -const ContentCard_1 = require("../../models/ContentCard"); -class ContentTemplate extends ContentCard_1.ContentCard { - constructor(data, type) { - super(data); - this.type = type; - } -} -exports.ContentTemplate = ContentTemplate; -//# sourceMappingURL=Templates.js.map \ No newline at end of file diff --git a/packages/messaging/dist/ui/types/Templates.js.map b/packages/messaging/dist/ui/types/Templates.js.map deleted file mode 100644 index feef442d..00000000 --- a/packages/messaging/dist/ui/types/Templates.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Templates.js","sourceRoot":"","sources":["../../../src/ui/types/Templates.ts"],"names":[],"mappings":";;;AAUA,0DAIkC;AAGlC,MAAa,eAAgB,SAAQ,yBAAW;IAG9C,YAAY,IAAqB,EAAE,IAAyB;QAC1D,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAPD,0CAOC"} \ No newline at end of file diff --git a/packages/messaging/dist/ui/types/index.d.ts b/packages/messaging/dist/ui/types/index.d.ts deleted file mode 100644 index f10eddb6..00000000 --- a/packages/messaging/dist/ui/types/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './ContentViewEvent'; -export * from './Templates'; diff --git a/packages/messaging/dist/ui/types/index.js b/packages/messaging/dist/ui/types/index.js deleted file mode 100644 index 2af0517b..00000000 --- a/packages/messaging/dist/ui/types/index.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const tslib_1 = require("tslib"); -tslib_1.__exportStar(require("./ContentViewEvent"), exports); -tslib_1.__exportStar(require("./Templates"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/messaging/dist/ui/types/index.js.map b/packages/messaging/dist/ui/types/index.js.map deleted file mode 100644 index d54676d0..00000000 --- a/packages/messaging/dist/ui/types/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/types/index.ts"],"names":[],"mappings":";;;AAAA,6DAAmC;AACnC,sDAA4B"} \ No newline at end of file diff --git a/packages/messaging/src/Messaging.ts b/packages/messaging/src/Messaging.ts index dff61945..95b8b332 100644 --- a/packages/messaging/src/Messaging.ts +++ b/packages/messaging/src/Messaging.ts @@ -269,8 +269,12 @@ class Messaging { } return contentCards.map((card: any) => { + // Test: To mark first 2 cards as read, swap the two map lines above to add index, then replace isRead with: + // return contentCards.map((card: any, index: number) => { const type = card.data?.meta?.adobe?.template ?? "SmallImage"; - return new ContentTemplate(card, type); + const isRead = card.data?.read ?? false; + // const isRead = card.data?.read ?? (index < 2); + return new ContentTemplate(card, type, isRead); }); } @@ -296,19 +300,19 @@ class Messaging { unread_indicator: { unread_bg: { clr: { - light: "#000000", - dark: "#000000", + light: "#FFF3E0", // Light orange background for unread cards + dark: "#2D1B0E", // Dark orange background for unread cards }, }, unread_icon: { placement: "topright", image: { - url: "https://www.adobe.com", - darkUrl: "https://www.adobe.com", + url: "https://icons.veryicon.com/png/o/leisure/crisp-app-icon-library-v3/notification-5.png", // Image in light mode + darkUrl: "", // Empty URL = shows dot in dark mode }, }, }, - isUnreadEnabled: false, + isUnreadEnabled: true, // Enable unread features! }, showPagination: false, }; diff --git a/packages/messaging/src/models/ContentCard.ts b/packages/messaging/src/models/ContentCard.ts index 10336f20..6b9bfc98 100644 --- a/packages/messaging/src/models/ContentCard.ts +++ b/packages/messaging/src/models/ContentCard.ts @@ -72,9 +72,11 @@ export interface ContentCardData extends PropositionItemData { } export class ContentCard extends PropositionItem { data: ContentCardData['data']; + isRead: boolean = false; - constructor(contentCardData: ContentCardData) { + constructor(contentCardData: ContentCardData, isRead: boolean = false) { super(contentCardData); this.data = contentCardData.data; + this.isRead = isRead; } } diff --git a/packages/messaging/src/ui/components/ContentCardView/ContentCardView.tsx b/packages/messaging/src/ui/components/ContentCardView/ContentCardView.tsx index 0c99c5fd..4b309cf6 100644 --- a/packages/messaging/src/ui/components/ContentCardView/ContentCardView.tsx +++ b/packages/messaging/src/ui/components/ContentCardView/ContentCardView.tsx @@ -33,14 +33,16 @@ import { StyleSheet, Text, useColorScheme, - View, -} from "react-native"; -import MessagingEdgeEventType from "../../../models/MessagingEdgeEventType"; -import DismissButton from "../DismissButton/DismissButton"; -import { useTheme } from "../../theme"; -import useAspectRatio from "../../hooks/useAspectRatio"; -import { ContentCardTemplate } from "../../../models"; -import Button from "../Button/Button"; + View +} from 'react-native'; +import MessagingEdgeEventType from '../../../models/MessagingEdgeEventType'; +import DismissButton from '../DismissButton/DismissButton'; +import UnreadIcon from '../UnreadIcon/UnreadIcon'; +import { useTheme } from '../../theme'; +import useAspectRatio from '../../hooks/useAspectRatio'; +import { ContentCardTemplate } from '../../../models'; +import Button from '../Button/Button'; +import useContainerSettings from '../../hooks/useContainerSettings'; /** * Callback function that is called when a content card event occurs. @@ -100,6 +102,27 @@ export const ContentCardView: React.FC = ({ const [isVisible, setIsVisible] = useState(true); const isDisplayedRef = useRef(false); const theme = useTheme(); + const containerSettings = useContainerSettings(); + // Track read state in component state + const [isRead, setIsRead] = useState(template.isRead); + + // Sync state when template changes + useEffect(() => { + setIsRead(template.isRead); + }, [template.isRead]); + + // Default to true if not specified + const isUnreadEnabled = containerSettings?.content?.isUnreadEnabled ?? true; + + // Get unread background color based on theme + const unreadBackgroundColor = useMemo(() => { + if (!isUnreadEnabled || isRead || !containerSettings?.content?.unread_indicator?.unread_bg) { + return undefined; + } + + const unreadBg = containerSettings.content.unread_indicator.unread_bg; + return colorScheme === 'dark' ? unreadBg.clr.dark : unreadBg.clr.light; + }, [isUnreadEnabled, isRead, containerSettings, colorScheme]); const cardVariant = useMemo( () => variant ?? template.type ?? "SmallImage", @@ -121,6 +144,10 @@ export const ContentCardView: React.FC = ({ // Track interaction event using propositionItem template.track?.("content_clicked", MessagingEdgeEventType.INTERACT, null); + // Mark as read when interacted with + template.isRead = true; + setIsRead(true); + if (template.data?.content?.actionUrl) { try { Linking.openURL(template.data.content.actionUrl); @@ -131,7 +158,7 @@ export const ContentCardView: React.FC = ({ ); } } - }, [template]); + }, [template, listener]); const imageUri = useMemo(() => { if (colorScheme === "dark" && template.data?.content?.image?.darkUrl) { @@ -199,6 +226,7 @@ export const ContentCardView: React.FC = ({ ? smallImageStyles.container : styles.container, styleOverrides?.container, + unreadBackgroundColor && { backgroundColor: unreadBackgroundColor } ]} {...ContainerProps} > @@ -289,6 +317,9 @@ export const ContentCardView: React.FC = ({ {...DismissButtonProps} /> )} + {isUnreadEnabled && !isRead && ( + + )} ); diff --git a/packages/messaging/src/ui/components/UnreadIcon/UnreadIcon.spec.tsx b/packages/messaging/src/ui/components/UnreadIcon/UnreadIcon.spec.tsx new file mode 100644 index 00000000..64089a0c --- /dev/null +++ b/packages/messaging/src/ui/components/UnreadIcon/UnreadIcon.spec.tsx @@ -0,0 +1,756 @@ +/* + Copyright 2025 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law + or agreed to in writing, software distributed under the License is + distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF + ANY KIND, either express or implied. See the License for the specific + language governing permissions and limitations under the License. +*/ +import React from 'react'; +import { render } from '@testing-library/react-native'; +import { useColorScheme, Image } from 'react-native'; +import UnreadIcon from './UnreadIcon'; +import ContentCardContainerProvider from '../../providers/ContentCardContainerProvider'; + +// Mock useColorScheme +jest.mock('react-native/Libraries/Utilities/useColorScheme'); +const mockUseColorScheme = useColorScheme as jest.MockedFunction< + typeof useColorScheme +>; + +describe('UnreadIcon', () => { + const mockContainerSettings = { + templateType: 'inbox' as const, + content: { + heading: { content: 'Test' }, + layout: { orientation: 'vertical' as const }, + capacity: 10, + emptyStateSettings: { message: { content: 'Empty' } }, + unread_indicator: { + unread_bg: { + clr: { + light: '#FFF3E0', + dark: '#2D1B0E', + }, + }, + unread_icon: { + placement: 'topright' as const, + image: { + url: 'https://example.com/icon.png', + darkUrl: '', + }, + }, + }, + isUnreadEnabled: true, + }, + showPagination: false, + }; + + beforeEach(() => { + jest.clearAllMocks(); + mockUseColorScheme.mockReturnValue('light'); + }); + + afterEach(() => { + jest.clearAllMocks(); + }); + + describe('Basic rendering', () => { + it('should render successfully with container settings', () => { + const { getByTestId } = render( + + + + ); + expect(getByTestId('unread-icon')).toBeTruthy(); + }); + + it('should render with custom size', () => { + const { getByTestId } = render( + + + + ); + expect(getByTestId('unread-icon')).toBeTruthy(); + }); + + it('should render without crashing when settings provide null', () => { + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + }); + + describe('Placement positions', () => { + it('should render with topright placement', () => { + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + + it('should render with topleft placement', () => { + const settings = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: { + ...mockContainerSettings.content.unread_indicator, + unread_icon: { + ...mockContainerSettings.content.unread_indicator.unread_icon, + placement: 'topleft' as const, + }, + }, + }, + }; + + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + + it('should render with bottomright placement', () => { + const settings = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: { + ...mockContainerSettings.content.unread_indicator, + unread_icon: { + ...mockContainerSettings.content.unread_indicator.unread_icon, + placement: 'bottomright' as const, + }, + }, + }, + }; + + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + + it('should render with bottomleft placement', () => { + const settings = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: { + ...mockContainerSettings.content.unread_indicator, + unread_icon: { + ...mockContainerSettings.content.unread_indicator.unread_icon, + placement: 'bottomleft' as const, + }, + }, + }, + }; + + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + }); + + describe('Light mode rendering', () => { + beforeEach(() => { + mockUseColorScheme.mockReturnValue('light'); + }); + + it('should render in light mode with image URL', () => { + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + + it('should render dot when URL is empty string in light mode', () => { + const settings = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: { + ...mockContainerSettings.content.unread_indicator, + unread_icon: { + ...mockContainerSettings.content.unread_indicator.unread_icon, + image: { + url: '', + darkUrl: '', + }, + }, + }, + }, + }; + + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + }); + + describe('Dark mode rendering', () => { + beforeEach(() => { + mockUseColorScheme.mockReturnValue('dark'); + }); + + it('should render in dark mode with darkUrl provided', () => { + const settings = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: { + ...mockContainerSettings.content.unread_indicator, + unread_icon: { + ...mockContainerSettings.content.unread_indicator.unread_icon, + image: { + url: 'https://example.com/light.png', + darkUrl: 'https://example.com/dark.png', + }, + }, + }, + }, + }; + + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + + it('should render dot when darkUrl is empty string in dark mode', () => { + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + + it('should fallback to light mode image when no darkUrl provided', () => { + const settings = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: { + ...mockContainerSettings.content.unread_indicator, + unread_icon: { + placement: 'topright' as const, + image: { + url: 'https://example.com/icon.png', + }, + }, + }, + }, + }; + + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + }); + + describe('Props-based rendering', () => { + it('should render with custom source prop when no settings provided', () => { + const settingsWithoutImage = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: undefined, + }, + }; + + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + + it('should render with custom darkSource prop', () => { + mockUseColorScheme.mockReturnValue('dark'); + + const settingsWithoutImage = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: undefined, + }, + }; + + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + + it('should render with custom position prop', () => { + const settingsWithoutImage = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: undefined, + }, + }; + + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + + it('should render as dot when type prop is "dot"', () => { + const settingsWithoutImage = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: undefined, + }, + }; + + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + + it('should render as image when type prop is "image"', () => { + const settingsWithoutImage = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: undefined, + }, + }; + + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + }); + + describe('Custom styles', () => { + it('should accept and apply custom imageStyle', () => { + const customImageStyle = { opacity: 0.8 }; + + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + + it('should accept and apply custom containerStyle', () => { + const customContainerStyle = { padding: 5 }; + + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + + it('should handle both imageStyle and containerStyle together', () => { + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + }); + + describe('Size variations', () => { + it('should render with default size of 20', () => { + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + + it('should render with custom size of 30', () => { + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + + it('should render with custom size of 15', () => { + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + + it('should handle very large size', () => { + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + + it('should handle very small size', () => { + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + }); + + describe('Context settings priority', () => { + it('should prioritize context settings over props', () => { + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + + it('should use props when context settings are not available', () => { + const settingsWithoutImage = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: undefined, + }, + }; + + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + }); + + describe('Image error handling', () => { + it('should render without crashing when image URL is invalid', () => { + const settings = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: { + ...mockContainerSettings.content.unread_indicator, + unread_icon: { + ...mockContainerSettings.content.unread_indicator.unread_icon, + image: { + url: 'invalid-url', + darkUrl: '', + }, + }, + }, + }, + }; + + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + }); + + describe('Edge cases', () => { + it('should handle undefined image URLs', () => { + const settings = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: { + ...mockContainerSettings.content.unread_indicator, + unread_icon: { + placement: 'topright' as const, + image: { + url: undefined as any, + darkUrl: undefined, + }, + }, + }, + }, + }; + + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + + it('should handle zero size', () => { + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + + it('should handle negative size', () => { + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + }); + + describe('Color scheme switching', () => { + it('should adapt to color scheme changes from light to dark', () => { + mockUseColorScheme.mockReturnValue('light'); + + const { rerender } = render( + + + + ); + + // Switch to dark mode + mockUseColorScheme.mockReturnValue('dark'); + + expect(() => { + rerender( + + + + ); + }).not.toThrow(); + }); + + it('should handle null color scheme', () => { + mockUseColorScheme.mockReturnValue(null); + + expect(() => { + render( + + + + ); + }).not.toThrow(); + }); + }); + + describe('Behavioral verification', () => { + it('should render an Image when valid URL is provided', () => { + const { UNSAFE_getByType } = render( + + + + ); + + // Should render an Image component when URL is provided + expect(() => UNSAFE_getByType(Image)).not.toThrow(); + }); + + it('should render dot when image URLs are empty', () => { + const settings = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: { + ...mockContainerSettings.content.unread_indicator, + unread_icon: { + ...mockContainerSettings.content.unread_indicator.unread_icon, + image: { + url: '', + darkUrl: '', + }, + }, + }, + }, + }; + + const { UNSAFE_queryByType } = render( + + + + ); + + // Should not render Image when URLs are empty + expect(UNSAFE_queryByType(Image)).toBeNull(); + }); + + it('should render image when source is provided even with type="dot"', () => { + const settingsWithoutImage = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: undefined, + }, + }; + + const { UNSAFE_getByType } = render( + + + + ); + + // Should render Image when source is provided, even if type is "dot" + // The presence of source overrides the type prop + expect(() => UNSAFE_getByType(Image)).not.toThrow(); + }); + + it('should use darkUrl in dark mode when provided', () => { + mockUseColorScheme.mockReturnValue('dark'); + + const settings = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: { + ...mockContainerSettings.content.unread_indicator, + unread_icon: { + placement: 'topright' as const, + image: { + url: 'https://example.com/light.png', + darkUrl: 'https://example.com/dark.png', + }, + }, + }, + }, + }; + + const { UNSAFE_getByType } = render( + + + + ); + + const imageComponent = UNSAFE_getByType(Image); + expect(imageComponent.props.source).toEqual({ uri: 'https://example.com/dark.png' }); + }); + + it('should fallback to light URL when no darkUrl in dark mode', () => { + mockUseColorScheme.mockReturnValue('dark'); + + const settings = { + ...mockContainerSettings, + content: { + ...mockContainerSettings.content, + unread_indicator: { + ...mockContainerSettings.content.unread_indicator, + unread_icon: { + placement: 'topright' as const, + image: { + url: 'https://example.com/light.png', + }, + }, + }, + }, + }; + + const { UNSAFE_getByType } = render( + + + + ); + + const imageComponent = UNSAFE_getByType(Image); + expect(imageComponent.props.source).toEqual({ uri: 'https://example.com/light.png' }); + }); + + it('should use light URL in light mode', () => { + mockUseColorScheme.mockReturnValue('light'); + + const { UNSAFE_getByType } = render( + + + + ); + + const imageComponent = UNSAFE_getByType(Image); + expect(imageComponent.props.source).toEqual({ uri: 'https://example.com/icon.png' }); + }); + }); +}); \ No newline at end of file diff --git a/packages/messaging/src/ui/components/UnreadIcon/UnreadIcon.tsx b/packages/messaging/src/ui/components/UnreadIcon/UnreadIcon.tsx index f24e902e..79805184 100644 --- a/packages/messaging/src/ui/components/UnreadIcon/UnreadIcon.tsx +++ b/packages/messaging/src/ui/components/UnreadIcon/UnreadIcon.tsx @@ -1,11 +1,242 @@ -import { Text, View } from "react-native"; +/* + Copyright 2025 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law + or agreed to in writing, software distributed under the License is + distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF + ANY KIND, either express or implied. See the License for the specific + language governing permissions and limitations under the License. +*/ +import React, { useState, useMemo, useEffect } from 'react'; +import { + Image, + ImageProps, + ImageStyle, + StyleSheet, + View, + ViewProps, + ViewStyle, + useColorScheme +} from 'react-native'; +import useContainerSettings from '../../hooks/useContainerSettings'; +import { SettingsPlacement } from '../../providers/ContentCardContainerProvider'; + +export interface UnreadIconProps extends ViewProps { + imageStyle?: ImageStyle; + containerStyle?: ViewStyle; + source?: ImageProps['source']; + darkSource?: ImageProps['source']; + size?: number; + position?: SettingsPlacement; + type?: 'dot' | 'image'; +} + +interface DotProps { + size: number; + backgroundColor: string; +} + +const Dot = ({ size, backgroundColor }: DotProps) => ( + +); + +const UnreadIcon = ({ + imageStyle, + containerStyle, + source, + darkSource, + size = 20, + position = 'topright', + type = 'dot', + style, + ...props +}: UnreadIconProps) => { + const colorScheme = useColorScheme(); + const settings = useContainerSettings(); + const [imageLoadError, setImageLoadError] = useState(false); + + // Get unread indicator settings from context + const unreadSettings = settings?.content.unread_indicator; + + // Use settings from context with fallbacks to props + const displayPosition = unreadSettings?.unread_icon?.placement ?? position; + + const imageSource = unreadSettings?.unread_icon?.image?.url ? + { uri: unreadSettings.unread_icon.image.url } : source; + const darkImageSource = unreadSettings?.unread_icon?.image?.darkUrl ? + { uri: unreadSettings.unread_icon.image.darkUrl } : darkSource; + + // Determine if we should render as image type (only if we have valid URLs) + const hasImageUrl = Boolean( + unreadSettings?.unread_icon?.image?.url || + unreadSettings?.unread_icon?.image?.darkUrl || + imageSource || + darkImageSource + ); + const renderType = hasImageUrl ? 'image' : type; + + // Reset error state when image source changes + useEffect(() => { + setImageLoadError(false); + }, [imageSource, darkImageSource]); + + const positionStyle = useMemo(() => { + switch (displayPosition) { + case 'topleft': + return styles.positionTopLeft; + case 'topright': + return styles.positionTopRight; + case 'bottomleft': + return styles.positionBottomLeft; + case 'bottomright': + return styles.positionBottomRight; + default: + return styles.positionTopRight; + } + }, [displayPosition]); + + // Use default contrasting colors for visibility + // Note: unread_bg.clr is for the card background, not the dot + const dotColor = useMemo(() => + colorScheme === 'dark' ? '#FF6B6B' : '#FF4444', + [colorScheme] + ); + + const finalImageSource = useMemo(() => + colorScheme === 'dark' && darkImageSource ? darkImageSource : imageSource, + [colorScheme, darkImageSource, imageSource] + ); + + const content = useMemo(() => { + // Check if we should show dot instead of image based on URL availability + const isEmptyUrlForCurrentMode = () => { + const imageSettings = unreadSettings?.unread_icon?.image; + if (!imageSettings) return false; + + if (colorScheme === 'dark') { + // In dark mode, show dot if darkUrl is empty string or if both darkUrl doesn't exist and url is empty + return imageSettings.darkUrl === '' || + (!imageSettings.darkUrl && imageSettings.url === ''); + } + + // In light mode, show dot if url is empty string + return imageSettings.url === ''; + }; + + // If URL is explicitly empty string for current mode, show dot + if (isEmptyUrlForCurrentMode()) { + return ; + } + + // If image failed to load, fallback to dot + if (renderType === 'image' && imageLoadError) { + return ; + } + + if (renderType === 'image' && (imageSource || darkImageSource)) { + return ( + { + console.warn('Failed to load unread icon image:', error.nativeEvent.error); + setImageLoadError(true); + }} + /> + ); + } + + // Default dot type + return ; + }, [ + colorScheme, + unreadSettings?.unread_icon?.image, + size, + dotColor, + renderType, + imageLoadError, + imageSource, + darkImageSource, + finalImageSource, + imageStyle + ]); -function UnreadIcon() { return ( - - UnreadIcon + + {content} ); -} +}; export default UnreadIcon; + +const styles = StyleSheet.create({ + container: { + position: 'absolute', + zIndex: 1000, + justifyContent: 'center', + alignItems: 'center', + }, + positionTopLeft: { + top: 6, + left: 6, + }, + positionTopRight: { + top: 6, + right: 6, + }, + positionBottomLeft: { + bottom: 6, + left: 6, + }, + positionBottomRight: { + bottom: 6, + right: 6, + }, + dot: { + shadowColor: '#000', + shadowOffset: { + width: 0, + height: 1, + }, + shadowOpacity: 0.22, + shadowRadius: 2.22, + elevation: 3, + }, + image: { + shadowColor: '#000', + shadowOffset: { + width: 0, + height: 1, + }, + shadowOpacity: 0.22, + shadowRadius: 2.22, + elevation: 3, + } +}); diff --git a/packages/messaging/src/ui/hooks/useContainerSettings.ts b/packages/messaging/src/ui/hooks/useContainerSettings.ts index bc9cabc5..6a3dc4a3 100644 --- a/packages/messaging/src/ui/hooks/useContainerSettings.ts +++ b/packages/messaging/src/ui/hooks/useContainerSettings.ts @@ -1,11 +1,8 @@ import { useContext } from "react"; -import { ContentCardContainerContext } from "../providers/ContentCardContainerProvider"; +import { ContentCardContainerContext, ContainerSettings } from "../providers/ContentCardContainerProvider"; -function useContainerSettings() { +function useContainerSettings(): ContainerSettings | null { const settings = useContext(ContentCardContainerContext); - if (!settings) { - throw new Error("useContainerSettings must be used within a ContentCardContainerProvider"); - } return settings; } diff --git a/packages/messaging/src/ui/index.ts b/packages/messaging/src/ui/index.ts index 384e6142..3916bd8a 100644 --- a/packages/messaging/src/ui/index.ts +++ b/packages/messaging/src/ui/index.ts @@ -1,4 +1,6 @@ export * from './components'; export * from './hooks'; export * from './theme'; -export * from './types'; \ No newline at end of file +export * from './types'; +export * from './providers/ContentCardContainerProvider'; +export { default as ContentCardContainerProvider } from './providers/ContentCardContainerProvider'; \ No newline at end of file diff --git a/packages/messaging/src/ui/providers/ContentCardContainerProvider.tsx b/packages/messaging/src/ui/providers/ContentCardContainerProvider.tsx index eb5027e9..ebb83be5 100644 --- a/packages/messaging/src/ui/providers/ContentCardContainerProvider.tsx +++ b/packages/messaging/src/ui/providers/ContentCardContainerProvider.tsx @@ -1,5 +1,7 @@ import React, { createContext } from "react"; +export type SettingsPlacement = 'topleft' | 'topright' | 'bottomleft' | 'bottomright'; + export interface ContainerSettings { templateType: 'inbox' | 'banner' | 'custom'; content: { @@ -27,14 +29,15 @@ export interface ContainerSettings { }; }; unread_icon: { - placement: 'topleft' | 'topright' | 'bottomleft' | 'bottomright'; + placement: SettingsPlacement; image: { url: string; darkUrl?: string; }; }; }; - isUnreadEnabled: boolean; + /** Whether the unread feature is enabled. Defaults to true. */ + isUnreadEnabled?: boolean; }; showPagination?: boolean; } diff --git a/packages/messaging/src/ui/types/Templates.ts b/packages/messaging/src/ui/types/Templates.ts index 84b62730..2760c79a 100644 --- a/packages/messaging/src/ui/types/Templates.ts +++ b/packages/messaging/src/ui/types/Templates.ts @@ -18,8 +18,8 @@ import { DismissButtonProps } from '../components/DismissButton/DismissButton'; export class ContentTemplate extends ContentCard { readonly type: ContentCardTemplate; - constructor(data: ContentCardData, type: ContentCardTemplate) { - super(data); + constructor(data: ContentCardData, type: ContentCardTemplate, isRead: boolean = false) { + super(data, isRead); this.type = type; } }