@liquidcommerce/elements-sdk 2.1.1-beta.2 → 2.1.1-beta.4
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/dist/index.esm.js +7259 -7086
- package/dist/types/core/client/client-config.service.d.ts +4 -3
- package/dist/types/interfaces/cloud/retailer.interface.d.ts +1 -0
- package/dist/types/interfaces/configs/global.interface.d.ts +11 -0
- package/dist/types/interfaces/core.interface.d.ts +2 -7
- package/dist/types/modules/ui-components/promo-code-ticker/promo-code-ticker.component.d.ts +6 -3
- package/dist/types/utils/timezone.d.ts +16 -0
- package/package.json +1 -1
- package/umd/elements.js +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ElementsEnv } from '@/enums';
|
|
2
|
-
import type {
|
|
2
|
+
import type { IPromoTicker } from '@/interfaces/configs';
|
|
3
|
+
import type { IClientCustomThemeConfig, IElementsProxyConfig } from '@/interfaces/core.interface';
|
|
3
4
|
export type DeviceType = 'desktop' | 'tablet' | 'mobile';
|
|
4
5
|
export interface IClientConfigs {
|
|
5
6
|
apiKey: string;
|
|
@@ -14,7 +15,7 @@ export interface IClientConfigs {
|
|
|
14
15
|
isLocalStorageAvailable?: boolean;
|
|
15
16
|
version?: string;
|
|
16
17
|
clientPrepared: boolean;
|
|
17
|
-
promoTicker: IPromoTicker | null;
|
|
18
|
+
promoTicker: IPromoTicker[] | null;
|
|
18
19
|
}
|
|
19
20
|
export interface IClientConfigInput {
|
|
20
21
|
env?: ElementsEnv;
|
|
@@ -22,7 +23,7 @@ export interface IClientConfigInput {
|
|
|
22
23
|
enableDebugging?: boolean;
|
|
23
24
|
customTheme?: IClientCustomThemeConfig;
|
|
24
25
|
proxy?: IElementsProxyConfig;
|
|
25
|
-
promoTicker?: IPromoTicker;
|
|
26
|
+
promoTicker?: IPromoTicker[];
|
|
26
27
|
}
|
|
27
28
|
export declare class ClientConfigService {
|
|
28
29
|
private config;
|
|
@@ -22,6 +22,16 @@ export interface IGlobalTheme {
|
|
|
22
22
|
successColor: string;
|
|
23
23
|
drawerBackgroundColor: string;
|
|
24
24
|
}
|
|
25
|
+
export interface IPromoTicker {
|
|
26
|
+
promoCode: string;
|
|
27
|
+
text: string[];
|
|
28
|
+
separator: string;
|
|
29
|
+
activeFrom: string;
|
|
30
|
+
activeUntil: string;
|
|
31
|
+
}
|
|
32
|
+
export interface IExperienceFeatures {
|
|
33
|
+
promoTicker: IPromoTicker[];
|
|
34
|
+
}
|
|
25
35
|
export interface IGlobalLayout {
|
|
26
36
|
enablePersonalization: boolean;
|
|
27
37
|
personalizationText: string;
|
|
@@ -34,6 +44,7 @@ export interface IGlobalLayout {
|
|
|
34
44
|
export interface IComponentGlobalConfigs {
|
|
35
45
|
theme: IGlobalTheme;
|
|
36
46
|
layout: IGlobalLayout;
|
|
47
|
+
experienceFeatures: IExperienceFeatures;
|
|
37
48
|
}
|
|
38
49
|
export type UpdateComponentGlobalConfigs = DeepPartial<IComponentGlobalConfigs>;
|
|
39
50
|
export interface IAllConfigs {
|
|
@@ -2,7 +2,7 @@ import type { IAddressActions, ICartActions, ICheckoutActions, IProductActions }
|
|
|
2
2
|
import type { IClientConfigs } from '@/core/client/client-config.service';
|
|
3
3
|
import type { ComponentType, ElementsEnv } from '@/enums';
|
|
4
4
|
import type { IAddressOptions } from '@/modules/address/address.interface';
|
|
5
|
-
import type { UpdateAddressComponent, UpdateCartComponent, UpdateCheckoutComponent, UpdateComponentGlobalConfigs, UpdateProductComponent } from './configs';
|
|
5
|
+
import type { IPromoTicker, UpdateAddressComponent, UpdateCartComponent, UpdateCheckoutComponent, UpdateComponentGlobalConfigs, UpdateProductComponent } from './configs';
|
|
6
6
|
export type DeepPartial<T> = {
|
|
7
7
|
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
8
8
|
};
|
|
@@ -17,14 +17,9 @@ export interface IClientCustomThemeConfig {
|
|
|
17
17
|
cart?: UpdateCartComponent;
|
|
18
18
|
checkout?: UpdateCheckoutComponent;
|
|
19
19
|
}
|
|
20
|
-
export interface IPromoTicker {
|
|
21
|
-
promoCode: string;
|
|
22
|
-
text: string[];
|
|
23
|
-
separator?: string;
|
|
24
|
-
}
|
|
25
20
|
export interface ILiquidCommerceElementsConfig {
|
|
26
21
|
env?: ElementsEnv;
|
|
27
|
-
promoTicker?: IPromoTicker;
|
|
22
|
+
promoTicker?: IPromoTicker[];
|
|
28
23
|
customTheme?: IClientCustomThemeConfig;
|
|
29
24
|
proxy?: IElementsProxyConfig;
|
|
30
25
|
isBuilder?: boolean;
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
|
|
2
|
+
import type { IPromoTicker } from '@/interfaces/configs';
|
|
2
3
|
export interface IPromoCodeTickerParams {
|
|
3
4
|
context: 'cart' | 'checkout';
|
|
4
|
-
|
|
5
|
-
text: string[];
|
|
6
|
-
separator?: string;
|
|
5
|
+
tickers: IPromoTicker[];
|
|
7
6
|
}
|
|
8
7
|
export declare class PromoCodeTickerComponent extends BaseComponent<IPromoCodeTickerParams, null> {
|
|
9
8
|
get hostClasses(): string[];
|
|
10
9
|
private applyButton;
|
|
11
10
|
private promoCodeApplied;
|
|
11
|
+
private currentActiveTicker;
|
|
12
12
|
beforeSetupStoreWatchers(): void;
|
|
13
13
|
onStoreWatch(changes: IOnStoreChanged[]): void;
|
|
14
|
+
private isPromoCodeApplied;
|
|
15
|
+
private getActiveTickers;
|
|
16
|
+
private selectCurrentTicker;
|
|
14
17
|
private generateTextContent;
|
|
15
18
|
private handlePromoClick;
|
|
16
19
|
protected template(): HTMLElement[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare function detectUserTimezone(addressState?: string): string;
|
|
2
|
+
export declare function getCurrentTimeInTimezone(timezone: string): Date;
|
|
3
|
+
export declare function getCurrentTimeInUserTimezone(addressState?: string): Date;
|
|
4
|
+
export declare function isDateTimeInRange(options: {
|
|
5
|
+
startDate?: Date | string | null;
|
|
6
|
+
endDate?: Date | string | null;
|
|
7
|
+
addressState?: string;
|
|
8
|
+
}): boolean;
|
|
9
|
+
export declare function filterActiveItems<T extends {
|
|
10
|
+
activeFrom: Date | string;
|
|
11
|
+
activeUntil: Date | string;
|
|
12
|
+
}>(items: T[], addressState?: string): T[];
|
|
13
|
+
export declare function hasActiveItems<T extends {
|
|
14
|
+
activeFrom: Date | string;
|
|
15
|
+
activeUntil: Date | string;
|
|
16
|
+
}>(items: T[], addressState?: string): boolean;
|
package/package.json
CHANGED