@liquidcommerce/elements-sdk 2.6.0-beta.39 → 2.6.0-beta.40

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.
Files changed (20) hide show
  1. package/dist/index.checkout.esm.js +6878 -6825
  2. package/dist/index.esm.js +11428 -10987
  3. package/dist/types/constants/core.constant.d.ts +0 -4
  4. package/dist/types/enums/core.enum.d.ts +11 -0
  5. package/dist/types/interfaces/configs/product-list.interface.d.ts +2 -2
  6. package/dist/types/modules/address/address-input.component.d.ts +11 -0
  7. package/dist/types/modules/product-list/components/card-components/index.d.ts +3 -0
  8. package/dist/types/modules/product-list/components/card-components/product-badge.d.ts +8 -0
  9. package/dist/types/modules/product-list/components/card-components/product-fulfillments.d.ts +2 -0
  10. package/dist/types/modules/product-list/components/card-components/product-price-and-personalization.d.ts +13 -0
  11. package/dist/types/modules/product-list/components/card-components/product-title.d.ts +6 -0
  12. package/dist/types/modules/product-list/components/index.d.ts +1 -0
  13. package/dist/types/modules/product-list/components/product-list-engraving.component.d.ts +5 -1
  14. package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts +28 -0
  15. package/dist/types/modules/product-list/components/product-list-retailers.component.d.ts +10 -2
  16. package/dist/types/modules/product-list/product-list-card.component.d.ts +0 -5
  17. package/dist/types/modules/product-list/product-list.commands.d.ts +11 -2
  18. package/dist/types/modules/product-list/product-list.interface.d.ts +1 -0
  19. package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +11 -2
  20. package/package.json +1 -1
@@ -48,7 +48,3 @@ 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
- };
@@ -100,6 +100,7 @@ export declare const COMPONENT_TYPE: {
100
100
  readonly PRODUCT_LIST_CARD_LOADING: "product-list-card-loading";
101
101
  readonly PRODUCT_LIST_RETAILERS: "product-list-retailers";
102
102
  readonly PRODUCT_LIST_ENGRAVING_FORM: "product-list-engraving-form";
103
+ readonly PRODUCT_LIST_PRODUCT_PRE_CART: "product-list-product-pre-cart";
103
104
  readonly CART: "cart";
104
105
  readonly CART_RETAILER: "cart-retailer";
105
106
  readonly CART_ITEM: "cart-item";
@@ -172,3 +173,13 @@ export declare const CHECKOUT_EVENT_LEVEL: {
172
173
  readonly ERROR: "error";
173
174
  };
174
175
  export type CheckoutEventLevel = (typeof CHECKOUT_EVENT_LEVEL)[keyof typeof CHECKOUT_EVENT_LEVEL];
176
+ export declare const DISPLAY_MODE: {
177
+ readonly MODAL: "modal";
178
+ readonly DRAWER: "drawer";
179
+ };
180
+ export type DisplayModeType = (typeof DISPLAY_MODE)[keyof typeof DISPLAY_MODE];
181
+ export declare const NAVIGATION_SOURCE: {
182
+ readonly PRODUCT_CARD: "productCard";
183
+ readonly ADD_TO_CART_DRAWER: "addToCartDrawer";
184
+ };
185
+ export type NavigationSourceType = (typeof NAVIGATION_SOURCE)[keyof typeof NAVIGATION_SOURCE];
@@ -1,10 +1,10 @@
1
+ import type { DisplayModeType } from 'enums';
1
2
  import type { DeepPartial } from '@/interfaces/core.interface';
2
3
  export type ProductListCardStyle = 'card' | 'ghost';
3
4
  export type ProductListCardCornerRadius = 'rounded' | 'sharp';
4
5
  export interface IProductListTheme {
5
6
  backgroundColor: string;
6
7
  }
7
- export type IDisplayMode = 'modal' | 'drawer';
8
8
  export interface IProductListLayout {
9
9
  productCard: {
10
10
  style: ProductListCardStyle;
@@ -19,7 +19,7 @@ export interface IProductListLayout {
19
19
  showCollections: boolean;
20
20
  enablePersonalization: boolean;
21
21
  };
22
- displayMode: IDisplayMode;
22
+ displayMode: DisplayModeType;
23
23
  }
24
24
  export interface IProductListComponent {
25
25
  theme: IProductListTheme;
@@ -1,3 +1,7 @@
1
+ import type { IProductListProduct } from 'core/store/interfaces/product-list.interface';
2
+ import { type NavigationSourceType } from 'enums';
3
+ import type { IFulfillment } from 'interfaces/api/product.interface';
4
+ import type { IProductListComponent } from 'interfaces/configs';
1
5
  import { BaseComponent } from '@/core/base-component.service';
2
6
  import type { IAddressComponent } from '@/interfaces/configs';
3
7
  import type { IAddressOptions } from './address.interface';
@@ -5,6 +9,12 @@ export interface IAddressInputComponentParams {
5
9
  productId?: string;
6
10
  isIndependentComponent?: boolean;
7
11
  options?: IAddressOptions;
12
+ navigationSource?: NavigationSourceType;
13
+ product?: IProductListProduct;
14
+ shippingFulfillment?: IFulfillment | null;
15
+ onDemandFulfillment?: IFulfillment | null;
16
+ showCollections?: boolean;
17
+ config?: IProductListComponent;
8
18
  }
9
19
  export declare class AddressInputComponent extends BaseComponent<IAddressInputComponentParams, IAddressComponent> {
10
20
  private suggestions;
@@ -24,6 +34,7 @@ export declare class AddressInputComponent extends BaseComponent<IAddressInputCo
24
34
  private closeDrawer;
25
35
  private handleCancel;
26
36
  private handleCheckAvailability;
37
+ private reopenAddToCartDrawer;
27
38
  private handleSuggestionClick;
28
39
  private handleDocumentClick;
29
40
  private searchAddresses;
@@ -1,4 +1,7 @@
1
+ export * from './product-badge';
1
2
  export * from './product-button';
2
3
  export * from './product-fulfillments';
4
+ export * from './product-price-and-personalization';
3
5
  export * from './product-quantity-selector';
4
6
  export * from './product-sizes-list';
7
+ export * from './product-title';
@@ -0,0 +1,8 @@
1
+ export interface IBadgesParams {
2
+ badges: Array<{
3
+ text: string;
4
+ className?: string;
5
+ }>;
6
+ separatorText?: string;
7
+ }
8
+ export declare const createProductBadges: ({ badges, separatorText }: IBadgesParams) => HTMLElement;
@@ -1,10 +1,12 @@
1
1
  import type { IProductFulfillmentStore } from 'core/store/interfaces/product.interface';
2
+ import { type NavigationSourceType } from 'enums';
2
3
  export interface IFulfillmentSectionParams {
3
4
  shippingVariants: Record<string, IProductFulfillmentStore>;
4
5
  onDemandVariants: Record<string, IProductFulfillmentStore>;
5
6
  enableShippingFulfillment: boolean;
6
7
  enableOnDemandFulfillment: boolean;
7
8
  productId: string;
9
+ navigationSource?: NavigationSourceType;
8
10
  onDeliveryOptionsClick: (productId: string) => void | Promise<void>;
9
11
  }
10
12
  export declare const createFulfillmentSection: (params: IFulfillmentSectionParams) => HTMLElement;
@@ -0,0 +1,13 @@
1
+ export interface IPricePersonalizationSectionParams {
2
+ price: number;
3
+ showPrice: boolean;
4
+ hasPersonalization: boolean;
5
+ showPersonalization: boolean;
6
+ hasAddress: boolean;
7
+ wrapperClassName?: string;
8
+ priceClassName?: string;
9
+ personalizeClassName?: string;
10
+ personalizeText?: string;
11
+ onPersonalizeClick?: () => void;
12
+ }
13
+ export declare const createPricePersonalizationSection: ({ price, showPrice, hasPersonalization, showPersonalization, hasAddress, wrapperClassName, priceClassName, personalizeClassName, personalizeText, onPersonalizeClick, }: IPricePersonalizationSectionParams) => HTMLElement | null;
@@ -0,0 +1,6 @@
1
+ export interface ITitleSectionParams {
2
+ name: string;
3
+ productUrl?: string | null;
4
+ onTitleClick?: () => void;
5
+ }
6
+ export declare const createProductTitle: ({ name, productUrl, onTitleClick }: ITitleSectionParams) => HTMLElement;
@@ -4,5 +4,6 @@ export * from './filter-components/product-list-apply-filter-button';
4
4
  export * from './product-list-card-loading.component';
5
5
  export * from './product-list-engraving.component';
6
6
  export * from './product-list-filters.component';
7
+ export * from './product-list-product-pre-cart.component';
7
8
  export * from './product-list-retailers.component';
8
9
  export * from './product-list-search.component';
@@ -1,6 +1,10 @@
1
1
  import { BaseComponent } from 'core/base-component.service';
2
2
  import type { IEngravingFormComponentParams } from 'modules/ui-components/engraving';
3
3
  export declare class ProductListEngravingComponent extends BaseComponent<IEngravingFormComponentParams> {
4
- protected template(): HTMLElement;
4
+ protected template(): HTMLElement[];
5
5
  private createHeader;
6
+ private handleClose;
7
+ private handleEngravingComplete;
8
+ private handleEngravingCancel;
9
+ private reopenAddToCartDrawer;
6
10
  }
@@ -0,0 +1,28 @@
1
+ import { BaseComponent } from 'core/base-component.service';
2
+ import type { IProductListProduct } from 'core/store/interfaces/product-list.interface';
3
+ import { type DisplayModeType } from 'enums';
4
+ import type { IFulfillment } from 'interfaces/api/product.interface';
5
+ import type { IProductListComponent } from 'interfaces/configs';
6
+ export interface IProductListProductPreCartComponentParams {
7
+ displayMode: DisplayModeType;
8
+ product: IProductListProduct;
9
+ shippingFulfillment: IFulfillment | null;
10
+ onDemandFulfillment: IFulfillment | null;
11
+ config: IProductListComponent;
12
+ }
13
+ export declare class ProductListProductPreCartComponent extends BaseComponent<IProductListProductPreCartComponentParams, IProductListComponent> {
14
+ private selectedSize;
15
+ constructor();
16
+ protected template(): HTMLElement[];
17
+ private createCartHeader;
18
+ private createImageSection;
19
+ private createPricePersonalizationSection;
20
+ private createDeliversToSection;
21
+ private createSizesSection;
22
+ private handleDeliveryOptionsClick;
23
+ private createFulfillmentSectionWrapper;
24
+ createFulfillmentTextSection(selectedFulfillmentType: string, selectedFulfillmentRetailerName: string): HTMLElement;
25
+ private createAddToCartSection;
26
+ private handleAddToCart;
27
+ private createExpectationArrivalInfoSection;
28
+ }
@@ -1,9 +1,16 @@
1
- import type { IDisplayMode, IProductListComponent } from 'interfaces/configs';
1
+ import type { IProductListProduct } from 'core/store/interfaces/product-list.interface';
2
+ import { type DisplayModeType, type NavigationSourceType } from 'enums';
3
+ import type { IFulfillment } from 'interfaces/api/product.interface';
4
+ import type { IProductListComponent } from 'interfaces/configs';
2
5
  import { BaseComponent } from '@/core/base-component.service';
3
6
  export interface IProductListRetailersParams {
7
+ product?: IProductListProduct;
4
8
  productId: string;
5
9
  config?: IProductListComponent;
6
- displayMode?: IDisplayMode;
10
+ displayMode?: DisplayModeType;
11
+ navigationSource?: NavigationSourceType;
12
+ shippingFulfillment?: IFulfillment | null;
13
+ onDemandFulfillment?: IFulfillment | null;
7
14
  }
8
15
  export declare class ProductListRetailersComponent extends BaseComponent<IProductListRetailersParams, IProductListComponent> {
9
16
  get hostClasses(): string[];
@@ -13,6 +20,7 @@ export declare class ProductListRetailersComponent extends BaseComponent<IProduc
13
20
  private extractFulfillments;
14
21
  private onFulfillmentTabClick;
15
22
  private onRetailerCardClick;
23
+ private reopenAddToCartDrawer;
16
24
  private createHeader;
17
25
  private createNoAvailabilityMessage;
18
26
  }
@@ -16,16 +16,11 @@ export declare class ProductListCardComponent extends BaseComponent<IProductList
16
16
  protected connected(): Promise<void>;
17
17
  disconnected(): void;
18
18
  private reRender;
19
- private getAvailabilityData;
20
- private isPresaleActive;
21
- private handleAddToCart;
22
19
  protected template(): HTMLElement[];
23
20
  private generateProductUrl;
24
21
  private createVariantStandard;
25
22
  private createImageSection;
26
23
  private createContentSection;
27
- private createBadgesSection;
28
- private createTitleSection;
29
24
  private createPricePersonalizationSection;
30
25
  private createSizesSection;
31
26
  private handleDeliveryOptionsClick;
@@ -1,12 +1,13 @@
1
1
  import type { IModalContentConfig } from 'core/store/interfaces/core.interface';
2
+ import type { IProductSizeStore } from 'core/store/interfaces/product.interface';
2
3
  import type { IProductListProduct, IProductListStore } from 'core/store/interfaces/product-list.interface';
3
4
  import { BaseCommand } from '@/core/command/base-command.service';
4
5
  import { type FulfillmentType } from '@/enums';
5
- import type { IProduct, IRetailer } from '@/interfaces/api/product.interface';
6
+ import type { IFulfillment, IProduct, IProductSizeAttributes, IRetailer } from '@/interfaces/api/product.interface';
6
7
  import type { IFilterSchema, INavigationResponse, IProductSearchParams, IProductSearchResponse } from '@/interfaces/api/product-list.interface';
7
8
  import type { ProductListFilterType } from '@/interfaces/core.interface';
8
9
  import { type AddItemParams } from '@/modules/cart/cart.commands';
9
- import type { IExtendedFilterSchema, IPagination, IProductListFilters } from './product-list.interface';
10
+ import type { IExtendedFilterSchema, IPagination, IProductAvailabilityData, IProductListFilters } from './product-list.interface';
10
11
  type StateListener = (state: IProductListStore) => void;
11
12
  export declare class ProductListCommands extends BaseCommand {
12
13
  private readonly uiCommands;
@@ -63,5 +64,13 @@ export declare class ProductListCommands extends BaseCommand {
63
64
  selectSize: (productId: string, sizeId: string) => Promise<void>;
64
65
  private getFulfillmentForSize;
65
66
  updateQuantity: (productId: string, quantity: number) => void;
67
+ getAvailabilityData(params: {
68
+ product: IProductListProduct;
69
+ size?: IProductSizeStore;
70
+ shippingFulfillment?: IFulfillment | null;
71
+ onDemandFulfillment?: IFulfillment | null;
72
+ state?: string;
73
+ }): IProductAvailabilityData;
74
+ isPresaleActive(sizeAttributes: IProductSizeAttributes): boolean;
66
75
  }
67
76
  export {};
@@ -70,6 +70,7 @@ export interface IProductAvailabilityData {
70
70
  state: string;
71
71
  isPresale: boolean;
72
72
  isPresaleActive: boolean;
73
+ presaleShipBy: string | null;
73
74
  }
74
75
  export interface IProductVariantParams {
75
76
  image: string;
@@ -1,5 +1,8 @@
1
+ import type { IProductListProduct } from 'core/store/interfaces/product-list.interface';
2
+ import type { IFulfillment } from 'interfaces/api/product.interface';
1
3
  import { BaseComponent } from '@/core/base-component.service';
2
- import type { IDisplayMode } from '@/interfaces/configs';
4
+ import { type DisplayModeType, type NavigationSourceType } from '@/enums';
5
+ import type { IProductListComponent } from '@/interfaces/configs';
3
6
  export interface IEngravingFormComponentParams {
4
7
  identifier: string;
5
8
  context: 'product' | 'cart' | 'product-list';
@@ -8,7 +11,13 @@ export interface IEngravingFormComponentParams {
8
11
  maxCharsPerLine: number;
9
12
  fee: number;
10
13
  location?: string;
11
- displayMode?: IDisplayMode;
14
+ displayMode?: DisplayModeType;
15
+ navigationSource?: NavigationSourceType;
16
+ product?: IProductListProduct;
17
+ shippingFulfillment?: IFulfillment | null;
18
+ onDemandFulfillment?: IFulfillment | null;
19
+ showCollections?: boolean;
20
+ config?: IProductListComponent;
12
21
  }
13
22
  export declare class EngravingFormComponent extends BaseComponent<IEngravingFormComponentParams, null> {
14
23
  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.39",
6
+ "version": "2.6.0-beta.40",
7
7
  "homepage": "https://docs.liquidcommerce.co/elements-sdk",
8
8
  "repository": {
9
9
  "type": "git",