@moneylion/react-native-offer-carousel 1.10.0 → 1.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/lib/commonjs/capabilities/configuration/src/brands/checkVisualEligibility.js +13 -11
- package/lib/commonjs/capabilities/configuration/src/brands/checkVisualEligibility.js.map +1 -1
- package/lib/commonjs/capabilities/configuration/src/brands/createDerivedBrands.js +8 -19
- package/lib/commonjs/capabilities/configuration/src/brands/createDerivedBrands.js.map +1 -1
- package/lib/commonjs/capabilities/offer-catalog/src/utils/formatUtils.js +36 -21
- package/lib/commonjs/capabilities/offer-catalog/src/utils/formatUtils.js.map +1 -1
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/annualFee.js +7 -30
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/annualFee.js.map +1 -1
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.js +15 -17
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.js.map +1 -1
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.js +8 -2
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.js.map +1 -1
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/index.js +40 -38
- package/lib/commonjs/capabilities/offer-catalog/src/utils/stats/index.js.map +1 -1
- package/lib/commonjs/capabilities/offers/pipeline/src/sources/ratetables/withDeviceSignals.js +22 -12
- package/lib/commonjs/capabilities/offers/pipeline/src/sources/ratetables/withDeviceSignals.js.map +1 -1
- package/lib/commonjs/capabilities/ui/elements/src/components/MarkdownText/components.js +22 -10
- package/lib/commonjs/capabilities/ui/elements/src/components/MarkdownText/components.js.map +1 -1
- package/lib/commonjs/components/DynamicOffers/Render/Offer.js +51 -49
- package/lib/commonjs/components/DynamicOffers/Render/Offer.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/module/capabilities/configuration/src/brands/checkVisualEligibility.js +13 -11
- package/lib/module/capabilities/configuration/src/brands/checkVisualEligibility.js.map +1 -1
- package/lib/module/capabilities/configuration/src/brands/createDerivedBrands.js +7 -19
- package/lib/module/capabilities/configuration/src/brands/createDerivedBrands.js.map +1 -1
- package/lib/module/capabilities/offer-catalog/src/utils/formatUtils.js +35 -20
- package/lib/module/capabilities/offer-catalog/src/utils/formatUtils.js.map +1 -1
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/annualFee.js +7 -30
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/annualFee.js.map +1 -1
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.js +15 -17
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.js.map +1 -1
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.js +8 -2
- package/lib/module/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.js.map +1 -1
- package/lib/module/capabilities/offer-catalog/src/utils/stats/index.js +40 -38
- package/lib/module/capabilities/offer-catalog/src/utils/stats/index.js.map +1 -1
- package/lib/module/capabilities/offers/pipeline/src/sources/ratetables/withDeviceSignals.js +22 -11
- package/lib/module/capabilities/offers/pipeline/src/sources/ratetables/withDeviceSignals.js.map +1 -1
- package/lib/module/capabilities/ui/elements/src/components/MarkdownText/components.js +22 -10
- package/lib/module/capabilities/ui/elements/src/components/MarkdownText/components.js.map +1 -1
- package/lib/module/components/DynamicOffers/Render/Offer.js +51 -49
- package/lib/module/components/DynamicOffers/Render/Offer.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/apiEnvironment.d.ts.map +1 -0
- package/lib/typescript/builder/builder.d.ts.map +1 -0
- package/lib/typescript/builder/config/types.d.ts.map +1 -0
- package/lib/typescript/builder/index.d.ts.map +1 -0
- package/lib/typescript/capabilities/configuration/src/brands/checkVisualEligibility.d.ts.map +1 -0
- package/lib/typescript/capabilities/configuration/src/brands/createDerivedBrands.d.ts.map +1 -0
- package/lib/typescript/capabilities/configuration/src/brands/index.d.ts.map +1 -0
- package/lib/typescript/capabilities/configuration/src/brands/types.d.ts.map +1 -0
- package/lib/typescript/capabilities/configuration/src/userData/types.d.ts.map +1 -0
- package/lib/typescript/capabilities/core/src/index.d.ts.map +1 -0
- package/lib/typescript/capabilities/core/src/system/cnfContext/CnfContext.d.ts.map +1 -0
- package/lib/typescript/capabilities/core/src/system/cnfContext/schemas/App.d.ts.map +1 -0
- package/lib/typescript/capabilities/core/src/system/cnfContext/schemas/Brand.d.ts.map +1 -0
- package/lib/typescript/capabilities/core/src/system/cnfContext/schemas/Configuration.d.ts.map +1 -0
- package/lib/typescript/capabilities/core/src/system/cnfContext/schemas/Request.d.ts.map +1 -0
- package/lib/typescript/capabilities/core/src/system/cnfContext/schemas/Session.d.ts.map +1 -0
- package/lib/typescript/capabilities/core/src/system/cnfContext/schemas/Signals.d.ts.map +1 -0
- package/lib/typescript/capabilities/core/src/system/cnfContext/schemas/Subaccount.d.ts.map +1 -0
- package/lib/typescript/capabilities/core/src/system/cnfContext/schemas/index.d.ts.map +1 -0
- package/lib/typescript/capabilities/errors/types/index.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/api/offerCatalogApi.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/index.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/types/offerCatalogSchema.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/utils/arrayToMarkdownList.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/utils/contextUtil.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/utils/errorUtil.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/utils/formatUtils.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/utils/getEventCallbackContext.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/utils/getOfferUrl.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/annualFee.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/boolean.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/common.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/currency.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/index.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/percentage.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrency.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/index.d.ts.map +1 -0
- package/lib/typescript/capabilities/offer-catalog/src/utils/stats/types.d.ts.map +1 -0
- package/lib/typescript/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/index.d.ts.map +1 -0
- package/lib/typescript/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/oas/offer-catalog.d.ts.map +1 -0
- package/lib/typescript/capabilities/offers/pipeline/src/sources/ratetables/types/index.d.ts.map +1 -0
- package/lib/typescript/capabilities/offers/pipeline/src/sources/ratetables/withDeviceSignals.d.ts +20 -0
- package/lib/typescript/capabilities/offers/pipeline/src/sources/ratetables/withDeviceSignals.d.ts.map +1 -0
- package/lib/typescript/capabilities/ui/elements/src/components/MarkdownText/Abbreviation.d.ts.map +1 -0
- package/lib/typescript/capabilities/ui/elements/src/components/MarkdownText/components.d.ts.map +1 -0
- package/lib/typescript/capabilities/ui/elements/src/components/MarkdownText/index.d.ts.map +1 -0
- package/lib/typescript/capabilities/ui/elements/src/components/MarkdownText/markdownPreprocessor.d.ts.map +1 -0
- package/lib/typescript/capabilities/ui/elements/src/components/index.d.ts.map +1 -0
- package/lib/typescript/capabilities/ui/elements/src/components/thumbor/index.d.ts.map +1 -0
- package/lib/typescript/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.d.ts.map +1 -0
- package/lib/typescript/capabilities/ui/elements/src/index.d.ts.map +1 -0
- package/lib/typescript/capabilities/ui/elements/src/offerCardAttributes.d.ts.map +1 -0
- package/lib/typescript/components/Button/index.d.ts.map +1 -0
- package/lib/typescript/components/Common/BaseOfferCard/Content/Content.d.ts.map +1 -0
- package/lib/typescript/components/Common/BaseOfferCard/Content/index.d.ts.map +1 -0
- package/lib/typescript/components/Common/BaseOfferCard/Stat/Stat.d.ts.map +1 -0
- package/lib/typescript/components/Common/BaseOfferCard/Stat/index.d.ts.map +1 -0
- package/lib/typescript/components/Common/BaseOfferCard/StatsContainer/StatsContainer.d.ts.map +1 -0
- package/lib/typescript/components/Common/BaseOfferCard/StatsContainer/index.d.ts.map +1 -0
- package/lib/typescript/components/Common/BaseOfferCard/index.d.ts.map +1 -0
- package/lib/typescript/components/Common/DynamicOfferCard/CallToAction.d.ts.map +1 -0
- package/lib/typescript/components/Common/DynamicOfferCard/SeeMore.d.ts.map +1 -0
- package/lib/typescript/components/Common/DynamicOfferCard/index.d.ts.map +1 -0
- package/lib/typescript/components/Common/index.d.ts.map +1 -0
- package/lib/typescript/components/Divider/index.d.ts.map +1 -0
- package/lib/typescript/components/DynamicOffers/DynamicOffers.d.ts.map +1 -0
- package/lib/typescript/components/DynamicOffers/DynamicOffersContainer.d.ts.map +1 -0
- package/lib/typescript/components/DynamicOffers/Render/DynamicOffersRender.d.ts.map +1 -0
- package/lib/typescript/components/DynamicOffers/Render/FallbackOfferTemplate.d.ts.map +1 -0
- package/lib/typescript/components/DynamicOffers/Render/Offer.d.ts.map +1 -0
- package/lib/typescript/components/DynamicOffers/Render/index.d.ts.map +1 -0
- package/lib/typescript/components/DynamicOffers/SeeAllButton.d.ts.map +1 -0
- package/lib/typescript/components/ErrorBoundary/index.d.ts.map +1 -0
- package/lib/typescript/components/Layouts/CreditCardOfferCard/index.d.ts.map +1 -0
- package/lib/typescript/components/Layouts/CreditCardOfferCard/statsBuilder.d.ts.map +1 -0
- package/lib/typescript/components/Layouts/DefaultOfferCard/index.d.ts.map +1 -0
- package/lib/typescript/components/Layouts/DefaultOfferCard/statsBuilder.d.ts.map +1 -0
- package/lib/typescript/components/Layouts/HeadlineWithDescriptionCard/index.d.ts.map +1 -0
- package/lib/typescript/components/Layouts/index.d.ts.map +1 -0
- package/lib/typescript/components/Modal/AllOffersModal.d.ts.map +1 -0
- package/lib/typescript/components/Modal/DescriptionPoints.d.ts.map +1 -0
- package/lib/typescript/components/Modal/Disclaimer.d.ts.map +1 -0
- package/lib/typescript/components/Modal/OfferDetailsModal.d.ts.map +1 -0
- package/lib/typescript/components/MoneyLionOfferCarousel.d.ts.map +1 -0
- package/lib/typescript/components/Skeleton/Skeleton.d.ts.map +1 -0
- package/lib/typescript/components/Skeleton/index.d.ts.map +1 -0
- package/lib/typescript/components/Text/index.d.ts.map +1 -0
- package/lib/typescript/components/Touchable/TouchableOpacity.d.ts.map +1 -0
- package/lib/typescript/components/Touchable/index.d.ts.map +1 -0
- package/lib/typescript/components/View/index.d.ts.map +1 -0
- package/lib/typescript/components/utils/errorUtils.d.ts.map +1 -0
- package/lib/typescript/components/utils/withTestID.d.ts.map +1 -0
- package/lib/typescript/config/mocks/cnfContext.d.ts.map +1 -0
- package/lib/typescript/context/ConfigurationProvider.d.ts.map +1 -0
- package/lib/typescript/context/EventHandlerProvider.d.ts.map +1 -0
- package/lib/typescript/context/ThemeProvider.d.ts.map +1 -0
- package/lib/typescript/deps/configuration.d.ts.map +1 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/pageData.d.ts.map +1 -0
- package/lib/typescript/services/getDynamicOffers.d.ts.map +1 -0
- package/lib/typescript/services/getProductTypes.d.ts.map +1 -0
- package/lib/typescript/utils/addClientTagsToOfferLinks.d.ts.map +1 -0
- package/lib/typescript/utils/formatOfferUrl.d.ts.map +1 -0
- package/lib/typescript/utils/getDefaultProductType.d.ts.map +1 -0
- package/lib/typescript/utils/getEnableUseCachedOffers.d.ts.map +1 -0
- package/lib/typescript/utils/getOffersByProductTypes.d.ts.map +1 -0
- package/lib/typescript/utils/getProductTypesDefinition.d.ts.map +1 -0
- package/lib/typescript/utils/getThemeColors.d.ts.map +1 -0
- package/lib/typescript/utils/index.d.ts.map +1 -0
- package/lib/typescript/utils/parseStringProductTypes.d.ts.map +1 -0
- package/lib/typescript/utils/resolveProductTypes.d.ts.map +1 -0
- package/lib/typescript/utils/sortOffersByRecommendationScore.d.ts.map +1 -0
- package/lib/typescript/version.d.ts +2 -0
- package/lib/typescript/version.d.ts.map +1 -0
- package/package.json +3 -8
- package/src/capabilities/configuration/src/brands/checkVisualEligibility.ts +22 -16
- package/src/capabilities/configuration/src/brands/createDerivedBrands.ts +10 -23
- package/src/capabilities/offer-catalog/src/utils/formatUtils.ts +38 -19
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/annualFee.ts +19 -46
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.ts +17 -21
- package/src/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.ts +11 -8
- package/src/capabilities/offer-catalog/src/utils/stats/index.ts +40 -109
- package/src/capabilities/offers/pipeline/src/sources/ratetables/withDeviceSignals.ts +26 -17
- package/src/capabilities/ui/elements/src/components/MarkdownText/components.tsx +27 -6
- package/src/components/DynamicOffers/Render/Offer.tsx +34 -33
- package/src/version.ts +1 -1
- package/lib/typescript/src/apiEnvironment.d.ts.map +0 -1
- package/lib/typescript/src/builder/builder.d.ts.map +0 -1
- package/lib/typescript/src/builder/config/types.d.ts.map +0 -1
- package/lib/typescript/src/builder/index.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/configuration/src/brands/checkVisualEligibility.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/configuration/src/brands/createDerivedBrands.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/configuration/src/brands/index.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/configuration/src/brands/types.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/configuration/src/userData/types.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/core/src/index.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/CnfContext.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/App.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Brand.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Configuration.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Request.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Session.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Signals.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/Subaccount.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/core/src/system/cnfContext/schemas/index.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/errors/types/index.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/api/offerCatalogApi.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/index.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/types/offerCatalogSchema.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/arrayToMarkdownList.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/contextUtil.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/errorUtil.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/formatUtils.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/getEventCallbackContext.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/getOfferUrl.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/annualFee.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/boolean.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/common.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/creditBureaus.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/currency.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/currencyOrBasis.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/freeTrialDays.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/index.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/percentage.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrency.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rangeMonths.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rangePercent.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/recommendedCredit.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/formatters/rewardsDisplay.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/index.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offer-catalog/src/utils/stats/types.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/index.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offers/pipeline/src/sources/ratetables/offer-catalog/types/oas/offer-catalog.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offers/pipeline/src/sources/ratetables/types/index.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/offers/pipeline/src/sources/ratetables/withDeviceSignals.d.ts +0 -208
- package/lib/typescript/src/capabilities/offers/pipeline/src/sources/ratetables/withDeviceSignals.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/ui/elements/src/components/MarkdownText/Abbreviation.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/ui/elements/src/components/MarkdownText/components.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/ui/elements/src/components/MarkdownText/index.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/ui/elements/src/components/MarkdownText/markdownPreprocessor.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/ui/elements/src/components/index.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/ui/elements/src/components/thumbor/index.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/ui/elements/src/components/thumbor/useSvgUriViewBox.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/ui/elements/src/index.d.ts.map +0 -1
- package/lib/typescript/src/capabilities/ui/elements/src/offerCardAttributes.d.ts.map +0 -1
- package/lib/typescript/src/components/Button/index.d.ts.map +0 -1
- package/lib/typescript/src/components/Common/BaseOfferCard/Content/Content.d.ts.map +0 -1
- package/lib/typescript/src/components/Common/BaseOfferCard/Content/index.d.ts.map +0 -1
- package/lib/typescript/src/components/Common/BaseOfferCard/Stat/Stat.d.ts.map +0 -1
- package/lib/typescript/src/components/Common/BaseOfferCard/Stat/index.d.ts.map +0 -1
- package/lib/typescript/src/components/Common/BaseOfferCard/StatsContainer/StatsContainer.d.ts.map +0 -1
- package/lib/typescript/src/components/Common/BaseOfferCard/StatsContainer/index.d.ts.map +0 -1
- package/lib/typescript/src/components/Common/BaseOfferCard/index.d.ts.map +0 -1
- package/lib/typescript/src/components/Common/DynamicOfferCard/CallToAction.d.ts.map +0 -1
- package/lib/typescript/src/components/Common/DynamicOfferCard/SeeMore.d.ts.map +0 -1
- package/lib/typescript/src/components/Common/DynamicOfferCard/index.d.ts.map +0 -1
- package/lib/typescript/src/components/Common/index.d.ts.map +0 -1
- package/lib/typescript/src/components/Divider/index.d.ts.map +0 -1
- package/lib/typescript/src/components/DynamicOffers/DynamicOffers.d.ts.map +0 -1
- package/lib/typescript/src/components/DynamicOffers/DynamicOffersContainer.d.ts.map +0 -1
- package/lib/typescript/src/components/DynamicOffers/Render/DynamicOffersRender.d.ts.map +0 -1
- package/lib/typescript/src/components/DynamicOffers/Render/FallbackOfferTemplate.d.ts.map +0 -1
- package/lib/typescript/src/components/DynamicOffers/Render/Offer.d.ts.map +0 -1
- package/lib/typescript/src/components/DynamicOffers/Render/index.d.ts.map +0 -1
- package/lib/typescript/src/components/DynamicOffers/SeeAllButton.d.ts.map +0 -1
- package/lib/typescript/src/components/ErrorBoundary/index.d.ts.map +0 -1
- package/lib/typescript/src/components/Layouts/CreditCardOfferCard/index.d.ts.map +0 -1
- package/lib/typescript/src/components/Layouts/CreditCardOfferCard/statsBuilder.d.ts.map +0 -1
- package/lib/typescript/src/components/Layouts/DefaultOfferCard/index.d.ts.map +0 -1
- package/lib/typescript/src/components/Layouts/DefaultOfferCard/statsBuilder.d.ts.map +0 -1
- package/lib/typescript/src/components/Layouts/HeadlineWithDescriptionCard/index.d.ts.map +0 -1
- package/lib/typescript/src/components/Layouts/index.d.ts.map +0 -1
- package/lib/typescript/src/components/Modal/AllOffersModal.d.ts.map +0 -1
- package/lib/typescript/src/components/Modal/DescriptionPoints.d.ts.map +0 -1
- package/lib/typescript/src/components/Modal/Disclaimer.d.ts.map +0 -1
- package/lib/typescript/src/components/Modal/OfferDetailsModal.d.ts.map +0 -1
- package/lib/typescript/src/components/MoneyLionOfferCarousel.d.ts.map +0 -1
- package/lib/typescript/src/components/Skeleton/Skeleton.d.ts.map +0 -1
- package/lib/typescript/src/components/Skeleton/index.d.ts.map +0 -1
- package/lib/typescript/src/components/Text/index.d.ts.map +0 -1
- package/lib/typescript/src/components/Touchable/TouchableOpacity.d.ts.map +0 -1
- package/lib/typescript/src/components/Touchable/index.d.ts.map +0 -1
- package/lib/typescript/src/components/View/index.d.ts.map +0 -1
- package/lib/typescript/src/components/utils/errorUtils.d.ts.map +0 -1
- package/lib/typescript/src/components/utils/withTestID.d.ts.map +0 -1
- package/lib/typescript/src/config/mocks/cnfContext.d.ts.map +0 -1
- package/lib/typescript/src/context/ConfigurationProvider.d.ts.map +0 -1
- package/lib/typescript/src/context/EventHandlerProvider.d.ts.map +0 -1
- package/lib/typescript/src/context/ThemeProvider.d.ts.map +0 -1
- package/lib/typescript/src/deps/configuration.d.ts.map +0 -1
- package/lib/typescript/src/index.d.ts.map +0 -1
- package/lib/typescript/src/pageData.d.ts.map +0 -1
- package/lib/typescript/src/services/getDynamicOffers.d.ts.map +0 -1
- package/lib/typescript/src/services/getProductTypes.d.ts.map +0 -1
- package/lib/typescript/src/utils/addClientTagsToOfferLinks.d.ts.map +0 -1
- package/lib/typescript/src/utils/formatOfferUrl.d.ts.map +0 -1
- package/lib/typescript/src/utils/getDefaultProductType.d.ts.map +0 -1
- package/lib/typescript/src/utils/getEnableUseCachedOffers.d.ts.map +0 -1
- package/lib/typescript/src/utils/getOffersByProductTypes.d.ts.map +0 -1
- package/lib/typescript/src/utils/getProductTypesDefinition.d.ts.map +0 -1
- package/lib/typescript/src/utils/getThemeColors.d.ts.map +0 -1
- package/lib/typescript/src/utils/index.d.ts.map +0 -1
- package/lib/typescript/src/utils/parseStringProductTypes.d.ts.map +0 -1
- package/lib/typescript/src/utils/resolveProductTypes.d.ts.map +0 -1
- package/lib/typescript/src/utils/sortOffersByRecommendationScore.d.ts.map +0 -1
- package/lib/typescript/src/version.d.ts +0 -2
- package/lib/typescript/src/version.d.ts.map +0 -1
- /package/lib/typescript/{src/apiEnvironment.d.ts → apiEnvironment.d.ts} +0 -0
- /package/lib/typescript/{src/builder → builder}/builder.d.ts +0 -0
- /package/lib/typescript/{src/builder → builder}/config/types.d.ts +0 -0
- /package/lib/typescript/{src/builder → builder}/index.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/configuration/src/brands/checkVisualEligibility.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/configuration/src/brands/createDerivedBrands.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/configuration/src/brands/index.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/configuration/src/brands/types.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/configuration/src/userData/types.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/core/src/index.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/core/src/system/cnfContext/CnfContext.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/core/src/system/cnfContext/schemas/App.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/core/src/system/cnfContext/schemas/Brand.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/core/src/system/cnfContext/schemas/Configuration.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/core/src/system/cnfContext/schemas/Request.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/core/src/system/cnfContext/schemas/Session.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/core/src/system/cnfContext/schemas/Signals.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/core/src/system/cnfContext/schemas/Subaccount.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/core/src/system/cnfContext/schemas/index.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/errors/types/index.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/api/offerCatalogApi.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/index.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/types/offerCatalogSchema.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/utils/arrayToMarkdownList.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/utils/contextUtil.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/utils/errorUtil.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/utils/formatUtils.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/utils/getEventCallbackContext.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/utils/getOfferUrl.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/utils/stats/formatters/annualFee.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/utils/stats/formatters/boolean.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/utils/stats/formatters/common.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/utils/stats/formatters/creditBureaus.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/utils/stats/formatters/currency.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/utils/stats/formatters/currencyOrBasis.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/utils/stats/formatters/freeTrialDays.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/utils/stats/formatters/fromListStringWithAnd.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/utils/stats/formatters/index.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/utils/stats/formatters/monthlyOrAnnualCurrency.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/utils/stats/formatters/percentage.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/utils/stats/formatters/purchaseApr.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/utils/stats/formatters/rangeCurrency.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/utils/stats/formatters/rangeCurrencyByTime.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/utils/stats/formatters/rangeCurrencyUnabbreviated.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/utils/stats/formatters/rangeMonths.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/utils/stats/formatters/rangePercent.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/utils/stats/formatters/recommendedCredit.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/utils/stats/formatters/rewardsDisplay.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/utils/stats/index.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offer-catalog/src/utils/stats/types.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offers/pipeline/src/sources/ratetables/offer-catalog/types/index.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offers/pipeline/src/sources/ratetables/offer-catalog/types/oas/offer-catalog.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/offers/pipeline/src/sources/ratetables/types/index.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/ui/elements/src/components/MarkdownText/Abbreviation.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/ui/elements/src/components/MarkdownText/components.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/ui/elements/src/components/MarkdownText/index.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/ui/elements/src/components/MarkdownText/markdownPreprocessor.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/ui/elements/src/components/index.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/ui/elements/src/components/thumbor/index.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/ui/elements/src/components/thumbor/useSvgUriViewBox.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/ui/elements/src/index.d.ts +0 -0
- /package/lib/typescript/{src/capabilities → capabilities}/ui/elements/src/offerCardAttributes.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Button/index.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Common/BaseOfferCard/Content/Content.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Common/BaseOfferCard/Content/index.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Common/BaseOfferCard/Stat/Stat.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Common/BaseOfferCard/Stat/index.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Common/BaseOfferCard/StatsContainer/StatsContainer.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Common/BaseOfferCard/StatsContainer/index.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Common/BaseOfferCard/index.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Common/DynamicOfferCard/CallToAction.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Common/DynamicOfferCard/SeeMore.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Common/DynamicOfferCard/index.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Common/index.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Divider/index.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/DynamicOffers/DynamicOffers.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/DynamicOffers/DynamicOffersContainer.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/DynamicOffers/Render/DynamicOffersRender.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/DynamicOffers/Render/FallbackOfferTemplate.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/DynamicOffers/Render/Offer.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/DynamicOffers/Render/index.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/DynamicOffers/SeeAllButton.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/ErrorBoundary/index.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Layouts/CreditCardOfferCard/index.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Layouts/CreditCardOfferCard/statsBuilder.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Layouts/DefaultOfferCard/index.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Layouts/DefaultOfferCard/statsBuilder.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Layouts/HeadlineWithDescriptionCard/index.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Layouts/index.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Modal/AllOffersModal.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Modal/DescriptionPoints.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Modal/Disclaimer.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Modal/OfferDetailsModal.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/MoneyLionOfferCarousel.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Skeleton/Skeleton.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Skeleton/index.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Text/index.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Touchable/TouchableOpacity.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/Touchable/index.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/View/index.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/utils/errorUtils.d.ts +0 -0
- /package/lib/typescript/{src/components → components}/utils/withTestID.d.ts +0 -0
- /package/lib/typescript/{src/config → config}/mocks/cnfContext.d.ts +0 -0
- /package/lib/typescript/{src/context → context}/ConfigurationProvider.d.ts +0 -0
- /package/lib/typescript/{src/context → context}/EventHandlerProvider.d.ts +0 -0
- /package/lib/typescript/{src/context → context}/ThemeProvider.d.ts +0 -0
- /package/lib/typescript/{src/deps → deps}/configuration.d.ts +0 -0
- /package/lib/typescript/{src/index.d.ts → index.d.ts} +0 -0
- /package/lib/typescript/{src/pageData.d.ts → pageData.d.ts} +0 -0
- /package/lib/typescript/{src/services → services}/getDynamicOffers.d.ts +0 -0
- /package/lib/typescript/{src/services → services}/getProductTypes.d.ts +0 -0
- /package/lib/typescript/{src/utils → utils}/addClientTagsToOfferLinks.d.ts +0 -0
- /package/lib/typescript/{src/utils → utils}/formatOfferUrl.d.ts +0 -0
- /package/lib/typescript/{src/utils → utils}/getDefaultProductType.d.ts +0 -0
- /package/lib/typescript/{src/utils → utils}/getEnableUseCachedOffers.d.ts +0 -0
- /package/lib/typescript/{src/utils → utils}/getOffersByProductTypes.d.ts +0 -0
- /package/lib/typescript/{src/utils → utils}/getProductTypesDefinition.d.ts +0 -0
- /package/lib/typescript/{src/utils → utils}/getThemeColors.d.ts +0 -0
- /package/lib/typescript/{src/utils → utils}/index.d.ts +0 -0
- /package/lib/typescript/{src/utils → utils}/parseStringProductTypes.d.ts +0 -0
- /package/lib/typescript/{src/utils → utils}/resolveProductTypes.d.ts +0 -0
- /package/lib/typescript/{src/utils → utils}/sortOffersByRecommendationScore.d.ts +0 -0
|
@@ -10,8 +10,10 @@ var _Abbreviation = require("./Abbreviation");
|
|
|
10
10
|
var _reactNativeMarkdownDisplay = require("react-native-markdown-display");
|
|
11
11
|
var _Text = _interopRequireDefault(require("../../../../../../components/Text"));
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
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); }
|
|
13
14
|
const BoldText = ({
|
|
14
|
-
children
|
|
15
|
+
children,
|
|
16
|
+
testID
|
|
15
17
|
}) => {
|
|
16
18
|
const processChildren = _children => {
|
|
17
19
|
return _react.default.Children.map(_children, child => {
|
|
@@ -21,7 +23,6 @@ const BoldText = ({
|
|
|
21
23
|
}, child);
|
|
22
24
|
}
|
|
23
25
|
if (/*#__PURE__*/_react.default.isValidElement(child) && child.type === _Text.default) {
|
|
24
|
-
// Use a properly typed props object
|
|
25
26
|
const newProps = {
|
|
26
27
|
weight: "bold",
|
|
27
28
|
style: child.props.style
|
|
@@ -31,12 +32,18 @@ const BoldText = ({
|
|
|
31
32
|
return child;
|
|
32
33
|
});
|
|
33
34
|
};
|
|
34
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
35
|
+
return /*#__PURE__*/_react.default.createElement(_Text.default, {
|
|
36
|
+
testID: testID
|
|
37
|
+
}, processChildren(children));
|
|
35
38
|
};
|
|
36
39
|
|
|
37
40
|
// Helper to create text variants
|
|
38
|
-
const createTextVariant = props => (
|
|
39
|
-
return /*#__PURE__*/_react.default.createElement(_Text.default,
|
|
41
|
+
const createTextVariant = props => (node, children) => {
|
|
42
|
+
return /*#__PURE__*/_react.default.createElement(_Text.default, _extends({
|
|
43
|
+
key: node.key || `${node.type}-${node.index}`
|
|
44
|
+
}, props, {
|
|
45
|
+
testID: `${node.type}-${node.index}`
|
|
46
|
+
}), children);
|
|
40
47
|
};
|
|
41
48
|
const createMarkdownComponents = ({
|
|
42
49
|
numberOfLines,
|
|
@@ -73,7 +80,8 @@ const createMarkdownComponents = ({
|
|
|
73
80
|
weight: weight,
|
|
74
81
|
color: color,
|
|
75
82
|
numberOfLines: numberOfLines,
|
|
76
|
-
style: styles.bulletList
|
|
83
|
+
style: styles.bulletList,
|
|
84
|
+
testID: `${node.type}-${node.index}`
|
|
77
85
|
}, children);
|
|
78
86
|
},
|
|
79
87
|
// Links - Add detection for abbreviations in the text content
|
|
@@ -91,7 +99,8 @@ const createMarkdownComponents = ({
|
|
|
91
99
|
weight: weight,
|
|
92
100
|
color: color,
|
|
93
101
|
style: styles.linkText,
|
|
94
|
-
onPress: () => (0, _reactNativeMarkdownDisplay.openUrl)(node.attributes.href || "")
|
|
102
|
+
onPress: () => (0, _reactNativeMarkdownDisplay.openUrl)(node.attributes.href || ""),
|
|
103
|
+
testID: `${node.type}-${node.index}`
|
|
95
104
|
}, children);
|
|
96
105
|
},
|
|
97
106
|
// Custom parser for text to find potential abbreviation patterns
|
|
@@ -115,7 +124,8 @@ const createMarkdownComponents = ({
|
|
|
115
124
|
key: node.key || `${node.type}-${node.index}`,
|
|
116
125
|
variant: variant || "body-3",
|
|
117
126
|
weight: weight,
|
|
118
|
-
color: color
|
|
127
|
+
color: color,
|
|
128
|
+
testID: `${node.type}-${node.index}`
|
|
119
129
|
}, /*#__PURE__*/_react.default.createElement(_Text.default, {
|
|
120
130
|
variant: "body-1"
|
|
121
131
|
}, prefix, "\u2022 "), children);
|
|
@@ -126,11 +136,13 @@ const createMarkdownComponents = ({
|
|
|
126
136
|
key: node.key || `${node.type}-${node.index}`,
|
|
127
137
|
variant: variant,
|
|
128
138
|
weight: weight,
|
|
129
|
-
color: color
|
|
139
|
+
color: color,
|
|
140
|
+
testID: `${node.type}-${node.index}`
|
|
130
141
|
}, children);
|
|
131
142
|
},
|
|
132
143
|
strong: (node, children) => /*#__PURE__*/_react.default.createElement(BoldText, {
|
|
133
|
-
key: node.key || `${node.type}-${node.index}
|
|
144
|
+
key: node.key || `${node.type}-${node.index}`,
|
|
145
|
+
testID: `${node.type}-${node.index}`
|
|
134
146
|
}, children)
|
|
135
147
|
};
|
|
136
148
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_Abbreviation","_reactNativeMarkdownDisplay","_Text","e","__esModule","default","BoldText","children","processChildren","_children","React","Children","map","child","createElement","weight","isValidElement","type","Text","newProps","style","props","cloneElement","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_Abbreviation","_reactNativeMarkdownDisplay","_Text","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","BoldText","children","testID","processChildren","_children","React","Children","map","child","createElement","weight","isValidElement","type","Text","newProps","style","props","cloneElement","createTextVariant","node","key","index","createMarkdownComponents","numberOfLines","variant","color","isFirstListItem","heading1","heading2","heading3","heading4","heading5","bullet_list","styles","bulletList","link","attributes","title","Abbreviation","linkText","onPress","openUrl","href","text","content","list_item","prefix","paragraph","strong","exports","StyleSheet","create","marginVertical","flexDirection","alignItems","bulletPoint","width","height","borderRadius","backgroundColor","marginTop","marginRight","listItemText","marginBottom","textDecorationLine"],"sourceRoot":"../../../../../../../../src","sources":["capabilities/ui/elements/src/components/MarkdownText/components.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,2BAAA,GAAAH,OAAA;AAKA,IAAAI,KAAA,GAAAL,sBAAA,CAAAC,OAAA;AAI2C,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,SAAA,WAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,CAAA,aAAAP,CAAA,MAAAA,CAAA,GAAAQ,SAAA,CAAAC,MAAA,EAAAT,CAAA,UAAAU,CAAA,GAAAF,SAAA,CAAAR,CAAA,YAAAW,CAAA,IAAAD,CAAA,OAAAE,cAAA,CAAAC,IAAA,CAAAH,CAAA,EAAAC,CAAA,MAAAJ,CAAA,CAAAI,CAAA,IAAAD,CAAA,CAAAC,CAAA,aAAAJ,CAAA,KAAAJ,QAAA,CAAAW,KAAA,OAAAN,SAAA;AAG3C,MAAMO,QAAQ,GAAGA,CAAC;EACjBC,QAAQ;EACRC;AAID,CAAC,KAAK;EACL,MAAMC,eAAe,GAAIC,SAA0B,IAAK;IACvD,OAAOC,cAAK,CAACC,QAAQ,CAACC,GAAG,CAACH,SAAS,EAAGI,KAAK,IAAK;MAC/C,IAAI,OAAO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ACDC,WAAW,EAAE;IACZC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,CAAC;IACTC,YAAY,EAAE,CAAC;IACfC,eAAe,EAAE,OAAO;IACxBC,SAAS,EAAE,CAAC;IACZC,WAAW,EAAE;EACd,CAAC;EACDC,YAAY,EAAE;IACbC,YAAY,EAAE;EACf,CAAC;EACDxB,QAAQ,EAAE;IACTyB,kBAAkB,EAAE;EACrB;AACD,CAAC,CAAC","ignoreList":[]}
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Offer = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _tsPattern = require("ts-pattern");
|
|
9
8
|
var _Layouts = require("../../Layouts");
|
|
10
9
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
11
10
|
const Offer = ({
|
|
@@ -25,56 +24,59 @@ const Offer = ({
|
|
|
25
24
|
please add it to the productTypeBuilder or inform a fallback template`);
|
|
26
25
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
|
27
26
|
}
|
|
27
|
+
const renderCard = () => {
|
|
28
|
+
if (!builder) {
|
|
29
|
+
if (!fallbackTemplate) return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
|
30
|
+
const FallbackTemplate = fallbackTemplate;
|
|
31
|
+
return /*#__PURE__*/_react.default.createElement(FallbackTemplate, {
|
|
32
|
+
showCardBorder: showCardBorder,
|
|
33
|
+
offerIndex: offerIndex,
|
|
34
|
+
key: `${offerIndex}-${offer.uuid}`,
|
|
35
|
+
offer: offer,
|
|
36
|
+
showProductTypeLabel: showProductTypeLabel,
|
|
37
|
+
fullCardWidth: fullCardWidth,
|
|
38
|
+
isHorizontalScroll: isHorizontalScroll
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
switch (builder.layout) {
|
|
42
|
+
case "defaultOfferCard":
|
|
43
|
+
return /*#__PURE__*/_react.default.createElement(_Layouts.DefaultOfferCard, {
|
|
44
|
+
offerIndex: offerIndex,
|
|
45
|
+
key: `${offerIndex}-${offer.uuid}`,
|
|
46
|
+
offer: offer,
|
|
47
|
+
productTypeBuilder: builder,
|
|
48
|
+
showCardBorder: showCardBorder,
|
|
49
|
+
showProductTypeLabel: showProductTypeLabel,
|
|
50
|
+
fullCardWidth: fullCardWidth,
|
|
51
|
+
isHorizontalScroll: isHorizontalScroll
|
|
52
|
+
});
|
|
53
|
+
case "creditCardOfferCard":
|
|
54
|
+
return /*#__PURE__*/_react.default.createElement(_Layouts.CreditCardOfferCard, {
|
|
55
|
+
offerIndex: offerIndex,
|
|
56
|
+
key: `${offerIndex}-${offer.uuid}`,
|
|
57
|
+
offer: offer,
|
|
58
|
+
productTypeBuilder: builder,
|
|
59
|
+
showCardBorder: showCardBorder,
|
|
60
|
+
showProductTypeLabel: showProductTypeLabel,
|
|
61
|
+
fullCardWidth: fullCardWidth,
|
|
62
|
+
isHorizontalScroll: isHorizontalScroll
|
|
63
|
+
});
|
|
64
|
+
case "headlineWithDescriptionCard":
|
|
65
|
+
return /*#__PURE__*/_react.default.createElement(_Layouts.HeadlineWithDescriptionCard, {
|
|
66
|
+
offerIndex: offerIndex,
|
|
67
|
+
key: `${offerIndex}-${offer.uuid}`,
|
|
68
|
+
offer: offer,
|
|
69
|
+
productTypeBuilder: builder,
|
|
70
|
+
showCardBorder: showCardBorder,
|
|
71
|
+
showProductTypeLabel: showProductTypeLabel,
|
|
72
|
+
fullCardWidth: fullCardWidth,
|
|
73
|
+
isHorizontalScroll: isHorizontalScroll
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
};
|
|
28
77
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, {
|
|
29
78
|
key: `${offerIndex}-${offer.uuid}`
|
|
30
|
-
}, (
|
|
31
|
-
layout: "defaultOfferCard"
|
|
32
|
-
}, layout => /*#__PURE__*/_react.default.createElement(_Layouts.DefaultOfferCard, {
|
|
33
|
-
offerIndex: offerIndex,
|
|
34
|
-
key: `${offerIndex}-${offer.uuid}`,
|
|
35
|
-
offer: offer,
|
|
36
|
-
productTypeBuilder: layout,
|
|
37
|
-
showCardBorder: showCardBorder,
|
|
38
|
-
showProductTypeLabel: showProductTypeLabel,
|
|
39
|
-
fullCardWidth: fullCardWidth,
|
|
40
|
-
isHorizontalScroll: isHorizontalScroll
|
|
41
|
-
})).with({
|
|
42
|
-
layout: "creditCardOfferCard"
|
|
43
|
-
}, layout => /*#__PURE__*/_react.default.createElement(_Layouts.CreditCardOfferCard, {
|
|
44
|
-
offerIndex: offerIndex,
|
|
45
|
-
key: `${offerIndex}-${offer.uuid}`,
|
|
46
|
-
offer: offer,
|
|
47
|
-
productTypeBuilder: layout,
|
|
48
|
-
showCardBorder: showCardBorder,
|
|
49
|
-
showProductTypeLabel: showProductTypeLabel,
|
|
50
|
-
fullCardWidth: fullCardWidth,
|
|
51
|
-
isHorizontalScroll: isHorizontalScroll
|
|
52
|
-
})).with({
|
|
53
|
-
layout: "headlineWithDescriptionCard"
|
|
54
|
-
}, layout => /*#__PURE__*/_react.default.createElement(_Layouts.HeadlineWithDescriptionCard, {
|
|
55
|
-
offerIndex: offerIndex,
|
|
56
|
-
key: `${offerIndex}-${offer.uuid}`,
|
|
57
|
-
offer: offer,
|
|
58
|
-
productTypeBuilder: layout,
|
|
59
|
-
showCardBorder: showCardBorder,
|
|
60
|
-
showProductTypeLabel: showProductTypeLabel,
|
|
61
|
-
fullCardWidth: fullCardWidth,
|
|
62
|
-
isHorizontalScroll: isHorizontalScroll
|
|
63
|
-
})).with(undefined, () => {
|
|
64
|
-
if (!fallbackTemplate) {
|
|
65
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
|
66
|
-
}
|
|
67
|
-
const FallbackTemplate = fallbackTemplate;
|
|
68
|
-
return /*#__PURE__*/_react.default.createElement(FallbackTemplate, {
|
|
69
|
-
showCardBorder: showCardBorder,
|
|
70
|
-
offerIndex: offerIndex,
|
|
71
|
-
key: `${offerIndex}-${offer.uuid}`,
|
|
72
|
-
offer: offer,
|
|
73
|
-
showProductTypeLabel: showProductTypeLabel,
|
|
74
|
-
fullCardWidth: fullCardWidth,
|
|
75
|
-
isHorizontalScroll: isHorizontalScroll
|
|
76
|
-
});
|
|
77
|
-
}).exhaustive());
|
|
79
|
+
}, renderCard());
|
|
78
80
|
});
|
|
79
81
|
exports.Offer = Offer;
|
|
80
82
|
//# sourceMappingURL=Offer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_Layouts","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","Offer","productTypeBuilder","offers","showProductTypeLabel","fallbackTemplate","showCardBorder","fullCardWidth","isHorizontalScroll","map","offer","offerIndex","builder","find","productTypes","includes","productType","console","error","createElement","Fragment","renderCard","FallbackTemplate","key","uuid","layout","DefaultOfferCard","CreditCardOfferCard","HeadlineWithDescriptionCard","exports"],"sourceRoot":"../../../../../src","sources":["components/DynamicOffers/Render/Offer.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,QAAA,GAAAD,OAAA;AAIuB,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OA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AC;MAEJ,KAAK,qBAAqB;QACzB,oBACC9B,MAAA,CAAAc,OAAA,CAAA2B,aAAA,CAACtC,QAAA,CAAA8C,mBAAmB;UACnBhB,UAAU,EAAEA,UAAW;UACvBY,GAAG,EAAE,GAAGZ,UAAU,IAAID,KAAK,CAACc,IAAI,EAAG;UACnCd,KAAK,EAAEA,KAAM;UACbR,kBAAkB,EAAEU,OAAQ;UAC5BN,cAAc,EAAEA,cAAe;UAC/BF,oBAAoB,EAAEA,oBAAqB;UAC3CG,aAAa,EAAEA,aAAc;UAC7BC,kBAAkB,EAAEA;QAAmB,CACvC,CAAC;MAEJ,KAAK,6BAA6B;QACjC,oBACC9B,MAAA,CAAAc,OAAA,CAAA2B,aAAA,CAACtC,QAAA,CAAA+C,2BAA2B;UAC3BjB,UAAU,EAAEA,UAAW;UACvBY,GAAG,EAAE,GAAGZ,UAAU,IAAID,KAAK,CAACc,IAAI,EAAG;UACnCd,KAAK,EAAEA,KAAM;UACbR,kBAAkB,EAAEU,OAAQ;UAC5BN,cAAc,EAAEA,cAAe;UAC/BF,oBAAoB,EAAEA,oBAAqB;UAC3CG,aAAa,EAAEA,aAAc;UAC7BC,kBAAkB,EAAEA;QAAmB,CACvC,CAAC;IAEL;EACD,CAAC;EAED,oBACC9B,MAAA,CAAAc,OAAA,CAAA2B,aAAA,CAACzC,MAAA,CAAA0C,QAAQ;IAACG,GAAG,EAAE,GAAGZ,UAAU,IAAID,KAAK,CAACc,IAAI;EAAG,GAAEH,UAAU,CAAC,CAAY,CAAC;AAEzE,CAAC,CAAC;AAACQ,OAAA,CAAA5B,KAAA,GAAAA,KAAA","ignoreList":[]}
|
package/lib/commonjs/version.js
CHANGED
|
@@ -5,5 +5,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.VERSION = void 0;
|
|
7
7
|
// Version is kept in sync with package.json via the sync-version script
|
|
8
|
-
const VERSION = exports.VERSION = "1.10.
|
|
8
|
+
const VERSION = exports.VERSION = "1.10.2";
|
|
9
9
|
//# sourceMappingURL=version.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { get } from "radash";
|
|
2
2
|
import { enhanceType } from "./types";
|
|
3
|
-
import { match, P } from "ts-pattern";
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* A UI centric concept that prioritizes brands for visual use, both by the data available and the preferences of the brand.
|
|
@@ -11,14 +10,17 @@ import { match, P } from "ts-pattern";
|
|
|
11
10
|
* Used to rank a primary eligible brand highest if no brand prefers primary, such as a licensed brand
|
|
12
11
|
* @param brand
|
|
13
12
|
*/
|
|
14
|
-
export const checkVisualBrandEligibility = brand =>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
logo: true
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
export const checkVisualBrandEligibility = brand => {
|
|
14
|
+
const type = enhanceType(brand);
|
|
15
|
+
const allowedMarks = get(brand, "allowedMarks");
|
|
16
|
+
const hasFullMarks = (allowedMarks === null || allowedMarks === void 0 ? void 0 : allowedMarks.logo) === true && (allowedMarks === null || allowedMarks === void 0 ? void 0 : allowedMarks.name) === true;
|
|
17
|
+
const hasNameOnlyMarks = (allowedMarks === null || allowedMarks === void 0 ? void 0 : allowedMarks.logo) === false && (allowedMarks === null || allowedMarks === void 0 ? void 0 : allowedMarks.name) === true;
|
|
18
|
+
if ((brand === null || brand === void 0 ? void 0 : brand.isLicensed) === true) return "primary";
|
|
19
|
+
if ((type === "business" || type === "product") && hasFullMarks) {
|
|
20
|
+
return "primary";
|
|
21
|
+
}
|
|
22
|
+
if (type === "individual") return "secondary";
|
|
23
|
+
if (type === "business" && hasNameOnlyMarks) return "secondary";
|
|
24
|
+
return "none";
|
|
25
|
+
};
|
|
24
26
|
//# sourceMappingURL=checkVisualEligibility.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["get","enhanceType","
|
|
1
|
+
{"version":3,"names":["get","enhanceType","checkVisualBrandEligibility","brand","type","allowedMarks","hasFullMarks","logo","name","hasNameOnlyMarks","isLicensed"],"sourceRoot":"../../../../../../src","sources":["capabilities/configuration/src/brands/checkVisualEligibility.ts"],"mappings":"AAAA,SAASA,GAAG,QAAQ,QAAQ;AAC5B,SAASC,WAAW,QAAoB,SAAS;;AAEjD;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,2BAA2B,GAAIC,KAAY,IAAsB;EAC7E,MAAMC,IAAI,GAAGH,WAAW,CAACE,KAAK,CAAC;EAC/B,MAAME,YAAY,GAAGL,GAAG,CACvBG,KAAK,EACL,cACD,CAAC;EAED,MAAMG,YAAY,GACjB,CAAAD,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEE,IAAI,MAAK,IAAI,IAAI,CAAAF,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEG,IAAI,MAAK,IAAI;EAC3D,MAAMC,gBAAgB,GACrB,CAAAJ,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEE,IAAI,MAAK,KAAK,IAAI,CAAAF,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEG,IAAI,MAAK,IAAI;EAE5D,IAAI,CAAAL,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEO,UAAU,MAAK,IAAI,EAAE,OAAO,SAAS;EAChD,IAAI,CAACN,IAAI,KAAK,UAAU,IAAIA,IAAI,KAAK,SAAS,KAAKE,YAAY,EAAE;IAChE,OAAO,SAAS;EACjB;EAEA,IAAIF,IAAI,KAAK,YAAY,EAAE,OAAO,WAAW;EAC7C,IAAIA,IAAI,KAAK,UAAU,IAAIK,gBAAgB,EAAE,OAAO,WAAW;EAE/D,OAAO,MAAM;AACd,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { isObject, sift } from "radash";
|
|
2
|
-
import { P, match } from "ts-pattern";
|
|
3
2
|
import { enhanceType } from "./types";
|
|
4
3
|
import { checkVisualBrandEligibility } from "./checkVisualEligibility";
|
|
4
|
+
const resolveLicensedBrand = brand => {
|
|
5
|
+
if (enhanceType(brand) === "licensed") return brand;
|
|
6
|
+
const candidate = (brand === null || brand === void 0 ? void 0 : brand.isLicensed) || (brand === null || brand === void 0 ? void 0 : brand.licensedBrand);
|
|
7
|
+
if (isObject(candidate)) return candidate;
|
|
8
|
+
throw new Error("Missing Licensed Brand");
|
|
9
|
+
};
|
|
5
10
|
|
|
6
11
|
/**
|
|
7
12
|
* Extracts and normalizes a brand into -
|
|
@@ -10,24 +15,7 @@ import { checkVisualBrandEligibility } from "./checkVisualEligibility";
|
|
|
10
15
|
* @param brand
|
|
11
16
|
*/
|
|
12
17
|
export const createDerivedBrands = brand => {
|
|
13
|
-
|
|
14
|
-
const licensedBrand = match([enhanceType(brand), (brand === null || brand === void 0 ? void 0 : brand.isLicensed) || (brand === null || brand === void 0 ? void 0 : brand.licensedBrand)])
|
|
15
|
-
// Ensure we get back a brand at the end
|
|
16
|
-
.returnType()
|
|
17
|
-
// If the type is licensed, return this brand
|
|
18
|
-
.with(["licensed", P._], () => brand)
|
|
19
|
-
// If the type is not licensed, but there is a cobrand setup, use that to get the licensed brand
|
|
20
|
-
.with([P.not("licensed"), P.select("licensedBrandObj")], ({
|
|
21
|
-
licensedBrandObj
|
|
22
|
-
}) => {
|
|
23
|
-
if (isObject(licensedBrandObj)) return licensedBrandObj;
|
|
24
|
-
// Throw if no licensed brand is able to be found
|
|
25
|
-
throw new Error("Missing Licensed Brand");
|
|
26
|
-
}).otherwise(() => {
|
|
27
|
-
throw new Error("Missing Licensed Brand");
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
// Determine the set of visual brands which should be displayed on the page
|
|
18
|
+
const licensedBrand = resolveLicensedBrand(brand);
|
|
31
19
|
const brandCanBeShown = checkVisualBrandEligibility(brand) !== "none";
|
|
32
20
|
return Array.from(new Set(sift([licensedBrand, brandCanBeShown && brand])));
|
|
33
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isObject","sift","
|
|
1
|
+
{"version":3,"names":["isObject","sift","enhanceType","checkVisualBrandEligibility","resolveLicensedBrand","brand","candidate","isLicensed","licensedBrand","Error","createDerivedBrands","brandCanBeShown","Array","from","Set"],"sourceRoot":"../../../../../../src","sources":["capabilities/configuration/src/brands/createDerivedBrands.ts"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,IAAI,QAAQ,QAAQ;AAEvC,SAASC,WAAW,QAAQ,SAAS;AACrC,SAASC,2BAA2B,QAAQ,0BAA0B;AAEtE,MAAMC,oBAAoB,GAAIC,KAAY,IAAY;EACrD,IAAIH,WAAW,CAACG,KAAK,CAAC,KAAK,UAAU,EAAE,OAAOA,KAAK;EAEnD,MAAMC,SAAS,GAAG,CAAAD,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEE,UAAU,MAAIF,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEG,aAAa;EAC3D,IAAIR,QAAQ,CAACM,SAAS,CAAC,EAAE,OAAOA,SAAS;EAEzC,MAAM,IAAIG,KAAK,CAAC,wBAAwB,CAAC;AAC1C,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,GAAIL,KAAY,IAAK;EACpD,MAAMG,aAAa,GAAGJ,oBAAoB,CAACC,KAAK,CAAC;EAEjD,MAAMM,eAAe,GAAGR,2BAA2B,CAACE,KAAK,CAAC,KAAK,MAAM;EACrE,OAAOO,KAAK,CAACC,IAAI,CAAC,IAAIC,GAAG,CAACb,IAAI,CAAC,CAACO,aAAa,EAAEG,eAAe,IAAIN,KAAK,CAAC,CAAC,CAAC,CAAC;AAC5E,CAAC","ignoreList":[]}
|
|
@@ -1,4 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
const formatNumberWithMantissa = (value, mantissa, trimMantissa, thousandSeparated) => {
|
|
2
|
+
let str = value.toFixed(mantissa);
|
|
3
|
+
if (trimMantissa && str.includes(".")) {
|
|
4
|
+
str = str.replace(/0+$/, "").replace(/\.$/, "");
|
|
5
|
+
}
|
|
6
|
+
if (thousandSeparated) {
|
|
7
|
+
const [intPart, decPart] = str.split(".");
|
|
8
|
+
const withCommas = (intPart ?? "").replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
9
|
+
str = decPart !== undefined ? `${withCommas}.${decPart}` : withCommas;
|
|
10
|
+
}
|
|
11
|
+
return str;
|
|
12
|
+
};
|
|
13
|
+
const COMPACT_UNITS = [{
|
|
14
|
+
threshold: 1e12,
|
|
15
|
+
suffix: "T"
|
|
16
|
+
}, {
|
|
17
|
+
threshold: 1e9,
|
|
18
|
+
suffix: "B"
|
|
19
|
+
}, {
|
|
20
|
+
threshold: 1e6,
|
|
21
|
+
suffix: "M"
|
|
22
|
+
}, {
|
|
23
|
+
threshold: 1e3,
|
|
24
|
+
suffix: "K"
|
|
25
|
+
}];
|
|
2
26
|
|
|
3
27
|
/**
|
|
4
28
|
* Format the amount
|
|
@@ -23,15 +47,12 @@ export const formatAmount = (amount, raw) => {
|
|
|
23
47
|
const isLargeAmount = amount >= 99999900;
|
|
24
48
|
const amountInDollars = isLargeAmount ? Math.ceil(amount / 1000000) * 1000000 / 100 // Round to nearest million if large
|
|
25
49
|
: amount / 100;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
spaceSeparated: false
|
|
33
|
-
});
|
|
34
|
-
return formattedAmount.toUpperCase();
|
|
50
|
+
const mantissa = amountInDollars < 1000 ? 2 : 1;
|
|
51
|
+
const trimMantissa = !(amount < 100 && amount !== 0);
|
|
52
|
+
const unit = COMPACT_UNITS.find(u => amountInDollars >= u.threshold);
|
|
53
|
+
const scaled = unit ? amountInDollars / unit.threshold : amountInDollars;
|
|
54
|
+
const suffix = (unit === null || unit === void 0 ? void 0 : unit.suffix) ?? "";
|
|
55
|
+
return `$${formatNumberWithMantissa(scaled, mantissa, trimMantissa, false)}${suffix}`.toUpperCase();
|
|
35
56
|
};
|
|
36
57
|
|
|
37
58
|
/**
|
|
@@ -48,10 +69,7 @@ export const formatAmount = (amount, raw) => {
|
|
|
48
69
|
*/
|
|
49
70
|
export const formatPercentage = percentage => {
|
|
50
71
|
if (percentage === undefined || percentage === null) return "N/A";
|
|
51
|
-
return `${
|
|
52
|
-
mantissa: 2,
|
|
53
|
-
trimMantissa: true
|
|
54
|
-
})}%`;
|
|
72
|
+
return `${formatNumberWithMantissa(percentage / 100, 2, true, false)}%`;
|
|
55
73
|
};
|
|
56
74
|
|
|
57
75
|
/**
|
|
@@ -99,13 +117,10 @@ const formatAmountUnabbreviated = (amount, raw) => {
|
|
|
99
117
|
const isLargeAmount = amount >= 99999900;
|
|
100
118
|
const amountInDollars = isLargeAmount ? Math.ceil(amount / 1000000) * 1000000 / 100 // Round to nearest million if large
|
|
101
119
|
: amount / 100;
|
|
120
|
+
const mantissa = amountInDollars < 1000 ? 2 : 1;
|
|
121
|
+
const trimMantissa = !(amount < 100 && amount !== 0);
|
|
102
122
|
// Format the amount in dollars
|
|
103
|
-
const formattedAmount =
|
|
104
|
-
mantissa: amountInDollars < 1000 ? 2 : 1,
|
|
105
|
-
trimMantissa: !(amount < 100 && amount !== 0),
|
|
106
|
-
spaceSeparated: false,
|
|
107
|
-
thousandSeparated: true
|
|
108
|
-
});
|
|
123
|
+
const formattedAmount = `$${formatNumberWithMantissa(amountInDollars, mantissa, trimMantissa, true)}`;
|
|
109
124
|
return formattedAmount.toUpperCase();
|
|
110
125
|
};
|
|
111
126
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["formatNumberWithMantissa","value","mantissa","trimMantissa","thousandSeparated","str","toFixed","includes","replace","intPart","decPart","split","withCommas","undefined","COMPACT_UNITS","threshold","suffix","formatAmount","amount","raw","Number","isNaN","isLargeAmount","amountInDollars","Math","ceil","unit","find","u","scaled","toUpperCase","formatPercentage","percentage","formatStringListWithAnd","strings","length","newStrings","lastString","pop","join","formatAmountUnabbreviated","formattedAmount","formatRange","min","max","type","amountFormat","resolvedFormatAmount"],"sourceRoot":"../../../../../../src","sources":["capabilities/offer-catalog/src/utils/formatUtils.ts"],"mappings":"AAAA,MAAMA,wBAAwB,GAAGA,CAChCC,KAAa,EACbC,QAAgB,EAChBC,YAAqB,EACrBC,iBAA0B,KACd;EACZ,IAAIC,GAAG,GAAGJ,KAAK,CAACK,OAAO,CAACJ,QAAQ,CAAC;EAEjC,IAAIC,YAAY,IAAIE,GAAG,CAACE,QAAQ,CAAC,GAAG,CAAC,EAAE;IACtCF,GAAG,GAAGA,GAAG,CAACG,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAACA,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;EAChD;EAEA,IAAIJ,iBAAiB,EAAE;IACtB,MAAM,CAACK,OAAO,EAAEC,OAAO,CAAC,GAAGL,GAAG,CAACM,KAAK,CAAC,GAAG,CAAC;IACzC,MAAMC,UAAU,GAAG,CAACH,OAAO,IAAI,EAAE,EAAED,OAAO,CAAC,uBAAuB,EAAE,GAAG,CAAC;IACxEH,GAAG,GAAGK,OAAO,KAAKG,SAAS,GAAG,GAAGD,UAAU,IAAIF,OAAO,EAAE,GAAGE,UAAU;EACtE;EAEA,OAAOP,GAAG;AACX,CAAC;AAED,MAAMS,aAAa,GAAG,CACrB;EAAEC,SAAS,EAAE,IAAI;EAAEC,MAAM,EAAE;AAAI,CAAC,EAChC;EAAED,SAAS,EAAE,GAAG;EAAEC,MAAM,EAAE;AAAI,CAAC,EAC/B;EAAED,SAAS,EAAE,GAAG;EAAEC,MAAM,EAAE;AAAI,CAAC,EAC/B;EAAED,SAAS,EAAE,GAAG;EAAEC,MAAM,EAAE;AAAI,CAAC,CACtB;;AAEV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAY,GA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IzC,wBAAwB,CAACuB,eAAe,EAAErB,QAAQ,EAAEC,YAAY,EAAE,IAAI,CAAC,EAAE;EAErG,OAAOsC,eAAe,CAACX,WAAW,CAAC,CAAC;AACrC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMY,WAAW,GAAGA,CAC1BC,GAAY,EACZC,GAAY,EACZC,IAA6B,GAAG,QAAQ,EACxCC,YAA8B,KAClB;EACZ,MAAMC,oBAAoB,GACzBD,YAAY,KAAK,eAAe,GAAGN,yBAAyB,GAAGvB,YAAY;EAC5E,IAAI0B,GAAG,KAAK9B,SAAS,IAAI+B,GAAG,KAAK/B,SAAS,EAAE,OAAO,KAAK;EAExD,IAAIgC,IAAI,KAAK,YAAY,EAAE;IAC1B,OAAOF,GAAG,KAAKC,GAAG,GACfb,gBAAgB,CAACY,GAAG,CAAC,GACrB,GAAGZ,gBAAgB,CAACY,GAAG,CAAC,MAAMZ,gBAAgB,CAACa,GAAG,CAAC,EAAE;EACzD;EAEA,IAAI,CAACD,GAAG,KAAK,CAAC,IAAIA,GAAG,KAAK,CAAC,KAAKC,GAAG,KAAK,CAAC,EAAE;IAC1C,OAAO,SAASG,oBAAoB,CAACH,GAAG,CAAC,EAAE;EAC5C;EAEA,OAAOD,GAAG,KAAKC,GAAG,GACfG,oBAAoB,CAACJ,GAAG,CAAC,GACzB,GAAGI,oBAAoB,CAACJ,GAAG,CAAC,MAAMI,oBAAoB,CAACH,GAAG,CAAC,EAAE;AACjE,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { get } from "radash";
|
|
2
|
-
import { P, match } from "ts-pattern";
|
|
3
2
|
import { formatAmount, formatRange } from "../../formatUtils";
|
|
4
3
|
const determineContent = ({
|
|
5
4
|
minAnnualFeeValue,
|
|
@@ -8,41 +7,19 @@ const determineContent = ({
|
|
|
8
7
|
annualIntroFeeTermValue,
|
|
9
8
|
raw
|
|
10
9
|
}) => {
|
|
11
|
-
|
|
12
|
-
minAnnualFeeValue,
|
|
13
|
-
maxAnnualFeeValue,
|
|
14
|
-
annualIntroFeeValue,
|
|
15
|
-
annualIntroFeeTermValue
|
|
16
|
-
}).with({
|
|
17
|
-
annualIntroFeeValue: P.not(undefined)
|
|
18
|
-
}, ({
|
|
19
|
-
annualIntroFeeValue,
|
|
20
|
-
annualIntroFeeTermValue,
|
|
21
|
-
minAnnualFeeValue,
|
|
22
|
-
maxAnnualFeeValue
|
|
23
|
-
}) => {
|
|
10
|
+
if (annualIntroFeeValue !== undefined) {
|
|
24
11
|
const postIntroFee = formatRange(minAnnualFeeValue, maxAnnualFeeValue, "amount");
|
|
25
12
|
return `${formatAmount(annualIntroFeeValue)} for ${annualIntroFeeTermValue} years, then ${postIntroFee}`;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
maxAnnualFeeValue: P.not(undefined)
|
|
29
|
-
}, ({
|
|
30
|
-
minAnnualFeeValue,
|
|
31
|
-
maxAnnualFeeValue
|
|
32
|
-
}) => {
|
|
13
|
+
}
|
|
14
|
+
if (minAnnualFeeValue !== undefined && maxAnnualFeeValue !== undefined) {
|
|
33
15
|
if (minAnnualFeeValue === maxAnnualFeeValue) {
|
|
34
16
|
return formatAmount(minAnnualFeeValue, raw);
|
|
35
17
|
}
|
|
36
18
|
return formatRange(minAnnualFeeValue, maxAnnualFeeValue, "amount");
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}) => formatAmount(minAnnualFeeValue)).with({
|
|
42
|
-
maxAnnualFeeValue: P.not(undefined)
|
|
43
|
-
}, ({
|
|
44
|
-
maxAnnualFeeValue
|
|
45
|
-
}) => formatAmount(maxAnnualFeeValue)).otherwise(() => "See Terms");
|
|
19
|
+
}
|
|
20
|
+
const fee = minAnnualFeeValue ?? maxAnnualFeeValue;
|
|
21
|
+
if (fee !== undefined) return formatAmount(fee);
|
|
22
|
+
return "See Terms";
|
|
46
23
|
};
|
|
47
24
|
export const annualFee = offer => ({
|
|
48
25
|
label,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["get","
|
|
1
|
+
{"version":3,"names":["get","formatAmount","formatRange","determineContent","minAnnualFeeValue","maxAnnualFeeValue","annualIntroFeeValue","annualIntroFeeTermValue","raw","undefined","postIntroFee","fee","annualFee","offer","label","minAnnualFeeField","maxAnnualFeeField","annualIntroFeeField","annualIntroFeeTermField","content"],"sourceRoot":"../../../../../../../../src","sources":["capabilities/offer-catalog/src/utils/stats/formatters/annualFee.ts"],"mappings":"AAAA,SAASA,GAAG,QAAQ,QAAQ;AAE5B,SAASC,YAAY,EAAEC,WAAW,QAAQ,mBAAmB;AAa7D,MAAMC,gBAAgB,GAAGA,CAAC;EACzBC,iBAAiB;EACjBC,iBAAiB;EACjBC,mBAAmB;EACnBC,uBAAuB;EACvBC;AAOD,CAAC,KAAa;EACb,IAAIF,mBAAmB,KAAKG,SAAS,EAAE;IACtC,MAAMC,YAAY,GAAGR,WAAW,CAC/BE,iBAAiB,EACjBC,iBAAiB,EACjB,QACD,CAAC;IACD,OAAO,GAAGJ,YAAY,CAACK,mBAAmB,CAAC,QAAQC,uBAAuB,gBAAgBG,YAAY,EAAE;EACzG;EACA,IAAIN,iBAAiB,KAAKK,SAAS,IAAIJ,iBAAiB,KAAKI,SAAS,EAAE;IACvE,IAAIL,iBAAiB,KAAKC,iBAAiB,EAAE;MAC5C,OAAOJ,YAAY,CAACG,iBAAiB,EAAEI,GAAG,CAAC;IAC5C;IACA,OAAON,WAAW,CAACE,iBAAiB,EAAEC,iBAAiB,EAAE,QAAQ,CAAC;EACnE;EAEA,MAAMM,GAAG,GAAGP,iBAAiB,IAAIC,iBAAiB;EAClD,IAAIM,GAAG,KAAKF,SAAS,EAAE,OAAOR,YAAY,CAACU,GAAG,CAAC;EAC/C,OAAO,WAAW;AACnB,CAAC;AAED,OAAO,MAAMC,SAAS,GACpBC,KAAgB,IACjB,CAAC;EACAC,KAAK;EACLC,iBAAiB;EACjBC,iBAAiB;EACjBC,mBAAmB;EACnBC,uBAAuB;EACvBV,GAAG,GAAG;AACQ,CAAC,KAAuB;EACtC,MAAMJ,iBAAiB,GAAGJ,GAAG,CAASa,KAAK,EAAEE,iBAAiB,CAAC;EAC/D,MAAMV,iBAAiB,GAAGL,GAAG,CAASa,KAAK,EAAEG,iBAAiB,CAAC;EAC/D,MAAMV,mBAAmB,GAAGN,GAAG,CAASa,KAAK,EAAEI,mBAAmB,CAAC;EACnE,MAAMV,uBAAuB,GAAGP,GAAG,CAASa,KAAK,EAAEK,uBAAuB,CAAC;EAE3E,MAAMC,OAAO,GAAGhB,gBAAgB,CAAC;IAChCC,iBAAiB;IACjBC,iBAAiB;IACjBC,mBAAmB;IACnBC,uBAAuB;IACvBC;EACD,CAAC,CAAC;EAEF,OAAO;IACNM,KAAK;IACLK;EACD,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { get } from "radash";
|
|
2
|
-
import { P, match } from "ts-pattern";
|
|
3
2
|
import { formatRange } from "../../formatUtils";
|
|
4
3
|
/**
|
|
5
4
|
* Determine the content of the purchaseApr stat
|
|
@@ -18,21 +17,13 @@ const determineContent = ({
|
|
|
18
17
|
minPurchaseAprValue,
|
|
19
18
|
maxPurchaseAprValue
|
|
20
19
|
}) => {
|
|
21
|
-
|
|
22
|
-
purchaseAprValue
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
purchaseAprValue
|
|
29
|
-
}) => purchaseAprValue).with({
|
|
30
|
-
minPurchaseAprValue: P.not(undefined),
|
|
31
|
-
maxPurchaseAprValue: P.not(undefined)
|
|
32
|
-
}, ({
|
|
33
|
-
minPurchaseAprValue,
|
|
34
|
-
maxPurchaseAprValue
|
|
35
|
-
}) => formatRange(minPurchaseAprValue, maxPurchaseAprValue, "percentage")).otherwise(() => "See Terms");
|
|
20
|
+
if (purchaseAprValue !== undefined) {
|
|
21
|
+
return purchaseAprValue;
|
|
22
|
+
}
|
|
23
|
+
if (minPurchaseAprValue !== undefined && maxPurchaseAprValue !== undefined) {
|
|
24
|
+
return formatRange(minPurchaseAprValue, maxPurchaseAprValue, "percentage");
|
|
25
|
+
}
|
|
26
|
+
return "See Terms";
|
|
36
27
|
};
|
|
37
28
|
|
|
38
29
|
/**
|
|
@@ -42,7 +33,14 @@ const determineContent = ({
|
|
|
42
33
|
* @returns {string}
|
|
43
34
|
*/
|
|
44
35
|
const determineLabel = (aprType, label) => {
|
|
45
|
-
|
|
36
|
+
switch (aprType) {
|
|
37
|
+
case "variable":
|
|
38
|
+
return "Variable APR:";
|
|
39
|
+
case "fixed":
|
|
40
|
+
return "Fixed APR:";
|
|
41
|
+
default:
|
|
42
|
+
return label;
|
|
43
|
+
}
|
|
46
44
|
};
|
|
47
45
|
export const purchaseApr = offer => ({
|
|
48
46
|
label: defaultLabel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["get","
|
|
1
|
+
{"version":3,"names":["get","formatRange","determineContent","purchaseAprValue","minPurchaseAprValue","maxPurchaseAprValue","undefined","determineLabel","aprType","label","purchaseApr","offer","defaultLabel","purchaseAprTextField","minPurchaseAprField","maxPurchaseAprField","aprTypeField","aprTypeValue","content","replace"],"sourceRoot":"../../../../../../../../src","sources":["capabilities/offer-catalog/src/utils/stats/formatters/purchaseApr.ts"],"mappings":"AAAA,SAASA,GAAG,QAAQ,QAAQ;AAE5B,SAASC,WAAW,QAAQ,mBAAmB;AAY/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAGA,CAAC;EACzBC,gBAAgB;EAChBC,mBAAmB;EACnBC;AAKD,CAAC,KAAa;EACb,IAAIF,gBAAgB,KAAKG,SAA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