@liquidcommercedev/rmn-sdk 1.5.0-beta.32 → 1.5.0-beta.33

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 (88) hide show
  1. package/dist/index.cjs +4232 -4154
  2. package/dist/index.esm.js +4231 -4153
  3. package/dist/types/common/helpers/utils.helper.d.ts +2 -2
  4. package/dist/types/constants/spot-dimension.constant.d.ts +2 -0
  5. package/dist/types/enums.d.ts +2 -0
  6. package/dist/types/index.umd.d.ts +2 -2
  7. package/dist/types/modules/element/component/carousel/carousel.interface.d.ts +8 -3
  8. package/dist/types/modules/element/component/spot/spot.component.d.ts +20 -3
  9. package/dist/types/modules/element/component/spot/spot.interface.d.ts +11 -7
  10. package/dist/types/modules/element/element.constant.d.ts +2 -8
  11. package/dist/types/modules/element/element.interface.d.ts +2 -6
  12. package/dist/types/modules/element/element.service.d.ts +19 -12
  13. package/dist/types/modules/helper-service/index.d.ts +1 -0
  14. package/dist/types/modules/helper-service/localstorage.service.d.ts +0 -1
  15. package/dist/types/modules/helper-service/proximity-observer.service.d.ts +30 -0
  16. package/dist/types/modules/helper-service/pubsub.service.d.ts +0 -1
  17. package/dist/types/modules/monitor/monitor.interface.d.ts +2 -7
  18. package/dist/types/modules/monitor/monitor.service.d.ts +0 -1
  19. package/dist/types/modules/monitor/monitors/datalayer.monitor.d.ts +0 -1
  20. package/dist/types/modules/selection/selection.interface.d.ts +14 -8
  21. package/dist/types/modules/spot-manager/index.d.ts +2 -0
  22. package/dist/types/modules/{event/event.interface.d.ts → spot-manager/spot-manager.interface.d.ts} +2 -6
  23. package/dist/types/modules/{event/event.service.d.ts → spot-manager/spot-manager.service.d.ts} +7 -12
  24. package/dist/types/modules/spot-template/iab/billboard/billboard-v1.template.d.ts +14 -0
  25. package/dist/types/modules/spot-template/iab/billboard/index.d.ts +1 -0
  26. package/dist/types/modules/{element/template → spot-template}/iab/in-text/in-text-v1.template.d.ts +1 -1
  27. package/dist/types/modules/{element/template → spot-template}/iab/large-leaderboard/index.d.ts +0 -1
  28. package/dist/types/modules/{element/template → spot-template}/iab/square/index.d.ts +0 -1
  29. package/dist/types/modules/spot-template/iab-template.interface.d.ts +12 -0
  30. package/dist/types/modules/spot-template/index.d.ts +4 -0
  31. package/dist/types/modules/spot-template/rb-template.interface.d.ts +110 -0
  32. package/dist/types/modules/spot-template/reservebar/collection-banner-without-text-block.template.d.ts +7 -0
  33. package/dist/types/modules/spot-template/reservebar/homepage-hero-full-image.template.d.ts +7 -0
  34. package/dist/types/modules/spot-template/reservebar/homepage-hero-three-tile.template.d.ts +7 -0
  35. package/dist/types/modules/spot-template/reservebar/homepage-hero-two-tile.template.d.ts +7 -0
  36. package/dist/types/modules/spot-template/reservebar/in-text.template.d.ts +7 -0
  37. package/dist/types/modules/{element/template → spot-template}/reservebar/index.d.ts +2 -0
  38. package/dist/types/modules/spot-template/reservebar/large-category-image-tout.template.d.ts +7 -0
  39. package/dist/types/modules/spot-template/reservebar/long-tout-short.template.d.ts +7 -0
  40. package/dist/types/modules/spot-template/reservebar/long-tout-tall.template.d.ts +7 -0
  41. package/dist/types/modules/spot-template/reservebar/navigation-banner.template.d.ts +7 -0
  42. package/dist/types/modules/spot-template/reservebar/small-category-image-tout.template.d.ts +7 -0
  43. package/dist/types/modules/spot-template/reservebar/small-discover-tout.template.d.ts +7 -0
  44. package/dist/types/modules/spot-template/reservebar/video-player.template.d.ts +35 -0
  45. package/dist/types/modules/spot-template/spot-template.constant.d.ts +3 -0
  46. package/dist/types/modules/spot-template/spot-template.interface.d.ts +13 -0
  47. package/dist/types/modules/spot-template/spot-template.service.d.ts +13 -0
  48. package/dist/types/modules/spot-template/utils.d.ts +3 -0
  49. package/dist/types/rmn-client.d.ts +58 -22
  50. package/dist/types/rmn-client.helper.d.ts +11 -6
  51. package/dist/types/types.d.ts +3 -3
  52. package/package.json +20 -19
  53. package/umd/liquidcommerce-rmn-sdk.min.js +1 -1
  54. package/dist/types/constants/example.constant.d.ts +0 -4
  55. package/dist/types/constants/index.d.ts +0 -2
  56. package/dist/types/modules/element/component/skeleton/skeleton.template.d.ts +0 -2
  57. package/dist/types/modules/element/template/helper.d.ts +0 -5
  58. package/dist/types/modules/element/template/iab/billboard/billboard-v1.template.d.ts +0 -2
  59. package/dist/types/modules/element/template/iab/billboard/billboard-v2.template.d.ts +0 -2
  60. package/dist/types/modules/element/template/iab/billboard/billboard-v3.template.d.ts +0 -2
  61. package/dist/types/modules/element/template/iab/billboard/index.d.ts +0 -3
  62. package/dist/types/modules/element/template/iab/large-leaderboard/large-leaderboard-v2.template.d.ts +0 -2
  63. package/dist/types/modules/element/template/iab/square/square-v2.template.d.ts +0 -2
  64. package/dist/types/modules/element/template/index.d.ts +0 -1
  65. package/dist/types/modules/element/template/reservebar/collection-banner-without-text-block.template.d.ts +0 -3
  66. package/dist/types/modules/element/template/reservebar/homepage-hero-full-image.template.d.ts +0 -3
  67. package/dist/types/modules/element/template/reservebar/homepage-hero-three-tile.template.d.ts +0 -3
  68. package/dist/types/modules/element/template/reservebar/homepage-hero-two-tile.template.d.ts +0 -3
  69. package/dist/types/modules/element/template/reservebar/in-text.template.d.ts +0 -3
  70. package/dist/types/modules/element/template/reservebar/large-category-image-tout.template.d.ts +0 -3
  71. package/dist/types/modules/element/template/reservebar/navigation-banner.template.d.ts +0 -3
  72. package/dist/types/modules/element/template/reservebar/small-category-image-tout.template.d.ts +0 -3
  73. package/dist/types/modules/element/template/reservebar/small-discover-tout.template.d.ts +0 -3
  74. package/dist/types/modules/element/template/reservebar/video-player.template.d.ts +0 -3
  75. package/dist/types/modules/element/template/template.service.d.ts +0 -11
  76. package/dist/types/modules/element/template/template.type.d.ts +0 -11
  77. package/dist/types/modules/event/event.constant.d.ts +0 -1
  78. package/dist/types/modules/event/index.d.ts +0 -3
  79. /package/dist/types/modules/{element/template → spot-template}/iab/in-text/index.d.ts +0 -0
  80. /package/dist/types/modules/{element/template → spot-template}/iab/index.d.ts +0 -0
  81. /package/dist/types/modules/{element/template → spot-template}/iab/large-leaderboard/large-leaderboard-v1.template.d.ts +0 -0
  82. /package/dist/types/modules/{element/template → spot-template}/iab/large-rectangle/index.d.ts +0 -0
  83. /package/dist/types/modules/{element/template → spot-template}/iab/large-rectangle/large-rectangle-v1.template.d.ts +0 -0
  84. /package/dist/types/modules/{element/template → spot-template}/iab/square/square-v1.template.d.ts +0 -0
  85. /package/dist/types/modules/{element/template → spot-template}/iab/vertical-rectangle/index.d.ts +0 -0
  86. /package/dist/types/modules/{element/template → spot-template}/iab/vertical-rectangle/vertical-rectangle-v1.template.d.ts +0 -0
  87. /package/dist/types/modules/{element/template → spot-template}/iab/wide-skyscraper/index.d.ts +0 -0
  88. /package/dist/types/modules/{element/template → spot-template}/iab/wide-skyscraper/wide-skyscraper-v1.template.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- import type { IFireEventParams } from 'modules/event';
1
+ import type { IFireEventParams } from 'modules/spot-manager';
2
2
  export declare function fallbackEventFire(url: string): Promise<boolean>;
3
3
  /**
4
4
  * Helper function to decode base64 string and parse JSON
@@ -24,7 +24,7 @@ export declare function getRedirectUrlFromPayload(url: string): string | null;
24
24
  * @param {string} params.eventUrl - The URL to which the event is sent.
25
25
  * @returns {Promise<void>} - A promise that resolves when the event is fired.
26
26
  */
27
- export declare function fireEvent({ event, eventUrl }: IFireEventParams): Promise<void>;
27
+ export declare function fireEvent({ spotType, event, eventUrl }: IFireEventParams): Promise<void>;
28
28
  export declare function calculateScaleFactor(elementScale: number): number;
29
29
  /**
30
30
  * Converts an object to a query string.
@@ -0,0 +1,2 @@
1
+ import type { SpotDimensionsType } from 'modules/selection';
2
+ export declare const SPOT_DIMENSIONS: SpotDimensionsType;
@@ -6,6 +6,8 @@ export declare enum RMN_SPOT_TYPE {
6
6
  RB_LARGE_CATEGORY_IMAGE_TOUT = "rbLargeCategoryImageTout",
7
7
  RB_SMALL_DISCOVER_TOUT = "rbSmallDiscoverTout",
8
8
  RB_SMALL_CATEGORY_IMAGE_TOUT = "rbSmallCategoryImageTout",
9
+ RB_LONG_TOUT_SHORT = "rbLongToutShort",
10
+ RB_LONG_TOUT_TALL = "rbLongToutTall",
9
11
  RB_COLLECTION_BANNER_WITHOUT_TEXT_BLOCK = "rbCollectionBannerWithoutTextBlock",
10
12
  RB_PRODUCT_UPCS = "rbProductUpcs",
11
13
  RB_NAVIGATION_BANNER = "rbNavigationBanner",
@@ -1,2 +1,2 @@
1
- import { RmnClient, RmnCreateSpotElement, RmnEventManager } from './index';
2
- export { RmnClient, RmnCreateSpotElement, RmnEventManager };
1
+ import { RmnClient, RmnEventManager } from './index';
2
+ export { RmnClient, RmnEventManager };
@@ -1,4 +1,3 @@
1
- import type { ICreateElementConfig } from 'modules/element';
2
1
  export type CarouselNavPositionType = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'middle-left' | 'middle-right' | 'middle-sides';
3
2
  export interface ICarouselDotOptions {
4
3
  position: CarouselNavPositionType;
@@ -24,12 +23,18 @@ export interface ICarouselOptions {
24
23
  useDots?: ICarouselDotOptions | boolean;
25
24
  useButtons?: ICarouselButtonOptions | boolean;
26
25
  }
27
- export type ICustomCarouselElementData = ICreateElementConfig & ICarouselOptions;
26
+ export interface ICreateCarouselConfig {
27
+ width: number;
28
+ height: number;
29
+ fluid?: boolean;
30
+ minScale: number;
31
+ }
32
+ export type ICustomCarouselElementData = ICreateCarouselConfig & ICarouselOptions;
28
33
  export interface ICustomCarouselElement extends HTMLElement {
29
34
  data: ICustomCarouselElementData;
30
35
  slides: HTMLElement[];
31
36
  }
32
37
  export interface ICreateCarouselElementParams {
33
38
  slides: HTMLElement[];
34
- config: ICreateElementConfig;
39
+ config: ICreateCarouselConfig;
35
40
  }
@@ -1,3 +1,20 @@
1
- import type { ICustomSpotElement } from './spot.interface';
2
- declare let SpotElement: new () => ICustomSpotElement;
3
- export { SpotElement };
1
+ import type { ISpotTemplateBaseData } from 'modules/spot-template';
2
+ import type { ICreateSpotConfig } from './spot.interface';
3
+ declare const BaseElement: typeof HTMLElement;
4
+ export declare abstract class BaseSpotComponent<TData extends ISpotTemplateBaseData = ISpotTemplateBaseData, TConfig extends ICreateSpotConfig = ICreateSpotConfig> extends BaseElement {
5
+ private initialized;
6
+ private dataInitialized;
7
+ protected readonly _data: TData;
8
+ protected readonly _config: TConfig;
9
+ protected constructor();
10
+ initializeData(data: TData, config: TConfig): void;
11
+ private render;
12
+ private baseStyles;
13
+ protected abstract template(): HTMLElement | string;
14
+ protected abstract styles(): string;
15
+ protected connected?(): void;
16
+ protected disconnected?(): void;
17
+ connectedCallback(): void;
18
+ disconnectedCallback(): void;
19
+ }
20
+ export {};
@@ -1,10 +1,14 @@
1
- import type { ICreateElementConfig } from 'modules/element';
2
- export type ICustomSpotElementData = ICreateElementConfig;
3
- export interface ICustomSpotElement extends HTMLElement {
4
- data: ICustomSpotElementData;
5
- content: HTMLElement;
1
+ import type { ISpotOverlay } from 'modules/element/element.interface';
2
+ import type { ISpot } from 'modules/selection';
3
+ import type { BaseSpotComponent } from './spot.component';
4
+ export interface ICreateSpotConfig {
5
+ prefix: string;
6
+ fluid: boolean;
7
+ useShadowDom: boolean;
8
+ overlay?: ISpotOverlay;
6
9
  }
7
10
  export interface ICreateSpotElementParams {
8
- content: HTMLElement;
9
- config: ICreateElementConfig;
11
+ spot: ISpot;
12
+ config: ICreateSpotConfig;
10
13
  }
14
+ export type BaseSpotComponentConstructor = new () => BaseSpotComponent;
@@ -1,8 +1,2 @@
1
- import type { SpotDimensionsType } from 'modules/selection';
2
- export declare const SPOT_ELEMENT_TAG = "spot-element";
3
- export declare const CAROUSEL_ELEMENT_TAG = "spot-carousel-element";
4
- export declare const SKELETON_ELEMENT_TAG = "spot-skeleton-element";
5
- export declare const GFONT_PRECONNECT = "\n <link rel=\"preconnect\" href=\"https://fonts.googleapis.com\">\n <link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin>\n";
6
- export declare const GFONT_SOURCE_SANS_3 = "\n <link rel=\"stylesheet\" href=\"https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap\">\n";
7
- export declare const GFONT_CORMORANT = "\n <link rel=\"stylesheet\" href=\"https://fonts.googleapis.com/css2?family=Cormorant:ital,wght@0,300..700;1,300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap\">\n";
8
- export declare const SPOT_DIMENSIONS: SpotDimensionsType;
1
+ export declare const CAROUSEL_ELEMENT_TAG = "spot-carousel";
2
+ export declare const SKELETON_ELEMENT_TAG = "spot-skeleton";
@@ -1,5 +1,6 @@
1
1
  import type { RMN_FILTER_PROPERTIES, RMN_SPOT_TYPE } from 'enums';
2
2
  import type { ICarouselOptions, ICreateCarouselElementParams } from 'modules/element/component/carousel';
3
+ import type { ICreateSkeletonElementParams } from 'modules/element/component/skeleton';
3
4
  import type { ICreateSpotElementParams } from 'modules/element/component/spot';
4
5
  import type { RmnFilterType } from 'modules/selection';
5
6
  export interface ISpotColors {
@@ -46,10 +47,5 @@ export interface IInjectSpotElementParams {
46
47
  export interface IElementService {
47
48
  createSpotElement(params: ICreateSpotElementParams): HTMLElement | null;
48
49
  createCarouselElement(params: ICreateCarouselElementParams): HTMLElement | null;
49
- }
50
- export interface IRmnCreateSpotElementConfig {
51
- fluid?: boolean;
52
- colors?: ISpotColors;
53
- overlay?: ISpotOverlay;
54
- minScale?: number;
50
+ createSkeletonElement(params: ICreateSkeletonElementParams): HTMLElement | null;
55
51
  }
@@ -1,9 +1,10 @@
1
- import type { ISpot } from 'modules/selection';
2
1
  import type { ICreateCarouselElementParams } from './component/carousel';
3
2
  import type { ICreateSkeletonElementParams } from './component/skeleton';
4
3
  import type { ICreateSpotElementParams } from './component/spot';
5
- import type { IElementService, ISpotColors } from './element.interface';
4
+ import type { IElementService } from './element.interface';
6
5
  export declare class ElementService implements IElementService {
6
+ private readonly spotTemplateService;
7
+ private constructor();
7
8
  static getInstance(): ElementService;
8
9
  /**
9
10
  * Creates the html element based on the provided data, content and configs using shadow dom.
@@ -14,7 +15,7 @@ export declare class ElementService implements IElementService {
14
15
  *
15
16
  * @return {HTMLElement | null} - The html element or null if the browser environment is not available.
16
17
  */
17
- createSpotElement({ content, config }: ICreateSpotElementParams): HTMLElement | null;
18
+ createSpotElement(params: ICreateSpotElementParams): HTMLElement | null;
18
19
  /**
19
20
  * Creates the carousel html element based on the provided slides and configs using shadow dom.
20
21
  *
@@ -24,7 +25,7 @@ export declare class ElementService implements IElementService {
24
25
  *
25
26
  * @return {HTMLElement | null} - The html element or null if the browser environment is not available.
26
27
  */
27
- createCarouselElement({ slides, config, }: ICreateCarouselElementParams): HTMLElement | null;
28
+ createCarouselElement(params: ICreateCarouselElementParams): HTMLElement | null;
28
29
  /**
29
30
  * Creates the skeleton html element based on the provided data using shadow dom.
30
31
  *
@@ -36,16 +37,22 @@ export declare class ElementService implements IElementService {
36
37
  */
37
38
  createSkeletonElement(params: ICreateSkeletonElementParams): HTMLElement | null;
38
39
  /**
39
- * Overrides the spot colors with the provided colors.
40
+ * Defines a custom element with a unique class implementation based on the provided base element class.
41
+ * Registers the custom element with the specified tag name.
40
42
  *
41
- * @param {ISpot} spot - The spot data.
42
- * @param {ISpotColors} colors - The colors to override.
43
- *
44
- * @return {ISpot} - The spot data with the colors overridden.
43
+ * @param {string} tagName - The name of the custom element to define in the DOM.
44
+ * @param {BaseSpotComponentConstructor} elementClass - The base class for the custom element, extended to provide unique behavior.
45
+ * @return {void} This method does not return a value.
45
46
  */
46
- overrideSpotColors(spot: ISpot, colors?: ISpotColors): ISpot;
47
+ private defineSpotCustomElement;
47
48
  /**
48
- * @returns {boolean} - True if the browser environment is available and the element is defined.
49
+ * Defines custom elements for the application if they are not already defined in the browser's `customElements` registry.
50
+ *
51
+ * It checks and registers the following custom elements:
52
+ * - `CAROUSEL_ELEMENT_TAG` associated with `CarouselElement`
53
+ * - `SKELETON_ELEMENT_TAG` associated with `SkeletonElement`
54
+ *
55
+ * @return {void} This method does not return a value.
49
56
  */
50
- private ensureBrowserEnvironmentAndDefineElement;
57
+ private defineCustomElements;
51
58
  }
@@ -1,4 +1,5 @@
1
1
  export * from './intersection.service';
2
2
  export * from './localstorage.service';
3
+ export * from './proximity-observer.service';
3
4
  export * from './pubsub.service';
4
5
  export * from './resize.service';
@@ -18,7 +18,6 @@ export type LocalStorageSpots = Record<string, // spotId
18
18
  ILocalStorageSpot>;
19
19
  export declare class LocalStorageService {
20
20
  private spots?;
21
- private static instance;
22
21
  private static readonly localStorageKeyPrefix;
23
22
  private static localStorageKey;
24
23
  private static readonly spotExpirationTime;
@@ -0,0 +1,30 @@
1
+ interface IProximityObserverOptions {
2
+ verticalThreshold?: number;
3
+ horizontalThreshold?: number;
4
+ intersectionMargin?: string;
5
+ maxGroupSize?: number;
6
+ }
7
+ export declare class ProximityObserver {
8
+ private intersectionObserver;
9
+ private mutationObserver;
10
+ private targetIds;
11
+ private observedElements;
12
+ private processedGroups;
13
+ private readonly callback;
14
+ private readonly verticalThreshold;
15
+ private readonly horizontalThreshold;
16
+ private readonly intersectionMargin;
17
+ private maxGroupSize;
18
+ constructor(elementIds: string[], callback: (intersectingIds: string[]) => void, options?: IProximityObserverOptions);
19
+ private initializeIntersectionObserver;
20
+ private initializeMutationObserver;
21
+ private isElementInViewportRange;
22
+ private findNearbyElements;
23
+ private handleIntersection;
24
+ private isElementProcessed;
25
+ private handleMutation;
26
+ private checkAndObserveElement;
27
+ private startObservingExistingElements;
28
+ cleanup(): void;
29
+ }
30
+ export {};
@@ -13,7 +13,6 @@ export type PubSubUnsubscribe = () => void;
13
13
  * @template IRmnEventMap A record type defining the structure of events and their data
14
14
  */
15
15
  export declare class PubsubService<IRmnEventMap> {
16
- private static instance;
17
16
  static getInstance<IRmnEventMap>(): PubsubService<IRmnEventMap>;
18
17
  /**
19
18
  * Object to store subscribers for each event type
@@ -1,19 +1,14 @@
1
- import type { RMN_SPOT_EVENT } from 'enums';
1
+ import type { RMN_SPOT_EVENT, RMN_SPOT_TYPE } from 'enums';
2
2
  export interface IDataLayerEvent {
3
3
  event: RMN_SPOT_EVENT;
4
4
  products: IProductData[];
5
5
  }
6
- export interface INormalizedEventData {
7
- event: RMN_SPOT_EVENT;
8
- productIds: Array<string | number>;
9
- productPrice?: number;
10
- productQuantity?: number;
11
- }
12
6
  export interface IFireAndPublishSpotEventParams {
13
7
  spotEvent: RMN_SPOT_EVENT;
14
8
  eventUrl: string;
15
9
  placementId: string;
16
10
  spotId: string;
11
+ spotType: RMN_SPOT_TYPE;
17
12
  }
18
13
  export interface IProductData {
19
14
  id: string | number;
@@ -1,5 +1,4 @@
1
1
  export declare class MonitorService {
2
- private static instance;
3
2
  private readonly implementedMonitor?;
4
3
  private readonly pubSubService;
5
4
  private readonly localStorageService;
@@ -1,6 +1,5 @@
1
1
  import type { IDataLayerEvent } from '../monitor.interface';
2
2
  export declare class DataLayerMonitor {
3
- private static instance;
4
3
  private readonly originalPush;
5
4
  private listener?;
6
5
  private constructor();
@@ -36,14 +36,20 @@ export interface ISpot {
36
36
  mobilePrimaryImage?: string;
37
37
  mobileSecondaryImage?: string;
38
38
  productIds?: Array<string | number>;
39
- videoUrl?: string;
40
- videoOverlayImage?: string;
41
- videoOverlayHeader?: string;
42
- videoOverlayDescription?: string;
43
- videoControls?: boolean;
44
- videoAutoPlay?: boolean;
45
- videoMute?: boolean;
46
- videoLoop?: boolean;
39
+ video?: {
40
+ url?: string;
41
+ poster?: string;
42
+ posterTitle?: string;
43
+ posterDescription?: string;
44
+ autoplay?: boolean;
45
+ mute?: boolean;
46
+ loop?: boolean;
47
+ showControls?: boolean;
48
+ showPlay?: boolean;
49
+ showTimeline?: boolean;
50
+ showVolume?: boolean;
51
+ showTime?: boolean;
52
+ };
47
53
  rbProductUpcs?: Array<string | number>;
48
54
  rbProductSalsifyGroupings?: Array<string | number>;
49
55
  rbProductSalsifyPids?: Array<string | number>;
@@ -0,0 +1,2 @@
1
+ export * from './spot-manager.interface';
2
+ export * from './spot-manager.service';
@@ -1,11 +1,7 @@
1
- import type { RMN_EVENT, RMN_SPOT_EVENT } from 'enums';
1
+ import type { RMN_EVENT, RMN_SPOT_EVENT, RMN_SPOT_TYPE } from 'enums';
2
2
  import type { ISpot } from '../selection';
3
- export type ActiveSpotsType = Map<string, // spotId
4
- {
5
- placementId: string;
6
- spotElement: HTMLElement;
7
- }>;
8
3
  export interface IFireEventParams {
4
+ spotType: RMN_SPOT_TYPE;
9
5
  event: RMN_SPOT_EVENT;
10
6
  eventUrl: string;
11
7
  }
@@ -1,33 +1,28 @@
1
1
  import { RMN_EVENT } from 'enums';
2
2
  import type { ISpot } from 'modules/selection';
3
- import type { ILifecycleState, IRegisterSpotParams, IRmnEventMap } from './event.interface';
4
- export declare class EventService {
5
- private static instance;
3
+ import type { ILifecycleState, IRegisterSpotParams, IRmnEventMap } from './spot-manager.interface';
4
+ export declare class SpotManagerService {
6
5
  private pubSubService;
7
6
  private localStorageService;
8
- private intersectionObserver;
9
- private spotStates;
10
- private readonly activeSpots;
7
+ private spotLifecyleState;
11
8
  private constructor();
12
- static getInstance(): EventService;
9
+ static getInstance(): SpotManagerService;
13
10
  subscribe(eventType: RMN_EVENT, callback: (data: IRmnEventMap[RMN_EVENT]) => void): () => void;
14
11
  publish(eventType: RMN_EVENT, data: IRmnEventMap[RMN_EVENT]): void;
15
12
  registerSpot(params: IRegisterSpotParams): void;
16
- unregisterSpot(placementId: string): void;
13
+ unregisterSpot(rawPlacementId: string): void;
17
14
  /**
18
15
  * Updates the state of a spot.
19
16
  *
20
17
  * @param {string} placementId - The placement ID of the spot.
21
18
  * @param {Partial<ILifecycleState>} updates - The updates to apply to the spot state.
22
- * @param {boolean} publish - Whether to publish the updated state.
19
+ * @param publish - Whether to publish the updated state.
23
20
  *
24
21
  * @returns {void}
25
22
  */
26
- handleSpotState(placementId: string, updates: Partial<ILifecycleState>, publish?: boolean): void;
23
+ updateSpotLifecycleState(placementId: string, updates: Partial<ILifecycleState>, publish?: boolean): void;
27
24
  saveSpotDataToLocalStorage(placementId: string, spot: ISpot): void;
28
25
  private handleClickEvent;
29
26
  private handleImpressionEvent;
30
- private getSpotIdByPlacementId;
31
27
  private deepMerge;
32
- private handleIntersectionObserver;
33
28
  }
@@ -0,0 +1,14 @@
1
+ import { BaseSpotComponent } from 'modules/element/component/spot';
2
+ import type { IBillboardV1Spot } from '../../iab-template.interface';
3
+ export declare class BillboardV1SE extends BaseSpotComponent<IBillboardV1Spot> {
4
+ private resizeObserver?;
5
+ private originalFontSizes;
6
+ constructor();
7
+ protected connected(): void;
8
+ protected disconnected(): void;
9
+ private setupResizeObserver;
10
+ private handleSpotSizeChanged;
11
+ private adjustFontSize;
12
+ protected template(): string;
13
+ protected styles(): string;
14
+ }
@@ -0,0 +1 @@
1
+ export * from './billboard-v1.template';
@@ -1,2 +1,2 @@
1
- import type { ISpot } from 'types';
1
+ import type { ISpot } from '../../../selection';
2
2
  export declare function inTextV1Template(spot: ISpot): string;
@@ -1,2 +1 @@
1
1
  export * from './large-leaderboard-v1.template';
2
- export * from './large-leaderboard-v2.template';
@@ -1,2 +1 @@
1
1
  export * from './square-v1.template';
2
- export * from './square-v2.template';
@@ -0,0 +1,12 @@
1
+ import type { ISpotTemplateBaseData } from './spot-template.interface';
2
+ export interface IBillboardV1Spot extends ISpotTemplateBaseData {
3
+ preHeader: string;
4
+ header: string;
5
+ description: string;
6
+ ctaText: string;
7
+ textColor: string;
8
+ ctaTextColor: string;
9
+ ctaBorderColor: string;
10
+ primaryImage: string;
11
+ mobilePrimaryImage?: string;
12
+ }
@@ -0,0 +1,4 @@
1
+ export * from './iab-template.interface';
2
+ export * from './rb-template.interface';
3
+ export * from './spot-template.interface';
4
+ export * from './spot-template.service';
@@ -0,0 +1,110 @@
1
+ import type { ISpotTemplateBaseData } from './spot-template.interface';
2
+ export interface ICollectionBannerWithoutTextBlockRbSpot extends ISpotTemplateBaseData {
3
+ primaryImage: string;
4
+ mobilePrimaryImage?: string;
5
+ }
6
+ export interface IHomepageHeroFullImageRbSpot extends ISpotTemplateBaseData {
7
+ preHeader: string;
8
+ header: string;
9
+ description: string;
10
+ ctaText: string;
11
+ textColor: string;
12
+ ctaTextColor: string;
13
+ ctaBorderColor: string;
14
+ primaryImage: string;
15
+ mobilePrimaryImage?: string;
16
+ }
17
+ export interface IHomepageHeroThreeTileRbSpot extends ISpotTemplateBaseData {
18
+ header: string;
19
+ description: string;
20
+ ctaText: string;
21
+ textColor: string;
22
+ backgroundColor: string;
23
+ ctaTextColor: string;
24
+ primaryImage: string;
25
+ mobilePrimaryImage?: string;
26
+ secondaryImage: string;
27
+ mobileSecondaryImage?: string;
28
+ }
29
+ export interface IHomepageHeroTwoTileRbSpot extends ISpotTemplateBaseData {
30
+ header: string;
31
+ description: string;
32
+ ctaText: string;
33
+ textColor: string;
34
+ backgroundColor: string;
35
+ ctaTextColor: string;
36
+ primaryImage: string;
37
+ mobilePrimaryImage?: string;
38
+ }
39
+ export interface IInTextRbSpot extends ISpotTemplateBaseData {
40
+ header: string;
41
+ textColor: string;
42
+ backgroundColor: string;
43
+ }
44
+ export interface ILargeCategoryImageToutRbSpot extends ISpotTemplateBaseData {
45
+ header: string;
46
+ description: string;
47
+ ctaText: string;
48
+ textColor: string;
49
+ ctaTextColor: string;
50
+ ctaBorderColor: string;
51
+ primaryImage: string;
52
+ mobilePrimaryImage?: string;
53
+ }
54
+ export interface INavigationBannerRbSpot extends ISpotTemplateBaseData {
55
+ header: string;
56
+ textColor: string;
57
+ primaryImage: string;
58
+ mobilePrimaryImage?: string;
59
+ }
60
+ export interface ISmallCategoryImageToutRbSpot extends ISpotTemplateBaseData {
61
+ header: string;
62
+ textColor: string;
63
+ primaryImage: string;
64
+ mobilePrimaryImage?: string;
65
+ }
66
+ export interface ISmallDiscoverToutRbSpot extends ISpotTemplateBaseData {
67
+ header: string;
68
+ textColor: string;
69
+ backgroundColor: string;
70
+ primaryImage: string;
71
+ mobilePrimaryImage?: string;
72
+ }
73
+ export interface ILongToutShortRbSpot extends ISpotTemplateBaseData {
74
+ preHeader: string;
75
+ header: string;
76
+ description: string;
77
+ ctaText: string;
78
+ textColor: string;
79
+ ctaTextColor: string;
80
+ ctaBorderColor: string;
81
+ primaryImage: string;
82
+ mobilePrimaryImage?: string;
83
+ }
84
+ export interface ILongToutTallRbSpot extends ISpotTemplateBaseData {
85
+ preHeader: string;
86
+ header: string;
87
+ description: string;
88
+ ctaText: string;
89
+ textColor: string;
90
+ ctaTextColor: string;
91
+ ctaBorderColor: string;
92
+ primaryImage: string;
93
+ mobilePrimaryImage?: string;
94
+ }
95
+ export interface IVideoPlayerRbSpot extends ISpotTemplateBaseData {
96
+ video: {
97
+ url?: string;
98
+ poster?: string;
99
+ posterTitle?: string;
100
+ posterDescription?: string;
101
+ autoplay?: boolean;
102
+ mute?: boolean;
103
+ loop?: boolean;
104
+ showControls?: boolean;
105
+ showPlay?: boolean;
106
+ showTimeline?: boolean;
107
+ showVolume?: boolean;
108
+ showTime?: boolean;
109
+ };
110
+ }
@@ -0,0 +1,7 @@
1
+ import { BaseSpotComponent } from 'modules/element/component/spot';
2
+ import type { ICollectionBannerWithoutTextBlockRbSpot } from '../rb-template.interface';
3
+ export declare class RbCollectionBannerWithoutTextBlockSE extends BaseSpotComponent<ICollectionBannerWithoutTextBlockRbSpot> {
4
+ constructor();
5
+ protected template(): string;
6
+ protected styles(): string;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { BaseSpotComponent } from 'modules/element/component/spot';
2
+ import type { IHomepageHeroFullImageRbSpot } from '../rb-template.interface';
3
+ export declare class RbHomepageHeroFullImageSE extends BaseSpotComponent<IHomepageHeroFullImageRbSpot> {
4
+ constructor();
5
+ protected template(): string;
6
+ protected styles(): string;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { BaseSpotComponent } from 'modules/element/component/spot';
2
+ import type { IHomepageHeroThreeTileRbSpot } from '../rb-template.interface';
3
+ export declare class RbHomepageHeroThreeTileSE extends BaseSpotComponent<IHomepageHeroThreeTileRbSpot> {
4
+ constructor();
5
+ protected template(): string;
6
+ protected styles(): string;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { BaseSpotComponent } from 'modules/element/component/spot';
2
+ import type { IHomepageHeroTwoTileRbSpot } from '../rb-template.interface';
3
+ export declare class RbHomepageHeroTwoTileSE extends BaseSpotComponent<IHomepageHeroTwoTileRbSpot> {
4
+ constructor();
5
+ protected template(): string;
6
+ protected styles(): string;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { BaseSpotComponent } from 'modules/element/component/spot';
2
+ import type { IInTextRbSpot } from '../rb-template.interface';
3
+ export declare class RbInTextSE extends BaseSpotComponent<IInTextRbSpot> {
4
+ constructor();
5
+ protected template(): string;
6
+ protected styles(): string;
7
+ }
@@ -4,6 +4,8 @@ export * from './homepage-hero-three-tile.template';
4
4
  export * from './homepage-hero-two-tile.template';
5
5
  export * from './in-text.template';
6
6
  export * from './large-category-image-tout.template';
7
+ export * from './long-tout-short.template';
8
+ export * from './long-tout-tall.template';
7
9
  export * from './navigation-banner.template';
8
10
  export * from './small-category-image-tout.template';
9
11
  export * from './small-discover-tout.template';
@@ -0,0 +1,7 @@
1
+ import { BaseSpotComponent } from 'modules/element/component/spot';
2
+ import type { ILargeCategoryImageToutRbSpot } from '../rb-template.interface';
3
+ export declare class RbLargeCategoryImageToutSE extends BaseSpotComponent<ILargeCategoryImageToutRbSpot> {
4
+ constructor();
5
+ protected template(): string;
6
+ protected styles(): string;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { BaseSpotComponent } from 'modules/element/component/spot';
2
+ import type { ILongToutShortRbSpot } from '../rb-template.interface';
3
+ export declare class RbLongToutShortSE extends BaseSpotComponent<ILongToutShortRbSpot> {
4
+ constructor();
5
+ protected template(): string;
6
+ protected styles(): string;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { BaseSpotComponent } from 'modules/element/component/spot';
2
+ import type { ILongToutTallRbSpot } from '../rb-template.interface';
3
+ export declare class RbLongToutTallSE extends BaseSpotComponent<ILongToutTallRbSpot> {
4
+ constructor();
5
+ protected template(): string;
6
+ protected styles(): string;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { BaseSpotComponent } from 'modules/element/component/spot';
2
+ import type { INavigationBannerRbSpot } from '../rb-template.interface';
3
+ export declare class RbNavigationBannerSE extends BaseSpotComponent<INavigationBannerRbSpot> {
4
+ constructor();
5
+ protected template(): string;
6
+ protected styles(): string;
7
+ }