@liquidcommercedev/rmn-sdk 1.5.0-beta.12 → 1.5.0-beta.14
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.cjs +343 -120
- package/dist/index.esm.js +343 -120
- package/dist/types/common/helpers/utils.helper.d.ts +5 -4
- 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 +13 -0
- package/dist/types/modules/element/component/skeleton/skeleton.template.d.ts +2 -0
- package/dist/types/modules/element/element.constant.d.ts +3 -0
- package/dist/types/modules/element/element.service.d.ts +11 -0
- package/dist/types/modules/monitor/monitor.interface.d.ts +4 -0
- package/dist/types/rmn-client.d.ts +24 -9
- package/package.json +1 -1
- package/umd/liquidcommerce-rmn-sdk.min.js +1 -1
@@ -0,0 +1,13 @@
|
|
1
|
+
import type { RMN_SPOT_TYPE } from 'enums';
|
2
|
+
export interface ICustomSkeletonElementData {
|
3
|
+
fluid: boolean;
|
4
|
+
width: number;
|
5
|
+
height: number;
|
6
|
+
}
|
7
|
+
export interface ICustomSkeletonElement extends HTMLElement {
|
8
|
+
data: ICustomSkeletonElementData;
|
9
|
+
}
|
10
|
+
export interface ICreateSkeletonElementParams {
|
11
|
+
fluid: boolean;
|
12
|
+
spotType: RMN_SPOT_TYPE;
|
13
|
+
}
|
@@ -1,5 +1,8 @@
|
|
1
|
+
import type { SpotDimensionsType } from 'modules/selection';
|
1
2
|
export declare const SPOT_ELEMENT_TAG = "spot-element";
|
2
3
|
export declare const CAROUSEL_ELEMENT_TAG = "spot-carousel-element";
|
4
|
+
export declare const SKELETON_ELEMENT_TAG = "spot-skeleton-element";
|
3
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";
|
4
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";
|
5
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,5 +1,6 @@
|
|
1
1
|
import type { ISpot } from 'modules/selection';
|
2
2
|
import type { ICreateCarouselElementParams } from './component/carousel';
|
3
|
+
import type { ICreateSkeletonElementParams } from './component/skeleton';
|
3
4
|
import type { ICreateSpotElementParams } from './component/spot';
|
4
5
|
import type { IElementService, ISpotColors } from './element.interface';
|
5
6
|
export declare class ElementService implements IElementService {
|
@@ -24,6 +25,16 @@ export declare class ElementService implements IElementService {
|
|
24
25
|
* @return {HTMLElement | null} - The html element or null if the browser environment is not available.
|
25
26
|
*/
|
26
27
|
createCarouselElement({ slides, config, }: ICreateCarouselElementParams): HTMLElement | null;
|
28
|
+
/**
|
29
|
+
* Creates the skeleton html element based on the provided data using shadow dom.
|
30
|
+
*
|
31
|
+
* This method is only available in browser environments.
|
32
|
+
*
|
33
|
+
* @param {ICreateSkeletonElementParams} params - The parameters to create the final element.
|
34
|
+
*
|
35
|
+
* @return {HTMLElement | null} - The html element or null if the browser environment is not available.
|
36
|
+
*/
|
37
|
+
createSkeletonElement(params: ICreateSkeletonElementParams): HTMLElement | null;
|
27
38
|
/**
|
28
39
|
* Overrides the spot colors with the provided colors.
|
29
40
|
*
|
@@ -6,6 +6,7 @@ export declare class LiquidCommerceRmnClient implements IRmnClient {
|
|
6
6
|
private readonly selectionService;
|
7
7
|
private readonly elementService;
|
8
8
|
private readonly eventService;
|
9
|
+
private intersectionObserver;
|
9
10
|
constructor(auth: IAuthCredentials);
|
10
11
|
/**
|
11
12
|
* Makes a selection request on our server based on the provided data.
|
@@ -27,14 +28,7 @@ export declare class LiquidCommerceRmnClient implements IRmnClient {
|
|
27
28
|
* @return {Promise<void>} - A promise that resolves when the spot elements are injected.
|
28
29
|
*/
|
29
30
|
injectSpotElement(params: IInjectSpotElementParams): Promise<void>;
|
30
|
-
/**
|
31
|
-
* Makes a selection request on our server based on the provided data.
|
32
|
-
*
|
33
|
-
* @param {IInjectSpotElementParams} params - Parameters for injecting spot elements.
|
34
|
-
*
|
35
|
-
* @return {Promise<ISpots | {error: string}>} - The spots response object.
|
36
|
-
*/
|
37
|
-
private spotSelectionRequest;
|
31
|
+
/** ========================= HELPER METHODS ========================= **/
|
38
32
|
/**
|
39
33
|
* Injects a carousel element with the provided spots into the placement.
|
40
34
|
*
|
@@ -56,6 +50,22 @@ export declare class LiquidCommerceRmnClient implements IRmnClient {
|
|
56
50
|
* @return {void}
|
57
51
|
*/
|
58
52
|
private injectOneSpotElement;
|
53
|
+
/**
|
54
|
+
* Clears the placement element by removing all its children.
|
55
|
+
*
|
56
|
+
* @param {string} placementId - The placement id.
|
57
|
+
*
|
58
|
+
* @return {void}
|
59
|
+
*/
|
60
|
+
private clearPlacement;
|
61
|
+
/**
|
62
|
+
* Makes a selection request on our server based on the provided data.
|
63
|
+
*
|
64
|
+
* @param {IInjectSpotElementParams} params - Parameters for injecting spot elements.
|
65
|
+
*
|
66
|
+
* @return {Promise<ISpots | {error: string}>} - The spots response object.
|
67
|
+
*/
|
68
|
+
private spotSelectionRequest;
|
59
69
|
/**
|
60
70
|
* Prevents duplicate placement ids in the inject data.
|
61
71
|
*
|
@@ -66,8 +76,13 @@ export declare class LiquidCommerceRmnClient implements IRmnClient {
|
|
66
76
|
* @return {void}
|
67
77
|
*/
|
68
78
|
private preventDuplicateSpotPlacementIds;
|
79
|
+
/**
|
80
|
+
* Prevents non-existent spot types in the inject data.
|
81
|
+
*
|
82
|
+
* @param {IInjectSpotElement[]} inject - The inject data.
|
83
|
+
* @return {IInjectSpotElement[]} - The filtered inject data.
|
84
|
+
*/
|
69
85
|
private preventNonExistentSpotTypes;
|
70
|
-
private updateSpotsState;
|
71
86
|
private useSpotSelectionExample;
|
72
87
|
}
|
73
88
|
/**
|
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.5.0-beta.
|
5
|
+
"version": "1.5.0-beta.14",
|
6
6
|
"homepage": "https://docs.liquidcommerce.co/rmn-sdk",
|
7
7
|
"main": "./dist/index.cjs",
|
8
8
|
"module": "./dist/index.esm.js",
|