ads-web-sdkm 2.0.24
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/README.md +369 -0
- package/dist/AdsCarousel.css +1 -0
- package/dist/AdsCarousel.d.ts +1 -0
- package/dist/AdsCarousel.js +519 -0
- package/dist/AdsCarousel.js.map +1 -0
- package/dist/Brandshop.css +1 -0
- package/dist/Brandshop.d.ts +1 -0
- package/dist/Brandshop.js +918 -0
- package/dist/Brandshop.js.map +1 -0
- package/dist/Brandshops.css +1 -0
- package/dist/Brandshops.d.ts +1 -0
- package/dist/Brandshops.js +103 -0
- package/dist/Brandshops.js.map +1 -0
- package/dist/Image-zvdPHg5N.js +35 -0
- package/dist/Image-zvdPHg5N.js.map +1 -0
- package/dist/ReactQueryProvider-D__k2BsQ.js +6755 -0
- package/dist/ReactQueryProvider-D__k2BsQ.js.map +1 -0
- package/dist/ads-CChrT00a.js +4470 -0
- package/dist/ads-CChrT00a.js.map +1 -0
- package/dist/api/queries/useGetAds.d.ts +16 -0
- package/dist/api/queries/useGetBrandshop.d.ts +14 -0
- package/dist/api/queries/useGetBrandshopList.d.ts +11 -0
- package/dist/api/queries/useGetCollection.d.ts +11 -0
- package/dist/api/services/getAds.d.ts +14 -0
- package/dist/api/services/getBrandshop.d.ts +13 -0
- package/dist/api/services/getBrandshopList.d.ts +11 -0
- package/dist/api/services/getCollection.d.ts +4 -0
- package/dist/components/Brandshop/Banner.d.ts +6 -0
- package/dist/components/Brandshop/BannerSection.d.ts +15 -0
- package/dist/components/Brandshop/BannerWithLink.d.ts +8 -0
- package/dist/components/Brandshop/Brandshop.d.ts +16 -0
- package/dist/components/Brandshop/BrandshopContent.d.ts +3 -0
- package/dist/components/Brandshop/BrandshopError.d.ts +6 -0
- package/dist/components/Brandshop/BrandshopSection.d.ts +18 -0
- package/dist/components/Brandshop/BrandshopSkeleton.d.ts +1 -0
- package/dist/components/Brandshop/CategorySection.d.ts +14 -0
- package/dist/components/Brandshop/NavigationSection.d.ts +16 -0
- package/dist/components/Brandshop/ProductSliderSection.d.ts +18 -0
- package/dist/components/Brandshop/index.d.ts +1 -0
- package/dist/components/Brandshops/Brandshops.d.ts +11 -0
- package/dist/components/Brandshops/BrandshopsList.d.ts +3 -0
- package/dist/components/Brandshops/BrandshopsSkeleton.d.ts +6 -0
- package/dist/components/Brandshops/index.d.ts +1 -0
- package/dist/components/Card/Card.d.ts +8 -0
- package/dist/components/Carousel/AdBanner.d.ts +17 -0
- package/dist/components/Carousel/AdBanners.d.ts +24 -0
- package/dist/components/Carousel/AdCarousel.d.ts +43 -0
- package/dist/components/Carousel/AdSkeleton.d.ts +8 -0
- package/dist/components/Carousel/AdsCarousel.d.ts +24 -0
- package/dist/components/Carousel/index.d.ts +1 -0
- package/dist/components/Chip/Chip.d.ts +6 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.d.ts +18 -0
- package/dist/components/Image/Image.d.ts +13 -0
- package/dist/components/ProductsCarousel/CouponBadge.d.ts +8 -0
- package/dist/components/ProductsCarousel/DiscountChip.d.ts +12 -0
- package/dist/components/ProductsCarousel/PriceDisplay.d.ts +8 -0
- package/dist/components/ProductsCarousel/ProductCard.d.ts +15 -0
- package/dist/components/ProductsCarousel/ProductCardSkeleton.d.ts +5 -0
- package/dist/components/ProductsCarousel/ProductSliderSkeleton.d.ts +5 -0
- package/dist/components/ProductsCarousel/ProductTitle.d.ts +5 -0
- package/dist/components/ProductsCarousel/ProductsCarousel.d.ts +11 -0
- package/dist/hooks/use-async-memo.d.ts +1 -0
- package/dist/hooks/use-is-platform.d.ts +8 -0
- package/dist/hooks/useDetectScrolledToBottom.d.ts +5 -0
- package/dist/hooks/useSwipeThreshold.d.ts +4 -0
- package/dist/providers/ReactQueryProvider.d.ts +5 -0
- package/dist/types/ads.d.ts +116 -0
- package/dist/types/brandshop.d.ts +62 -0
- package/dist/types/brandshopsList.d.ts +32 -0
- package/dist/types/configTypes.d.ts +16 -0
- package/dist/types/enums.d.ts +8 -0
- package/dist/types/products.d.ts +72 -0
- package/dist/types/tenures.d.ts +11 -0
- package/dist/types/types.d.ts +2 -0
- package/dist/utils/analytics/trackAdsEvent.d.ts +16 -0
- package/dist/utils/analytics/trackBrandshopEvents.d.ts +15 -0
- package/dist/utils/helpers/ads.d.ts +3 -0
- package/dist/utils/helpers/authToken.d.ts +5 -0
- package/dist/utils/helpers/discountChip.d.ts +14 -0
- package/dist/utils/helpers/getBaseUrl.d.ts +4 -0
- package/dist/utils/helpers/mergeClasses.d.ts +1 -0
- package/dist/utils/helpers/price-utils.d.ts +1 -0
- package/dist/utils/helpers/productDiscounts.d.ts +3 -0
- package/dist/utils/helpers/products.d.ts +4 -0
- package/dist/utils/helpers/text.d.ts +1 -0
- package/dist/utils/helpers/translate.d.ts +63 -0
- package/dist/utils/helpers/utilities.d.ts +1 -0
- package/dist/utils/validations/ads.d.ts +7 -0
- package/package.json +81 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AdsDeviceType, TAdsLocations } from '../../types/ads';
|
|
2
|
+
import { TLanguage } from '../../types/types';
|
|
3
|
+
import { TEnvironment } from '../../types/configTypes';
|
|
4
|
+
|
|
5
|
+
type TGetAdsProps = {
|
|
6
|
+
deviceType: AdsDeviceType;
|
|
7
|
+
language: TLanguage;
|
|
8
|
+
locationId: TAdsLocations;
|
|
9
|
+
environment: TEnvironment;
|
|
10
|
+
adServerApiKey: string;
|
|
11
|
+
params?: Record<string, string>;
|
|
12
|
+
enabled?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare const GET_ADS_QUERY_KEY = "ads";
|
|
15
|
+
export declare const useGetAdsQuery: ({ deviceType, language, locationId, environment, adServerApiKey, params, enabled, }: TGetAdsProps) => import('@tanstack/react-query').UseQueryResult<any, Error>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TLanguage } from '../../types/types';
|
|
2
|
+
import { TEnvironment } from '../../types/configTypes';
|
|
3
|
+
|
|
4
|
+
type TGetBrandshopProps = {
|
|
5
|
+
deviceType: string;
|
|
6
|
+
language: TLanguage;
|
|
7
|
+
brandshopId: string;
|
|
8
|
+
environment: TEnvironment;
|
|
9
|
+
adServerApiKey: string;
|
|
10
|
+
enabled?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare const GET_BRANDSHOP_QUERY_KEY = "brandshop";
|
|
13
|
+
export declare const useGetBrandshopQuery: ({ deviceType, language, brandshopId, environment, adServerApiKey, enabled, }: TGetBrandshopProps) => import('@tanstack/react-query').UseQueryResult<import('../../types/brandshop').TBrandshopData, Error>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TLanguage } from '../../types/types';
|
|
2
|
+
import { TEnvironment } from '../../types/configTypes';
|
|
3
|
+
|
|
4
|
+
type TGetBrandshopsListProps = {
|
|
5
|
+
language: TLanguage;
|
|
6
|
+
environment: TEnvironment;
|
|
7
|
+
adServerApiKey: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const GET_BRANDSHOPS_LIST_QUERY_KEY = "brandshops";
|
|
10
|
+
export declare const useGetBrandshopsListQuery: ({ language, environment, adServerApiKey, }: TGetBrandshopsListProps) => import('@tanstack/react-query').UseQueryResult<import('../../types/brandshopsList').TBrandshopsList[], Error>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TLanguage } from '../../types/types';
|
|
2
|
+
import { TEnvironment } from '../../types/configTypes';
|
|
3
|
+
|
|
4
|
+
export type TGetCollectionProps = {
|
|
5
|
+
language: TLanguage;
|
|
6
|
+
environment: TEnvironment;
|
|
7
|
+
collectionId: string;
|
|
8
|
+
adServerApiKey: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const GET_COLLECTION_QUERY_KEY = "collection";
|
|
11
|
+
export declare const useGetCollectionQuery: ({ language, collectionId, environment, adServerApiKey, }: TGetCollectionProps) => import('@tanstack/react-query').UseQueryResult<import('../../types/products').TCollectionData | null, Error>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AdsDeviceType, TAdsLocations } from '../../types/ads';
|
|
2
|
+
import { TLanguage } from '../../types/types';
|
|
3
|
+
import { TEnvironment } from '../../types/configTypes';
|
|
4
|
+
|
|
5
|
+
type TGetAdsProps = {
|
|
6
|
+
deviceType: AdsDeviceType;
|
|
7
|
+
language: TLanguage;
|
|
8
|
+
environment: TEnvironment;
|
|
9
|
+
locationId: TAdsLocations;
|
|
10
|
+
adServerApiKey: string;
|
|
11
|
+
params?: Record<string, string>;
|
|
12
|
+
};
|
|
13
|
+
export declare const getAds: ({ deviceType, language, locationId, environment, adServerApiKey, params, }: TGetAdsProps) => Promise<any>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TLanguage } from '../../types/types';
|
|
2
|
+
import { TEnvironment } from '../../types/configTypes';
|
|
3
|
+
import { TBrandshopData } from '../../types/brandshop';
|
|
4
|
+
|
|
5
|
+
type TGetBrandshopProps = {
|
|
6
|
+
deviceType: string;
|
|
7
|
+
language: TLanguage;
|
|
8
|
+
environment: TEnvironment;
|
|
9
|
+
brandshopId: string;
|
|
10
|
+
adServerApiKey: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const getBrandshop: ({ deviceType, language, brandshopId, environment, adServerApiKey, }: TGetBrandshopProps) => Promise<TBrandshopData>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TLanguage } from '../../types/types';
|
|
2
|
+
import { TEnvironment } from '../../types/configTypes';
|
|
3
|
+
import { TBrandshopsList } from '../../types/brandshopsList';
|
|
4
|
+
|
|
5
|
+
type TGetBrandshopsListProps = {
|
|
6
|
+
language: TLanguage;
|
|
7
|
+
environment: TEnvironment;
|
|
8
|
+
adServerApiKey: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const getBrandshopsList: ({ language, environment, adServerApiKey, }: TGetBrandshopsListProps) => Promise<TBrandshopsList[]>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TCollectionData } from '../../types/products';
|
|
2
|
+
import { TGetCollectionProps } from '../queries/useGetCollection';
|
|
3
|
+
|
|
4
|
+
export declare const getCollection: ({ language, collectionId, environment, adServerApiKey, }: TGetCollectionProps) => Promise<TCollectionData | null>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TLinkClickEvent } from '../../types/ads';
|
|
2
|
+
import { TBrandshopDataItem } from '../../types/brandshop';
|
|
3
|
+
import { TTrackEvents } from '../../types/configTypes';
|
|
4
|
+
|
|
5
|
+
type BannerSectionProps = {
|
|
6
|
+
title: string;
|
|
7
|
+
hideTitle: boolean;
|
|
8
|
+
banners: TBrandshopDataItem[];
|
|
9
|
+
isLoggedin: boolean;
|
|
10
|
+
sectionTitle: string;
|
|
11
|
+
onBannerClick: (link: TLinkClickEvent) => void;
|
|
12
|
+
trackBrandshopHandler?: TTrackEvents;
|
|
13
|
+
};
|
|
14
|
+
export declare const BannerSection: ({ title, hideTitle, banners, isLoggedin, sectionTitle, onBannerClick, trackBrandshopHandler, }: BannerSectionProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TLanguage } from '../../types/types';
|
|
2
|
+
import { TTrackEvents, TEnvironment } from '../../types/configTypes';
|
|
3
|
+
import { TLinkClickEvent } from '../../types/ads';
|
|
4
|
+
import { TBrandshopData } from '../../types/brandshop';
|
|
5
|
+
|
|
6
|
+
export type TBrandshopProps = {
|
|
7
|
+
language: TLanguage;
|
|
8
|
+
brandshopId: string;
|
|
9
|
+
environment: TEnvironment;
|
|
10
|
+
adServerApiKey: string;
|
|
11
|
+
isLoggedin: boolean;
|
|
12
|
+
brandshop?: TBrandshopData;
|
|
13
|
+
onLinkClick: (event: TLinkClickEvent) => void;
|
|
14
|
+
trackBrandshopHandler?: TTrackEvents;
|
|
15
|
+
};
|
|
16
|
+
export default function Brandshop(props: Readonly<TBrandshopProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TBrandshopProps } from './Brandshop';
|
|
2
|
+
|
|
3
|
+
export declare function BrandshopContent({ language, brandshopId, environment, adServerApiKey, isLoggedin, brandshop, onLinkClick, trackBrandshopHandler, }: Readonly<TBrandshopProps>): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TBrandshopSection } from '../../types/brandshop';
|
|
2
|
+
import { TLinkClickEvent } from '../../types/ads';
|
|
3
|
+
import { TEnvironment, TTrackEvents } from '../../types/configTypes';
|
|
4
|
+
import { TLanguage } from '../../types/types';
|
|
5
|
+
|
|
6
|
+
type BrandshopSectionProps = {
|
|
7
|
+
section: TBrandshopSection;
|
|
8
|
+
isLoggedin: boolean;
|
|
9
|
+
brandName: string;
|
|
10
|
+
language: TLanguage;
|
|
11
|
+
environment: TEnvironment;
|
|
12
|
+
adServerApiKey: string;
|
|
13
|
+
brandshopName?: string;
|
|
14
|
+
onLinkClick: (data: TLinkClickEvent) => void;
|
|
15
|
+
trackBrandshopHandler?: TTrackEvents;
|
|
16
|
+
};
|
|
17
|
+
export declare const BrandshopSection: ({ section, onLinkClick, trackBrandshopHandler, isLoggedin, brandName, language, environment, adServerApiKey, brandshopName, }: BrandshopSectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function BrandshopSkeleton(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TLinkClickEvent } from '../../types/ads';
|
|
2
|
+
import { TBrandshopDataItem } from '../../types/brandshop';
|
|
3
|
+
import { TTrackEvents } from '../../types/configTypes';
|
|
4
|
+
|
|
5
|
+
type CategorySectionProps = {
|
|
6
|
+
title: string;
|
|
7
|
+
hideTitle: boolean;
|
|
8
|
+
categories: TBrandshopDataItem[];
|
|
9
|
+
isLoggedin: boolean;
|
|
10
|
+
onCategoryClick: (link: TLinkClickEvent) => void;
|
|
11
|
+
trackBrandshopHandler?: TTrackEvents;
|
|
12
|
+
};
|
|
13
|
+
export declare const CategorySection: ({ title, hideTitle, categories, isLoggedin, onCategoryClick, trackBrandshopHandler, }: CategorySectionProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TNavigationLinkItem } from '../../types/brandshop';
|
|
2
|
+
import { TLinkClickEvent } from '../../types/ads';
|
|
3
|
+
import { TTrackEvents } from '../../types/configTypes';
|
|
4
|
+
|
|
5
|
+
type NavigationSectionProps = {
|
|
6
|
+
title: string;
|
|
7
|
+
hideTitle: boolean;
|
|
8
|
+
logo: string;
|
|
9
|
+
navigationLinks: TNavigationLinkItem[];
|
|
10
|
+
isLoggedin: boolean;
|
|
11
|
+
brandshopName?: string;
|
|
12
|
+
onLinkClick: (link: TLinkClickEvent) => void;
|
|
13
|
+
trackBrandshopHandler?: TTrackEvents;
|
|
14
|
+
};
|
|
15
|
+
export declare const NavigationSection: ({ title, hideTitle, logo, navigationLinks, isLoggedin, brandshopName, onLinkClick, trackBrandshopHandler, }: NavigationSectionProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TEnvironment, TTrackEvents } from '../../types/configTypes';
|
|
2
|
+
import { TLinkClickEvent } from '../../types/ads';
|
|
3
|
+
import { TLanguage } from '../../types/types';
|
|
4
|
+
import { TBrandshopCollection } from '../../types/brandshop';
|
|
5
|
+
|
|
6
|
+
type ProductSliderSectionProps = {
|
|
7
|
+
products: TBrandshopCollection;
|
|
8
|
+
title: string;
|
|
9
|
+
hideTitle: boolean;
|
|
10
|
+
isLoggedin: boolean;
|
|
11
|
+
language: TLanguage;
|
|
12
|
+
environment: TEnvironment;
|
|
13
|
+
adServerApiKey: string;
|
|
14
|
+
trackBrandshopHandler?: TTrackEvents;
|
|
15
|
+
onProductClick: (data: TLinkClickEvent) => void;
|
|
16
|
+
};
|
|
17
|
+
export declare function ProductSliderSection({ products, title, hideTitle, isLoggedin, language, environment, adServerApiKey, trackBrandshopHandler, onProductClick, }: Readonly<ProductSliderSectionProps>): import("react/jsx-runtime").JSX.Element | null;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Brandshop } from './Brandshop';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TEnvironment } from '../../types/configTypes';
|
|
2
|
+
import { TLanguage } from '../../types/types';
|
|
3
|
+
|
|
4
|
+
export type TBrandshopsProps = {
|
|
5
|
+
language: TLanguage;
|
|
6
|
+
environment: TEnvironment;
|
|
7
|
+
adServerApiKey: string;
|
|
8
|
+
onBrandshopClick: (brandshopID: string) => void;
|
|
9
|
+
title?: string;
|
|
10
|
+
};
|
|
11
|
+
export default function Brandshops(props: Readonly<TBrandshopsProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Brandshops } from './Brandshops';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TAdsLocations, AdData } from '../../types/ads';
|
|
2
|
+
import { TLogError } from '../../types/configTypes';
|
|
3
|
+
import { default as Autoplay } from 'embla-carousel-autoplay';
|
|
4
|
+
|
|
5
|
+
interface AdBannerProps {
|
|
6
|
+
ad: AdData;
|
|
7
|
+
locationId: TAdsLocations;
|
|
8
|
+
trackAdHandler?: (eventName: string, eventProperties: Record<string, unknown>) => void;
|
|
9
|
+
plugin?: ReturnType<typeof Autoplay>;
|
|
10
|
+
fallback?: string;
|
|
11
|
+
isLoggedin?: boolean;
|
|
12
|
+
userId?: string;
|
|
13
|
+
onClick?: () => void;
|
|
14
|
+
logError?: TLogError;
|
|
15
|
+
}
|
|
16
|
+
declare const AdBanner: ({ ad, locationId, trackAdHandler, fallback, plugin, isLoggedin, userId, onClick, logError, }: AdBannerProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export default AdBanner;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { TAdsLocations, AdData, TLinkClickEvent } from '../../types/ads';
|
|
2
|
+
import { TLanguage } from '../../types/types';
|
|
3
|
+
import { TLogError, TEnvironment } from '../../types/configTypes';
|
|
4
|
+
|
|
5
|
+
interface AdBannersProps {
|
|
6
|
+
language: TLanguage;
|
|
7
|
+
locationId: TAdsLocations;
|
|
8
|
+
environment: TEnvironment;
|
|
9
|
+
adServerApiKey: string;
|
|
10
|
+
isLoggedin?: boolean;
|
|
11
|
+
userId?: string;
|
|
12
|
+
trackAdHandler?: (eventName: string, eventProperties: Record<string, unknown>) => void;
|
|
13
|
+
params?: Record<string, string>;
|
|
14
|
+
autoplayDelay?: number;
|
|
15
|
+
fallbackImg?: string;
|
|
16
|
+
banners?: AdData[];
|
|
17
|
+
swipeThreshold?: number;
|
|
18
|
+
transitionDuration?: number;
|
|
19
|
+
showProgressBar?: boolean;
|
|
20
|
+
onAdClick?: (event: TLinkClickEvent) => void;
|
|
21
|
+
logError?: TLogError;
|
|
22
|
+
}
|
|
23
|
+
declare const AdBanners: ({ language, locationId, environment, adServerApiKey, isLoggedin, userId, trackAdHandler, params, autoplayDelay, fallbackImg, banners, swipeThreshold, transitionDuration, showProgressBar, onAdClick, logError, }: AdBannersProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export default AdBanners;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { default as useEmblaCarousel, UseEmblaCarouselType } from 'embla-carousel-react';
|
|
2
|
+
import { default as Autoplay } from 'embla-carousel-autoplay';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
type AdCarouselApi = UseEmblaCarouselType[1];
|
|
5
|
+
type UseAdCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
6
|
+
type AdCarouselOptions = UseAdCarouselParameters[0];
|
|
7
|
+
type AdCarouselPlugin = UseAdCarouselParameters[1];
|
|
8
|
+
type AdCarouselProps = {
|
|
9
|
+
opts?: AdCarouselOptions;
|
|
10
|
+
plugins?: AdCarouselPlugin;
|
|
11
|
+
orientation?: 'horizontal' | 'vertical';
|
|
12
|
+
swipeThresholdPercentage?: number;
|
|
13
|
+
transitionDuration?: number;
|
|
14
|
+
setApi?: (api: AdCarouselApi) => void;
|
|
15
|
+
};
|
|
16
|
+
type AdCarouselPaginationProps = {
|
|
17
|
+
slidesCount: number;
|
|
18
|
+
currentIndex: number;
|
|
19
|
+
onClick: (index: number) => void;
|
|
20
|
+
autoplay?: ReturnType<typeof Autoplay>;
|
|
21
|
+
delay?: number;
|
|
22
|
+
isRtl?: boolean;
|
|
23
|
+
showProgress?: boolean;
|
|
24
|
+
containerClassName?: string;
|
|
25
|
+
buttonClassName?: string;
|
|
26
|
+
progressContainerClassName?: string;
|
|
27
|
+
progressBarClassName?: string;
|
|
28
|
+
dotClassName?: string;
|
|
29
|
+
activeDotClassName?: string;
|
|
30
|
+
inactiveDotClassName?: string;
|
|
31
|
+
};
|
|
32
|
+
type TAdCarouselButtonProps = {
|
|
33
|
+
className?: string;
|
|
34
|
+
iconClassName?: string;
|
|
35
|
+
autoplay?: ReturnType<typeof Autoplay>;
|
|
36
|
+
};
|
|
37
|
+
declare const AdCarousel: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & AdCarouselProps & React.RefAttributes<HTMLDivElement>>;
|
|
38
|
+
declare const AdCarouselContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
39
|
+
declare const AdCarouselItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
40
|
+
declare const AdCarouselPrevious: React.ForwardRefExoticComponent<TAdCarouselButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
41
|
+
declare const AdCarouselNext: React.ForwardRefExoticComponent<TAdCarouselButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
42
|
+
declare const AdCarouselPagination: ({ slidesCount, currentIndex, onClick, autoplay, delay, isRtl, showProgress, containerClassName, buttonClassName, progressContainerClassName, progressBarClassName, dotClassName, activeDotClassName, inactiveDotClassName, }: AdCarouselPaginationProps) => import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export { type AdCarouselApi, AdCarousel, AdCarouselContent, AdCarouselItem, AdCarouselPrevious, AdCarouselNext, AdCarouselPagination, };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { TLinkClickEvent, TAdsLocations, AdData } from '../../types/ads';
|
|
2
|
+
import { TLanguage } from '../../types/types';
|
|
3
|
+
import { TLogError, TEnvironment, TTrackEvents } from '../../types/configTypes';
|
|
4
|
+
|
|
5
|
+
interface AdsCarouselProps {
|
|
6
|
+
locationId: TAdsLocations;
|
|
7
|
+
language: TLanguage;
|
|
8
|
+
environment: TEnvironment;
|
|
9
|
+
adServerApiKey: string;
|
|
10
|
+
isLoggedin?: boolean;
|
|
11
|
+
userId?: string;
|
|
12
|
+
trackAdHandler?: TTrackEvents;
|
|
13
|
+
params?: Record<string, string>;
|
|
14
|
+
autoplayDelay?: number;
|
|
15
|
+
fallbackImg?: string;
|
|
16
|
+
swipeThreshold?: number;
|
|
17
|
+
banners?: AdData[];
|
|
18
|
+
transitionDuration?: number;
|
|
19
|
+
showProgressBar?: boolean;
|
|
20
|
+
onAdClick?: (event: TLinkClickEvent) => void;
|
|
21
|
+
logError?: TLogError;
|
|
22
|
+
}
|
|
23
|
+
declare function AdsCarousel({ locationId, language, environment, adServerApiKey, isLoggedin, userId, trackAdHandler, params, autoplayDelay, fallbackImg, swipeThreshold, banners, transitionDuration, showProgressBar, onAdClick, logError, }: Readonly<AdsCarouselProps>): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export default AdsCarousel;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as AdsCarousel } from './AdsCarousel';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Component, ErrorInfo, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
interface ErrorBoundaryProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
fallback: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
interface ErrorBoundaryState {
|
|
8
|
+
hasError: boolean;
|
|
9
|
+
error: Error | null;
|
|
10
|
+
errorInfo: ErrorInfo | null;
|
|
11
|
+
}
|
|
12
|
+
declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
13
|
+
constructor(props: ErrorBoundaryProps);
|
|
14
|
+
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
15
|
+
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
16
|
+
render(): ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export default ErrorBoundary;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type FetchPriority = 'high' | 'low' | 'auto';
|
|
2
|
+
type ImageProps = {
|
|
3
|
+
src: string;
|
|
4
|
+
alt: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
fallback?: string;
|
|
7
|
+
onError?: () => void;
|
|
8
|
+
fetchPriority?: FetchPriority;
|
|
9
|
+
width?: number;
|
|
10
|
+
height?: number;
|
|
11
|
+
};
|
|
12
|
+
export declare function Image({ src, alt, className, fallback, onError, fetchPriority, width, height, }: Readonly<ImageProps>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TProductDiscount } from '../../types/products';
|
|
2
|
+
import { TLanguage } from '../../types/types';
|
|
3
|
+
|
|
4
|
+
type TDiscountChipProps = {
|
|
5
|
+
language: TLanguage;
|
|
6
|
+
promotionValue?: string;
|
|
7
|
+
coupon?: TProductDiscount | null;
|
|
8
|
+
isPriceDropped?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function DiscountChip({ language, promotionValue, coupon, isPriceDropped, className, }: Readonly<TDiscountChipProps>): import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TPrice, TDiscount } from '../../types/products';
|
|
2
|
+
|
|
3
|
+
type TPriceDisplayProps = {
|
|
4
|
+
price: TPrice;
|
|
5
|
+
discounts: TDiscount[];
|
|
6
|
+
};
|
|
7
|
+
export declare function PriceDisplay({ price, discounts, }: Readonly<TPriceDisplayProps>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TDiscount, TPrice } from '../../types/products';
|
|
2
|
+
import { TLanguage } from '../../types/types';
|
|
3
|
+
|
|
4
|
+
type TProductCardProps = {
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
brand: string;
|
|
8
|
+
image: string;
|
|
9
|
+
price: TPrice;
|
|
10
|
+
discounts: TDiscount[];
|
|
11
|
+
language: TLanguage;
|
|
12
|
+
className?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function ProductCard({ id, title, brand, image, price, discounts, language, className, }: Readonly<TProductCardProps>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TCollectionItem } from '../../types/products';
|
|
2
|
+
import { TLanguage } from '../../types/types';
|
|
3
|
+
|
|
4
|
+
type ProductsCarouselProps = {
|
|
5
|
+
products: TCollectionItem[];
|
|
6
|
+
onProductClick: (product: TCollectionItem, index: number) => void;
|
|
7
|
+
slidesToScroll?: number;
|
|
8
|
+
language: TLanguage;
|
|
9
|
+
};
|
|
10
|
+
export declare function ProductsCarousel({ slidesToScroll, products, onProductClick, language, }: Readonly<ProductsCarouselProps>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useAsyncMemo<T>(fn: (() => Promise<T>) | null, deps?: unknown[]): [T | null, boolean];
|