@liquidcommercedev/rmn-sdk 1.5.0-beta.5 → 1.5.0-beta.50

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 (110) hide show
  1. package/README.md +201 -57
  2. package/dist/index.cjs +8261 -4055
  3. package/dist/index.esm.js +8260 -4054
  4. package/dist/types/common/helpers/event-type.helper.d.ts +8 -0
  5. package/dist/types/common/helpers/extract-deep.helper.d.ts +14 -0
  6. package/dist/types/common/helpers/index.d.ts +6 -0
  7. package/dist/types/common/helpers/normalize-string.helper.d.ts +14 -0
  8. package/dist/types/common/helpers/utils.helper.d.ts +37 -0
  9. package/dist/types/common/http/api.constant.d.ts +1 -1
  10. package/dist/types/common/http/api.interface.d.ts +1 -1
  11. package/dist/types/common/http/base.api.d.ts +1 -1
  12. package/dist/types/constants/special-chars-map.constant.d.ts +1 -0
  13. package/dist/types/constants/spot-dimension.constant.d.ts +2 -0
  14. package/dist/types/enums.d.ts +29 -1
  15. package/dist/types/index.umd.d.ts +2 -2
  16. package/dist/types/modules/element/component/carousel/carousel.interface.d.ts +8 -3
  17. package/dist/types/modules/element/component/skeleton/index.d.ts +2 -0
  18. package/dist/types/modules/element/component/skeleton/skeleton.component.d.ts +3 -0
  19. package/dist/types/modules/element/component/skeleton/skeleton.interface.d.ts +14 -0
  20. package/dist/types/modules/element/component/spot/spot.component.d.ts +25 -3
  21. package/dist/types/modules/element/component/spot/spot.interface.d.ts +11 -7
  22. package/dist/types/modules/element/element.constant.d.ts +2 -5
  23. package/dist/types/modules/element/element.interface.d.ts +11 -9
  24. package/dist/types/modules/element/element.service.d.ts +29 -11
  25. package/dist/types/modules/helper-service/index.d.ts +4 -0
  26. package/dist/types/modules/helper-service/localstorage.service.d.ts +82 -0
  27. package/dist/types/modules/helper-service/proximity-observer.service.d.ts +30 -0
  28. package/dist/types/modules/{event/pubsub.d.ts → helper-service/pubsub.service.d.ts} +8 -9
  29. package/dist/types/modules/monitor/index.d.ts +2 -0
  30. package/dist/types/modules/monitor/monitor.enums.d.ts +5 -0
  31. package/dist/types/modules/monitor/monitor.interface.d.ts +21 -0
  32. package/dist/types/modules/monitor/monitor.service.d.ts +12 -0
  33. package/dist/types/modules/{event/helpers → monitor/monitors}/datalayer.monitor.d.ts +3 -2
  34. package/dist/types/modules/selection/selection.interface.d.ts +35 -3
  35. package/dist/types/modules/selection/selection.service.d.ts +1 -0
  36. package/dist/types/modules/selection/selection.type.d.ts +5 -9
  37. package/dist/types/modules/spot-manager/index.d.ts +2 -0
  38. package/dist/types/modules/{event/event.interface.d.ts → spot-manager/spot-manager.interface.d.ts} +9 -29
  39. package/dist/types/modules/spot-manager/spot-manager.service.d.ts +28 -0
  40. package/dist/types/modules/spot-template/iab/billboard/billboard-v1.template.d.ts +14 -0
  41. package/dist/types/modules/spot-template/iab/billboard/index.d.ts +1 -0
  42. package/dist/types/modules/{element/template → spot-template}/iab/in-text/in-text-v1.template.d.ts +1 -1
  43. package/dist/types/modules/{element/template → spot-template}/iab/large-leaderboard/index.d.ts +0 -1
  44. package/dist/types/modules/{element/template → spot-template}/iab/square/index.d.ts +0 -1
  45. package/dist/types/modules/spot-template/iab-template.interface.d.ts +12 -0
  46. package/dist/types/modules/spot-template/index.d.ts +4 -0
  47. package/dist/types/modules/spot-template/rb-template.interface.d.ts +208 -0
  48. package/dist/types/modules/spot-template/reservebar/carousel-horizontal-info-card.template.d.ts +9 -0
  49. package/dist/types/modules/spot-template/reservebar/carousel-horizontal-short-info-card.template.d.ts +9 -0
  50. package/dist/types/modules/spot-template/reservebar/carousel-vertical-small-image-info-card.template.d.ts +9 -0
  51. package/dist/types/modules/spot-template/reservebar/collection-banner-without-text-block.template.d.ts +7 -0
  52. package/dist/types/modules/spot-template/reservebar/homepage-hero-full-image.template.d.ts +10 -0
  53. package/dist/types/modules/spot-template/reservebar/homepage-hero-three-tile.template.d.ts +9 -0
  54. package/dist/types/modules/spot-template/reservebar/homepage-hero-two-tile.template.d.ts +9 -0
  55. package/dist/types/modules/spot-template/reservebar/in-text.template.d.ts +7 -0
  56. package/dist/types/modules/{element/template → spot-template}/reservebar/index.d.ts +7 -0
  57. package/dist/types/modules/spot-template/reservebar/large-category-image-tout.template.d.ts +9 -0
  58. package/dist/types/modules/spot-template/reservebar/long-tout-short.template.d.ts +9 -0
  59. package/dist/types/modules/spot-template/reservebar/long-tout-tall.template.d.ts +10 -0
  60. package/dist/types/modules/spot-template/reservebar/navigation-banner.template.d.ts +9 -0
  61. package/dist/types/modules/spot-template/reservebar/small-category-image-tout.template.d.ts +9 -0
  62. package/dist/types/modules/spot-template/reservebar/small-discover-tout.template.d.ts +8 -0
  63. package/dist/types/modules/spot-template/reservebar/video-player.template.d.ts +23 -0
  64. package/dist/types/modules/spot-template/spot-template.constant.d.ts +8 -0
  65. package/dist/types/modules/spot-template/spot-template.interface.d.ts +14 -0
  66. package/dist/types/modules/spot-template/spot-template.service.d.ts +13 -0
  67. package/dist/types/modules/spot-template/utils.d.ts +5 -0
  68. package/dist/types/rmn-client.d.ts +76 -39
  69. package/dist/types/rmn-client.helper.d.ts +41 -0
  70. package/dist/types/types.d.ts +8 -7
  71. package/package.json +27 -48
  72. package/umd/liquidcommerce-rmn-sdk.min.js +1 -1
  73. package/dist/types/modules/element/component/utils.d.ts +0 -1
  74. package/dist/types/modules/element/template/helper.d.ts +0 -4
  75. package/dist/types/modules/element/template/iab/billboard/billboard-v1.template.d.ts +0 -2
  76. package/dist/types/modules/element/template/iab/billboard/billboard-v2.template.d.ts +0 -2
  77. package/dist/types/modules/element/template/iab/billboard/billboard-v3.template.d.ts +0 -2
  78. package/dist/types/modules/element/template/iab/billboard/index.d.ts +0 -3
  79. package/dist/types/modules/element/template/iab/large-leaderboard/large-leaderboard-v2.template.d.ts +0 -2
  80. package/dist/types/modules/element/template/iab/square/square-v2.template.d.ts +0 -2
  81. package/dist/types/modules/element/template/index.d.ts +0 -1
  82. package/dist/types/modules/element/template/reservebar/collection-banner-without-text-block.template.d.ts +0 -3
  83. package/dist/types/modules/element/template/reservebar/homepage-hero-full-image.template.d.ts +0 -3
  84. package/dist/types/modules/element/template/reservebar/homepage-hero-three-tile.template.d.ts +0 -3
  85. package/dist/types/modules/element/template/reservebar/homepage-hero-two-tile.template.d.ts +0 -3
  86. package/dist/types/modules/element/template/reservebar/large-category-image-tout.template.d.ts +0 -3
  87. package/dist/types/modules/element/template/reservebar/navigation-banner.template.d.ts +0 -3
  88. package/dist/types/modules/element/template/reservebar/small-category-image-tout.template.d.ts +0 -3
  89. package/dist/types/modules/element/template/reservebar/small-discover-tout.template.d.ts +0 -3
  90. package/dist/types/modules/element/template/template.service.d.ts +0 -11
  91. package/dist/types/modules/element/template/template.type.d.ts +0 -11
  92. package/dist/types/modules/event/event.constant.d.ts +0 -1
  93. package/dist/types/modules/event/event.service.d.ts +0 -47
  94. package/dist/types/modules/event/helpers/index.d.ts +0 -4
  95. package/dist/types/modules/event/helpers/intersection.service.d.ts +0 -8
  96. package/dist/types/modules/event/helpers/localstorage.service.d.ts +0 -31
  97. package/dist/types/modules/event/index.d.ts +0 -5
  98. package/dist/types/modules/event/user.monitor.d.ts +0 -13
  99. package/dist/types/static.constant.d.ts +0 -4
  100. /package/dist/types/modules/{event/helpers → helper-service}/resize.service.d.ts +0 -0
  101. /package/dist/types/modules/{element/template → spot-template}/iab/in-text/index.d.ts +0 -0
  102. /package/dist/types/modules/{element/template → spot-template}/iab/index.d.ts +0 -0
  103. /package/dist/types/modules/{element/template → spot-template}/iab/large-leaderboard/large-leaderboard-v1.template.d.ts +0 -0
  104. /package/dist/types/modules/{element/template → spot-template}/iab/large-rectangle/index.d.ts +0 -0
  105. /package/dist/types/modules/{element/template → spot-template}/iab/large-rectangle/large-rectangle-v1.template.d.ts +0 -0
  106. /package/dist/types/modules/{element/template → spot-template}/iab/square/square-v1.template.d.ts +0 -0
  107. /package/dist/types/modules/{element/template → spot-template}/iab/vertical-rectangle/index.d.ts +0 -0
  108. /package/dist/types/modules/{element/template → spot-template}/iab/vertical-rectangle/vertical-rectangle-v1.template.d.ts +0 -0
  109. /package/dist/types/modules/{element/template → spot-template}/iab/wide-skyscraper/index.d.ts +0 -0
  110. /package/dist/types/modules/{element/template → spot-template}/iab/wide-skyscraper/wide-skyscraper-v1.template.d.ts +0 -0
@@ -1 +0,0 @@
1
- export declare function calculateScaleFactor(elementScale: number): number;
@@ -1,4 +0,0 @@
1
- import type { ISpotOverlay } from '../element.interface';
2
- export declare function convertHexToRgba(hex: string, opacity?: number): string;
3
- export declare function generateGradientColor(overlay?: ISpotOverlay, fallback?: string): string;
4
- export declare function spotHtmlStringToElement(htmlString: string): HTMLElement;
@@ -1,2 +0,0 @@
1
- import type { ISpot } from 'types';
2
- export declare function billboardV1Template(spot: ISpot): string;
@@ -1,2 +0,0 @@
1
- import type { ISpot } from 'types';
2
- export declare function billboardV2Template(spot: ISpot): string;
@@ -1,2 +0,0 @@
1
- import type { ISpot } from 'types';
2
- export declare function billboardV3Template(spot: ISpot): string;
@@ -1,3 +0,0 @@
1
- export * from './billboard-v1.template';
2
- export * from './billboard-v2.template';
3
- export * from './billboard-v3.template';
@@ -1,2 +0,0 @@
1
- import type { ISpot } from 'types';
2
- export declare function largeLeaderboardV2Template(spot: ISpot): string;
@@ -1,2 +0,0 @@
1
- import type { ISpot } from 'types';
2
- export declare function squareV2Template(spot: ISpot): string;
@@ -1 +0,0 @@
1
- export * from './template.service';
@@ -1,3 +0,0 @@
1
- import type { ISpot } from 'types';
2
- import type { ISpotTemplateConfig } from '../template.type';
3
- export declare function rbCollectionBannerWithoutTextBlockTemplate(spot: ISpot, config: ISpotTemplateConfig): string;
@@ -1,3 +0,0 @@
1
- import type { ISpot } from 'types';
2
- import type { ISpotTemplateConfig } from '../template.type';
3
- export declare function rbHomepageHeroFullImageTemplate(spot: ISpot, config: ISpotTemplateConfig): string;
@@ -1,3 +0,0 @@
1
- import type { ISpot } from 'types';
2
- import type { ISpotTemplateConfig } from '../template.type';
3
- export declare function rbHomepageHeroThreeTileTemplate(spot: ISpot, config: ISpotTemplateConfig): string;
@@ -1,3 +0,0 @@
1
- import type { ISpot } from 'types';
2
- import type { ISpotTemplateConfig } from '../template.type';
3
- export declare function rbHomepageHeroTwoTileTemplate(spot: ISpot, config: ISpotTemplateConfig): string;
@@ -1,3 +0,0 @@
1
- import type { ISpot } from 'types';
2
- import type { ISpotTemplateConfig } from '../template.type';
3
- export declare function rbLargeCategoryImageToutTemplate(spot: ISpot, config: ISpotTemplateConfig): string;
@@ -1,3 +0,0 @@
1
- import type { ISpot } from 'types';
2
- import type { ISpotTemplateConfig } from '../template.type';
3
- export declare function rbNavigationBannerTemplate(spot: ISpot, config: ISpotTemplateConfig): string;
@@ -1,3 +0,0 @@
1
- import type { ISpot } from 'types';
2
- import type { ISpotTemplateConfig } from '../template.type';
3
- export declare function rbSmallCategoryImageToutTemplate(spot: ISpot, config: ISpotTemplateConfig): string;
@@ -1,3 +0,0 @@
1
- import type { ISpot } from 'types';
2
- import type { ISpotTemplateConfig } from '../template.type';
3
- export declare function rbSmallDiscoverToutTemplate(spot: ISpot, config: ISpotTemplateConfig): string;
@@ -1,11 +0,0 @@
1
- import type { ISpot } from 'types';
2
- import type { ISpotTemplateConfig } from './template.type';
3
- /**
4
- * Returns the HTML element for the given spot.
5
- *
6
- * @param {ISpot} spot - The spot object.
7
- * @param {ISpotTemplateConfig} config - The spot template configuration.
8
- *
9
- * @return {HTMLElement | null} - The HTML element for the given spot or null if the spot template is not found.
10
- */
11
- export declare const SPOT_TEMPLATE_HTML_ELEMENT: (spot: ISpot, config?: ISpotTemplateConfig) => HTMLElement | null;
@@ -1,11 +0,0 @@
1
- import type { RMN_SPOT_TYPE } from 'enums';
2
- import type { SpotVariantType } from 'modules/selection';
3
- import type { ISpot } from 'types';
4
- import type { ISpotOverlay } from '../element.interface';
5
- export interface ISpotTemplateConfig {
6
- overlay?: ISpotOverlay;
7
- prefix?: string;
8
- }
9
- export type TemplateFunction = (spot: ISpot, config: ISpotTemplateConfig) => string;
10
- export type SpotTypeTemplate = Partial<Record<SpotVariantType, TemplateFunction>>;
11
- export type SpotTemplates = Record<RMN_SPOT_TYPE, SpotTypeTemplate>;
@@ -1 +0,0 @@
1
- export declare const EVENT_API_PATH = "/spots/event";
@@ -1,47 +0,0 @@
1
- import { RMN_SPOT_EVENT } from 'enums';
2
- import type { ILifecycleState, IRegisterSpotParams, IRmnEventMap } from './event.interface';
3
- export declare class EventService {
4
- private static instance;
5
- private pubSub;
6
- private localStorage;
7
- private intersectionObserver;
8
- private spotStates;
9
- private activeSpots;
10
- private constructor();
11
- static getInstance(): EventService;
12
- subscribe(eventType: RMN_SPOT_EVENT, callback: (data: IRmnEventMap[RMN_SPOT_EVENT]) => void): () => void;
13
- publish(eventType: RMN_SPOT_EVENT, data: IRmnEventMap[RMN_SPOT_EVENT]): void;
14
- registerSpot(params: IRegisterSpotParams): void;
15
- unregisterSpot(placementId: string): void;
16
- /**
17
- * Updates the state of a spot.
18
- *
19
- * @param {string} placementId - The placement ID of the spot.
20
- * @param {Partial<ILifecycleState>} updates - The updates to apply to the spot state.
21
- * @param {boolean} publish - Whether to publish the updated state.
22
- *
23
- * @returns {void}
24
- */
25
- handleSpotState(placementId: string, updates: Partial<ILifecycleState>, publish?: boolean): void;
26
- private handleClick;
27
- private handleIntersectionObserver;
28
- private fireImpressionEvent;
29
- /**
30
- * Fires an event using the navigator.sendBeacon method or a fallback method if sendBeacon is not available.
31
- * If the event is a click event and a redirect URL is found, it redirects the user to that URL.
32
- *
33
- * @param {IFireEventParams} params - The parameters for firing the event.
34
- * @param {RMN_SPOT_EVENT} params.event - The event type.
35
- * @param {string} params.eventUrl - The URL to which the event is sent.
36
- * @returns {Promise<void>} - A promise that resolves when the event is fired.
37
- */
38
- private fireEvent;
39
- private fallbackEventFire;
40
- /**
41
- * Extracts and decodes a URL from a base64-encoded query parameter.
42
- *
43
- * @param {string} url - The URL containing the base64-encoded query parameter.
44
- * @returns {string | null} - The decoded URL or null if not found or invalid.
45
- */
46
- private getRedirectUrlFromPayload;
47
- }
@@ -1,4 +0,0 @@
1
- export * from './datalayer.monitor';
2
- export * from './intersection.service';
3
- export * from './localstorage.service';
4
- export * from './resize.service';
@@ -1,8 +0,0 @@
1
- export declare class IntersectionObserverService {
2
- private observers;
3
- private readonly defaultOptions;
4
- constructor(defaultOptions?: IntersectionObserverInit);
5
- observe(element: HTMLElement, callback: (entry: IntersectionObserverEntry) => void, options?: IntersectionObserverInit): void;
6
- unobserve(element: HTMLElement): void;
7
- unobserveAll(): void;
8
- }
@@ -1,31 +0,0 @@
1
- import type { RMN_SPOT_TYPE } from 'enums';
2
- import type { ISpotEvent } from 'modules/selection';
3
- export type LocalStorageSpotsMapType = Map<string, // spotId
4
- ILocalStorageSpot>;
5
- export type LocalStorageSpotsObjType = Record<string, // spotId
6
- ILocalStorageSpot>;
7
- export interface ILocalStorageSpot {
8
- spotId: string;
9
- spotType: RMN_SPOT_TYPE;
10
- events: ISpotEvent[];
11
- productIds: Array<string | number>;
12
- createdAt?: number;
13
- }
14
- export declare class LocalStorage {
15
- private spots?;
16
- private static instance;
17
- private static readonly localStorageKey;
18
- private static readonly spotExpirationTime;
19
- private constructor();
20
- static getInstance(): LocalStorage;
21
- private syncLocalStorage;
22
- setSpot(spotId: string, data: ILocalStorageSpot): void;
23
- removeSpot(spotId: string): void;
24
- getSpot(spotId: string): ILocalStorageSpot | undefined;
25
- getSpots(): LocalStorageSpotsObjType | undefined;
26
- private updateLocalStorage;
27
- private clearLocalStorage;
28
- private removeExpiredSpots;
29
- private mapToObj;
30
- private objToMap;
31
- }
@@ -1,5 +0,0 @@
1
- export * from './event.constant';
2
- export * from './event.interface';
3
- export * from './event.service';
4
- export * from './helpers';
5
- export * from './user.monitor';
@@ -1,13 +0,0 @@
1
- export declare enum AnalyticsTool {
2
- GoogleAnalytics = "google-analytics",
3
- Other = "Other"
4
- }
5
- export declare class UserMonitor {
6
- private static instance;
7
- private readonly implementedMonitor?;
8
- private readonly localStorage?;
9
- private constructor();
10
- static getInstance(): UserMonitor;
11
- start(): void;
12
- private detectAnalyticsTool;
13
- }
@@ -1,4 +0,0 @@
1
- import type { ISpotEvent, ISpots } from 'types';
2
- export declare const SPOT_EVENTS_EXAMPLE: ISpotEvent[];
3
- export declare const RB_SPOTS_SELECTION_EXAMPLE: Partial<ISpots>;
4
- export declare const IAB_SPOTS_SELECTION_EXAMPLE: Partial<ISpots>;