@liquidcommerce/elements-sdk 2.7.2 → 2.7.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.
Files changed (111) hide show
  1. package/README.md +1 -1
  2. package/dist/index.checkout.esm.js +7345 -7451
  3. package/dist/index.esm.js +12318 -12512
  4. package/dist/ssr-stub.checkout.esm.js +18 -0
  5. package/dist/ssr-stub.esm.js +270 -0
  6. package/dist/types/auto-initialize/shared-utils.d.ts +3 -1
  7. package/dist/types/clients/base.d.ts +7 -4
  8. package/dist/types/clients/builder.d.ts +2 -1
  9. package/dist/types/clients/checkout.d.ts +2 -10
  10. package/dist/types/clients/helpers.d.ts +1 -1
  11. package/dist/types/clients/main.d.ts +2 -1
  12. package/dist/types/constants/core.constant.d.ts +0 -6
  13. package/dist/types/core/api/api-client.service.d.ts +16 -15
  14. package/dist/types/core/api/api-result.d.ts +19 -0
  15. package/dist/types/core/api/auth-client.service.d.ts +13 -5
  16. package/dist/types/core/client/client-action.service.d.ts +1 -1
  17. package/dist/types/core/client/client-config.service.d.ts +1 -1
  18. package/dist/types/core/pubsub/pubsub.service.d.ts +0 -2
  19. package/dist/types/core/singleton-manager.service.d.ts +12 -8
  20. package/dist/types/core/store/interfaces/core.interface.d.ts +8 -12
  21. package/dist/types/core/store/interfaces/product-list.interface.d.ts +12 -28
  22. package/dist/types/core/store/store.constant.d.ts +2 -1
  23. package/dist/types/core/store/store.service.d.ts +1 -0
  24. package/dist/types/core/telemetry/telemetry.service.d.ts +1 -0
  25. package/dist/types/enums/core.enum.d.ts +5 -4
  26. package/dist/types/index.checkout.d.ts +3 -2
  27. package/dist/types/index.checkout.umd.d.ts +1 -1
  28. package/dist/types/index.d.ts +4 -1
  29. package/dist/types/interfaces/api/product-list.interface.d.ts +2 -1
  30. package/dist/types/interfaces/client.interface.d.ts +72 -0
  31. package/dist/types/interfaces/component.interface.d.ts +7 -0
  32. package/dist/types/interfaces/config.interface.d.ts +46 -0
  33. package/dist/types/interfaces/configs/address.interface.d.ts +1 -1
  34. package/dist/types/interfaces/configs/cart.interface.d.ts +1 -1
  35. package/dist/types/interfaces/configs/checkout.interface.d.ts +1 -1
  36. package/dist/types/interfaces/configs/global.interface.d.ts +2 -2
  37. package/dist/types/interfaces/configs/product-list.interface.d.ts +34 -20
  38. package/dist/types/interfaces/configs/product.interface.d.ts +1 -1
  39. package/dist/types/interfaces/injection.interface.d.ts +47 -0
  40. package/dist/types/modules/address/address-input.component.d.ts +0 -11
  41. package/dist/types/modules/address/address.command.d.ts +1 -1
  42. package/dist/types/modules/checkout/components/checkout-completed.component.d.ts +1 -0
  43. package/dist/types/modules/product/components/product-image-carousel.component.d.ts +3 -0
  44. package/dist/types/modules/product/components/product-retailers-carousel.component.d.ts +3 -0
  45. package/dist/types/modules/product/components/product-retailers-popup-list.component.d.ts +5 -2
  46. package/dist/types/modules/product/product.commands.d.ts +1 -3
  47. package/dist/types/modules/product-list/components/card-components/index.d.ts +0 -2
  48. package/dist/types/modules/product-list/components/card-components/product-badge.d.ts +1 -0
  49. package/dist/types/modules/product-list/components/card-components/product-button.d.ts +1 -3
  50. package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts +3 -4
  51. package/dist/types/modules/product-list/components/card-components/product-sizes-list.d.ts +9 -5
  52. package/dist/types/modules/product-list/components/filter-components/product-list-toggle-filters.d.ts +0 -6
  53. package/dist/types/modules/product-list/components/index.d.ts +1 -1
  54. package/dist/types/modules/product-list/components/product-list-engraving.component.d.ts +7 -5
  55. package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +4 -5
  56. package/dist/types/modules/product-list/components/product-list-product-engraving-lines.component.d.ts +22 -0
  57. package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts +32 -14
  58. package/dist/types/modules/product-list/components/product-list-search.component.d.ts +4 -3
  59. package/dist/types/modules/product-list/product-list-card.component.d.ts +20 -16
  60. package/dist/types/modules/product-list/product-list-filter.utils.d.ts +8 -0
  61. package/dist/types/modules/product-list/product-list.commands.d.ts +16 -62
  62. package/dist/types/modules/product-list/product-list.component.d.ts +3 -11
  63. package/dist/types/modules/product-list/product-list.constants.d.ts +0 -1
  64. package/dist/types/modules/product-list/product-list.interface.d.ts +0 -30
  65. package/dist/types/modules/ui-components/drawer/drawer.component.d.ts +1 -0
  66. package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +2 -10
  67. package/dist/types/modules/ui-components/engraving/engraving-view.component.d.ts +5 -1
  68. package/dist/types/modules/ui-components/promo-code-ticker/promo-code-ticker.component.d.ts +1 -1
  69. package/dist/types/modules/ui-components/ui.commands.d.ts +6 -4
  70. package/dist/types/ssr/stub.checkout.d.ts +6 -0
  71. package/dist/types/ssr/stub.d.ts +10 -0
  72. package/dist/types/utils/product-selection.d.ts +16 -0
  73. package/dist/types/utils/product.d.ts +10 -0
  74. package/docs/v1/README.md +2 -2
  75. package/docs/v1/api/actions/address-actions.md +11 -11
  76. package/docs/v1/api/actions/cart-actions.md +13 -13
  77. package/docs/v1/api/actions/checkout-actions.md +23 -23
  78. package/docs/v1/api/actions/product-actions.md +6 -6
  79. package/docs/v1/api/client.md +11 -11
  80. package/docs/v1/api/ui-helpers.md +11 -11
  81. package/docs/v1/examples/advanced-patterns.md +1 -1
  82. package/docs/v1/examples/checkout-flow.md +1 -1
  83. package/docs/v1/getting-started/concepts.md +7 -7
  84. package/docs/v1/getting-started/installation.md +2 -2
  85. package/docs/v1/getting-started/quick-start.md +3 -3
  86. package/docs/v1/guides/address-component.md +11 -11
  87. package/docs/v1/guides/best-practices.md +14 -14
  88. package/docs/v1/guides/cart-component.md +23 -23
  89. package/docs/v1/guides/checkout-component.md +24 -24
  90. package/docs/v1/guides/product-component.md +5 -5
  91. package/docs/v1/integration/nextjs.md +11 -2
  92. package/docs/v1/integration/react.md +3 -3
  93. package/docs/v1/integration/vanilla-js.md +1 -1
  94. package/docs/v1/integration/vue.md +24 -0
  95. package/docs/v1/reference/error-handling.md +2 -2
  96. package/docs/v1/reference/troubleshooting.md +10 -2
  97. package/package.json +17 -13
  98. package/dist/types/interfaces/core.interface.d.ts +0 -140
  99. package/dist/types/modules/product-list/components/card-components/product-fulfillments.d.ts +0 -12
  100. package/dist/types/modules/product-list/components/card-components/product-title.d.ts +0 -6
  101. package/dist/types/modules/product-list/components/product-list-retailers.component.d.ts +0 -26
  102. package/dist/types/modules/ui-components/modal/modal.component.d.ts +0 -23
  103. package/dist/types/modules/ui-components/styles/modal.style.d.ts +0 -1
  104. package/docs/gitbook/actions.md +0 -964
  105. package/docs/gitbook/address.md +0 -48
  106. package/docs/gitbook/cart.md +0 -65
  107. package/docs/gitbook/checkout.md +0 -131
  108. package/docs/gitbook/events.md +0 -1765
  109. package/docs/gitbook/overview.md +0 -166
  110. package/docs/gitbook/product.md +0 -64
  111. package/docs/gitbook/quick-start-guide.md +0 -393
@@ -1,45 +1,29 @@
1
1
  import type { IPagination } from 'modules/product-list/product-list.interface';
2
2
  import type { FulfillmentType } from '@/enums';
3
- import type { IFulfillment, IProduct, IProductVariant, IRetailer, IRetailerAddress } from '@/interfaces/api/product.interface';
3
+ import type { IProduct } from '@/interfaces/api/product.interface';
4
4
  import type { IFilterSchema } from '@/interfaces/api/product-list.interface';
5
- import type { IProductSizeStore } from './product.interface';
6
- export type IProductFulfillmentStore = IFulfillment & {
7
- retailerName: string;
8
- retailerAddress: IRetailerAddress;
9
- retailerAddressFormatted: string;
10
- variant: IProductVariant;
11
- image: string | null;
12
- };
13
- export interface IProductList extends IProduct {
5
+ import type { IProductFulfillmentStore, IProductSizeStore } from './product.interface';
6
+ export interface IPLProductStore extends Omit<IProduct, 'sizes'> {
7
+ id: string;
8
+ sizes: Record<string, IProductSizeStore>;
14
9
  quantity: number;
15
10
  selectedSizeId: string | null;
16
11
  selectedFulfillmentType: FulfillmentType;
17
12
  selectedFulfillmentId: string | null;
18
13
  selectedFulfillment: IProductFulfillmentStore | null;
14
+ engravingLines: string[];
19
15
  productHasAvailability: boolean;
20
16
  fulfillmentHasAvailability: boolean;
21
- }
22
- export interface IProductListProduct extends Omit<IProduct, 'sizes'> {
23
- sizes: Record<string, IProductSizeStore>;
17
+ loading: boolean;
18
+ updating: boolean;
24
19
  }
25
20
  export interface IProductListStore {
26
- products: IProductListProduct[];
27
- retailers: Record<string, IRetailer>;
21
+ products: Record<string, IPLProductStore>;
22
+ appliedFilters: Record<string, string[]>;
28
23
  filters: IFilterSchema[];
29
24
  pagination: IPagination;
30
- appliedFilters: Record<string, string[]>;
31
25
  searchTerm: string;
32
- gridConfig?: {
33
- rows: number;
34
- columns: number;
35
- };
36
- userProducts: {
37
- [productId: string]: {
38
- selectedSizeId: string;
39
- selectedFulfillmentType: FulfillmentType;
40
- selectedFulfillment: IProductFulfillmentStore | null;
41
- selectedQuantity: number;
42
- };
43
- };
26
+ rows: number;
27
+ columns: number;
44
28
  loading: boolean;
45
29
  }
@@ -12,5 +12,6 @@ export declare const initialCartState: ICartStore;
12
12
  export declare const initialCheckoutState: ICheckoutStore;
13
13
  export declare const initialUIState: IUIStore;
14
14
  export declare const initialMetadataState: IElementsMetadataStore;
15
- export declare const initialProductsListState: IProductListStore;
15
+ export declare const initialProductsListState: Record<string, IProductListStore>;
16
+ export declare function createInitialProductListState(): IProductListStore;
16
17
  export declare const initialStoreState: IGlobalStore;
@@ -28,6 +28,7 @@ export declare class StoreService {
28
28
  createProductInstance(productId: string): boolean;
29
29
  removeProductInstance(productId: string): boolean;
30
30
  getProductInstances(): Record<string, IProductStore>;
31
+ destroy(): void;
31
32
  getState(): IGlobalStore;
32
33
  private setupMiddleware;
33
34
  private loggingMiddleware;
@@ -10,6 +10,7 @@ export declare class TelemetryService {
10
10
  constructor();
11
11
  static getInstance(): TelemetryService;
12
12
  isEnabled(): boolean;
13
+ destroy(): void;
13
14
  captureEvent(level: TelemetryLevel, message: string, options?: ITelemetryEventOptions): void;
14
15
  private buildErrorContext;
15
16
  private buildSDKContext;
@@ -76,7 +76,6 @@ export declare const COMPONENT_TYPE: {
76
76
  readonly PURCHASE_MIN_ALERT: "purchase-min-alert";
77
77
  readonly ALERT: "alert";
78
78
  readonly PROMO_CODE_TICKER: "promo-code-ticker";
79
- readonly MODAL: "modal";
80
79
  readonly ADDRESS: "address";
81
80
  readonly ADDRESS_INPUT: "address-input";
82
81
  readonly ADDRESS_DISPLAY: "address-display";
@@ -98,9 +97,10 @@ export declare const COMPONENT_TYPE: {
98
97
  readonly PRODUCT_LIST_FILTERS: "product-list-filters";
99
98
  readonly PRODUCT_LIST_SEARCH: "product-list-search";
100
99
  readonly PRODUCT_LIST_CARD_LOADING: "product-list-card-loading";
101
- readonly PRODUCT_LIST_RETAILERS: "product-list-retailers";
102
100
  readonly PRODUCT_LIST_ENGRAVING_FORM: "product-list-engraving-form";
103
101
  readonly PRODUCT_LIST_PRODUCT_PRE_CART: "product-list-product-pre-cart";
102
+ readonly PRODUCT_LIST_PRODUCT_ENGRAVING_LINES: "product-list-product-engraving-lines";
103
+ readonly PRODUCT_LIST_SIZE_SELECTOR: "product-list-size-selector";
104
104
  readonly CART: "cart";
105
105
  readonly CART_RETAILER: "cart-retailer";
106
106
  readonly CART_ITEM: "cart-item";
@@ -179,7 +179,8 @@ export declare const DISPLAY_MODE: {
179
179
  };
180
180
  export type DisplayModeType = (typeof DISPLAY_MODE)[keyof typeof DISPLAY_MODE];
181
181
  export declare const NAVIGATION_SOURCE: {
182
- readonly PRODUCT_CARD: "productCard";
183
- readonly ADD_TO_CART_DRAWER: "addToCartDrawer";
182
+ readonly PRODUCT: "product";
183
+ readonly PRODUCT_LIST_CARD: "product-list-card";
184
+ readonly PRE_CART: "pre-cart";
184
185
  };
185
186
  export type NavigationSourceType = (typeof NAVIGATION_SOURCE)[keyof typeof NAVIGATION_SOURCE];
@@ -1,7 +1,8 @@
1
- import type { IElementsCheckoutActions, IElementsCheckoutClient } from '@/clients/checkout';
2
1
  import { ElementsCheckout } from '@/clients/checkout';
3
2
  import type { DebugMode, ElementsEnv } from '@/enums';
4
3
  import { DEBUG_MODE, ELEMENTS_ENV } from '@/enums';
5
- import type { IInjectedComponent, ILiquidCommerceElementsCheckoutClientConfig } from '@/interfaces/core.interface';
4
+ import type { IElementsCheckoutActions, IElementsCheckoutClient } from '@/interfaces/client.interface';
5
+ import type { IInjectedComponent } from '@/interfaces/component.interface';
6
+ import type { ILiquidCommerceElementsCheckoutClientConfig } from '@/interfaces/config.interface';
6
7
  export { DEBUG_MODE, ELEMENTS_ENV, ElementsCheckout };
7
8
  export type { DebugMode, ElementsEnv, IElementsCheckoutActions, IElementsCheckoutClient, IInjectedComponent, ILiquidCommerceElementsCheckoutClientConfig, };
@@ -1,4 +1,4 @@
1
- import type { IElementsCheckoutActions, IElementsCheckoutClient } from './clients/checkout';
1
+ import type { IElementsCheckoutActions, IElementsCheckoutClient } from '@/interfaces/client.interface';
2
2
  import { ElementsCheckout } from './clients/checkout';
3
3
  export { ElementsCheckout };
4
4
  export type { IElementsCheckoutActions, IElementsCheckoutClient };
@@ -2,5 +2,8 @@ export * from './clients/builder';
2
2
  export * from './clients/main';
3
3
  export * from './core/sdk-error-handler';
4
4
  export * from './enums';
5
+ export * from './interfaces/client.interface';
6
+ export * from './interfaces/component.interface';
7
+ export * from './interfaces/config.interface';
5
8
  export * from './interfaces/configs';
6
- export * from './interfaces/core.interface';
9
+ export * from './interfaces/injection.interface';
@@ -2,6 +2,7 @@ import type { FILTER_KEYS } from 'modules/product-list/product-list.constants';
2
2
  import type { ILocation } from '@/interfaces/api/address.interface';
3
3
  import type { IProductAvailabilityResponse } from '@/interfaces/api/product.interface';
4
4
  export interface IProductSearchParams {
5
+ slug: string;
5
6
  location?: ILocation;
6
7
  search?: string;
7
8
  pageToken?: string;
@@ -17,7 +18,7 @@ export interface IFilterParams {
17
18
  key: string;
18
19
  values: IFilterParamsValue;
19
20
  }
20
- export type FacetFilterKeys = typeof FILTER_KEYS.BRANDS | typeof FILTER_KEYS.CATEGORIES | typeof FILTER_KEYS.FLAVOR | typeof FILTER_KEYS.REGION | typeof FILTER_KEYS.VARIETY | typeof FILTER_KEYS.VINTAGE | typeof FILTER_KEYS.COUNTRY | typeof FILTER_KEYS.APPELLATION | typeof FILTER_KEYS.TAGS | typeof FILTER_KEYS.MATERIALS | typeof FILTER_KEYS.SIZES | typeof FILTER_KEYS.ENGRAVING | typeof FILTER_KEYS.PRESALE | typeof FILTER_KEYS.FULFILLMENT | typeof FILTER_KEYS.PRICE | typeof FILTER_KEYS.AVAILABILITY | typeof FILTER_KEYS.COLORS;
21
+ export type FacetFilterKeys = typeof FILTER_KEYS.BRANDS | typeof FILTER_KEYS.CATEGORIES | typeof FILTER_KEYS.FLAVOR | typeof FILTER_KEYS.REGION | typeof FILTER_KEYS.VARIETY | typeof FILTER_KEYS.VINTAGE | typeof FILTER_KEYS.COUNTRY | typeof FILTER_KEYS.APPELLATION | typeof FILTER_KEYS.TAGS | typeof FILTER_KEYS.MATERIALS | typeof FILTER_KEYS.SIZES | typeof FILTER_KEYS.ENGRAVING | typeof FILTER_KEYS.FULFILLMENT | typeof FILTER_KEYS.PRICE | typeof FILTER_KEYS.AVAILABILITY | typeof FILTER_KEYS.COLORS;
21
22
  export interface IFilterSchema {
22
23
  type: FacetFilterKeys;
23
24
  values: IFilterValue[];
@@ -0,0 +1,72 @@
1
+ import type { IAddressActions } from '@/core/client/actions/client-address-action.service';
2
+ import type { ICartActions } from '@/core/client/actions/client-cart-action.service';
3
+ import type { ICheckoutActions } from '@/core/client/actions/client-checkout-action.service';
4
+ import type { IProductActions } from '@/core/client/actions/client-product-action.service';
5
+ import type { IClientConfigs } from '@/core/client/client-config.service';
6
+ import type { IAddressOptions } from '@/modules/address/address.interface';
7
+ import type { IInjectedComponent } from './component.interface';
8
+ import type { UpdateAddressComponent, UpdateCartComponent, UpdateCheckoutComponent, UpdateComponentGlobalConfigs, UpdateProductComponent, UpdateProductListComponent } from './configs';
9
+ import type { IBuilderInjectElementParams, IInjectCheckoutBuilderParams, IInjectCheckoutParams, IInjectProductElement, IInjectProductListFiltersParams, IInjectProductListParams, IInjectProductListSearchParams } from './injection.interface';
10
+ export interface ILiquidCommerceElementsUIMethod {
11
+ cartButton(containerId: string, showItemsCount?: boolean): void;
12
+ floatingCartButton(showItemsCount?: boolean): void;
13
+ cartSubtotal(elementId: string): void;
14
+ cartItemsCount(elementId: string, options?: {
15
+ hideZero: boolean;
16
+ }): void;
17
+ }
18
+ export interface ILiquidCommerceElementsActions {
19
+ product: IProductActions;
20
+ address: IAddressActions;
21
+ cart: ICartActions;
22
+ checkout: ICheckoutActions;
23
+ }
24
+ export interface IElementsCheckoutActions extends Omit<ICheckoutActions, 'openCheckout' | 'closeCheckout' | 'toggleCheckout'> {
25
+ }
26
+ export interface IElementsCheckoutClient {
27
+ injectCheckout: (params: IInjectCheckoutParams) => Promise<IInjectedComponent | null>;
28
+ actions: {
29
+ checkout: IElementsCheckoutActions;
30
+ };
31
+ destroy(): void;
32
+ }
33
+ export interface ILiquidCommerceElementsBuilderClient {
34
+ updateComponentGlobalConfigs(configs: UpdateComponentGlobalConfigs): Promise<void>;
35
+ updateProductComponent(configs: UpdateProductComponent): Promise<void>;
36
+ updateAddressComponent(configs: UpdateAddressComponent): void;
37
+ updateCartComponent(configs: UpdateCartComponent): void;
38
+ updateCheckoutComponent(configs: UpdateCheckoutComponent): void;
39
+ updateProductListComponent(configs: UpdateProductListComponent): void;
40
+ injectElement(params: IBuilderInjectElementParams): Promise<IInjectedComponent | null>;
41
+ injectProductElement(params: IInjectProductElement[]): Promise<IInjectedComponent[]>;
42
+ injectAddressElement(containerId: string, options?: IAddressOptions): Promise<IInjectedComponent | null>;
43
+ injectCartElement(containerId: string): Promise<IInjectedComponent | null>;
44
+ injectCheckoutElement(params: IInjectCheckoutBuilderParams): Promise<IInjectedComponent | null>;
45
+ injectProductList(params: IInjectProductListParams): Promise<void>;
46
+ actions: ILiquidCommerceElementsActions;
47
+ destroy(): void;
48
+ }
49
+ export interface ILiquidCommerceElementsClient {
50
+ injectProductElement(params: IInjectProductElement[]): Promise<IInjectedComponent[]>;
51
+ injectAddressElement(containerId: string, options?: IAddressOptions): Promise<IInjectedComponent | null>;
52
+ injectCartElement(containerId: string): Promise<IInjectedComponent | null>;
53
+ injectCheckoutElement(params: IInjectCheckoutParams): Promise<IInjectedComponent | null>;
54
+ injectProductList(params: IInjectProductListParams): Promise<void>;
55
+ injectProductListSearch(params: IInjectProductListSearchParams): Promise<void>;
56
+ injectProductListFilters(params: IInjectProductListFiltersParams): Promise<void>;
57
+ ui: ILiquidCommerceElementsUIMethod;
58
+ actions: ILiquidCommerceElementsActions;
59
+ getInjectedComponents(): Map<string, IInjectedComponent>;
60
+ destroy(): void;
61
+ }
62
+ export interface ILiquidCommerceElementsCheckoutClient {
63
+ prepare(): Promise<void>;
64
+ injectCheckout(params: IInjectCheckoutParams): Promise<IInjectedComponent | null>;
65
+ actions: {
66
+ checkout: IElementsCheckoutActions;
67
+ };
68
+ destroy(): void;
69
+ }
70
+ export type LiquidCommerceElementsClientConstructor = new (clientConfigs: IClientConfigs) => ILiquidCommerceElementsClient;
71
+ export type LiquidCommerceElementsBuilderClientConstructor = new (clientConfigs: IClientConfigs) => ILiquidCommerceElementsBuilderClient;
72
+ export type LiquidCommerceElementsCheckoutClientConstructor = new (clientConfigs: IClientConfigs) => ILiquidCommerceElementsCheckoutClient;
@@ -0,0 +1,7 @@
1
+ import type { ComponentType } from '@/enums';
2
+ export interface IInjectedComponent {
3
+ getType(): ComponentType;
4
+ getElement(): HTMLElement;
5
+ rerender(): void;
6
+ destroy(): void;
7
+ }
@@ -0,0 +1,46 @@
1
+ import type { DebugMode, ElementsEnv } from '@/enums';
2
+ import type { IPromoTicker, UpdateAddressComponent, UpdateCartComponent, UpdateCheckoutComponent, UpdateComponentGlobalConfigs, UpdateProductComponent, UpdateProductListComponent } from './configs';
3
+ export type DeepPartial<T> = {
4
+ [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
5
+ };
6
+ export interface IElementsProxyConfig {
7
+ baseUrl: string;
8
+ headers?: Record<string, string>;
9
+ }
10
+ export interface ILiquidCommerceElementsDevelopmentConfig {
11
+ customApiUrl?: string;
12
+ paymentMethodId?: string;
13
+ openShadowDom?: boolean;
14
+ }
15
+ export interface IClientCustomThemeConfig {
16
+ global?: UpdateComponentGlobalConfigs;
17
+ product?: UpdateProductComponent;
18
+ address?: UpdateAddressComponent;
19
+ cart?: UpdateCartComponent;
20
+ checkout?: UpdateCheckoutComponent;
21
+ productList?: UpdateProductListComponent;
22
+ }
23
+ export interface ILiquidCommerceElementsCheckoutConfig {
24
+ pageUrl: string;
25
+ }
26
+ export interface ILiquidCommerceElementsBaseConfig {
27
+ env?: ElementsEnv;
28
+ promoTicker?: IPromoTicker[];
29
+ customTheme?: IClientCustomThemeConfig;
30
+ debugMode?: DebugMode;
31
+ checkout?: ILiquidCommerceElementsCheckoutConfig;
32
+ }
33
+ export interface ILiquidCommerceElementsBuilderConfig extends ILiquidCommerceElementsBaseConfig {
34
+ }
35
+ export interface ILiquidCommerceElementsConfig extends ILiquidCommerceElementsBaseConfig {
36
+ proxy?: IElementsProxyConfig;
37
+ development?: ILiquidCommerceElementsDevelopmentConfig;
38
+ }
39
+ export interface ILiquidCommerceElementsCheckoutClientConfig {
40
+ env?: ElementsEnv;
41
+ customTheme?: IClientCustomThemeConfig;
42
+ debugMode?: DebugMode;
43
+ checkout?: ILiquidCommerceElementsCheckoutConfig;
44
+ proxy?: IElementsProxyConfig;
45
+ development?: ILiquidCommerceElementsDevelopmentConfig;
46
+ }
@@ -1,4 +1,4 @@
1
- import type { DeepPartial } from '@/interfaces/core.interface';
1
+ import type { DeepPartial } from '@/interfaces/config.interface';
2
2
  export interface IAddressTheme {
3
3
  backgroundColor: string;
4
4
  }
@@ -1,4 +1,4 @@
1
- import type { DeepPartial } from '@/interfaces/core.interface';
1
+ import type { DeepPartial } from '@/interfaces/config.interface';
2
2
  export interface ICartTheme {
3
3
  backgroundColor: string;
4
4
  }
@@ -1,4 +1,4 @@
1
- import type { DeepPartial } from '@/interfaces/core.interface';
1
+ import type { DeepPartial } from '@/interfaces/config.interface';
2
2
  export interface ICheckoutMarketingOptIn {
3
3
  show: boolean;
4
4
  checked: boolean;
@@ -1,5 +1,5 @@
1
+ import type { DeepPartial } from '@/interfaces/config.interface';
1
2
  import type { IElementsConfigurations } from '@/interfaces/configs/configurations.interface';
2
- import type { DeepPartial } from '@/interfaces/core.interface';
3
3
  import type { IAddressComponent } from './address.interface';
4
4
  import type { ICartComponent } from './cart.interface';
5
5
  import type { ICheckoutComponent } from './checkout.interface';
@@ -53,10 +53,10 @@ export interface IAllConfigs {
53
53
  configurations: IElementsConfigurations;
54
54
  global: IComponentGlobalConfigs;
55
55
  product: IProductComponent;
56
+ productList: IProductListComponent;
56
57
  address: IAddressComponent;
57
58
  cart: ICartComponent;
58
59
  checkout: ICheckoutComponent;
59
- productList: IProductListComponent;
60
60
  }
61
61
  export type ConfigsKeyType = 'all' | 'configurations' | 'global' | 'product' | 'address' | 'cart' | 'checkout' | 'productList';
62
62
  export type ConfigsType = IAllConfigs | IElementsConfigurations | IComponentGlobalConfigs | IProductComponent | IAddressComponent | ICartComponent | ICheckoutComponent | IProductListComponent;
@@ -1,25 +1,39 @@
1
- import type { DisplayModeType } from 'enums';
2
- import type { DeepPartial } from '@/interfaces/core.interface';
3
- export type ProductListCardStyle = 'card' | 'ghost';
4
- export type ProductListCardCornerRadius = 'rounded' | 'sharp';
5
- export interface IProductListTheme {
6
- backgroundColor: string;
1
+ import type { DeepPartial } from '@/interfaces/config.interface';
2
+ import type { ProductListFilterType } from '@/interfaces/injection.interface';
3
+ export type PLCPresentationModeType = 'drawer' | 'modal';
4
+ export type PLCListType = 'curated' | 'dynamic';
5
+ export type PLCCardStyle = 'card' | 'ghost';
6
+ export interface IPLCProductCard {
7
+ style: PLCCardStyle;
8
+ cornerRadius: string;
9
+ showPrice: boolean;
10
+ showSizes: boolean;
11
+ showRetailerName: boolean;
12
+ showFulfillmentOptions: boolean;
13
+ enableShippingFulfillment: boolean;
14
+ enableOnDemandFulfillment: boolean;
15
+ enablePersonalization: boolean;
16
+ showQuantityCounter: boolean;
17
+ enablePreCart: boolean;
18
+ showCollectionTags: boolean;
19
+ }
20
+ export interface IPLCList {
21
+ type: PLCListType;
22
+ name: string;
23
+ slug: string;
24
+ filters: Record<string, string[]>;
25
+ productCard: IPLCProductCard;
26
+ presentationMode: PLCPresentationModeType;
27
+ availableFilters: ProductListFilterType[];
28
+ rows: number;
29
+ columns: number;
30
+ productUrl: string | null;
7
31
  }
8
32
  export interface IProductListLayout {
9
- productCard: {
10
- style: ProductListCardStyle;
11
- cornerRadius: ProductListCardCornerRadius;
12
- showPrice: boolean;
13
- showSizeSelector: boolean;
14
- showFulfillment: boolean;
15
- showRetailerName: boolean;
16
- showQuantityCounter: boolean;
17
- enableShippingFulfillment: boolean;
18
- enableOnDemandFulfillment: boolean;
19
- showCollections: boolean;
20
- enablePersonalization: boolean;
21
- };
22
- displayMode: DisplayModeType;
33
+ lists: IPLCList[];
34
+ }
35
+ export interface IProductListTheme {
36
+ backgroundColor: string;
23
37
  }
24
38
  export interface IProductListComponent {
25
39
  theme: IProductListTheme;
@@ -1,4 +1,4 @@
1
- import type { DeepPartial } from '@/interfaces/core.interface';
1
+ import type { DeepPartial } from '@/interfaces/config.interface';
2
2
  export type FulfillmentDisplayType = 'carousel' | 'popup';
3
3
  export interface IProductLayout {
4
4
  showImages: boolean;
@@ -0,0 +1,47 @@
1
+ import type { PRODUCT_LIST_FILTER_TYPES } from '@/constants';
2
+ import type { ComponentType } from '@/enums';
3
+ import type { IAddressOptions } from '@/modules/address/address.interface';
4
+ export interface IInjectProductElement {
5
+ containerId: string;
6
+ identifier: string;
7
+ }
8
+ export type ProductListFilterType = (typeof PRODUCT_LIST_FILTER_TYPES)[keyof typeof PRODUCT_LIST_FILTER_TYPES];
9
+ export interface IInjectProductListParams {
10
+ containerId: string;
11
+ slug: string;
12
+ rows?: number;
13
+ columns?: number;
14
+ filters?: ProductListFilterType[];
15
+ productUrl?: string;
16
+ }
17
+ export interface IInjectProductListSearchParams {
18
+ containerId: string;
19
+ slug: string;
20
+ }
21
+ export interface IInjectProductListFiltersParams {
22
+ containerId: string;
23
+ slug: string;
24
+ filters?: ProductListFilterType[];
25
+ }
26
+ export interface IBuilderInjectElementParams {
27
+ type: ComponentType;
28
+ containerId: string;
29
+ [key: string]: any;
30
+ }
31
+ export interface IProcessInjectElementParams {
32
+ type: ComponentType;
33
+ containerId: string;
34
+ identifier?: string;
35
+ options?: IAddressOptions;
36
+ checkoutId?: string;
37
+ hideHeader?: boolean;
38
+ }
39
+ export interface IInjectCheckoutParams {
40
+ containerId: string;
41
+ checkoutId?: string;
42
+ hideHeader?: boolean;
43
+ }
44
+ export interface IInjectCheckoutBuilderParams extends IInjectCheckoutParams {
45
+ simulatePresale?: boolean;
46
+ presaleExpiresInMinutes?: number;
47
+ }
@@ -1,7 +1,3 @@
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';
5
1
  import { BaseComponent } from '@/core/base-component.service';
6
2
  import type { IAddressComponent } from '@/interfaces/configs';
7
3
  import type { IAddressOptions } from './address.interface';
@@ -9,12 +5,6 @@ export interface IAddressInputComponentParams {
9
5
  productId?: string;
10
6
  isIndependentComponent?: boolean;
11
7
  options?: IAddressOptions;
12
- navigationSource?: NavigationSourceType;
13
- product?: IProductListProduct;
14
- shippingFulfillment?: IFulfillment | null;
15
- onDemandFulfillment?: IFulfillment | null;
16
- showCollections?: boolean;
17
- config?: IProductListComponent;
18
8
  }
19
9
  export declare class AddressInputComponent extends BaseComponent<IAddressInputComponentParams, IAddressComponent> {
20
10
  private suggestions;
@@ -34,7 +24,6 @@ export declare class AddressInputComponent extends BaseComponent<IAddressInputCo
34
24
  private closeDrawer;
35
25
  private handleCancel;
36
26
  private handleCheckAvailability;
37
- private reopenAddToCartDrawer;
38
27
  private handleSuggestionClick;
39
28
  private handleDocumentClick;
40
29
  private searchAddresses;
@@ -6,7 +6,7 @@ export declare class AddressCommands extends BaseCommand {
6
6
  constructor();
7
7
  static getInstance(): AddressCommands;
8
8
  searchAddresses(query: string): Promise<IAddressAutocompleteResult[]>;
9
- getAddressDetails(addressId: string): Promise<IAddressDetailsResult>;
9
+ getAddressDetails(addressId: string): Promise<IAddressDetailsResult | null>;
10
10
  setSelectedAddress(addressData: IAddressData): Promise<void>;
11
11
  setAddressManually(address: IAddressAddress, coordinates: IAddressCoordinates): Promise<void>;
12
12
  clearSelectedAddress(): Promise<void>;
@@ -8,6 +8,7 @@ export interface ICheckoutCompletedComponentParams {
8
8
  giftRecipientEmail: string | null;
9
9
  checkoutToken?: string;
10
10
  cartId?: string;
11
+ isCompleted?: boolean;
11
12
  }
12
13
  export declare class CheckoutCompletedComponent extends BaseComponent<ICheckoutCompletedComponentParams, ICheckoutComponent> {
13
14
  get hostClasses(): string[];
@@ -17,6 +17,8 @@ export declare class ProductImageCarouselComponent extends BaseComponent<IImageC
17
17
  private startX;
18
18
  private currentTranslateX;
19
19
  private translateX;
20
+ private boundDragMove;
21
+ private boundDragEnd;
20
22
  constructor();
21
23
  afterRender(): void;
22
24
  onStoreWatch(changes: IOnStoreChanged[]): void;
@@ -26,6 +28,7 @@ export declare class ProductImageCarouselComponent extends BaseComponent<IImageC
26
28
  private scrollToIndex;
27
29
  private setupMainImageSwipe;
28
30
  private setupGalleryDrag;
31
+ protected disconnected(): void;
29
32
  private handleDragStart;
30
33
  private handleDragMove;
31
34
  private handleDragEnd;
@@ -13,6 +13,8 @@ export declare class ProductRetailersCarouselComponent extends BaseComponent<IPr
13
13
  private startX;
14
14
  private currentTranslateX;
15
15
  private translateX;
16
+ private boundDragMove;
17
+ private boundDragEnd;
16
18
  constructor();
17
19
  afterRender(): void;
18
20
  private cacheElements;
@@ -21,6 +23,7 @@ export declare class ProductRetailersCarouselComponent extends BaseComponent<IPr
21
23
  private updateSelectedCard;
22
24
  private scrollToIndex;
23
25
  private setupDrag;
26
+ protected disconnected(): void;
24
27
  private handleDragStart;
25
28
  private handleDragMove;
26
29
  private handleDragEnd;
@@ -1,12 +1,15 @@
1
1
  import { BaseComponent } from '@/core/base-component.service';
2
+ import { type NavigationSourceType } from '@/enums';
2
3
  import type { IProductComponent } from '@/interfaces/configs';
3
4
  export interface IProductRetailersPopupListComponentParams {
4
5
  productId: string;
6
+ navigationSource: NavigationSourceType;
7
+ slug?: string;
5
8
  }
6
9
  export declare class ProductRetailersPopupListComponent extends BaseComponent<IProductRetailersPopupListComponentParams, IProductComponent> {
7
10
  get hostClasses(): string[];
8
- constructor();
9
- private getProductId;
11
+ private get isProductListContext();
12
+ beforeSetupStoreWatchers(): void;
10
13
  private onFulfillmentTabClick;
11
14
  private onRetailerCardClick;
12
15
  protected template(): HTMLElement[];
@@ -16,7 +16,7 @@ export declare class ProductCommands extends BaseCommand {
16
16
  selectSize(productId: string, sizeId: string): Promise<void>;
17
17
  selectFulfillment(productId: string, selectedFulfillmentId: string): Promise<void>;
18
18
  updateQuantity(productId: string, delta: number): Promise<void>;
19
- changeFulfillmentType(productId: string, selectedFulfillmentType: FulfillmentType): Promise<void>;
19
+ changeFulfillmentType(productId: string, newFulfillmentType: FulfillmentType): Promise<void>;
20
20
  removeProduct(productId: string): Promise<void>;
21
21
  openProductDrawer(productId: string, contentType: IProductDrawerContentConfig['type'], data?: Record<string, any>): Promise<void>;
22
22
  closeProductDrawer(productId: string): Promise<void>;
@@ -24,6 +24,4 @@ export declare class ProductCommands extends BaseCommand {
24
24
  addToCart(productId: string, params: AddItemParams): Promise<void>;
25
25
  addPresaleToCart(productId: string, params: AddItemParams): Promise<void>;
26
26
  productDataForEventFromStore(identifier: string): IBaseProductEventData;
27
- private findFirstAvailableSize;
28
- private loadProductStoreUpdate;
29
27
  }
@@ -1,7 +1,5 @@
1
1
  export * from './product-badge';
2
2
  export * from './product-button';
3
- export * from './product-fulfillments';
4
3
  export * from './product-price-and-personalization';
5
4
  export * from './product-quantity-selector';
6
5
  export * from './product-sizes-list';
7
- export * from './product-title';
@@ -5,4 +5,5 @@ export interface IBadgesParams {
5
5
  }>;
6
6
  separatorText?: string;
7
7
  }
8
+ export declare const createProductBadge: (name: string, className?: string) => HTMLElement;
8
9
  export declare const createProductBadges: ({ badges, separatorText }: IBadgesParams) => HTMLElement;
@@ -1,11 +1,9 @@
1
- import type { ProductListCardCornerRadius } from 'interfaces/configs';
2
1
  export interface IAddToCartButtonParams {
3
2
  isPresale: boolean;
4
3
  hasAvailability: boolean;
5
4
  state: string;
6
5
  disabled?: boolean;
7
- borderRadius: ProductListCardCornerRadius;
8
6
  hasAddress: boolean;
9
7
  onClick?: (e: MouseEvent) => void | Promise<void>;
10
8
  }
11
- export declare const createAddToCartButton: ({ isPresale, hasAvailability, state, disabled, borderRadius, hasAddress, onClick, }: IAddToCartButtonParams) => HTMLElement;
9
+ export declare const createAddToCartButton: ({ isPresale, hasAvailability, state, disabled, hasAddress, onClick, }: IAddToCartButtonParams) => HTMLElement;
@@ -1,10 +1,9 @@
1
- import type { ProductListCardCornerRadius, ProductListCardStyle } from 'interfaces/configs';
1
+ import type { PLCCardStyle } from 'interfaces/configs/product-list.interface';
2
2
  export interface IQuantitySelectorParams {
3
3
  initialQuantity: number;
4
4
  minQuantity: number;
5
5
  maxQuantity: number;
6
- cornerRadius: ProductListCardCornerRadius;
7
- cardStyle: ProductListCardStyle;
6
+ cardStyle: PLCCardStyle;
8
7
  onChange: (quantity: number) => void;
9
8
  }
10
- export declare const createQuantitySelector: ({ initialQuantity, minQuantity, maxQuantity, cornerRadius, cardStyle, onChange, }: IQuantitySelectorParams) => HTMLElement;
9
+ export declare const createQuantitySelector: ({ initialQuantity, minQuantity, maxQuantity, cardStyle, onChange }: IQuantitySelectorParams) => HTMLElement;
@@ -1,9 +1,13 @@
1
1
  import type { IProductSizeStore } from 'core/store/interfaces/product.interface';
2
- import type { ProductListCardCornerRadius } from 'interfaces/configs';
3
- export interface ISizeSelectorParams {
2
+ import { BaseComponent } from '@/core/base-component.service';
3
+ export interface IProductListSizeSelectorParams {
4
4
  sizes: Record<string, IProductSizeStore>;
5
- selectedSize: IProductSizeStore;
6
- cornerRadius: ProductListCardCornerRadius;
5
+ selectedSizeId: string | null;
7
6
  onSelect?: (size: IProductSizeStore) => void;
8
7
  }
9
- export declare const createProductSizesList: ({ sizes, selectedSize, cornerRadius, onSelect }: ISizeSelectorParams) => HTMLElement;
8
+ export declare class ProductListSizeSelectorComponent extends BaseComponent<IProductListSizeSelectorParams> {
9
+ private onOutsideClick;
10
+ get hostClasses(): string[];
11
+ protected disconnected?(): void;
12
+ protected template(): HTMLElement[];
13
+ }