@liquidcommerce/elements-sdk 2.6.0-beta.35 → 2.6.0-beta.37

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.
@@ -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: (containerId: string, checkoutId?: string) => Promise<IInjectedComponent | null>, options: {
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 { ICheckoutDetailsEventData } from '@/core/pubsub/interfaces/checkout.interface';
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
- import type { BillingFieldName, CustomerFieldName, GiftFieldName } from '@/modules/checkout/constant';
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: (containerId: string, checkoutId?: string) => Promise<IInjectedComponent | null>;
8
+ injectCheckout: (params: IInjectCheckoutParams) => Promise<IInjectedComponent | null>;
21
9
  actions: {
22
10
  checkout: IElementsCheckoutActions;
23
11
  };
@@ -48,3 +48,7 @@ export declare const Z_INDEX: {
48
48
  readonly MODAL: 2147483640;
49
49
  };
50
50
  export declare const DESKTOP_BREAKPOINT = 1024;
51
+ export declare const DISPLAY_MODE: {
52
+ MODAL: string;
53
+ DRAWER: string;
54
+ };
@@ -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;
@@ -2,7 +2,6 @@ import type { IPagination } from 'modules/product-list/product-list.interface';
2
2
  import type { FulfillmentType } from '@/enums';
3
3
  import type { IFulfillment, IProduct, IProductVariant, IRetailer, IRetailerAddress } from '@/interfaces/api/product.interface';
4
4
  import type { IFilterSchema } from '@/interfaces/api/product-list.interface';
5
- import type { IModalStore } from './core.interface';
6
5
  import type { IProductSizeStore } from './product.interface';
7
6
  export type IProductFulfillmentStore = IFulfillment & {
8
7
  retailerName: string;
@@ -40,7 +39,6 @@ export interface IProductListStore {
40
39
  selectedFulfillmentType: FulfillmentType;
41
40
  selectedFulfillment: IProductFulfillmentStore | null;
42
41
  selectedQuantity: number;
43
- modal: IModalStore;
44
42
  };
45
43
  };
46
44
  loading: boolean;
@@ -4,6 +4,7 @@ export type ProductListCardCornerRadius = 'rounded' | 'sharp';
4
4
  export interface IProductListTheme {
5
5
  backgroundColor: string;
6
6
  }
7
+ export type IDisplayMode = 'modal' | 'drawer';
7
8
  export interface IProductListLayout {
8
9
  productCard: {
9
10
  style: ProductListCardStyle;
@@ -18,6 +19,7 @@ export interface IProductListLayout {
18
19
  showCollections: boolean;
19
20
  enablePersonalization: boolean;
20
21
  };
22
+ displayMode: IDisplayMode;
21
23
  }
22
24
  export interface IProductListComponent {
23
25
  theme: IProductListTheme;
@@ -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(containerId: string, checkoutId?: string): Promise<IInjectedComponent | null>;
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 getPromoTickerData;
11
- private checkForActiveTickers;
12
- private createHeaderWrapper;
11
+ private createHeader;
13
12
  }
@@ -1,6 +1,7 @@
1
+ import type { IProductListComponent } from 'interfaces/configs';
1
2
  import { BaseComponent } from '@/core/base-component.service';
2
3
  import type { IProductListComponentParams } from '@/modules/product-list/product-list.component';
3
- export declare class ProductListCardLoadingComponent extends BaseComponent<IProductListComponentParams> {
4
+ export declare class ProductListCardLoadingComponent extends BaseComponent<IProductListComponentParams, IProductListComponent> {
4
5
  get hostClasses(): string[];
5
6
  private createSkeletonCard;
6
7
  protected template(): HTMLElement[];
@@ -1,8 +1,9 @@
1
- import type { IProductListComponent } from 'interfaces/configs';
1
+ import type { IDisplayMode, IProductListComponent } from 'interfaces/configs';
2
2
  import { BaseComponent } from '@/core/base-component.service';
3
3
  export interface IProductListRetailersParams {
4
4
  productId: string;
5
5
  config?: IProductListComponent;
6
+ displayMode?: IDisplayMode;
6
7
  }
7
8
  export declare class ProductListRetailersComponent extends BaseComponent<IProductListRetailersParams, IProductListComponent> {
8
9
  get hostClasses(): string[];
@@ -1,3 +1,4 @@
1
+ import type { IProductListComponent } from 'interfaces/configs';
1
2
  import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
2
3
  import type { ProductListFilterType } from '@/interfaces/core.interface';
3
4
  export interface IProductListComponentParams {
@@ -6,7 +7,7 @@ export interface IProductListComponentParams {
6
7
  filters: ProductListFilterType[];
7
8
  productUrl?: string;
8
9
  }
9
- export declare class ProductListComponent extends BaseComponent<IProductListComponentParams> {
10
+ export declare class ProductListComponent extends BaseComponent<IProductListComponentParams, IProductListComponent> {
10
11
  private products;
11
12
  private retailers;
12
13
  private pagination;
@@ -1,4 +1,5 @@
1
1
  import { BaseComponent } from '@/core/base-component.service';
2
+ import type { IDisplayMode } from '@/interfaces/configs';
2
3
  export interface IEngravingFormComponentParams {
3
4
  identifier: string;
4
5
  context: 'product' | 'cart' | 'product-list';
@@ -7,6 +8,7 @@ export interface IEngravingFormComponentParams {
7
8
  maxCharsPerLine: number;
8
9
  fee: number;
9
10
  location?: string;
11
+ displayMode?: IDisplayMode;
10
12
  }
11
13
  export declare class EngravingFormComponent extends BaseComponent<IEngravingFormComponentParams, null> {
12
14
  get hostClasses(): string[];
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.35",
6
+ "version": "2.6.0-beta.37",
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.11",
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",