@swipefindercom/finder-sdk 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/finder-sdk.esm.js +11608 -0
  2. package/dist/finder-sdk.umd.js +1 -0
  3. package/dist/style.css +1 -0
  4. package/dist/types/components/CardList/CardList.d.ts +14 -0
  5. package/dist/types/components/CardWrapper/CardWrapper.d.ts +18 -0
  6. package/dist/types/components/CardWrapper/ImageWrapper/ImageWrapper.d.ts +18 -0
  7. package/dist/types/components/CardWrapper/VideoWrapper/VideoWrapper.d.ts +26 -0
  8. package/dist/types/components/CardsCounter/CardsCounter.d.ts +9 -0
  9. package/dist/types/components/Drawer/Drawer.d.ts +19 -0
  10. package/dist/types/components/FiltersButton/FiltersButton.d.ts +11 -0
  11. package/dist/types/components/FiltersDrawer/FiltersDrawer.d.ts +25 -0
  12. package/dist/types/components/HistoryButton/HistoryButton.d.ts +13 -0
  13. package/dist/types/components/HistoryDrawer/HistoryDrawer.d.ts +30 -0
  14. package/dist/types/components/HorizontalCtaTooltip/HorizontalCtaTooltip.d.ts +26 -0
  15. package/dist/types/components/Logo/Logo.d.ts +14 -0
  16. package/dist/types/components/Positioned/Positioned.d.ts +20 -0
  17. package/dist/types/components/SideArrowsButtons/SideArrowsButtons.d.ts +49 -0
  18. package/dist/types/components/SideEmojisButtons/SideEmojisButtons.d.ts +23 -0
  19. package/dist/types/components/Summary/Summary.d.ts +27 -0
  20. package/dist/types/components/SwipeTutorialOverlay/SwipeTutorialOverlay.d.ts +20 -0
  21. package/dist/types/components/SwipeableCard/SwipeableCard.d.ts +58 -0
  22. package/dist/types/components/SwipeableFeed/SwipeableFeed.d.ts +55 -0
  23. package/dist/types/components/VerticalCtaTooltip/VerticalCtaTooltip.d.ts +28 -0
  24. package/dist/types/components/VerticalEmojisButtons/VerticalEmojisButtons.d.ts +48 -0
  25. package/dist/types/components/VolumeControl/VolumeControl.d.ts +19 -0
  26. package/dist/types/containers/InteractiveFeed/InteractiveFeed.d.ts +42 -0
  27. package/dist/types/containers/MainBootstrap/MainBootstrap.d.ts +17 -0
  28. package/dist/types/containers/SwippingJourney/SwippingJourney.d.ts +21 -0
  29. package/dist/types/contexts/AppStateContext.d.ts +45 -0
  30. package/dist/types/contexts/DataContext.d.ts +32 -0
  31. package/dist/types/contexts/MonitoringContext.d.ts +23 -0
  32. package/dist/types/contexts/UIContext.d.ts +25 -0
  33. package/dist/types/contexts/index.d.ts +25 -0
  34. package/dist/types/guards/cardType.guard.d.ts +4 -0
  35. package/dist/types/sdk/SwipeFinderSDK.d.ts +28 -0
  36. package/dist/types/sdk/index.d.ts +20 -0
  37. package/dist/types/services/DataService.d.ts +16 -0
  38. package/dist/types/services/MonitorService.d.ts +17 -0
  39. package/dist/types/types/FeedUIConfig.d.ts +214 -0
  40. package/dist/types/types/api.d.ts +40 -0
  41. package/dist/types/types/card.d.ts +22 -0
  42. package/dist/types/types/category.d.ts +4 -0
  43. package/dist/types/types/swipe.d.ts +12 -0
  44. package/package.json +66 -0
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { VolumeControlUIConfig } from '../../types/FeedUIConfig';
3
+ export interface VolumeControlProps {
4
+ /** Volume control UI configuration */
5
+ volumeControlUIConfig: VolumeControlUIConfig;
6
+ /** Current mute state */
7
+ isMuted: boolean;
8
+ /** Current volume (0-1) */
9
+ volume: number;
10
+ /** Whether the control should be visible */
11
+ visible?: boolean;
12
+ /** Additional CSS class name */
13
+ className?: string;
14
+ /** Callback when mute state should be toggled */
15
+ onToggleMute: () => void;
16
+ /** Callback when volume changes */
17
+ onVolumeChange: (volume: number) => void;
18
+ }
19
+ export declare const VolumeControl: React.FC<VolumeControlProps>;
@@ -0,0 +1,42 @@
1
+ import React from 'react';
2
+ import { SwipeableFeedProps } from '../../components/SwipeableFeed/SwipeableFeed';
3
+ import { Card } from '../../types/card';
4
+ import { Category } from '../../types/category';
5
+ import { CardsCounterUIConfig, NavigationUIConfig, SummaryUIConfig, LogoUIConfig, HistoryUIConfig, FiltersUIConfig, VolumeControlUIConfig, FinderUIConfig } from '../../types/FeedUIConfig';
6
+ export interface InteractiveFeedProps extends Omit<SwipeableFeedProps, 'isMuted' | 'volume' | 'cards'> {
7
+ /** Cards to display */
8
+ cards: Card[];
9
+ /** Available categories for filtering */
10
+ categories?: Category[];
11
+ /** Finder UI configuration */
12
+ finderUiConfig: FinderUIConfig;
13
+ /** History UI configuration */
14
+ historyUIConfig: HistoryUIConfig;
15
+ /** Callback when history button is clicked */
16
+ onOpenHistory?: () => void;
17
+ /** Callback when a card in history is clicked */
18
+ onHistoryCardClick?: (cardId: string | undefined, cardUrl: string | undefined, cardPosition: number | undefined) => void;
19
+ /** Callback when filter selection changes */
20
+ onFilterChange?: (selectedCategoryIds: string[]) => void;
21
+ /** Initial mute state */
22
+ initialMuted?: boolean;
23
+ /** Filters UI configuration */
24
+ filtersUIConfig: FiltersUIConfig;
25
+ /** Volume control UI configuration */
26
+ volumeControlUIConfig: VolumeControlUIConfig;
27
+ /** Cards counter UI configuration */
28
+ cardsCounterUIConfig: CardsCounterUIConfig;
29
+ /** Navigation UI configuration */
30
+ navigationUIConfig: NavigationUIConfig;
31
+ /** Summary UI configuration */
32
+ summaryUIConfig: SummaryUIConfig;
33
+ /** Logo UI configuration */
34
+ logoUIConfig: LogoUIConfig;
35
+ /** Additional CSS class name */
36
+ className?: string;
37
+ }
38
+ /**
39
+ * InteractiveFeed - Wrapper container that combines SwipeableFeed, VolumeControl, HistoryButton, and FiltersButton
40
+ * Manages state coordination between all components
41
+ */
42
+ export declare const InteractiveFeed: React.FC<InteractiveFeedProps>;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { SwippingJourneyProps } from '../SwippingJourney/SwippingJourney';
3
+ import { MonitorService } from '../../services/MonitorService';
4
+ import { DataService } from '../../services/DataService';
5
+ export interface MainBootstrapProps extends Omit<SwippingJourneyProps, 'cards' | 'creation' | 'categories'> {
6
+ /** Monitor service instance */
7
+ monitorService: MonitorService;
8
+ /** Data service instance */
9
+ dataService: DataService;
10
+ /** Backend URL for API calls */
11
+ backendUrl: string;
12
+ /** Finder ID - if not provided, will be extracted from URL params */
13
+ finderId: string;
14
+ /** Additional CSS class name */
15
+ className?: string;
16
+ }
17
+ export declare const MainBootstrap: React.FC<MainBootstrapProps>;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { FinderUIConfig } from '../../types/FeedUIConfig';
3
+ export interface SwippingJourneyProps {
4
+ /** Whether summary is enabled */
5
+ summaryEnabled?: boolean;
6
+ /** Finder UI configuration */
7
+ finderUiConfig?: FinderUIConfig;
8
+ /** Callback when a card in summary is clicked */
9
+ onSummaryCardClick?: (cardId: string | undefined, cardUrl: string | undefined, cardPosition: number | undefined) => void;
10
+ /** Callback for share button in summary */
11
+ onSummaryShareClick?: (rightCardIds: string[], upCardIds: string[]) => void;
12
+ /** Callback when all cards are swiped (before showing summary) */
13
+ onAllCardsSwiped?: () => void;
14
+ /** Additional CSS class name */
15
+ className?: string;
16
+ }
17
+ /**
18
+ * SwippingJourney - Container that combines InteractiveFeed and Summary
19
+ * Shows InteractiveFeed while swiping, and Summary after all cards are swiped
20
+ */
21
+ export declare const SwippingJourney: React.FC<SwippingJourneyProps>;
@@ -0,0 +1,45 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { Card } from '../types/card';
3
+ type SwipeDirection = 'left' | 'right' | 'up' | 'down';
4
+ type SwipeHistoryEntry = {
5
+ direction: SwipeDirection;
6
+ card: Card;
7
+ timestamp: number;
8
+ };
9
+ interface AppStateContextType {
10
+ currentCardIndex: number;
11
+ swipeHistory: SwipeHistoryEntry[];
12
+ isAnimating: boolean;
13
+ demoActive: boolean;
14
+ noMoreCards: boolean;
15
+ userHasInteracted: boolean;
16
+ isMuted: boolean;
17
+ volume: number;
18
+ logoVisible: boolean;
19
+ allCards: Card[];
20
+ filteredCards: Card[];
21
+ selectedCategories: string[];
22
+ setCurrentCardIndex: (index: number) => void;
23
+ addSwipeToHistory: (direction: SwipeDirection, card: Card) => void;
24
+ clearSwipeHistory: () => void;
25
+ setIsAnimating: (value: boolean) => void;
26
+ setDemoActive: (value: boolean) => void;
27
+ setNoMoreCards: (value: boolean) => void;
28
+ setUserHasInteracted: (value: boolean) => void;
29
+ getCardsByDirection: (direction: SwipeDirection) => Card[];
30
+ setIsMuted: (value: boolean) => void;
31
+ setVolume: (value: number) => void;
32
+ toggleMute: () => void;
33
+ showLogo: (timeout: number) => void;
34
+ setCards: (cards: Card[]) => void;
35
+ setSelectedCategories: (categoryIds: string[]) => void;
36
+ }
37
+ interface AppStateProviderProps {
38
+ children: ReactNode;
39
+ }
40
+ export declare const AppStateProvider: React.FC<AppStateProviderProps>;
41
+ /**
42
+ * Hook to access AppStateContext
43
+ */
44
+ export declare const useAppState: () => AppStateContextType;
45
+ export {};
@@ -0,0 +1,32 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { Card } from '../types/card';
3
+ import { Category } from '../types/category';
4
+ import { FinderUIConfig } from '../types/FeedUIConfig';
5
+ import { DataService } from '../services/DataService';
6
+ interface DataContextType {
7
+ cards: Card[];
8
+ finder: FinderUIConfig | null;
9
+ categories: Category[];
10
+ loading: boolean;
11
+ error: string | null;
12
+ isInitiallyLoaded: boolean;
13
+ setCards: (cards: Card[]) => void;
14
+ setFinder: (finder: FinderUIConfig | null) => void;
15
+ setCategories: (categories: Category[]) => void;
16
+ loadFinder: () => Promise<void>;
17
+ }
18
+ interface DataProviderProps {
19
+ children: ReactNode;
20
+ dataService: DataService;
21
+ finderId?: string | null;
22
+ backendUrl?: string;
23
+ initialCards?: Card[];
24
+ initialFinder?: FinderUIConfig | null;
25
+ initialCategories?: Category[];
26
+ }
27
+ export declare const DataProvider: React.FC<DataProviderProps>;
28
+ /**
29
+ * Hook to access DataContext
30
+ */
31
+ export declare const useData: () => DataContextType;
32
+ export {};
@@ -0,0 +1,23 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { MonitorService } from '../services/MonitorService';
3
+ interface MonitoringContextType {
4
+ sessionId: string;
5
+ sendImpressionEvent: (cardId: string) => void;
6
+ sendSwipeEvent: (cardId: string, direction: string) => void;
7
+ sendClickEvent: (cardId: string) => void;
8
+ sendButtonClickEvent: () => void;
9
+ sendCreativeImpressionEvent: () => void;
10
+ startCardImpression: (cardId: string) => void;
11
+ setConsentGranted: () => void;
12
+ }
13
+ interface MonitoringProviderProps {
14
+ children: ReactNode;
15
+ monitorService: MonitorService;
16
+ finderId: string;
17
+ }
18
+ export declare const MonitoringProvider: React.FC<MonitoringProviderProps>;
19
+ /**
20
+ * Hook to access MonitoringContext
21
+ */
22
+ export declare const useMonitoring: () => MonitoringContextType;
23
+ export {};
@@ -0,0 +1,25 @@
1
+ import React, { ReactNode } from 'react';
2
+ interface UIContextType {
3
+ buttonsVisible: boolean;
4
+ summaryVisible: boolean;
5
+ ctaTooltipVisible: boolean;
6
+ selectedCategories: string[];
7
+ logoVisible: boolean;
8
+ showButtons: () => void;
9
+ hideButtons: () => void;
10
+ showSummary: () => void;
11
+ hideSummary: () => void;
12
+ showCtaTooltip: () => void;
13
+ hideCtaTooltip: () => void;
14
+ setSelectedCategories: (categories: string[]) => void;
15
+ toggleLogo: (visible: boolean) => void;
16
+ }
17
+ interface UIProviderProps {
18
+ children: ReactNode;
19
+ }
20
+ export declare const UIProvider: React.FC<UIProviderProps>;
21
+ /**
22
+ * Hook to access UIContext
23
+ */
24
+ export declare const useUI: () => UIContextType;
25
+ export {};
@@ -0,0 +1,25 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { MonitorService } from '../services/MonitorService';
3
+ import { DataService } from '../services/DataService';
4
+ /**
5
+ * AppProviders - Wraps all context providers in the correct order
6
+ * Provider order matters: outer providers can use inner providers
7
+ */
8
+ export interface AppProvidersProps {
9
+ children: ReactNode;
10
+ monitorService: MonitorService;
11
+ dataService: DataService;
12
+ /** Backend URL for API calls */
13
+ backendUrl: string;
14
+ /** Finder ID */
15
+ finderId: string;
16
+ }
17
+ export declare const AppProviders: React.FC<AppProvidersProps>;
18
+ export { useData } from './DataContext';
19
+ export { useAppState } from './AppStateContext';
20
+ export { useUI } from './UIContext';
21
+ export { useMonitoring } from './MonitoringContext';
22
+ export { DataProvider } from './DataContext';
23
+ export { AppStateProvider } from './AppStateContext';
24
+ export { UIProvider } from './UIContext';
25
+ export { MonitoringProvider } from './MonitoringContext';
@@ -0,0 +1,4 @@
1
+ import { Card, ImageCard, VideoCard } from "../types/card";
2
+ export declare const isCardType: (card: any) => card is Card;
3
+ export declare const isImageCard: (card: any) => card is ImageCard;
4
+ export declare const isVideoCard: (card: any) => card is VideoCard;
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import type { SwipeFinderConfig } from './index';
3
+ export interface SwipeFinderSDKProps extends SwipeFinderConfig {
4
+ /** Backend URL for API calls */
5
+ backendUrl: string;
6
+ /** Finder ID */
7
+ finderId: string;
8
+ /** Additional CSS class name for the root container */
9
+ className?: string;
10
+ }
11
+ /**
12
+ * SwipeFinderSDK — drop-in React component.
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * import { SwipeFinderSDK } from 'finder-sdk';
17
+ *
18
+ * function App() {
19
+ * return (
20
+ * <SwipeFinderSDK
21
+ * backendUrl="https://finder-creator.vercel.app"
22
+ * finderId="698efae51574415767b9eaaf"
23
+ * />
24
+ * );
25
+ * }
26
+ * ```
27
+ */
28
+ export declare const SwipeFinderSDK: React.FC<SwipeFinderSDKProps>;
@@ -0,0 +1,20 @@
1
+ import { MainBootstrapProps } from '../containers/MainBootstrap/MainBootstrap';
2
+ import '../global.css';
3
+ export { SwipeFinderSDK } from './SwipeFinderSDK';
4
+ export type { SwipeFinderSDKProps } from './SwipeFinderSDK';
5
+ export type SwipeFinderConfig = Omit<MainBootstrapProps, 'monitorService' | 'dataService' | 'backendUrl' | 'campaignId' | 'campaignCreativeSetId' | 'finderId'>;
6
+ export interface SwipeFinderOptions extends SwipeFinderConfig {
7
+ /** Backend URL for API calls */
8
+ backendUrl: string;
9
+ /** Finder ID */
10
+ finderId: string;
11
+ /** DOM element where MainBootstrap will be rendered */
12
+ element: HTMLElement;
13
+ }
14
+ /**
15
+ * Initialize SwipeFinder SDK
16
+ * @param options - Configuration options including backend URL, campaign IDs, finder ID and DOM element
17
+ * @returns Cleanup function to unmount the React app
18
+ */
19
+ export declare function initSwipeFinder(options: SwipeFinderOptions): () => void;
20
+ export type { MainBootstrapProps } from '../containers/MainBootstrap/MainBootstrap';
@@ -0,0 +1,16 @@
1
+ import { Card } from '../types/card';
2
+ import { Category } from '../types/category';
3
+ import { FinderUIConfig } from '../types/FeedUIConfig';
4
+ /**
5
+ * DefaultDataService - Default implementation
6
+ */
7
+ export declare class DataService {
8
+ /**
9
+ * Load finder from API
10
+ */
11
+ loadFinderFromApi(finderId: string, backendUrl: string): Promise<{
12
+ finder: FinderUIConfig | null;
13
+ cards: Card[];
14
+ categories: Category[];
15
+ }>;
16
+ }
@@ -0,0 +1,17 @@
1
+ export declare class MonitorService {
2
+ /**
3
+ * Get monitor URL from window
4
+ */
5
+ private getMonitorUrl;
6
+ /**
7
+ * Send monitoring event to API
8
+ */
9
+ sendEvent(params: {
10
+ sessionId: string;
11
+ finderId: string;
12
+ event: string;
13
+ cardId?: string;
14
+ cardViewDuration?: number;
15
+ direction?: string;
16
+ }): void;
17
+ }
@@ -0,0 +1,214 @@
1
+ export type SwipeDirection = 'right' | 'left' | 'up' | 'down';
2
+ export interface SummaryUIConfig {
3
+ /** Whether summary is enabled - default is true */
4
+ enabled: boolean;
5
+ /** Summary layout type - default is 'list' */
6
+ endCardType: 'list' | 'grid';
7
+ /** Whether to show explanation text in summary - default is false */
8
+ explanationVisible: boolean;
9
+ /** Summary explanation texts per direction */
10
+ explanationTexts: {
11
+ right?: string;
12
+ left?: string;
13
+ up?: string;
14
+ down?: string;
15
+ };
16
+ /** Summary tabs background color - default is '#f5f5f5' */
17
+ tabsBackgroundColor: string;
18
+ /** Summary tabs border color - default is '#e0e0e0' */
19
+ tabsBorderColor: string;
20
+ /** Summary card item background color - default is '#F2F2F2' */
21
+ cardItemBackgroundColor: string;
22
+ /** Summary card item text color - default is '#181818' */
23
+ cardItemTextColor: string;
24
+ /** Summary content background color - default is '#ffffff' */
25
+ contentBackgroundColor: string;
26
+ /** Custom CSS class name */
27
+ className: string;
28
+ }
29
+ export interface HistoryUIConfig {
30
+ /** Whether history is enabled - default is true */
31
+ enabled: boolean;
32
+ /** History button size in pixels - default is 40 */
33
+ buttonSize: number;
34
+ /** History button color - default is '#415c77' */
35
+ buttonColor: string;
36
+ /** History button tooltip text - default is 'History' */
37
+ tooltipText: string;
38
+ /** History button tooltip text size in pixels - default is 12 */
39
+ tooltipTextSize: number;
40
+ /** History button tooltip text color - default is '#000000' */
41
+ tooltipTextColor: string;
42
+ /** History button tooltip background color - default is '#FFFFFF' */
43
+ tooltipBackgroundColor: string;
44
+ /** History button tooltip timeout in milliseconds - default is 3000 */
45
+ tooltipTimeout: number;
46
+ /** History button position from bottom in percentage - default is 20 */
47
+ buttonBottomPosition: number;
48
+ /** History button position from left in percentage - default is 50 */
49
+ buttonLeftPosition: number;
50
+ /** History drawer height in percentage - default is 70% */
51
+ drawerHeight: number;
52
+ /** History drawer max height in percentage - default is 90% */
53
+ drawerMaxHeight: number;
54
+ /** History drawer close button text - default is 'Close' */
55
+ drawerCloseButtonText: string;
56
+ /** History drawer item background color - default is '#F2F2F2' */
57
+ drawerItemBackgroundColor: string;
58
+ /** History drawer item text color - default is '#181818' */
59
+ drawerItemTextColor: string;
60
+ /** History drawer content background color - default is '#ffffff' */
61
+ drawerContentBackgroundColor: string;
62
+ /** History drawer tabs background color - default is '#f5f5f5' */
63
+ drawerTabsBackgroundColor: string;
64
+ /** History drawer tabs border color - default is '#e0e0e0' */
65
+ drawerTabsBorderColor: string;
66
+ /** History drawer end card type - default is 'list' */
67
+ drawerEndCardType: 'list' | 'grid';
68
+ }
69
+ export interface FiltersUIConfig {
70
+ /** Whether filters are enabled - default is true */
71
+ enabled: boolean;
72
+ /** Filters button text - default is 'Filters' */
73
+ buttonText: string;
74
+ /** Filters button color - default is '#415c77' */
75
+ buttonColor: string;
76
+ /** Filters button position from left in percentage - default is 50 */
77
+ buttonLeftPosition: number;
78
+ /** Filters button position from bottom in percentage - default is 20 */
79
+ buttonBottomPosition: number;
80
+ /** Filters button icon size in pixels - default is 16 */
81
+ iconSize: number;
82
+ /** Filters button text color - default is '#FFFFFF' */
83
+ textColor: string;
84
+ /** Whether to show filter icon - default is true */
85
+ showIcon: boolean;
86
+ /** Filters drawer close button text - default is 'Close' */
87
+ drawerCloseButtonText: string;
88
+ /** Filters drawer categories title - default is 'Categories' */
89
+ drawerCategoriesTitle: string;
90
+ }
91
+ export interface CardsCounterUIConfig {
92
+ /** Whether cards counter are enabled - default is true */
93
+ enabled: boolean;
94
+ /** Cards counter text - default is 'Cards counter' */
95
+ text: string;
96
+ /** Cards counter text size in pixels - default is 12 */
97
+ textSize: number;
98
+ /** Cards counter position from bottom in percentage - default is 20 */
99
+ positionBottom: number;
100
+ /** Cards counter position from left in percentage - default is 50 */
101
+ positionLeft: number;
102
+ }
103
+ export interface LogoUIConfig {
104
+ /** Whether logo are enabled - default is true */
105
+ enabled: boolean;
106
+ /** Logo URL - default is 'https://www.example.com/logo.png' */
107
+ url: string;
108
+ /** Logo size in pixels - default is 100 */
109
+ size: number;
110
+ /** Logo position Y in percentage - default is 15 */
111
+ positionY: number;
112
+ /** Logo position X in percentage - default is 15 */
113
+ positionX: number;
114
+ /** Logo auto hide timeout in milliseconds - default is 3000 */
115
+ autoHideTimeout: number;
116
+ }
117
+ export interface NavigationUIConfig {
118
+ type: 'vertical-emojis' | 'side-emojis' | 'side-arrows';
119
+ /** Swipeoptions */
120
+ options: {
121
+ [key in SwipeDirection]: {
122
+ enabled: boolean;
123
+ gesture: boolean;
124
+ label: string;
125
+ };
126
+ };
127
+ /** Navigation button size in pixels - default is 40 */
128
+ size: number;
129
+ /** Navigation button background color - default is '#FFFFFF' */
130
+ backgroundColor: string;
131
+ /** Navigation button text color - default is '#000000' */
132
+ textColor: string;
133
+ /** Navigation button text size in pixels - default is 12 */
134
+ textSize: number;
135
+ /** Applicable only for 'side-emojis' and 'side-arrows' types */
136
+ /** Navigation button spread in percentage - default is 100 */
137
+ buttonsSpread: number;
138
+ /** Applicable only for 'vertical-emojis' type */
139
+ /** Navigation button position from right in percentage - default is 20 */
140
+ positionRight: number;
141
+ /** Navigation button position from top in percentage - default is 20 */
142
+ positionTop: number;
143
+ }
144
+ export interface NavigationDemoTooltipUIConfig {
145
+ /** Whether demo tooltip are enabled - default is true */
146
+ enabled: boolean;
147
+ /** Navigation button tooltip text - default is 'Click Here' */
148
+ text: string;
149
+ /** Navigation button tooltip text color - default is '#000000' */
150
+ textColor: string;
151
+ /** Navigation button tooltip text size in pixels - default is 12 */
152
+ textSize: number;
153
+ /** Navigation button tooltip background color - default is '#FFFFFF' */
154
+ backgroundColor: string;
155
+ /** Navigation button tooltip timeout in milliseconds - default is 3000 */
156
+ timeout: number;
157
+ /** Navigation button tooltip keep - default is false */
158
+ keep: boolean;
159
+ /** Applicable only for 'vertical-emojis' type */
160
+ /** Navigation button tooltip bottom offset in percentage */
161
+ bottomOffset: number;
162
+ }
163
+ export interface CardTitleUIConfig {
164
+ /** Whether card title are enabled - default is true */
165
+ enabled: boolean;
166
+ /** Card title text size in pixels - default is 12 */
167
+ textSize: number;
168
+ /** Card title position from bottom in percentage - default is 10 */
169
+ positionBottom: number;
170
+ }
171
+ export interface CardGradientUIConfig {
172
+ /** Whether card gradient are enabled - default is true */
173
+ type: 'none' | 'top' | 'bottom' | 'top-and-bottom';
174
+ /** Card gradient color - default is '#000000' */
175
+ color: string;
176
+ }
177
+ export interface CardUIConfig {
178
+ /** Card title UI configuration */
179
+ title: CardTitleUIConfig;
180
+ /** Card gradient UI configuration */
181
+ gradient: CardGradientUIConfig;
182
+ }
183
+ export interface VolumeControlUIConfig {
184
+ /** Whether volume control are enabled - default is true */
185
+ enabled: boolean;
186
+ /** Volume control size in pixels - default is 40 */
187
+ size: number;
188
+ /** Volume control position - default is 'top-right' */
189
+ position: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
190
+ /** Whether volume control is visible - default is true */
191
+ volumeControl: boolean;
192
+ }
193
+ export interface FinderUIConfig {
194
+ /** Initial volume (0-1) - default is 0.5, 0 is initially muted */
195
+ initialVolume: number;
196
+ /** Volume control UI configuration */
197
+ volumeControl: VolumeControlUIConfig;
198
+ /** Summary UI configuration */
199
+ summary: SummaryUIConfig;
200
+ /** History UI configuration */
201
+ history: HistoryUIConfig;
202
+ /** Filters UI configuration */
203
+ filters: FiltersUIConfig;
204
+ /** Cards counter UI configuration */
205
+ cardsCounter: CardsCounterUIConfig;
206
+ /** Logo UI configuration */
207
+ logo: LogoUIConfig;
208
+ /** Navigation UI configuration */
209
+ navigation: NavigationUIConfig;
210
+ /** Navigation demo tooltip UI configuration */
211
+ navigationDemoTooltip: NavigationDemoTooltipUIConfig;
212
+ /** Card UI configuration */
213
+ card: CardUIConfig;
214
+ }
@@ -0,0 +1,40 @@
1
+ import { FinderUIConfig } from './FeedUIConfig';
2
+ import { Card } from './card';
3
+ import { Category } from './category';
4
+ /**
5
+ * Pagination information
6
+ */
7
+ export interface Pagination {
8
+ /** Current page number */
9
+ currentPage: number;
10
+ /** Page limit (items per page) */
11
+ pageLimit: number;
12
+ /** Total number of cards */
13
+ totalCards: number;
14
+ /** Total number of pages */
15
+ totalPages: number;
16
+ /** Whether there is a next page */
17
+ hasNextPage: boolean;
18
+ /** Whether there is a previous page */
19
+ hasPrevPage: boolean;
20
+ }
21
+ /**
22
+ * Cards response structure
23
+ */
24
+ export interface CardsResponse {
25
+ /** Array of card items */
26
+ items: Card[];
27
+ /** Pagination information */
28
+ pagination: Pagination;
29
+ }
30
+ /**
31
+ * API response structure
32
+ */
33
+ export interface ApiResponse {
34
+ /** Finder configuration */
35
+ finder: FinderUIConfig;
36
+ /** Cards response with items and pagination */
37
+ cards: CardsResponse;
38
+ /** Categories array */
39
+ categories: Category[];
40
+ }
@@ -0,0 +1,22 @@
1
+ export type CardBase = {
2
+ id: string;
3
+ type: 'image' | 'video';
4
+ title: string;
5
+ description?: string;
6
+ url?: string;
7
+ price?: number;
8
+ currency?: string;
9
+ position?: number;
10
+ categoryIds?: string[];
11
+ };
12
+ export type VideoCard = CardBase & {
13
+ type: 'video';
14
+ videoThumbnail?: string;
15
+ summaryImage?: string;
16
+ videoUrl: string;
17
+ };
18
+ export type ImageCard = CardBase & {
19
+ type: 'image';
20
+ imageUrl: string;
21
+ };
22
+ export type Card = VideoCard | ImageCard;
@@ -0,0 +1,4 @@
1
+ export type Category = {
2
+ id: string;
3
+ name: string;
4
+ };
@@ -0,0 +1,12 @@
1
+ import { Card } from "./card";
2
+ export type SwipeDirection = 'left' | 'right' | 'up' | 'down';
3
+ export interface SwipeOptionConfig {
4
+ enabled: boolean;
5
+ gesture: boolean;
6
+ label: string;
7
+ }
8
+ export interface SwipeHistoryEntry {
9
+ card: Card;
10
+ direction: SwipeDirection;
11
+ timestamp: number;
12
+ }