@liquidcommercedev/rmn-sdk 1.4.6-beta.2 → 1.4.6-beta.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. package/dist/index.cjs +611 -504
  2. package/dist/index.esm.js +611 -505
  3. package/dist/types/enums.d.ts +1 -0
  4. package/dist/types/index.umd.d.ts +2 -2
  5. package/dist/types/modules/element/component/carousel/carousel.component.d.ts +3 -58
  6. package/dist/types/modules/element/component/carousel/carousel.interface.d.ts +31 -0
  7. package/dist/types/modules/element/component/carousel/carousel.style.d.ts +2 -1
  8. package/dist/types/modules/element/component/carousel/index.d.ts +1 -0
  9. package/dist/types/modules/element/component/spot/index.d.ts +2 -0
  10. package/dist/types/modules/element/component/spot/spot.component.d.ts +3 -0
  11. package/dist/types/modules/element/component/spot/spot.interface.d.ts +10 -0
  12. package/dist/types/modules/element/element.constant.d.ts +2 -1
  13. package/dist/types/modules/element/element.interface.d.ts +21 -15
  14. package/dist/types/modules/element/{spot.element.service.d.ts → element.service.d.ts} +15 -3
  15. package/dist/types/modules/element/index.d.ts +1 -1
  16. package/dist/types/modules/element/template/helper.d.ts +1 -0
  17. package/dist/types/modules/element/template/template.service.d.ts +1 -1
  18. package/dist/types/modules/event/helpers/resize.service.d.ts +1 -1
  19. package/dist/types/modules/selection/selection.interface.d.ts +2 -2
  20. package/dist/types/modules/selection/selection.type.d.ts +3 -2
  21. package/dist/types/rmn-client.d.ts +36 -14
  22. package/dist/types/static.constant.d.ts +3 -0
  23. package/dist/types/types.d.ts +4 -4
  24. package/package.json +2 -2
  25. package/umd/liquidcommerce-rmn-sdk.min.js +1 -1
  26. package/dist/types/modules/element/spot.element.d.ts +0 -2
@@ -38,6 +38,7 @@ export declare enum RMN_SPOT_TYPE {
38
38
  }
39
39
  export declare enum RMN_FILTER_PROPERTIES {
40
40
  KEYWORDS = "keywords",
41
+ PAGE_LOCATION = "pageLocation",
41
42
  PARENTCO = "parentCo",
42
43
  BRAND = "brand",
43
44
  CATEGORY = "category",
@@ -1,2 +1,2 @@
1
- import { RmnClient } from './index';
2
- export { RmnClient };
1
+ import { RmnClient, RmnCreateSpotElement } from './index';
2
+ export { RmnClient, RmnCreateSpotElement };
@@ -1,58 +1,3 @@
1
- export type CarouselNavPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'middle-left' | 'middle-right' | 'middle-sides';
2
- export interface ICarouselDotOptions {
3
- position: CarouselNavPosition;
4
- color: string;
5
- activeColor: string;
6
- }
7
- export interface ICarouselButtonOptions {
8
- position: CarouselNavPosition;
9
- together: boolean;
10
- textColor: string;
11
- backgroundColor: string;
12
- borderRadius: string;
13
- prev: string;
14
- next: string;
15
- }
16
- export interface ICarouselOptions {
17
- autoplay?: boolean;
18
- interval?: number;
19
- useDots?: ICarouselDotOptions | false;
20
- useButtons?: ICarouselButtonOptions | false;
21
- }
22
- export declare class CarouselComponent {
23
- private readonly carousel;
24
- private readonly shadowRoot;
25
- private readonly slidesContainer;
26
- private readonly slides;
27
- private readonly autoplay;
28
- private readonly interval;
29
- private readonly dotsOptions;
30
- private readonly buttonsOptions;
31
- private currentSlide;
32
- private dotElements;
33
- private prevButton;
34
- private nextButton;
35
- private autoplayInterval;
36
- constructor(slides: Array<HTMLElement | string>, options?: ICarouselOptions);
37
- getElement(): HTMLElement;
38
- private render;
39
- private setupCarousel;
40
- private renderSlides;
41
- private renderDots;
42
- private renderButtons;
43
- private setupDots;
44
- private setupButtons;
45
- private nextSlide;
46
- private prevSlide;
47
- private goToSlide;
48
- private updateCarousel;
49
- private updateDots;
50
- private startAutoplay;
51
- private stopAutoplay;
52
- private resetAutoplay;
53
- private initializeDotOptions;
54
- private initializeButtonOptions;
55
- private validateOptions;
56
- private validateDotsPosition;
57
- private validateButtonsPosition;
58
- }
1
+ import type { ICustomCarouselElement } from './carousel.interface';
2
+ declare let CarouselElement: new () => ICustomCarouselElement;
3
+ export { CarouselElement };
@@ -0,0 +1,31 @@
1
+ import type { ICreateElementConfig } from 'modules/element';
2
+ export type CarouselNavPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'middle-left' | 'middle-right' | 'middle-sides';
3
+ export interface ICarouselDotOptions {
4
+ position: CarouselNavPosition;
5
+ color: string;
6
+ activeColor: string;
7
+ }
8
+ export interface ICarouselButtonOptions {
9
+ position: CarouselNavPosition;
10
+ together: boolean;
11
+ textColor: string;
12
+ backgroundColor: string;
13
+ borderRadius: string;
14
+ prev: string;
15
+ next: string;
16
+ }
17
+ export interface ICarouselOptions {
18
+ autoplay?: boolean;
19
+ interval?: number;
20
+ useDots?: ICarouselDotOptions | boolean;
21
+ useButtons?: ICarouselButtonOptions | boolean;
22
+ }
23
+ export type ICustomCarouselElementData = ICreateElementConfig & ICarouselOptions;
24
+ export interface ICustomCarouselElement extends HTMLElement {
25
+ data: ICustomCarouselElementData;
26
+ slides: HTMLElement[];
27
+ }
28
+ export interface ICreateCarouselElementParams {
29
+ slides: HTMLElement[];
30
+ config: ICreateElementConfig;
31
+ }
@@ -1 +1,2 @@
1
- export declare const CAROUSEL_COMPONENT_STYLE = "\n :host {\n position: relative;\n display: inline-block;\n margin: 0;\n overflow: hidden;\n height: 100%;\n width: 100%;\n }\n\n .carousel-slides {\n position: relative;\n height: 100%;\n width: 100%;\n }\n\n .carousel-slide {\n display: none;\n\n justify-content: center;\n align-items: center;\n height: 100%;\n width: 100%;\n }\n\n .carousel-slide.active {\n display: flex;\n }\n\n .carousel-dots {\n position: absolute;\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .carousel-dots .dot {\n width: 12px;\n height: 12px;\n border-radius: 50%;\n cursor: pointer;\n transition: all 0.3s ease;\n }\n\n .carousel-dots.top-left,\n .carousel-dots.bottom-left {\n left: 10px;\n }\n\n .carousel-dots.top-center,\n .carousel-dots.bottom-center {\n left: 50%;\n transform: translateX(-50%);\n }\n\n .carousel-dots.top-right,\n .carousel-dots.bottom-right {\n right: 10px;\n }\n\n .carousel-dots.top-left,\n .carousel-dots.top-center,\n .carousel-dots.top-right {\n top: 10px;\n }\n\n .carousel-dots.bottom-left,\n .carousel-dots.bottom-center,\n .carousel-dots.bottom-right {\n bottom: 10px;\n }\n\n .carousel-dots.middle-left {\n left: 10px;\n top: 50%;\n transform: translateY(-50%);\n flex-direction: column;\n }\n\n .carousel-dots.middle-right {\n right: 10px;\n top: 50%;\n transform: translateY(-50%);\n flex-direction: column;\n }\n\n .carousel-buttons button {\n background-color: #00000080;\n color: #fff;\n border: none;\n padding: 10px;\n cursor: pointer;\n transition: background-color 0.3s ease;\n }\n\n .carousel-buttons button:hover {\n background-color: #000000b3;\n }\n\n .carousel-buttons.buttons-separate button {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n }\n\n .carousel-buttons.buttons-separate .prev-button {\n left: 10px;\n }\n\n .carousel-buttons.buttons-separate .next-button {\n right: 10px;\n }\n\n .carousel-buttons.buttons-together {\n position: absolute;\n display: flex;\n gap: 10px;\n }\n\n .carousel-buttons.buttons-together.top-left,\n .carousel-buttons.buttons-together.bottom-left {\n left: 10px;\n }\n\n .carousel-buttons.buttons-together.top-center,\n .carousel-buttons.buttons-together.bottom-center {\n left: 50%;\n transform: translateX(-50%);\n }\n\n .carousel-buttons.buttons-together.top-right,\n .carousel-buttons.buttons-together.bottom-right {\n right: 10px;\n }\n\n .carousel-buttons.buttons-together.top-left,\n .carousel-buttons.buttons-together.top-center,\n .carousel-buttons.buttons-together.top-right {\n top: 10px;\n }\n\n .carousel-buttons.buttons-together.bottom-left,\n .carousel-buttons.buttons-together.bottom-center,\n .carousel-buttons.buttons-together.bottom-right {\n bottom: 10px;\n }\n\n .carousel-buttons.buttons-together.middle-left,\n .carousel-buttons.buttons-together.middle-right {\n top: 50%;\n transform: translateY(-50%);\n flex-direction: column;\n }\n\n .carousel-buttons.buttons-together.middle-left {\n left: 10px;\n }\n\n .carousel-buttons.buttons-together.middle-right {\n right: 10px;\n }\n\n @media (max-width: 768px) {\n .carousel-buttons button {\n padding: 8px 12px;\n font-size: 14px;\n }\n\n .carousel-dots .dot {\n width: 8px;\n height: 8px;\n }\n }\n";
1
+ import type { ICustomCarouselElementData } from './carousel.interface';
2
+ export declare const CAROUSEL_COMPONENT_STYLE: ({ width, height, fluid }: ICustomCarouselElementData) => string;
@@ -1,2 +1,3 @@
1
1
  export * from './carousel.component';
2
+ export * from './carousel.interface';
2
3
  export * from './carousel.style';
@@ -0,0 +1,2 @@
1
+ export * from './spot.component';
2
+ export * from './spot.interface';
@@ -0,0 +1,3 @@
1
+ import type { ICustomSpotElement } from './spot.interface';
2
+ declare let SpotElement: new () => ICustomSpotElement;
3
+ export { SpotElement };
@@ -0,0 +1,10 @@
1
+ import type { ICreateElementConfig } from 'modules/element';
2
+ export type ICustomSpotElementData = ICreateElementConfig;
3
+ export interface ICustomSpotElement extends HTMLElement {
4
+ data: ICustomSpotElementData;
5
+ content: HTMLElement;
6
+ }
7
+ export interface ICreateSpotElementParams {
8
+ content: HTMLElement;
9
+ config: ICreateElementConfig;
10
+ }
@@ -1,4 +1,5 @@
1
- export declare const ELEMENT_TAG = "spot-element";
1
+ export declare const SPOT_ELEMENT_TAG = "spot-element";
2
+ export declare const CAROUSEL_ELEMENT_TAG = "spot-carousel-element";
2
3
  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";
3
4
  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";
4
5
  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";
@@ -1,5 +1,7 @@
1
1
  import type { RMN_SPOT_TYPE } from 'enums';
2
- import type { ICarouselOptions } from './component/carousel';
2
+ import type { ICarouselOptions, ICreateCarouselElementParams } from 'modules/element/component/carousel';
3
+ import type { ICreateSpotElementParams } from 'modules/element/component/spot';
4
+ import type { RmnFilterType } from 'modules/selection';
3
5
  export interface ISpotColors {
4
6
  textColor?: string;
5
7
  backgroundColor?: string;
@@ -10,34 +12,38 @@ export interface ISpotOverlay {
10
12
  color: string;
11
13
  colorStop: string;
12
14
  }
13
- export interface ISpotBaseConfig {
15
+ export interface IInjectSpotElementConfig {
16
+ url?: string;
14
17
  colors?: ISpotColors;
15
18
  minScale?: number;
16
19
  overlay?: ISpotOverlay[];
20
+ carousel?: ICarouselOptions;
17
21
  }
18
22
  export interface IInjectSpotElement {
19
23
  placementId: string;
20
24
  spotType: RMN_SPOT_TYPE | string;
21
25
  count?: number;
26
+ config?: Omit<IInjectSpotElementConfig, 'url'>;
27
+ filter?: Partial<RmnFilterType>;
22
28
  }
23
- export interface IInjectSpotsConfig extends ISpotBaseConfig {
24
- carousel?: ICarouselOptions;
25
- }
26
- export interface ICreateFinalElementConfig {
29
+ export interface ICreateElementConfig {
27
30
  width: number;
28
31
  height: number;
29
32
  fluid?: boolean;
30
- minScale?: number;
33
+ minScale: number;
31
34
  }
32
- export interface ICreateFinalElementParams {
33
- content: HTMLElement | string;
34
- config: ICreateFinalElementConfig;
35
+ export interface IInjectSpotElementParams {
36
+ inject: IInjectSpotElement[];
37
+ config?: IInjectSpotElementConfig;
38
+ filter?: Partial<RmnFilterType>;
35
39
  }
36
40
  export interface IElementService {
37
- createFinalElement(data: ICreateFinalElementParams): HTMLElement | null;
41
+ createSpotElement(params: ICreateSpotElementParams): HTMLElement | null;
42
+ createCarouselElement(params: ICreateCarouselElementParams): HTMLElement | null;
38
43
  }
39
- export type ICustomSpotElementData = ICreateFinalElementConfig;
40
- export interface ICustomSpotElement extends HTMLElement {
41
- data: ICustomSpotElementData;
42
- content: HTMLElement | string;
44
+ export interface IRmnCreateSpotElementConfig {
45
+ fluid?: boolean;
46
+ colors?: ISpotColors;
47
+ overlay?: ISpotOverlay[];
48
+ minScale?: number;
43
49
  }
@@ -1,5 +1,7 @@
1
1
  import type { ISpot } from 'modules/selection';
2
- import type { ICreateFinalElementParams, IElementService, ISpotColors } from './element.interface';
2
+ import type { ICreateCarouselElementParams } from './component/carousel';
3
+ import type { ICreateSpotElementParams } from './component/spot';
4
+ import type { IElementService, ISpotColors } from './element.interface';
3
5
  export declare class ElementService implements IElementService {
4
6
  static getInstance(): ElementService;
5
7
  /**
@@ -7,11 +9,21 @@ export declare class ElementService implements IElementService {
7
9
  *
8
10
  * This method is only available in browser environments.
9
11
  *
10
- * @param {ICreateFinalElementParams} params - The parameters to create the final element.
12
+ * @param {ICreateSpotElementParams} params - The parameters to create the final element.
11
13
  *
12
14
  * @return {HTMLElement | null} - The html element or null if the browser environment is not available.
13
15
  */
14
- createFinalElement({ content, config }: ICreateFinalElementParams): HTMLElement | null;
16
+ createSpotElement({ content, config }: ICreateSpotElementParams): HTMLElement | null;
17
+ /**
18
+ * Creates the carousel html element based on the provided slides and configs using shadow dom.
19
+ *
20
+ * This method is only available in browser environments.
21
+ *
22
+ * @param {ICreateCarouselElementParams} params - The parameters to create the final element.
23
+ *
24
+ * @return {HTMLElement | null} - The html element or null if the browser environment is not available.
25
+ */
26
+ createCarouselElement({ slides, config, }: ICreateCarouselElementParams): HTMLElement | null;
15
27
  /**
16
28
  * Overrides the spot colors with the provided colors.
17
29
  *
@@ -1,3 +1,3 @@
1
1
  export * from './element.constant';
2
2
  export * from './element.interface';
3
- export * from './spot.element.service';
3
+ export * from './element.service';
@@ -1,2 +1,3 @@
1
1
  import type { ISpotOverlay } from '../element.interface';
2
2
  export declare function linearGradientColorStop(overlay: ISpotOverlay[], fallback: string): string;
3
+ export declare function spotHtmlStringToElement(htmlString: string): HTMLElement;
@@ -7,4 +7,4 @@ import type { ISpotTemplateConfig } from './template.type';
7
7
  *
8
8
  * @return {string} - The spot html string.
9
9
  */
10
- export declare const GET_SPOT_TEMPLATE_HTML_STRING: (spot: ISpot, config?: ISpotTemplateConfig) => string;
10
+ export declare const SPOT_TEMPLATE_HTML_ELEMENT: (spot: ISpot, config?: ISpotTemplateConfig) => HTMLElement | null;
@@ -5,7 +5,7 @@ export interface IResizeSize {
5
5
  export interface IResizeOptions {
6
6
  element: HTMLElement;
7
7
  maxSize: IResizeSize;
8
- minScale?: number;
8
+ minScale: number;
9
9
  }
10
10
  export interface ISizeChangedEvent extends CustomEvent {
11
11
  detail: {
@@ -1,5 +1,5 @@
1
1
  import type { RMN_SPOT_EVENT, RMN_SPOT_TYPE } from 'enums';
2
- import type { SpotIdentifierType, SpotVariantType } from 'modules/selection';
2
+ import type { PlacementIdType, SpotVariantType } from 'modules/selection';
3
3
  import type { RmnFilterType, RmnSpotType } from 'types';
4
4
  export interface ISpotSelectionParams {
5
5
  url?: string;
@@ -30,7 +30,7 @@ export interface ISpot {
30
30
  mobileSecondaryImage?: string;
31
31
  productUpcs?: string[];
32
32
  }
33
- export type ISpots = Record<SpotIdentifierType, ISpot[]>;
33
+ export type ISpots = Record<PlacementIdType, ISpot[]>;
34
34
  export interface ISelectionService {
35
35
  spotSelection(data: ISpotSelectionParams): Promise<ISpots>;
36
36
  }
@@ -2,12 +2,13 @@ import type { RMN_FILTER_PROPERTIES, RMN_SPOT_TYPE } from 'enums';
2
2
  export type RmnFilterType = {
3
3
  [key in RMN_FILTER_PROPERTIES]?: string[];
4
4
  };
5
+ export type PlacementIdType = RMN_SPOT_TYPE | `${RMN_SPOT_TYPE}${number}` | string;
5
6
  export type SpotFilterType = {
7
+ placementId?: PlacementIdType;
6
8
  spot: RMN_SPOT_TYPE | string;
7
- count: number;
9
+ count?: number;
8
10
  exactMatch?: string;
9
11
  } & Omit<RmnFilterType, RMN_FILTER_PROPERTIES.KEYWORDS>;
10
- export type SpotIdentifierType = RMN_SPOT_TYPE | `${RMN_SPOT_TYPE}${number}`;
11
12
  export type RmnSpotType = RMN_SPOT_TYPE | string | SpotFilterType;
12
13
  type RBSpotTypeKeys = keyof {
13
14
  [K in keyof typeof RMN_SPOT_TYPE as K extends `RB_${string}` ? K : never]: (typeof RMN_SPOT_TYPE)[K];
@@ -1,6 +1,6 @@
1
1
  import type { IAuthCredentials } from 'modules/auth';
2
- import type { IInjectSpotElement, IInjectSpotsConfig } from 'modules/element';
3
- import type { ISpots, ISpotSelectionParams } from 'modules/selection';
2
+ import type { IInjectSpotElementParams, IRmnCreateSpotElementConfig } from 'modules/element';
3
+ import type { ISpot, ISpots, ISpotSelectionParams } from 'modules/selection';
4
4
  import type { IRmnClient, IRmnConfig } from 'types';
5
5
  export declare class LiquidCommerceRmnClient implements IRmnClient {
6
6
  private readonly selectionService;
@@ -11,26 +11,33 @@ export declare class LiquidCommerceRmnClient implements IRmnClient {
11
11
  *
12
12
  * To create a spot html element, use the RmnCreateSpotElement function.
13
13
  *
14
- * @param {ISpotSelectionParams} data - Spots selection parameters.
14
+ * @param {ISpotSelectionParams} params - Spots selection parameters.
15
15
  *
16
16
  * @return {Promise<ISpots>} - The spots response object.
17
17
  */
18
- spotSelection(data: ISpotSelectionParams): Promise<ISpots>;
18
+ spotSelection(params: ISpotSelectionParams): Promise<ISpots>;
19
19
  /**
20
20
  * Injects the spot elements into their provided placement.
21
21
  *
22
- * @param {IInjectSpotElement[]} data - The spot elements data.
23
- * @param {IInjectSpotsConfig} config - The configuration object.
22
+ * @param {IInjectSpotElementParams} params - Parameters for injecting spot elements.
24
23
  *
25
24
  * @return {Promise<void>} - A promise that resolves when the spot elements are injected.
26
25
  */
27
- injectSpotElement(data: IInjectSpotElement[], config?: IInjectSpotsConfig): Promise<void>;
26
+ injectSpotElement(params: IInjectSpotElementParams): Promise<void>;
27
+ /**
28
+ * Makes a selection request on our server based on the provided data.
29
+ *
30
+ * @param {IInjectSpotElementParams} params - Parameters for injecting spot elements.
31
+ *
32
+ * @return {Promise<ISpots>} - The spots response object.
33
+ */
34
+ private spotSelectionRequest;
28
35
  /**
29
36
  * Injects a carousel element with the provided spots into the placement.
30
37
  *
31
38
  * @param {HTMLElement} placement - The placement element.
32
39
  * @param {ISpot[]} spots - The spot data.
33
- * @param {IInjectSpotsConfig} config - The configuration object.
40
+ * @param {IInjectSpotElementConfig} config - The configuration object.
34
41
  *
35
42
  * @return {void}
36
43
  */
@@ -41,19 +48,21 @@ export declare class LiquidCommerceRmnClient implements IRmnClient {
41
48
  * @param {IInjectSpotElement} injectItem - The inject item data.
42
49
  * @param {HTMLElement} placement - The placement element.
43
50
  * @param {ISpot} spot - The spot data.
44
- * @param {IInjectSpotsConfig} config - The configuration object.
51
+ * @param {IInjectSpotElementConfig} config - The configuration object.
45
52
  *
46
53
  * @return {void}
47
54
  */
48
55
  private injectOneSpotElement;
49
56
  /**
50
- * Normalizes the spot type data by adding a number suffix to the spot type.
57
+ * Prevents duplicate placement ids in the inject data.
58
+ *
59
+ * @param {IInjectSpotElement[]} inject - The inject data.
51
60
  *
52
- * @param {IInjectSpotElement[]} spots - The spot type data.
61
+ * @throws {Error} - If a duplicate placement id is found.
53
62
  *
54
- * @return {IInjectSpotElement[]} - The normalized spot type data.
63
+ * @return {void}
55
64
  */
56
- private normalizeDataSpotType;
65
+ private preventDuplicateSpotPlacementIds;
57
66
  }
58
67
  /**
59
68
  * Creates a new instance of the RmnClient.
@@ -64,4 +73,17 @@ export declare class LiquidCommerceRmnClient implements IRmnClient {
64
73
  * @return {Promise<IRmnClient>} - The RmnClient instance.
65
74
  */
66
75
  declare function RmnClient(apiKey: string, config: IRmnConfig): Promise<IRmnClient>;
67
- export { RmnClient };
76
+ /**
77
+ * Creates the spot html element based on the provided data using shadow dom.
78
+ *
79
+ * This method is useful when you are initializing the client in a non-browser environment.
80
+ * When you request a spot selection, you will receive the spot data in server-side and return them to the client.
81
+ * Then you can use this function to create the spot html element based on the provided data without the need of the RmnClient instance.
82
+ *
83
+ * @param {ISpot} spot - The spot data.
84
+ * @param {IRmnCreateSpotElementConfig} config - The configuration object.
85
+ *
86
+ * @return {HTMLElement | null} - The spot html element or null if the browser environment is not available.
87
+ */
88
+ declare function RmnCreateSpotElement(spot: ISpot, config?: IRmnCreateSpotElementConfig): HTMLElement | null;
89
+ export { RmnClient, RmnCreateSpotElement };
@@ -0,0 +1,3 @@
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>;
@@ -1,12 +1,12 @@
1
- export type { IInjectSpotsConfig } from 'modules/element';
1
+ export type { IInjectSpotElement, IInjectSpotElementConfig, IRmnCreateSpotElementConfig, } from 'modules/element';
2
2
  export type { ISpots, RmnFilterType, RmnSpotType } from 'modules/selection';
3
3
  export { ISpot, ISpotEvent, ISpotSelectionParams } from 'modules/selection';
4
4
  import type { RMN_ENV } from 'enums';
5
- import type { IInjectSpotElement, IInjectSpotsConfig } from 'modules/element';
5
+ import type { IInjectSpotElementParams } from 'modules/element';
6
6
  import type { ISpots, ISpotSelectionParams } from 'modules/selection';
7
7
  export interface IRmnClient {
8
- spotSelection(data: ISpotSelectionParams): Promise<ISpots>;
9
- injectSpotElement(spots: IInjectSpotElement[], config?: IInjectSpotsConfig): Promise<void>;
8
+ spotSelection(params: ISpotSelectionParams): Promise<ISpots>;
9
+ injectSpotElement(params: IInjectSpotElementParams): Promise<void>;
10
10
  }
11
11
  export interface IRmnConfig {
12
12
  env: RMN_ENV;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@liquidcommercedev/rmn-sdk",
3
3
  "description": "LiquidCommerce RMN SDK",
4
4
  "author": "LiquidCommerce Tech",
5
- "version": "1.4.6-beta.2",
5
+ "version": "1.4.6-beta.4",
6
6
  "homepage": "https://docs.liquidcommerce.co/rmn-sdk",
7
7
  "main": "./dist/index.cjs",
8
8
  "module": "./dist/index.esm.js",
@@ -42,7 +42,7 @@
42
42
  "test": "vitest run",
43
43
  "test:watch": "vitest",
44
44
  "test:coverage": "vitest run --coverage",
45
- "lint": "eslint \"src/**/*.ts\" --fix",
45
+ "lint": "eslint \"src/**/*.ts\"",
46
46
  "format": "prettier --write \"src/**/*.ts\"",
47
47
  "docs": "typedoc --out docs src",
48
48
  "prepublishOnly": "pnpm run build"