@liquidcommercedev/rmn-sdk 1.5.0-beta.4 → 1.5.0-beta.40
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 +201 -57
- package/dist/index.cjs +6287 -3419
- package/dist/index.esm.js +6286 -3418
- package/dist/types/common/helpers/event-type.helper.d.ts +8 -0
- package/dist/types/common/helpers/extract-deep.helper.d.ts +14 -0
- package/dist/types/common/helpers/index.d.ts +6 -0
- package/dist/types/common/helpers/normalize-string.helper.d.ts +14 -0
- package/dist/types/common/helpers/utils.helper.d.ts +37 -0
- package/dist/types/common/http/api.constant.d.ts +1 -1
- package/dist/types/common/http/api.interface.d.ts +1 -1
- package/dist/types/common/http/base.api.d.ts +1 -1
- package/dist/types/constants/special-chars-map.constant.d.ts +1 -0
- package/dist/types/constants/spot-dimension.constant.d.ts +2 -0
- package/dist/types/enums.d.ts +22 -1
- package/dist/types/index.umd.d.ts +2 -2
- package/dist/types/modules/element/component/carousel/carousel.interface.d.ts +8 -3
- package/dist/types/modules/element/component/skeleton/index.d.ts +2 -0
- package/dist/types/modules/element/component/skeleton/skeleton.component.d.ts +3 -0
- package/dist/types/modules/element/component/skeleton/skeleton.interface.d.ts +14 -0
- package/dist/types/modules/element/component/spot/spot.component.d.ts +21 -3
- package/dist/types/modules/element/component/spot/spot.interface.d.ts +11 -7
- package/dist/types/modules/element/element.constant.d.ts +2 -5
- package/dist/types/modules/element/element.interface.d.ts +5 -8
- package/dist/types/modules/element/element.service.d.ts +29 -11
- package/dist/types/modules/helper-service/index.d.ts +4 -0
- package/dist/types/modules/helper-service/localstorage.service.d.ts +82 -0
- package/dist/types/modules/helper-service/proximity-observer.service.d.ts +30 -0
- package/dist/types/modules/{event/pubsub.d.ts → helper-service/pubsub.service.d.ts} +8 -9
- package/dist/types/modules/monitor/index.d.ts +2 -0
- package/dist/types/modules/monitor/monitor.enums.d.ts +5 -0
- package/dist/types/modules/monitor/monitor.interface.d.ts +21 -0
- package/dist/types/modules/monitor/monitor.service.d.ts +12 -0
- package/dist/types/modules/monitor/monitors/datalayer.monitor.d.ts +11 -0
- package/dist/types/modules/selection/selection.interface.d.ts +26 -3
- package/dist/types/modules/selection/selection.service.d.ts +1 -0
- package/dist/types/modules/selection/selection.type.d.ts +5 -9
- package/dist/types/modules/spot-manager/index.d.ts +2 -0
- package/dist/types/modules/{event/event.interface.d.ts → spot-manager/spot-manager.interface.d.ts} +9 -29
- package/dist/types/modules/spot-manager/spot-manager.service.d.ts +28 -0
- package/dist/types/modules/spot-template/iab/billboard/billboard-v1.template.d.ts +14 -0
- package/dist/types/modules/spot-template/iab/billboard/index.d.ts +1 -0
- package/dist/types/modules/{element/template → spot-template}/iab/in-text/in-text-v1.template.d.ts +1 -1
- package/dist/types/modules/{element/template → spot-template}/iab/large-leaderboard/index.d.ts +0 -1
- package/dist/types/modules/{element/template → spot-template}/iab/square/index.d.ts +0 -1
- package/dist/types/modules/spot-template/iab-template.interface.d.ts +12 -0
- package/dist/types/modules/spot-template/index.d.ts +4 -0
- package/dist/types/modules/spot-template/rb-template.interface.d.ts +116 -0
- package/dist/types/modules/spot-template/reservebar/collection-banner-without-text-block.template.d.ts +7 -0
- package/dist/types/modules/spot-template/reservebar/homepage-hero-full-image.template.d.ts +8 -0
- package/dist/types/modules/spot-template/reservebar/homepage-hero-three-tile.template.d.ts +7 -0
- package/dist/types/modules/spot-template/reservebar/homepage-hero-two-tile.template.d.ts +7 -0
- package/dist/types/modules/spot-template/reservebar/in-text.template.d.ts +7 -0
- package/dist/types/modules/{element/template → spot-template}/reservebar/index.d.ts +4 -0
- package/dist/types/modules/spot-template/reservebar/large-category-image-tout.template.d.ts +7 -0
- package/dist/types/modules/spot-template/reservebar/long-tout-short.template.d.ts +7 -0
- package/dist/types/modules/spot-template/reservebar/long-tout-tall.template.d.ts +8 -0
- package/dist/types/modules/spot-template/reservebar/navigation-banner.template.d.ts +7 -0
- package/dist/types/modules/spot-template/reservebar/small-category-image-tout.template.d.ts +7 -0
- package/dist/types/modules/spot-template/reservebar/small-discover-tout.template.d.ts +7 -0
- package/dist/types/modules/spot-template/reservebar/video-player.template.d.ts +20 -0
- package/dist/types/modules/spot-template/spot-template.constant.d.ts +3 -0
- package/dist/types/modules/spot-template/spot-template.interface.d.ts +13 -0
- package/dist/types/modules/spot-template/spot-template.service.d.ts +13 -0
- package/dist/types/modules/{element/template/helper.d.ts → spot-template/utils.d.ts} +1 -2
- package/dist/types/rmn-client.d.ts +75 -38
- package/dist/types/rmn-client.helper.d.ts +41 -0
- package/dist/types/types.d.ts +8 -7
- package/package.json +30 -42
- package/umd/liquidcommerce-rmn-sdk.min.js +1 -1
- package/dist/types/modules/element/component/utils.d.ts +0 -1
- package/dist/types/modules/element/template/iab/billboard/billboard-v1.template.d.ts +0 -2
- package/dist/types/modules/element/template/iab/billboard/billboard-v2.template.d.ts +0 -2
- package/dist/types/modules/element/template/iab/billboard/billboard-v3.template.d.ts +0 -2
- package/dist/types/modules/element/template/iab/billboard/index.d.ts +0 -3
- package/dist/types/modules/element/template/iab/large-leaderboard/large-leaderboard-v2.template.d.ts +0 -2
- package/dist/types/modules/element/template/iab/square/square-v2.template.d.ts +0 -2
- package/dist/types/modules/element/template/index.d.ts +0 -1
- package/dist/types/modules/element/template/reservebar/collection-banner-without-text-block.template.d.ts +0 -3
- package/dist/types/modules/element/template/reservebar/homepage-hero-full-image.template.d.ts +0 -3
- package/dist/types/modules/element/template/reservebar/homepage-hero-three-tile.template.d.ts +0 -3
- package/dist/types/modules/element/template/reservebar/homepage-hero-two-tile.template.d.ts +0 -3
- package/dist/types/modules/element/template/reservebar/large-category-image-tout.template.d.ts +0 -3
- package/dist/types/modules/element/template/reservebar/navigation-banner.template.d.ts +0 -3
- package/dist/types/modules/element/template/reservebar/small-category-image-tout.template.d.ts +0 -3
- package/dist/types/modules/element/template/reservebar/small-discover-tout.template.d.ts +0 -3
- package/dist/types/modules/element/template/template.service.d.ts +0 -11
- package/dist/types/modules/element/template/template.type.d.ts +0 -11
- package/dist/types/modules/event/event.constant.d.ts +0 -1
- package/dist/types/modules/event/event.service.d.ts +0 -47
- package/dist/types/modules/event/helpers/index.d.ts +0 -3
- package/dist/types/modules/event/helpers/intersection.service.d.ts +0 -8
- package/dist/types/modules/event/helpers/localstorage.service.d.ts +0 -26
- package/dist/types/modules/event/index.d.ts +0 -4
- package/dist/types/static.constant.d.ts +0 -4
- /package/dist/types/modules/{event/helpers → helper-service}/resize.service.d.ts +0 -0
- /package/dist/types/modules/{element/template → spot-template}/iab/in-text/index.d.ts +0 -0
- /package/dist/types/modules/{element/template → spot-template}/iab/index.d.ts +0 -0
- /package/dist/types/modules/{element/template → spot-template}/iab/large-leaderboard/large-leaderboard-v1.template.d.ts +0 -0
- /package/dist/types/modules/{element/template → spot-template}/iab/large-rectangle/index.d.ts +0 -0
- /package/dist/types/modules/{element/template → spot-template}/iab/large-rectangle/large-rectangle-v1.template.d.ts +0 -0
- /package/dist/types/modules/{element/template → spot-template}/iab/square/square-v1.template.d.ts +0 -0
- /package/dist/types/modules/{element/template → spot-template}/iab/vertical-rectangle/index.d.ts +0 -0
- /package/dist/types/modules/{element/template → spot-template}/iab/vertical-rectangle/vertical-rectangle-v1.template.d.ts +0 -0
- /package/dist/types/modules/{element/template → spot-template}/iab/wide-skyscraper/index.d.ts +0 -0
- /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 +0,0 @@
|
|
1
|
-
export * from './template.service';
|
@@ -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,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,26 +0,0 @@
|
|
1
|
-
import type { RMN_SPOT_TYPE } from 'enums';
|
2
|
-
import type { ISpotEvent } from 'modules/selection';
|
3
|
-
export interface ILocalStorageSpot {
|
4
|
-
spotId: string;
|
5
|
-
spotType: RMN_SPOT_TYPE;
|
6
|
-
events: ISpotEvent[];
|
7
|
-
productIds: Array<string | number>;
|
8
|
-
createdAt?: number;
|
9
|
-
}
|
10
|
-
export declare class LocalStorage {
|
11
|
-
private spots?;
|
12
|
-
private static instance;
|
13
|
-
private static readonly localStorageKey;
|
14
|
-
private static readonly spotExpirationTime;
|
15
|
-
private constructor();
|
16
|
-
static getInstance(): LocalStorage;
|
17
|
-
private syncLocalStorage;
|
18
|
-
setSpot(spotId: string, data: ILocalStorageSpot): void;
|
19
|
-
getSpot(spotId: string): ILocalStorageSpot | undefined;
|
20
|
-
removeSpot(spotId: string): void;
|
21
|
-
private updateLocalStorage;
|
22
|
-
clearLocalStorage(): void;
|
23
|
-
private removeExpiredSpots;
|
24
|
-
private mapToObj;
|
25
|
-
private objToMap;
|
26
|
-
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/package/dist/types/modules/{element/template → spot-template}/iab/large-rectangle/index.d.ts
RENAMED
File without changes
|
File without changes
|
/package/dist/types/modules/{element/template → spot-template}/iab/square/square-v1.template.d.ts
RENAMED
File without changes
|
/package/dist/types/modules/{element/template → spot-template}/iab/vertical-rectangle/index.d.ts
RENAMED
File without changes
|
File without changes
|
/package/dist/types/modules/{element/template → spot-template}/iab/wide-skyscraper/index.d.ts
RENAMED
File without changes
|
File without changes
|