@liquidcommerce/elements-sdk 2.5.6-beta.10 → 2.5.6-beta.12
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 +9871 -9685
- package/dist/types/core/api-client.service.d.ts +1 -1
- package/dist/types/core/client/client-config.service.d.ts +4 -0
- package/dist/types/core/fingerprint.service.d.ts +2 -1
- package/dist/types/core/store/interfaces/checkout.interface.d.ts +8 -5
- package/dist/types/core/store/interfaces/core.interface.d.ts +2 -2
- package/dist/types/core/store/store.constant.d.ts +1 -1
- package/dist/types/enums/core.enum.d.ts +1 -0
- package/dist/types/interfaces/core.interface.d.ts +2 -0
- package/dist/types/modules/checkout/checkout.commands.d.ts +3 -3
- package/dist/types/modules/checkout/components/checkout-payment.component.d.ts +4 -21
- package/dist/types/modules/checkout/components/checkout-stripe-handler.component.d.ts +50 -0
- package/dist/types/modules/checkout/components/index.d.ts +1 -0
- package/dist/types/modules/product/components/components.d.ts +1 -1
- package/package.json +1 -1
- package/umd/elements.js +1 -1
- package/dist/types/modules/product/utils/index.d.ts +0 -2
|
@@ -23,7 +23,7 @@ export declare class ApiClientService {
|
|
|
23
23
|
prepareCheckout(params: ICheckoutPrepareParams): Promise<ICheckoutPrepareResponse>;
|
|
24
24
|
getPaymentSession(params: IUserPaymentSession): Promise<IUserSession>;
|
|
25
25
|
confirmPaymentSession(confirmationTokenId: string, setupIntentId: string): Promise<ILiquidPaymentToken>;
|
|
26
|
-
checkoutComplete(params: ICheckoutCompleteParams): Promise<ICheckoutCompleteResponse['order']>;
|
|
26
|
+
checkoutComplete(params: Partial<ICheckoutCompleteParams>): Promise<ICheckoutCompleteResponse['order']>;
|
|
27
27
|
catalogSearch(params: ICatalogParams): Promise<ICatalog>;
|
|
28
28
|
private validResponseData;
|
|
29
29
|
private ensureClientInitialized;
|
|
@@ -14,10 +14,12 @@ export interface IClientConfigs {
|
|
|
14
14
|
proxy: IElementsProxyConfig | null;
|
|
15
15
|
deviceType: DeviceType;
|
|
16
16
|
userDeviceId?: string;
|
|
17
|
+
localStorageKeyPrefix?: string;
|
|
17
18
|
isLocalStorageAvailable?: boolean;
|
|
18
19
|
version?: string;
|
|
19
20
|
clientPrepared: boolean;
|
|
20
21
|
promoTicker: IPromoTicker[] | null;
|
|
22
|
+
paymentMethodId?: string;
|
|
21
23
|
}
|
|
22
24
|
export interface IClientConfigInput {
|
|
23
25
|
env?: ElementsEnv;
|
|
@@ -26,6 +28,7 @@ export interface IClientConfigInput {
|
|
|
26
28
|
customTheme?: IClientCustomThemeConfig;
|
|
27
29
|
proxy?: IElementsProxyConfig;
|
|
28
30
|
promoTicker?: IPromoTicker[];
|
|
31
|
+
paymentMethodId?: string;
|
|
29
32
|
}
|
|
30
33
|
export declare class ClientConfigService {
|
|
31
34
|
private config;
|
|
@@ -34,6 +37,7 @@ export declare class ClientConfigService {
|
|
|
34
37
|
getConfigs(): IClientConfigs;
|
|
35
38
|
get<K extends keyof IClientConfigs>(key: K): IClientConfigs[K];
|
|
36
39
|
set<K extends keyof IClientConfigs>(key: K, value: IClientConfigs[K]): void;
|
|
40
|
+
isBeta(): boolean;
|
|
37
41
|
isDevelopment(): boolean;
|
|
38
42
|
isStaging(): boolean;
|
|
39
43
|
isProduction(): boolean;
|
|
@@ -4,9 +4,10 @@ interface FingerprintData {
|
|
|
4
4
|
timezone: string;
|
|
5
5
|
}
|
|
6
6
|
export declare class FingerPrintService {
|
|
7
|
-
private readonly keyPrefix;
|
|
8
7
|
private isLocalStorageAvailable;
|
|
9
8
|
private cachedFingerprint;
|
|
9
|
+
private readonly clientConfig;
|
|
10
|
+
constructor();
|
|
10
11
|
static getInstance(): FingerPrintService;
|
|
11
12
|
getId(partnerCode: string): Promise<string>;
|
|
12
13
|
getFingerprintData(): FingerprintData;
|
|
@@ -102,16 +102,19 @@ export interface ICheckoutPaymentCardStore {
|
|
|
102
102
|
brand: string;
|
|
103
103
|
last4: string;
|
|
104
104
|
}
|
|
105
|
-
export interface
|
|
105
|
+
export interface ICheckoutPaymentMethodStore {
|
|
106
|
+
id: string;
|
|
107
|
+
card: ICheckoutPaymentCardStore;
|
|
108
|
+
}
|
|
109
|
+
export interface ICheckoutPaymentSessionStore {
|
|
106
110
|
key: string;
|
|
107
111
|
secret: string;
|
|
108
|
-
paymentMethodId: string | null;
|
|
109
|
-
card: ICheckoutPaymentCardStore | null;
|
|
110
112
|
}
|
|
111
113
|
export interface ICheckoutPaymentFormStore {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
+
paymentSession: ICheckoutPaymentSessionStore | null;
|
|
115
|
+
paymentMethod: ICheckoutPaymentMethodStore | null;
|
|
114
116
|
data: ICheckoutBillingStore | null;
|
|
117
|
+
billingSameAsShipping: boolean;
|
|
115
118
|
isEditing: boolean;
|
|
116
119
|
isValid: boolean;
|
|
117
120
|
isSaving: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IAddressStore } from '@/core/store/interfaces/address.interface';
|
|
2
|
-
import type { ICheckoutCustomerFormStore, ICheckoutGiftRecipientFormStore, ICheckoutGiftRecipientStore, ICheckoutItemStore, ICheckoutMarketingPreferencesStore, ICheckoutPaymentFormStore,
|
|
2
|
+
import type { ICheckoutCustomerFormStore, ICheckoutGiftRecipientFormStore, ICheckoutGiftRecipientStore, ICheckoutItemStore, ICheckoutMarketingPreferencesStore, ICheckoutPaymentFormStore, ICheckoutPaymentMethodStore, ICheckoutPaymentSessionStore, ICheckoutPresaleStore, ICheckoutPromoCodeStore, ICheckoutStore } from '@/core/store/interfaces/checkout.interface';
|
|
3
3
|
import type { IProductSizeStore, IProductStore } from '@/core/store/interfaces/product.interface';
|
|
4
4
|
import type { ComponentType } from '@/enums';
|
|
5
5
|
import type { ICartItemStore, ICartPromoCodeStore, ICartStore, ICartTotalsStore, IRetailerFulfillmentStore, IRetailerStore } from './cart.interface';
|
|
@@ -25,7 +25,7 @@ export interface IPersistedStore {
|
|
|
25
25
|
p?: string;
|
|
26
26
|
c?: string;
|
|
27
27
|
}
|
|
28
|
-
export type StorePaths = keyof IGlobalStore | `products.${string}` | `products.${string}.${keyof IProductStore}` | `products.${string}.sizes.${string}` | `products.${string}.sizes.${string}.${keyof IProductSizeStore}` | `address.${keyof IAddressStore}` | `cart.${keyof ICartStore}` | `cart.items.${string}` | `cart.items.${string}.${keyof ICartItemStore}` | `cart.totals.${keyof ICartTotalsStore}` | `cart.retailers.${string}` | `cart.items.${string}.${keyof IRetailerStore}` | `cart.fulfillments.${string}` | `cart.fulfillments.${string}.${keyof IRetailerFulfillmentStore}` | `cart.promoCode.${keyof ICartPromoCodeStore}` | `ui.${keyof IUIStore}` | `ui.drawer.${keyof IDrawerStore}` | `checkout.${keyof ICheckoutStore}` | `checkout.customerForm.${keyof ICheckoutCustomerFormStore}` | `checkout.giftRecipientForm.${keyof ICheckoutGiftRecipientFormStore}` | `checkout.paymentForm.${keyof ICheckoutPaymentFormStore}` | `checkout.paymentForm.
|
|
28
|
+
export type StorePaths = keyof IGlobalStore | `products.${string}` | `products.${string}.${keyof IProductStore}` | `products.${string}.sizes.${string}` | `products.${string}.sizes.${string}.${keyof IProductSizeStore}` | `address.${keyof IAddressStore}` | `cart.${keyof ICartStore}` | `cart.items.${string}` | `cart.items.${string}.${keyof ICartItemStore}` | `cart.totals.${keyof ICartTotalsStore}` | `cart.retailers.${string}` | `cart.items.${string}.${keyof IRetailerStore}` | `cart.fulfillments.${string}` | `cart.fulfillments.${string}.${keyof IRetailerFulfillmentStore}` | `cart.promoCode.${keyof ICartPromoCodeStore}` | `ui.${keyof IUIStore}` | `ui.drawer.${keyof IDrawerStore}` | `checkout.${keyof ICheckoutStore}` | `checkout.customerForm.${keyof ICheckoutCustomerFormStore}` | `checkout.giftRecipientForm.${keyof ICheckoutGiftRecipientFormStore}` | `checkout.paymentForm.${keyof ICheckoutPaymentFormStore}` | `checkout.paymentForm.paymentSession.${keyof ICheckoutPaymentSessionStore}` | `checkout.paymentForm.paymentMethod.${keyof ICheckoutPaymentMethodStore}` | `checkout.presale.${keyof ICheckoutPresaleStore}` | `checkout.marketingPreferences.${keyof ICheckoutMarketingPreferencesStore}` | `checkout.giftRecipient.${keyof ICheckoutGiftRecipientStore}` | `checkout.giftCards.${string}` | `checkout.promoCode.${keyof ICheckoutPromoCodeStore}` | `checkout.items.${string}` | `checkout.items.${string}.${keyof ICheckoutItemStore}` | `checkout.onDemandFulfillmentTipInfo.${string}`;
|
|
29
29
|
interface MiddlewareContext {
|
|
30
30
|
action: string;
|
|
31
31
|
payload: any;
|
|
@@ -3,7 +3,7 @@ import type { ICartStore } from '@/core/store/interfaces/cart.interface';
|
|
|
3
3
|
import type { ICheckoutStore } from '@/core/store/interfaces/checkout.interface';
|
|
4
4
|
import type { IGlobalStore, IUIStore } from '@/core/store/interfaces/core.interface';
|
|
5
5
|
import type { IProductStore } from '@/core/store/interfaces/product.interface';
|
|
6
|
-
export declare const LOCAL_STORAGE_PREFIX = "
|
|
6
|
+
export declare const LOCAL_STORAGE_PREFIX = "lce";
|
|
7
7
|
export declare const initialProductState: IProductStore;
|
|
8
8
|
export declare const initialCartState: ICartStore;
|
|
9
9
|
export declare const initialCheckoutState: ICheckoutStore;
|
|
@@ -110,6 +110,7 @@ export declare const COMPONENT_TYPE: {
|
|
|
110
110
|
readonly CART_FULFILLMENT: "cart-fulfillment";
|
|
111
111
|
readonly CHECKOUT: "checkout";
|
|
112
112
|
readonly CHECKOUT_INFORMATION: "checkout-information";
|
|
113
|
+
readonly CHECKOUT_STRIPE_HANDLER: "checkout-stripe-handler";
|
|
113
114
|
readonly CHECKOUT_STRIPE_FORM: "checkout-stripe-form";
|
|
114
115
|
readonly CHECKOUT_PAYMENT: "checkout-payment";
|
|
115
116
|
readonly CHECKOUT_PAYMENT_SUMMARY: "checkout-payment-summary";
|
|
@@ -23,6 +23,7 @@ export interface ILiquidCommerceElementsBuilderConfig {
|
|
|
23
23
|
promoTicker?: IPromoTicker[];
|
|
24
24
|
customTheme?: IClientCustomThemeConfig;
|
|
25
25
|
debugMode?: DebugMode;
|
|
26
|
+
paymentMethodId?: string;
|
|
26
27
|
}
|
|
27
28
|
export interface ILiquidCommerceElementsConfig {
|
|
28
29
|
env?: ElementsEnv;
|
|
@@ -30,6 +31,7 @@ export interface ILiquidCommerceElementsConfig {
|
|
|
30
31
|
customTheme?: IClientCustomThemeConfig;
|
|
31
32
|
proxy?: IElementsProxyConfig;
|
|
32
33
|
debugMode?: DebugMode;
|
|
34
|
+
paymentMethodId?: string;
|
|
33
35
|
}
|
|
34
36
|
export interface IInjectProductElement {
|
|
35
37
|
containerId: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseCommand } from '@/core/command/base-command.service';
|
|
2
|
-
import type { ICheckoutBillingStore, ICheckoutCustomerStore, ICheckoutGiftRecipientStore } from '@/core/store/interfaces/checkout.interface';
|
|
2
|
+
import type { ICheckoutBillingStore, ICheckoutCustomerStore, ICheckoutGiftRecipientStore, ICheckoutPaymentMethodStore } from '@/core/store/interfaces/checkout.interface';
|
|
3
3
|
export declare class CheckoutCommands extends BaseCommand {
|
|
4
4
|
private readonly uiCommands;
|
|
5
5
|
private readonly commonCommands;
|
|
@@ -10,14 +10,13 @@ export declare class CheckoutCommands extends BaseCommand {
|
|
|
10
10
|
toggleBillingSameAsShipping(active?: boolean): Promise<void>;
|
|
11
11
|
toggleMarketingPreferences(fieldName: 'canEmail' | 'canSms', active?: boolean): Promise<void>;
|
|
12
12
|
getPaymentSession(): Promise<void>;
|
|
13
|
-
confirmPaymentSession(confirmationTokenId: string, setupIntentId: string): Promise<
|
|
13
|
+
confirmPaymentSession(confirmationTokenId: string, setupIntentId: string): Promise<ICheckoutPaymentMethodStore | null>;
|
|
14
14
|
applyPromoCode(code: string): Promise<void>;
|
|
15
15
|
removePromoCode(): Promise<void>;
|
|
16
16
|
clearPromoCodeError(): Promise<void>;
|
|
17
17
|
applyGiftCard(code: string): Promise<void>;
|
|
18
18
|
removeGiftCard(code: string): Promise<void>;
|
|
19
19
|
clearGiftCardError(): Promise<void>;
|
|
20
|
-
checkoutComplete(): Promise<void>;
|
|
21
20
|
openPresaleExpiredDrawer(): void;
|
|
22
21
|
rerenderCheckout(): void;
|
|
23
22
|
updateCheckoutItemQuantity(itemId: string, delta: number): Promise<void>;
|
|
@@ -45,6 +44,7 @@ export declare class CheckoutCommands extends BaseCommand {
|
|
|
45
44
|
setupIntentId: string;
|
|
46
45
|
};
|
|
47
46
|
}): Promise<void>;
|
|
47
|
+
checkoutComplete(): Promise<void>;
|
|
48
48
|
private updateStoreFromCheckoutResponse;
|
|
49
49
|
private partialLoadCheckout;
|
|
50
50
|
private dataForCheckoutPrepare;
|
|
@@ -4,44 +4,27 @@ export interface ICheckoutSendToFormComponentParams {
|
|
|
4
4
|
isIndependentComponent: boolean;
|
|
5
5
|
}
|
|
6
6
|
export declare class CheckoutPaymentComponent extends BaseComponent<ICheckoutSendToFormComponentParams, ICheckoutComponent> {
|
|
7
|
-
private
|
|
8
|
-
private
|
|
9
|
-
private isCreatingStripeForm;
|
|
7
|
+
private stripeHandlerElement;
|
|
8
|
+
private betaNoticeElement;
|
|
10
9
|
private saveButton;
|
|
11
10
|
private errorMessageElement;
|
|
12
|
-
private stripeFormContainer;
|
|
13
|
-
private stripeSummaryContainer;
|
|
14
11
|
private billingFormData;
|
|
15
12
|
private isValidBillingForm;
|
|
16
13
|
private isBillingSameAsShipping;
|
|
17
14
|
private stripeFormStatus;
|
|
18
|
-
private isSavingPayment;
|
|
19
|
-
private isInEditMode;
|
|
20
15
|
private savedCardInfo;
|
|
21
|
-
private
|
|
16
|
+
private showingStripeSummary;
|
|
17
|
+
private isSavingPayment;
|
|
22
18
|
get hostClasses(): string[];
|
|
23
19
|
constructor();
|
|
24
20
|
onStoreWatch(changes: IOnStoreChanged[]): void;
|
|
25
|
-
private handleSavingStateChange;
|
|
26
21
|
private handleBillingSameAsShippingChange;
|
|
27
|
-
private handleSavedCardChange;
|
|
28
|
-
private handleEditModeChange;
|
|
29
22
|
afterRender(): Promise<void>;
|
|
30
|
-
private setupStripeFormEventListeners;
|
|
31
|
-
private showStripeSummary;
|
|
32
|
-
private hideStripeSummary;
|
|
33
|
-
private showStripeForm;
|
|
34
|
-
private hideStripeForm;
|
|
35
|
-
private handleChangePayment;
|
|
36
23
|
private updateSaveButtonState;
|
|
37
24
|
private updateErrorMessage;
|
|
38
25
|
private showError;
|
|
39
26
|
protected template(): HTMLElement[];
|
|
40
27
|
private handleSaveButtonClick;
|
|
41
28
|
private validatePrerequisites;
|
|
42
|
-
private findRootComponent;
|
|
43
|
-
private removeExistingStripeForm;
|
|
44
|
-
private doStripeConfig;
|
|
45
|
-
private createAndMountStripeForm;
|
|
46
29
|
disconnected(): void;
|
|
47
30
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
|
|
2
|
+
import type { ICheckoutComponent } from '@/interfaces/configs';
|
|
3
|
+
import type { IStripeFormStatus } from '@/modules/checkout/components/checkout-stripe-form.component';
|
|
4
|
+
export interface ICheckoutStripeHandlerCallbacks {
|
|
5
|
+
onStripeFormStatusChanged?: (status: IStripeFormStatus) => void;
|
|
6
|
+
onSavedCardInfoChanged?: (cardInfo: {
|
|
7
|
+
brand?: string;
|
|
8
|
+
last4?: string;
|
|
9
|
+
} | null) => void;
|
|
10
|
+
onEditModeVisibilityChanged?: (showingSummary: boolean) => void;
|
|
11
|
+
onPaymentSessionConfirmed?: (confirmationTokenId: string, setupIntentId: string) => Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export interface ICheckoutStripeHandlerComponentParams {
|
|
14
|
+
isIndependentComponent: boolean;
|
|
15
|
+
callbacks?: ICheckoutStripeHandlerCallbacks;
|
|
16
|
+
}
|
|
17
|
+
export declare class CheckoutStripeHandlerComponent extends BaseComponent<ICheckoutStripeHandlerComponentParams, ICheckoutComponent> {
|
|
18
|
+
private stripeFormElement;
|
|
19
|
+
private rootComponent;
|
|
20
|
+
private isCreatingStripeForm;
|
|
21
|
+
private stripeFormContainer;
|
|
22
|
+
private stripeSummaryContainer;
|
|
23
|
+
private callbacks;
|
|
24
|
+
private stripeFormStatus;
|
|
25
|
+
private isInEditMode;
|
|
26
|
+
private savedCardInfo;
|
|
27
|
+
private isChangingPayment;
|
|
28
|
+
get hostClasses(): string[];
|
|
29
|
+
constructor();
|
|
30
|
+
beforeConnected(): void;
|
|
31
|
+
onStoreWatch(changes: IOnStoreChanged[]): void;
|
|
32
|
+
private handleSavedCardChange;
|
|
33
|
+
private handleEditModeChange;
|
|
34
|
+
private updateDisplayState;
|
|
35
|
+
afterRender(): Promise<void>;
|
|
36
|
+
private setupStripeFormEventListeners;
|
|
37
|
+
private showStripeSummary;
|
|
38
|
+
private hideStripeSummary;
|
|
39
|
+
private showStripeForm;
|
|
40
|
+
private hideStripeForm;
|
|
41
|
+
private handleChangePayment;
|
|
42
|
+
protected template(): HTMLElement[];
|
|
43
|
+
submitStripeForm(): void;
|
|
44
|
+
getStripeFormStatus(): IStripeFormStatus;
|
|
45
|
+
private findRootComponent;
|
|
46
|
+
private removeExistingStripeForm;
|
|
47
|
+
private doStripeConfig;
|
|
48
|
+
private createAndMountStripeForm;
|
|
49
|
+
disconnected(): void;
|
|
50
|
+
}
|
|
@@ -20,5 +20,6 @@ export * from './checkout-presale-expired.component';
|
|
|
20
20
|
export * from './checkout-promo-code.component';
|
|
21
21
|
export * from './checkout-send-as-gift.component';
|
|
22
22
|
export * from './checkout-stripe-form.component';
|
|
23
|
+
export * from './checkout-stripe-handler.component';
|
|
23
24
|
export * from './checkout-tips.component';
|
|
24
25
|
export * from './promo-pc-gc.component';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IProductFulfillmentStore } from '@/core/store/interfaces/product.interface';
|
|
2
2
|
import { type FulfillmentType } from '@/enums';
|
|
3
3
|
import type { IProductSizeAttributes } from '@/interfaces/cloud';
|
|
4
|
-
import {
|
|
4
|
+
import type { RetailerStatus } from '@/modules/product/utils/retailer-hours';
|
|
5
5
|
export declare function renderPopupRetailerCard({ fulfillment, selectedFulfillmentType, isSelected, fulfillmentStatus, selectedSizeAttributes, }: {
|
|
6
6
|
fulfillment: IProductFulfillmentStore;
|
|
7
7
|
selectedFulfillmentType: FulfillmentType;
|
package/package.json
CHANGED