@liquidcommerce/elements-sdk 2.6.0-beta.35 → 2.6.0-beta.36
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.checkout.esm.js +16038 -0
- package/dist/index.esm.js +8984 -8963
- package/dist/types/auto-initialize/shared-utils.d.ts +5 -2
- package/dist/types/clients/checkout.d.ts +4 -16
- package/dist/types/core/client/actions/client-checkout-action.service.d.ts +2 -0
- package/dist/types/interfaces/core.interface.d.ts +7 -1
- package/dist/types/modules/checkout/checkout.component.d.ts +2 -3
- package/package.json +2 -6
- package/umd/elements-checkout.js +0 -1
- package/umd/elements.js +0 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import type { IInjectedComponent, ILiquidCommerceElementsDevelopmentConfig } from '@/interfaces/core.interface';
|
|
1
|
+
import type { IInjectCheckoutParams, IInjectedComponent, ILiquidCommerceElementsDevelopmentConfig } from '@/interfaces/core.interface';
|
|
2
2
|
export declare const SHARED_ATTR: {
|
|
3
3
|
readonly SCRIPT: {
|
|
4
4
|
readonly CHECKOUT_PARAM: "data-checkout-param";
|
|
5
5
|
};
|
|
6
6
|
readonly ELEMENT: {
|
|
7
7
|
readonly CHECKOUT: "data-lce-checkout";
|
|
8
|
+
readonly HIDE_HEADER: "hide-header";
|
|
9
|
+
readonly EXIT_CHECKOUT: "data-lce-exit-checkout";
|
|
8
10
|
};
|
|
9
11
|
readonly JSON_SCRIPT: {
|
|
10
12
|
readonly DEVELOPMENT: "data-liquid-commerce-elements-development";
|
|
@@ -13,7 +15,8 @@ export declare const SHARED_ATTR: {
|
|
|
13
15
|
export declare function startsWithLcePrefix(value: string | null): boolean;
|
|
14
16
|
export declare function getDevelopmentConfigs(): ILiquidCommerceElementsDevelopmentConfig | undefined;
|
|
15
17
|
export declare function triggerAutoInit(initFunction: () => Promise<void>, errorPrefix: string): void;
|
|
16
|
-
export declare function setupCheckout(script: HTMLScriptElement, injectFn: (
|
|
18
|
+
export declare function setupCheckout(script: HTMLScriptElement, injectFn: (params: IInjectCheckoutParams) => Promise<IInjectedComponent | null>, exitCheckoutFn: () => void, options: {
|
|
17
19
|
requireCheckoutId?: boolean;
|
|
18
20
|
errorPrefix: string;
|
|
19
21
|
}): Promise<void>;
|
|
22
|
+
export declare function setupExitCheckoutHandlers(exitCheckoutFn: () => void): void;
|
|
@@ -1,23 +1,11 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { IInjectedComponent, ILiquidCommerceElementsCheckoutClientConfig } from '@/interfaces/core.interface';
|
|
1
|
+
import { type ICheckoutActions } from '@/core/client/actions/client-checkout-action.service';
|
|
2
|
+
import type { IInjectCheckoutParams, IInjectedComponent, ILiquidCommerceElementsCheckoutClientConfig } from '@/interfaces/core.interface';
|
|
3
3
|
import '@/modules/theme-provider/styles/register-styles';
|
|
4
4
|
import '@/modules/checkout/styles/register-styles';
|
|
5
|
-
|
|
6
|
-
export interface IElementsCheckoutActions {
|
|
7
|
-
applyPromoCode: (promoCode: string) => Promise<void>;
|
|
8
|
-
removePromoCode: () => Promise<void>;
|
|
9
|
-
applyGiftCard: (code: string) => Promise<void>;
|
|
10
|
-
removeGiftCard: (code: string) => Promise<void>;
|
|
11
|
-
toggleIsGift: (active?: boolean) => Promise<void>;
|
|
12
|
-
toggleBillingSameAsShipping: (active?: boolean) => Promise<void>;
|
|
13
|
-
toggleMarketingPreferences: (field: 'canEmail' | 'canSms', active: boolean) => Promise<void>;
|
|
14
|
-
updateCustomerInfo: (params: Record<CustomerFieldName, string>) => void;
|
|
15
|
-
updateBillingInfo: (params: Record<BillingFieldName, string>) => void;
|
|
16
|
-
updateGiftInfo: (params: Record<GiftFieldName, string>) => void;
|
|
17
|
-
getDetails: () => ICheckoutDetailsEventData;
|
|
5
|
+
export interface IElementsCheckoutActions extends Omit<ICheckoutActions, 'openCheckout' | 'closeCheckout' | 'toggleCheckout'> {
|
|
18
6
|
}
|
|
19
7
|
export interface IElementsCheckoutClient {
|
|
20
|
-
injectCheckout: (
|
|
8
|
+
injectCheckout: (params: IInjectCheckoutParams) => Promise<IInjectedComponent | null>;
|
|
21
9
|
actions: {
|
|
22
10
|
checkout: IElementsCheckoutActions;
|
|
23
11
|
};
|
|
@@ -6,6 +6,7 @@ export interface ICheckoutActions {
|
|
|
6
6
|
openCheckout: () => void;
|
|
7
7
|
closeCheckout: () => void;
|
|
8
8
|
toggleCheckout: () => void;
|
|
9
|
+
exitCheckout: () => void;
|
|
9
10
|
addProduct: (params: IAddProductParams[], openCheckout?: boolean) => Promise<void>;
|
|
10
11
|
applyPromoCode: (promoCode: string) => Promise<void>;
|
|
11
12
|
removePromoCode: () => Promise<void>;
|
|
@@ -33,6 +34,7 @@ export declare class ClientCheckoutActionService extends BaseActionService {
|
|
|
33
34
|
private openCheckout;
|
|
34
35
|
private closeCheckout;
|
|
35
36
|
private toggleCheckout;
|
|
37
|
+
private exitCheckout;
|
|
36
38
|
private addProduct;
|
|
37
39
|
private applyPromoCode;
|
|
38
40
|
private removePromoCode;
|
|
@@ -85,6 +85,12 @@ export interface IProcessInjectElementParams {
|
|
|
85
85
|
identifier?: string;
|
|
86
86
|
options?: IAddressOptions;
|
|
87
87
|
checkoutId?: string;
|
|
88
|
+
hideHeader?: boolean;
|
|
89
|
+
}
|
|
90
|
+
export interface IInjectCheckoutParams {
|
|
91
|
+
containerId: string;
|
|
92
|
+
checkoutId?: string;
|
|
93
|
+
hideHeader?: boolean;
|
|
88
94
|
}
|
|
89
95
|
export interface ILiquidCommerceElementsUIMethod {
|
|
90
96
|
cartButton(containerId: string, showItemsCount?: boolean): void;
|
|
@@ -121,7 +127,7 @@ export interface ILiquidCommerceElementsClient {
|
|
|
121
127
|
injectProductElement(params: IInjectProductElement[]): Promise<IInjectedComponent[]>;
|
|
122
128
|
injectAddressElement(containerId: string, options?: IAddressOptions): Promise<IInjectedComponent | null>;
|
|
123
129
|
injectCartElement(containerId: string): Promise<IInjectedComponent | null>;
|
|
124
|
-
injectCheckoutElement(
|
|
130
|
+
injectCheckoutElement(params: IInjectCheckoutParams): Promise<IInjectedComponent | null>;
|
|
125
131
|
injectProductList(params: IInjectProductListParams): Promise<void>;
|
|
126
132
|
injectProductListSearch(params: IInjectProductListSearchParams): Promise<void>;
|
|
127
133
|
injectProductListFilters(params: IInjectProductListFiltersParams): Promise<void>;
|
|
@@ -3,11 +3,10 @@ import type { ICheckoutComponent } from '@/interfaces/configs';
|
|
|
3
3
|
export interface ICheckoutComponentParams {
|
|
4
4
|
checkoutId: string;
|
|
5
5
|
isIndependentComponent: boolean;
|
|
6
|
+
hideHeader: boolean;
|
|
6
7
|
}
|
|
7
8
|
export declare class CheckoutComponent extends BaseComponent<ICheckoutComponentParams, ICheckoutComponent> {
|
|
8
9
|
constructor();
|
|
9
10
|
protected template(): HTMLElement[];
|
|
10
|
-
private
|
|
11
|
-
private checkForActiveTickers;
|
|
12
|
-
private createHeaderWrapper;
|
|
11
|
+
private createHeader;
|
|
13
12
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "LiquidCommerce Elements SDK",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"author": "LiquidCommerce Team",
|
|
6
|
-
"version": "2.6.0-beta.
|
|
6
|
+
"version": "2.6.0-beta.36",
|
|
7
7
|
"homepage": "https://docs.liquidcommerce.co/elements-sdk",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -13,27 +13,23 @@
|
|
|
13
13
|
"url": "https://github.com/liquidcommerce/elements-sdk/issues"
|
|
14
14
|
},
|
|
15
15
|
"module": "./dist/index.esm.js",
|
|
16
|
-
"browser": "./umd/elements.js",
|
|
17
16
|
"types": "./dist/types/index.d.ts",
|
|
18
17
|
"packageManager": "pnpm@10.0.0",
|
|
19
18
|
"exports": {
|
|
20
19
|
".": {
|
|
21
20
|
"types": "./dist/types/index.d.ts",
|
|
22
21
|
"import": "./dist/index.esm.js",
|
|
23
|
-
"browser": "./umd/elements.js",
|
|
24
22
|
"default": "./dist/index.esm.js"
|
|
25
23
|
},
|
|
26
24
|
"./checkout": {
|
|
27
25
|
"types": "./dist/types/index.checkout.d.ts",
|
|
28
26
|
"import": "./dist/index.checkout.esm.js",
|
|
29
|
-
"browser": "./umd/elements-checkout.js",
|
|
30
27
|
"default": "./dist/index.checkout.esm.js"
|
|
31
28
|
},
|
|
32
29
|
"./package.json": "./package.json"
|
|
33
30
|
},
|
|
34
31
|
"files": [
|
|
35
32
|
"dist",
|
|
36
|
-
"umd",
|
|
37
33
|
"docs",
|
|
38
34
|
"README.md",
|
|
39
35
|
"LICENSE"
|
|
@@ -81,7 +77,7 @@
|
|
|
81
77
|
"embeddable commerce"
|
|
82
78
|
],
|
|
83
79
|
"devDependencies": {
|
|
84
|
-
"@biomejs/biome": "2.3.
|
|
80
|
+
"@biomejs/biome": "2.3.12",
|
|
85
81
|
"@commitlint/cli": "^20.3.1",
|
|
86
82
|
"@commitlint/config-conventional": "^20.3.1",
|
|
87
83
|
"@rollup/plugin-alias": "^6.0.0",
|