@liquidcommerce/elements-sdk 2.6.0-beta.4 → 2.6.0-beta.41

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 (210) hide show
  1. package/README.md +83 -2519
  2. package/dist/index.checkout.esm.js +16086 -0
  3. package/dist/index.esm.js +16742 -14627
  4. package/dist/types/auto-initialize/checkout.d.ts +2 -0
  5. package/dist/types/auto-initialize/shared-utils.d.ts +27 -0
  6. package/dist/types/{elements-base-client.d.ts → clients/base.d.ts} +11 -1
  7. package/dist/types/clients/checkout.d.ts +13 -0
  8. package/dist/types/constants/core.constant.d.ts +5 -3
  9. package/dist/types/core/api/api-client.service.d.ts +10 -12
  10. package/dist/types/core/api/auth-client.service.d.ts +31 -9
  11. package/dist/types/core/api/http-client.service.d.ts +0 -1
  12. package/dist/types/core/client/actions/base-action.service.d.ts +15 -0
  13. package/dist/types/core/client/actions/client-address-action.service.d.ts +18 -0
  14. package/dist/types/core/client/actions/client-cart-action.service.d.ts +37 -0
  15. package/dist/types/core/client/actions/client-checkout-action.service.d.ts +50 -0
  16. package/dist/types/core/client/actions/client-product-action.service.d.ts +12 -0
  17. package/dist/types/core/client/client-action.service.d.ts +6 -70
  18. package/dist/types/core/client/client-config.service.d.ts +3 -2
  19. package/dist/types/core/command/common-command.service.d.ts +2 -1
  20. package/dist/types/core/google-tag-manager.service.d.ts +4 -1
  21. package/dist/types/core/logger/logger.service.d.ts +1 -1
  22. package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +27 -64
  23. package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +45 -50
  24. package/dist/types/core/pubsub/interfaces/core.interface.d.ts +5 -4
  25. package/dist/types/core/pubsub/interfaces/product.interface.d.ts +16 -75
  26. package/dist/types/core/store/interfaces/cart.interface.d.ts +16 -56
  27. package/dist/types/core/store/interfaces/checkout.interface.d.ts +17 -108
  28. package/dist/types/core/store/interfaces/core.interface.d.ts +18 -3
  29. package/dist/types/core/store/interfaces/metadata.interface.d.ts +11 -0
  30. package/dist/types/core/store/interfaces/product-list.interface.d.ts +45 -0
  31. package/dist/types/core/store/interfaces/product.interface.d.ts +3 -1
  32. package/dist/types/core/store/store.constant.d.ts +4 -0
  33. package/dist/types/enums/core.enum.d.ts +38 -1
  34. package/dist/types/enums/index.d.ts +0 -1
  35. package/dist/types/index.checkout.d.ts +7 -0
  36. package/dist/types/index.checkout.umd.d.ts +4 -0
  37. package/dist/types/index.d.ts +2 -2
  38. package/dist/types/interfaces/api/cart.interface.d.ts +95 -0
  39. package/dist/types/interfaces/api/checkout.interface.d.ts +217 -0
  40. package/dist/types/interfaces/api/product-list.interface.d.ts +38 -0
  41. package/dist/types/interfaces/api/product.interface.d.ts +5 -7
  42. package/dist/types/interfaces/configs/checkout.interface.d.ts +1 -0
  43. package/dist/types/interfaces/configs/global.interface.d.ts +4 -2
  44. package/dist/types/interfaces/configs/index.d.ts +1 -0
  45. package/dist/types/interfaces/configs/product-list.interface.d.ts +28 -0
  46. package/dist/types/interfaces/configs/product.interface.d.ts +1 -0
  47. package/dist/types/interfaces/core.interface.d.ts +34 -6
  48. package/dist/types/modules/address/address-input.component.d.ts +11 -0
  49. package/dist/types/modules/address/address.command.d.ts +1 -0
  50. package/dist/types/modules/address/styles/register-styles.d.ts +1 -0
  51. package/dist/types/modules/cart/cart.commands.d.ts +4 -5
  52. package/dist/types/modules/cart/components/cart-body.component.d.ts +2 -1
  53. package/dist/types/modules/cart/components/cart-footer.component.d.ts +0 -1
  54. package/dist/types/modules/cart/components/cart-fulfillment.component.d.ts +0 -2
  55. package/dist/types/modules/cart/styles/register-styles.d.ts +1 -0
  56. package/dist/types/modules/checkout/checkout.commands.d.ts +22 -9
  57. package/dist/types/modules/checkout/checkout.component.d.ts +2 -0
  58. package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +2 -2
  59. package/dist/types/modules/checkout/components/checkout-completed.component.d.ts +2 -0
  60. package/dist/types/modules/checkout/components/checkout-header.component.d.ts +1 -0
  61. package/dist/types/modules/checkout/components/checkout-items.component.d.ts +4 -3
  62. package/dist/types/modules/checkout/components/checkout-presale-countdown.component.d.ts +14 -1
  63. package/dist/types/modules/checkout/components/checkout-presale-expired.component.d.ts +7 -1
  64. package/dist/types/modules/checkout/components/checkout-tips.component.d.ts +2 -2
  65. package/dist/types/modules/checkout/components/promo-pc-gc.component.d.ts +0 -2
  66. package/dist/types/modules/checkout/constant.d.ts +3 -0
  67. package/dist/types/modules/checkout/styles/register-styles.d.ts +1 -0
  68. package/dist/types/modules/product/product.commands.d.ts +1 -0
  69. package/dist/types/modules/product/styles/register-styles.d.ts +1 -0
  70. package/dist/types/modules/product-list/components/card-components/index.d.ts +7 -0
  71. package/dist/types/modules/product-list/components/card-components/product-badge.d.ts +8 -0
  72. package/dist/types/modules/product-list/components/card-components/product-button.d.ts +11 -0
  73. package/dist/types/modules/product-list/components/card-components/product-fulfillments.d.ts +12 -0
  74. package/dist/types/modules/product-list/components/card-components/product-price-and-personalization.d.ts +13 -0
  75. package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts +10 -0
  76. package/dist/types/modules/product-list/components/card-components/product-sizes-list.d.ts +9 -0
  77. package/dist/types/modules/product-list/components/card-components/product-title.d.ts +6 -0
  78. package/dist/types/modules/product-list/components/filter-components/index.d.ts +7 -0
  79. package/dist/types/modules/product-list/components/filter-components/product-list-apply-filter-button.d.ts +1 -0
  80. package/dist/types/modules/product-list/components/filter-components/product-list-chip.d.ts +5 -0
  81. package/dist/types/modules/product-list/components/filter-components/product-list-filters-chips.d.ts +13 -0
  82. package/dist/types/modules/product-list/components/filter-components/product-list-fulfillment-filter.d.ts +14 -0
  83. package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-price-filter.components.d.ts → filter-components/product-list-price-filter.d.ts} +1 -1
  84. package/dist/types/modules/product-list/components/filter-components/product-list-toggle-filters.d.ts +13 -0
  85. package/dist/types/modules/product-list/components/index.d.ts +7 -3
  86. package/dist/types/modules/product-list/components/product-list-card-loading.component.d.ts +2 -1
  87. package/dist/types/modules/product-list/components/product-list-engraving.component.d.ts +10 -0
  88. package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +58 -37
  89. package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts +28 -0
  90. package/dist/types/modules/product-list/components/product-list-retailers.component.d.ts +26 -0
  91. package/dist/types/modules/product-list/components/product-list-search.component.d.ts +22 -0
  92. package/dist/types/modules/product-list/product-list-card.component.d.ts +30 -0
  93. package/dist/types/modules/product-list/product-list.commands.d.ts +64 -4
  94. package/dist/types/modules/product-list/product-list.component.d.ts +16 -44
  95. package/dist/types/modules/product-list/product-list.constants.d.ts +39 -0
  96. package/dist/types/modules/product-list/product-list.interface.d.ts +37 -31
  97. package/dist/types/modules/product-list/styles/product-list-card.style.d.ts +1 -0
  98. package/dist/types/modules/product-list/styles/product-list-filters.style.d.ts +1 -0
  99. package/dist/types/modules/product-list/styles/register-styles.d.ts +1 -0
  100. package/dist/types/modules/theme-provider/constants/component-groupings.d.ts +1 -0
  101. package/dist/types/modules/theme-provider/constants/css-variable-mappings.d.ts +1 -1
  102. package/dist/types/modules/theme-provider/services/style-registry.service.d.ts +16 -0
  103. package/dist/types/modules/theme-provider/services/stylesheet-generator.service.d.ts +0 -1
  104. package/dist/types/modules/theme-provider/styles/register-styles.d.ts +1 -0
  105. package/dist/types/modules/theme-provider/theme-provider.service.d.ts +2 -1
  106. package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +14 -1
  107. package/dist/types/modules/ui-components/input/index.d.ts +0 -1
  108. package/dist/types/modules/ui-components/input/input.component.d.ts +8 -1
  109. package/dist/types/modules/ui-components/modal/modal.component.d.ts +23 -0
  110. package/dist/types/modules/ui-components/purchase-min-alert/index.d.ts +0 -1
  111. package/dist/types/modules/ui-components/styles/modal.style.d.ts +1 -0
  112. package/dist/types/modules/ui-components/ui.commands.d.ts +3 -1
  113. package/dist/types/static/icon/check.icon.d.ts +2 -0
  114. package/dist/types/static/icon/index.d.ts +1 -0
  115. package/dist/types/utils/format.d.ts +0 -14
  116. package/docs/gitbook/actions.md +160 -0
  117. package/docs/gitbook/address.md +48 -0
  118. package/docs/gitbook/cart.md +65 -0
  119. package/docs/gitbook/checkout.md +131 -0
  120. package/docs/gitbook/events.md +137 -0
  121. package/docs/gitbook/overview.md +166 -0
  122. package/docs/gitbook/product.md +64 -0
  123. package/docs/gitbook/quick-start-guide.md +393 -0
  124. package/docs/v1/README.md +210 -0
  125. package/docs/v1/api/actions/address-actions.md +281 -0
  126. package/docs/v1/api/actions/cart-actions.md +337 -0
  127. package/docs/v1/api/actions/checkout-actions.md +387 -0
  128. package/docs/v1/api/actions/product-actions.md +115 -0
  129. package/docs/v1/api/client.md +482 -0
  130. package/docs/v1/api/configuration.md +1 -0
  131. package/docs/v1/api/injection-methods.md +247 -0
  132. package/docs/v1/api/typescript-types.md +1 -0
  133. package/docs/v1/api/ui-helpers.md +200 -0
  134. package/docs/v1/examples/advanced-patterns.md +96 -0
  135. package/docs/v1/examples/checkout-flow.md +91 -0
  136. package/docs/v1/examples/custom-theming.md +63 -0
  137. package/docs/v1/examples/multi-product-page.md +90 -0
  138. package/docs/v1/examples/simple-product-page.md +89 -0
  139. package/docs/v1/getting-started/concepts.md +507 -0
  140. package/docs/v1/getting-started/installation.md +328 -0
  141. package/docs/v1/getting-started/quick-start.md +405 -0
  142. package/docs/v1/guides/address-component.md +431 -0
  143. package/docs/v1/guides/best-practices.md +324 -0
  144. package/docs/v1/guides/cart-component.md +737 -0
  145. package/docs/v1/guides/checkout-component.md +672 -0
  146. package/docs/v1/guides/events.md +191 -0
  147. package/docs/v1/guides/product-component.md +686 -0
  148. package/docs/v1/guides/product-list-component.md +598 -0
  149. package/docs/v1/guides/theming.md +216 -0
  150. package/docs/v1/integration/angular.md +39 -0
  151. package/docs/v1/integration/laravel.md +41 -0
  152. package/docs/v1/integration/nextjs.md +60 -0
  153. package/docs/v1/integration/proxy-setup.md +89 -0
  154. package/docs/v1/integration/react.md +64 -0
  155. package/docs/v1/integration/vanilla-js.md +84 -0
  156. package/docs/v1/integration/vue.md +34 -0
  157. package/docs/v1/reference/browser-support.md +35 -0
  158. package/docs/v1/reference/error-handling.md +70 -0
  159. package/docs/v1/reference/performance.md +54 -0
  160. package/docs/v1/reference/troubleshooting.md +64 -0
  161. package/package.json +20 -13
  162. package/dist/types/enums/cloud.enum.d.ts +0 -403
  163. package/dist/types/interfaces/cloud/cart.interface.d.ts +0 -132
  164. package/dist/types/interfaces/cloud/catalog.interface.d.ts +0 -43
  165. package/dist/types/interfaces/cloud/checkout.interface.d.ts +0 -211
  166. package/dist/types/interfaces/cloud/core.interface.d.ts +0 -22
  167. package/dist/types/interfaces/cloud/index.d.ts +0 -5
  168. package/dist/types/interfaces/cloud/retailer.interface.d.ts +0 -67
  169. package/dist/types/interfaces/cloud/user.interface.d.ts +0 -100
  170. package/dist/types/modules/cart/cart.commands.helper.d.ts +0 -9
  171. package/dist/types/modules/checkout/components/checkout.type.d.ts +0 -4
  172. package/dist/types/modules/product-list/components/product-list-card.component.d.ts +0 -37
  173. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/index.d.ts +0 -6
  174. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-apply-filter-button.component.d.ts +0 -1
  175. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-delivery-options-filter.components.d.ts +0 -16
  176. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-search.component.d.ts +0 -16
  177. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-toggle-filters.components.d.ts +0 -18
  178. package/dist/types/modules/theme-provider/styles/address/index.d.ts +0 -1
  179. package/dist/types/modules/theme-provider/styles/cart/index.d.ts +0 -1
  180. package/dist/types/modules/theme-provider/styles/checkout/index.d.ts +0 -1
  181. package/dist/types/modules/theme-provider/styles/product/index.d.ts +0 -3
  182. package/dist/types/modules/theme-provider/styles/product-list/index.d.ts +0 -1
  183. package/dist/types/modules/theme-provider/styles/ui/index.d.ts +0 -3
  184. package/dist/types/modules/ui-components/input/birthdate-input.component.d.ts +0 -53
  185. package/dist/types/modules/ui-components/purchase-min-alert/helpers.d.ts +0 -7
  186. package/dist/types/utils/helper.d.ts +0 -27
  187. package/docs/ACTIONS.md +0 -1300
  188. package/docs/BROWSER_SUPPORT.md +0 -279
  189. package/docs/CONFIGURATION.md +0 -853
  190. package/docs/DOCUMENTATION_INDEX.md +0 -311
  191. package/docs/EVENTS.md +0 -798
  192. package/docs/PROXY.md +0 -228
  193. package/docs/THEMING.md +0 -592
  194. package/docs/TROUBLESHOOTING.md +0 -793
  195. package/umd/elements.js +0 -1
  196. /package/dist/types/{auto-initialize.d.ts → auto-initialize/main.d.ts} +0 -0
  197. /package/dist/types/{elements-builder-client.d.ts → clients/builder.d.ts} +0 -0
  198. /package/dist/types/{elements-client-helper.d.ts → clients/helpers.d.ts} +0 -0
  199. /package/dist/types/{elements-client.d.ts → clients/main.d.ts} +0 -0
  200. /package/dist/types/modules/{theme-provider/styles/address → address/styles}/address.style.d.ts +0 -0
  201. /package/dist/types/modules/{theme-provider/styles/cart → cart/styles}/cart.style.d.ts +0 -0
  202. /package/dist/types/modules/{theme-provider/styles/checkout → checkout/styles}/checkout.style.d.ts +0 -0
  203. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/image-carousel.style.d.ts +0 -0
  204. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/product.style.d.ts +0 -0
  205. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/retailers.style.d.ts +0 -0
  206. /package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-checkbox-filter.components.d.ts → filter-components/product-list-checkbox-filter.d.ts} +0 -0
  207. /package/dist/types/modules/{theme-provider/styles/product-list → product-list/styles}/product-list.style.d.ts +0 -0
  208. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/drawer.style.d.ts +0 -0
  209. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/loading.style.d.ts +0 -0
  210. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/promo-code-ticker.style.d.ts +0 -0
@@ -0,0 +1,28 @@
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;
7
+ }
8
+ 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;
23
+ }
24
+ export interface IProductListComponent {
25
+ theme: IProductListTheme;
26
+ layout: IProductListLayout;
27
+ }
28
+ export type UpdateProductListComponent = DeepPartial<IProductListComponent>;
@@ -2,6 +2,7 @@ import type { DeepPartial } from '@/interfaces/core.interface';
2
2
  export type FulfillmentDisplayType = 'carousel' | 'popup';
3
3
  export interface IProductLayout {
4
4
  showImages: boolean;
5
+ showOnlyMainImage: boolean;
5
6
  showTitle: boolean;
6
7
  showDescription: boolean;
7
8
  showQuantityCounter: boolean;
@@ -1,5 +1,8 @@
1
- import type { PRODUCT_LIST_CARD_VARIANT, PRODUCT_LIST_FILTER_TYPES } from '@/constants';
2
- import type { IAddressActions, ICartActions, ICheckoutActions, IProductActions } from '@/core/client/client-action.service';
1
+ import type { PRODUCT_LIST_FILTER_TYPES } from '@/constants';
2
+ import type { IAddressActions } from '@/core/client/actions/client-address-action.service';
3
+ import type { ICartActions } from '@/core/client/actions/client-cart-action.service';
4
+ import type { ICheckoutActions } from '@/core/client/actions/client-checkout-action.service';
5
+ import type { IProductActions } from '@/core/client/actions/client-product-action.service';
3
6
  import type { IClientConfigs } from '@/core/client/client-config.service';
4
7
  import type { ComponentType, DebugMode, ElementsEnv } from '@/enums';
5
8
  import type { IAddressOptions } from '@/modules/address/address.interface';
@@ -23,11 +26,15 @@ export interface IClientCustomThemeConfig {
23
26
  cart?: UpdateCartComponent;
24
27
  checkout?: UpdateCheckoutComponent;
25
28
  }
29
+ export interface ILiquidCommerceElementsCheckoutConfig {
30
+ pageUrl: string;
31
+ }
26
32
  export interface ILiquidCommerceElementsBaseConfig {
27
33
  env?: ElementsEnv;
28
34
  promoTicker?: IPromoTicker[];
29
35
  customTheme?: IClientCustomThemeConfig;
30
36
  debugMode?: DebugMode;
37
+ checkout?: ILiquidCommerceElementsCheckoutConfig;
31
38
  }
32
39
  export interface ILiquidCommerceElementsBuilderConfig extends ILiquidCommerceElementsBaseConfig {
33
40
  }
@@ -35,21 +42,33 @@ export interface ILiquidCommerceElementsConfig extends ILiquidCommerceElementsBa
35
42
  proxy?: IElementsProxyConfig;
36
43
  development?: ILiquidCommerceElementsDevelopmentConfig;
37
44
  }
45
+ export interface ILiquidCommerceElementsCheckoutClientConfig {
46
+ env?: ElementsEnv;
47
+ customTheme?: IClientCustomThemeConfig;
48
+ debugMode?: DebugMode;
49
+ checkout?: ILiquidCommerceElementsCheckoutConfig;
50
+ proxy?: IElementsProxyConfig;
51
+ development?: ILiquidCommerceElementsDevelopmentConfig;
52
+ }
38
53
  export interface IInjectProductElement {
39
54
  containerId: string;
40
55
  identifier: string;
41
56
  }
42
- export type ProductListCardVariantType = (typeof PRODUCT_LIST_CARD_VARIANT)[keyof typeof PRODUCT_LIST_CARD_VARIANT];
43
57
  export type ProductListFilterType = (typeof PRODUCT_LIST_FILTER_TYPES)[keyof typeof PRODUCT_LIST_FILTER_TYPES];
44
58
  export interface IInjectProductListParams {
45
59
  containerId: string;
46
60
  rows?: number;
47
61
  columns?: number;
48
- cardVariant?: ProductListCardVariantType;
49
- fillCard?: boolean;
50
62
  filters?: ProductListFilterType[];
51
63
  productUrl?: string;
52
64
  }
65
+ export interface IInjectProductListSearchParams {
66
+ containerId: string;
67
+ }
68
+ export interface IInjectProductListFiltersParams {
69
+ containerId: string;
70
+ filters: ProductListFilterType[];
71
+ }
53
72
  export interface IBuilderInjectElementParams {
54
73
  type: ComponentType;
55
74
  containerId: string;
@@ -65,6 +84,13 @@ export interface IProcessInjectElementParams {
65
84
  containerId: string;
66
85
  identifier?: string;
67
86
  options?: IAddressOptions;
87
+ checkoutId?: string;
88
+ hideHeader?: boolean;
89
+ }
90
+ export interface IInjectCheckoutParams {
91
+ containerId: string;
92
+ checkoutId?: string;
93
+ hideHeader?: boolean;
68
94
  }
69
95
  export interface ILiquidCommerceElementsUIMethod {
70
96
  cartButton(containerId: string, showItemsCount?: boolean): void;
@@ -101,8 +127,10 @@ export interface ILiquidCommerceElementsClient {
101
127
  injectProductElement(params: IInjectProductElement[]): Promise<IInjectedComponent[]>;
102
128
  injectAddressElement(containerId: string, options?: IAddressOptions): Promise<IInjectedComponent | null>;
103
129
  injectCartElement(containerId: string): Promise<IInjectedComponent | null>;
104
- injectCheckoutElement(containerId: string): Promise<IInjectedComponent | null>;
130
+ injectCheckoutElement(params: IInjectCheckoutParams): Promise<IInjectedComponent | null>;
105
131
  injectProductList(params: IInjectProductListParams): Promise<void>;
132
+ injectProductListSearch(params: IInjectProductListSearchParams): Promise<void>;
133
+ injectProductListFilters(params: IInjectProductListFiltersParams): Promise<void>;
106
134
  ui: ILiquidCommerceElementsUIMethod;
107
135
  actions: ILiquidCommerceElementsActions;
108
136
  getInjectedComponents(): Map<string, IInjectedComponent>;
@@ -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;
@@ -11,4 +11,5 @@ export declare class AddressCommands extends BaseCommand {
11
11
  setAddressManually(address: IAddressAddress, coordinates: IAddressCoordinates): Promise<void>;
12
12
  clearSelectedAddress(): Promise<void>;
13
13
  getDetails(): IAddressData | null;
14
+ private buildFormattedAddressString;
14
15
  }
@@ -1,7 +1,6 @@
1
1
  import { BaseCommand } from '@/core/command/base-command.service';
2
2
  import type { IBaseCartEventData } from '@/core/pubsub/interfaces/cart.interface';
3
3
  export interface AddItemParams {
4
- upc: string;
5
4
  fulfillmentId: string;
6
5
  partNumber: string;
7
6
  quantity: number;
@@ -9,17 +8,15 @@ export interface AddItemParams {
9
8
  identifier: string;
10
9
  }
11
10
  export declare class CartCommands extends BaseCommand {
12
- private readonly uiCommands;
13
- private readonly checkoutCommands;
14
- private readonly commonCommands;
15
11
  constructor();
16
12
  static getInstance(): CartCommands;
17
13
  updateItemQuantity(itemId: string, delta: number): Promise<void>;
18
14
  removeItem(itemId: string, isNotStandAlone?: boolean): Promise<void>;
19
15
  updateItemEngraving(productItemId: string, engravingLines: string[]): Promise<void>;
20
16
  addItem(params: AddItemParams): Promise<void>;
21
- addPresaleItem(params: AddItemParams): Promise<void>;
22
17
  handleGoToCheckout(): Promise<void>;
18
+ private trackBeginCheckout;
19
+ private resolveCheckoutRedirectUrl;
23
20
  applyPromoCode(promoCode: string): Promise<void>;
24
21
  removePromoCode(): Promise<void>;
25
22
  rerenderCart(): void;
@@ -32,4 +29,6 @@ export declare class CartCommands extends BaseCommand {
32
29
  private updateFulfillment;
33
30
  private addNewFulfillmentAndRetailer;
34
31
  private cleanupAfterItemRemoval;
32
+ private syncCartState;
33
+ private buildCartLoadedEventData;
35
34
  }
@@ -1,5 +1,6 @@
1
1
  import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
2
- export declare class CartBodyComponent extends BaseComponent<null, null> {
2
+ import type { ICartComponent } from '@/interfaces/configs';
3
+ export declare class CartBodyComponent extends BaseComponent<null, ICartComponent> {
3
4
  get hostClasses(): string[];
4
5
  constructor();
5
6
  private createEmptyCartElement;
@@ -12,7 +12,6 @@ export declare class CartFooterComponent extends BaseComponent<ICartFooterCompon
12
12
  onStoreWatch(changes: IOnStoreChanged[]): void;
13
13
  afterRender(): void;
14
14
  private isAnythingLoading;
15
- private hasUnmetMinimum;
16
15
  private shouldDisableCheckout;
17
16
  private updateCheckoutButtonState;
18
17
  private updateSubtotalItemsCount;
@@ -6,7 +6,6 @@ export declare class CartFulfillmentComponent extends BaseComponent<ICartFulfill
6
6
  get hostClasses(): string[];
7
7
  constructor();
8
8
  private getFulfillmentId;
9
- private getProductStore;
10
9
  private handleItemsUpdate;
11
10
  private setupItemElements;
12
11
  private setupMinimumPurchaseAlert;
@@ -17,7 +16,6 @@ export declare class CartFulfillmentComponent extends BaseComponent<ICartFulfill
17
16
  private isAnyItemUpdating;
18
17
  private checkAndUpdateLoadingState;
19
18
  onStoreChanged(changes: IOnStoreChanged[]): boolean | undefined;
20
- private hasFulfillmentFeesChanged;
21
19
  private hasFulfillmentDataChanged;
22
20
  protected afterRender(): void;
23
21
  protected disconnected(): void;
@@ -1,11 +1,19 @@
1
1
  import { BaseCommand } from '@/core/command/base-command.service';
2
- import type { ICheckoutBillingStore, ICheckoutCustomerStore, ICheckoutGiftRecipientStore, ICheckoutPaymentMethodStore } from '@/core/store/interfaces/checkout.interface';
2
+ import type { ICheckoutDetailsEventData } from '@/core/pubsub/interfaces/checkout.interface';
3
+ import type { ICheckoutPaymentMethodStore } from '@/core/store/interfaces/checkout.interface';
4
+ import type { ICheckoutBilling, ICheckoutCustomer, ICheckoutGiftRecipient } from '@/interfaces/api/checkout.interface';
5
+ import type { AddItemParams } from '@/modules/cart/cart.commands';
6
+ import type { PresaleExpiredReason } from '@/modules/checkout/components';
3
7
  export declare class CheckoutCommands extends BaseCommand {
4
8
  private readonly uiCommands;
5
- private readonly commonCommands;
6
9
  constructor();
7
10
  static getInstance(): CheckoutCommands;
8
- loadCheckout(cartIdParam?: string): Promise<void>;
11
+ addPresaleItem(params: AddItemParams): Promise<void>;
12
+ loadCheckout(params: {
13
+ checkoutId?: string;
14
+ cartId?: string;
15
+ isForPresale?: boolean;
16
+ }): Promise<void>;
9
17
  toggleIsGift(active?: boolean): Promise<void>;
10
18
  toggleBillingSameAsShipping(active?: boolean): Promise<void>;
11
19
  toggleMarketingPreferences(fieldName: 'canEmail' | 'canSms', active?: boolean): Promise<void>;
@@ -17,7 +25,10 @@ export declare class CheckoutCommands extends BaseCommand {
17
25
  applyGiftCard(code: string): Promise<void>;
18
26
  removeGiftCard(code: string): Promise<void>;
19
27
  clearGiftCardError(): Promise<void>;
20
- openPresaleExpiredDrawer(): void;
28
+ showPresaleExpired(reason?: PresaleExpiredReason): void;
29
+ openCheckout(): void;
30
+ getReturnUrl(): string | null;
31
+ private resolveCheckoutPageUrl;
21
32
  rerenderCheckout(): void;
22
33
  updateCheckoutItemQuantity(itemId: string, delta: number): Promise<void>;
23
34
  removeItemEngraving(productItemId: string): Promise<void>;
@@ -28,18 +39,18 @@ export declare class CheckoutCommands extends BaseCommand {
28
39
  clearCheckoutError(): Promise<void>;
29
40
  editCustomerForm(): Promise<void>;
30
41
  saveCustomerForm({ shippingAddressTwo, deliveryInstructions, customerData, }: {
31
- customerData: ICheckoutCustomerStore;
42
+ customerData: ICheckoutCustomer;
32
43
  shippingAddressTwo: string;
33
44
  deliveryInstructions: string;
34
45
  }): Promise<void>;
35
46
  editGiftRecipientForm(): Promise<void>;
36
- saveGiftRecipientForm({ shippingAddressTwo, deliveryInstructions, ...giftRecipientData }: ICheckoutGiftRecipientStore & {
47
+ saveGiftRecipientForm({ shippingAddressTwo, deliveryInstructions, ...giftRecipientData }: ICheckoutGiftRecipient & {
37
48
  shippingAddressTwo: string;
38
49
  deliveryInstructions: string;
39
50
  }): Promise<void>;
40
51
  editPaymentForm(): Promise<void>;
41
52
  savePaymentForm({ billingFormData, paymentSession, }: {
42
- billingFormData?: ICheckoutBillingStore;
53
+ billingFormData?: ICheckoutBilling;
43
54
  paymentSession?: {
44
55
  confirmationTokenId: string;
45
56
  setupIntentId: string;
@@ -47,7 +58,9 @@ export declare class CheckoutCommands extends BaseCommand {
47
58
  }): Promise<void>;
48
59
  checkoutComplete(): Promise<void>;
49
60
  private updateStoreFromCheckoutResponse;
50
- private partialLoadCheckout;
61
+ private syncFromItemUpdate;
62
+ private syncCheckoutState;
63
+ private refreshCheckout;
51
64
  private dataForCheckoutPrepare;
52
- private buildCheckoutItemStore;
65
+ getDetails(): ICheckoutDetailsEventData;
53
66
  }
@@ -3,8 +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[];
11
+ private createHeader;
10
12
  }
@@ -1,8 +1,8 @@
1
1
  import { BaseComponent } from '@/core/base-component.service';
2
- import type { ICheckoutBillingStore } from '@/core/store/interfaces/checkout.interface';
2
+ import type { ICheckoutBilling } from '@/interfaces/api/checkout.interface';
3
3
  import type { ICheckoutComponent } from '@/interfaces/configs';
4
4
  export interface ICheckoutBillingComponentParams {
5
- isFormValid: (isValid: boolean, data: ICheckoutBillingStore) => void;
5
+ isFormValid: (isValid: boolean, data: ICheckoutBilling) => void;
6
6
  }
7
7
  export declare class CheckoutBillingComponent extends BaseComponent<ICheckoutBillingComponentParams, ICheckoutComponent> {
8
8
  private billingData;
@@ -6,6 +6,8 @@ export interface ICheckoutCompletedComponentParams {
6
6
  cardLast4: string;
7
7
  customerEmail: string;
8
8
  giftRecipientEmail: string | null;
9
+ checkoutToken?: string;
10
+ cartId?: string;
9
11
  }
10
12
  export declare class CheckoutCompletedComponent extends BaseComponent<ICheckoutCompletedComponentParams, ICheckoutComponent> {
11
13
  get hostClasses(): string[];
@@ -2,6 +2,7 @@ import { BaseComponent } from '@/core/base-component.service';
2
2
  export interface ICheckoutHeaderParams {
3
3
  onClose?: () => void;
4
4
  onBackToCart?: () => void;
5
+ isHostedCheckout?: boolean;
5
6
  }
6
7
  export declare class CheckoutHeaderComponent extends BaseComponent<ICheckoutHeaderParams> {
7
8
  get hostClasses(): string[];
@@ -1,14 +1,15 @@
1
1
  import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
2
2
  import type { ICheckoutComponent } from '@/interfaces/configs';
3
3
  export declare class CheckoutItemsComponent extends BaseComponent<null, ICheckoutComponent> {
4
+ private togglerElement;
5
+ private togglerButton;
6
+ private togglerLabel;
7
+ private itemsList;
4
8
  get hostClasses(): string[];
5
9
  constructor();
6
10
  private createItemElement;
7
- private getItemsListContainer;
8
- private getTogglerLabel;
9
11
  private getCurrentItemsMap;
10
12
  private syncItemsWithStore;
11
- private updateItemCount;
12
13
  onStoreChanged(changes: IOnStoreChanged[]): boolean | undefined;
13
14
  private handleToggle;
14
15
  private setupToggler;
@@ -1,8 +1,11 @@
1
1
  import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
2
2
  export declare class CheckoutPresaleCountdownComponent extends BaseComponent<null> {
3
+ private static readonly DEFAULT_PRESALE_DURATION_SECONDS;
4
+ private static readonly ONE_MINUTE_THRESHOLD_SECONDS;
5
+ private static readonly COUNTDOWN_UPDATE_INTERVAL_MS;
3
6
  private countdownInterval;
4
7
  private expiresAt;
5
- private totalDuration;
8
+ private initialDurationSeconds;
6
9
  private rootElement;
7
10
  private scrollHandler;
8
11
  private scrollContainer;
@@ -11,16 +14,26 @@ export declare class CheckoutPresaleCountdownComponent extends BaseComponent<nul
11
14
  get hostClasses(): string[];
12
15
  constructor();
13
16
  onStoreChanged(changes: IOnStoreChanged[]): boolean;
17
+ private resetCountdownState;
14
18
  protected afterRender(): void;
15
19
  protected disconnected(): void;
16
20
  private setupDrawerScrollDetection;
21
+ private findScrollContainer;
22
+ private setScrolledState;
17
23
  private isScrollable;
18
24
  private cleanupScrollListener;
19
25
  private updateExpiresAt;
20
26
  private startCountdown;
21
27
  private stopCountdown;
22
28
  private updateCountdown;
29
+ private updateWarningState;
30
+ private updateTimerDisplay;
31
+ private updateProgressBar;
23
32
  private formatTime;
24
33
  private handleExpire;
25
34
  protected template(): HTMLElement;
35
+ private createTextContainer;
36
+ private createHeader;
37
+ private createSubtitle;
38
+ private createProgressBar;
26
39
  }
@@ -1,11 +1,17 @@
1
1
  import { BaseComponent } from '@/core/base-component.service';
2
2
  import type { ICheckoutComponent } from '@/interfaces/configs';
3
- export declare class CheckoutPresaleExpiredComponent extends BaseComponent<null, ICheckoutComponent> {
3
+ export type PresaleExpiredReason = 'time_expired' | 'items_unavailable';
4
+ export interface ICheckoutPresaleExpiredComponentParams {
5
+ reason: PresaleExpiredReason;
6
+ }
7
+ export declare class CheckoutPresaleExpiredComponent extends BaseComponent<ICheckoutPresaleExpiredComponentParams, ICheckoutComponent> {
4
8
  private autoCloseInterval;
5
9
  private autoCloseSeconds;
6
10
  private autoCloseElement;
7
11
  get hostClasses(): string[];
8
12
  get hostAttributes(): Record<string, string>;
13
+ private isItemsUnavailable;
14
+ private isTimeExpired;
9
15
  protected afterRender(): void;
10
16
  protected disconnected(): void;
11
17
  private handleExit;
@@ -6,8 +6,8 @@ export declare class CheckoutTipsComponent extends BaseComponent<null, ICheckout
6
6
  constructor();
7
7
  protected afterRender(): void;
8
8
  private getTipSelection;
9
- private getOnDemandFulfillmentTipInfo;
10
- private getFulfillmentTipInfoArray;
9
+ private getOnDemandFulfillments;
10
+ private getRetailerNameForFulfillment;
11
11
  private handlePercentageSelect;
12
12
  private handleFulfillmentTipInput;
13
13
  private removeTipFromFulfillment;
@@ -7,8 +7,6 @@ export declare class CheckoutPcGcComponent extends BaseComponent<null, ICheckout
7
7
  onStoreWatch(changes: IOnStoreChanged[]): void;
8
8
  private updateAppliedGiftCards;
9
9
  private createAppliedGiftCardElement;
10
- private pcInputContainer;
11
- private gcInputContainer;
12
10
  private inputContainer;
13
11
  private createErrorElement;
14
12
  protected template(): HTMLElement[];
@@ -8,6 +8,7 @@ export declare const customerFormFields: {
8
8
  readonly addressTwo: "addressTwo";
9
9
  readonly company: "company";
10
10
  };
11
+ export type CustomerFieldName = (typeof customerFormFields)[keyof typeof customerFormFields];
11
12
  export declare const giftFormFields: {
12
13
  readonly firstName: "firstName";
13
14
  readonly lastName: "lastName";
@@ -16,6 +17,7 @@ export declare const giftFormFields: {
16
17
  readonly addressTwo: "addressTwo";
17
18
  readonly message: "message";
18
19
  };
20
+ export type GiftFieldName = (typeof giftFormFields)[keyof typeof giftFormFields];
19
21
  export declare const billingFormFields: {
20
22
  readonly firstName: "firstName";
21
23
  readonly lastName: "lastName";
@@ -28,3 +30,4 @@ export declare const billingFormFields: {
28
30
  readonly state: "state";
29
31
  readonly zipCode: "zipCode";
30
32
  };
33
+ export type BillingFieldName = (typeof billingFormFields)[keyof typeof billingFormFields];
@@ -7,6 +7,7 @@ import { type AddItemParams } from '@/modules/cart/cart.commands';
7
7
  export declare class ProductCommands extends BaseCommand {
8
8
  private readonly uiCommands;
9
9
  private readonly cartCommands;
10
+ private readonly checkoutCommands;
10
11
  constructor();
11
12
  static getInstance(): ProductCommands;
12
13
  createProductInstance(productId: string, firstTime?: boolean): Promise<void>;
@@ -0,0 +1,7 @@
1
+ export * from './product-badge';
2
+ export * from './product-button';
3
+ export * from './product-fulfillments';
4
+ export * from './product-price-and-personalization';
5
+ export * from './product-quantity-selector';
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;
@@ -0,0 +1,11 @@
1
+ import type { ProductListCardCornerRadius } from 'interfaces/configs';
2
+ export interface IAddToCartButtonParams {
3
+ isPresale: boolean;
4
+ hasAvailability: boolean;
5
+ state: string;
6
+ disabled?: boolean;
7
+ borderRadius: ProductListCardCornerRadius;
8
+ hasAddress: boolean;
9
+ onClick?: (e: MouseEvent) => void | Promise<void>;
10
+ }
11
+ export declare const createAddToCartButton: ({ isPresale, hasAvailability, state, disabled, borderRadius, hasAddress, onClick, }: IAddToCartButtonParams) => HTMLElement;
@@ -0,0 +1,12 @@
1
+ import type { IProductFulfillmentStore } from 'core/store/interfaces/product.interface';
2
+ import { type NavigationSourceType } from 'enums';
3
+ export interface IFulfillmentSectionParams {
4
+ shippingVariants: Record<string, IProductFulfillmentStore>;
5
+ onDemandVariants: Record<string, IProductFulfillmentStore>;
6
+ enableShippingFulfillment: boolean;
7
+ enableOnDemandFulfillment: boolean;
8
+ productId: string;
9
+ navigationSource?: NavigationSourceType;
10
+ onDeliveryOptionsClick: (productId: string) => void | Promise<void>;
11
+ }
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,10 @@
1
+ import type { ProductListCardCornerRadius, ProductListCardStyle } from 'interfaces/configs';
2
+ export interface IQuantitySelectorParams {
3
+ initialQuantity: number;
4
+ minQuantity: number;
5
+ maxQuantity: number;
6
+ cornerRadius: ProductListCardCornerRadius;
7
+ cardStyle: ProductListCardStyle;
8
+ onChange: (quantity: number) => void;
9
+ }
10
+ export declare const createQuantitySelector: ({ initialQuantity, minQuantity, maxQuantity, cornerRadius, cardStyle, onChange, }: IQuantitySelectorParams) => HTMLElement;
@@ -0,0 +1,9 @@
1
+ import type { IProductSizeStore } from 'core/store/interfaces/product.interface';
2
+ import type { ProductListCardCornerRadius } from 'interfaces/configs';
3
+ export interface ISizeSelectorParams {
4
+ sizes: Record<string, IProductSizeStore>;
5
+ selectedSize: IProductSizeStore;
6
+ cornerRadius: ProductListCardCornerRadius;
7
+ onSelect?: (size: IProductSizeStore) => void;
8
+ }
9
+ export declare const createProductSizesList: ({ sizes, selectedSize, cornerRadius, onSelect }: ISizeSelectorParams) => HTMLElement;
@@ -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;
@@ -0,0 +1,7 @@
1
+ export * from './product-list-apply-filter-button';
2
+ export * from './product-list-checkbox-filter';
3
+ export * from './product-list-chip';
4
+ export * from './product-list-filters-chips';
5
+ export * from './product-list-fulfillment-filter';
6
+ export * from './product-list-price-filter';
7
+ export * from './product-list-toggle-filters';
@@ -0,0 +1 @@
1
+ export declare function createApplyFiltersButton(onApplyFilters: VoidFunction): HTMLElement;
@@ -0,0 +1,5 @@
1
+ export interface IChipComponentParams {
2
+ text: string;
3
+ onRemove?: VoidFunction;
4
+ }
5
+ export declare function createChip(params: IChipComponentParams): HTMLElement;
@@ -0,0 +1,13 @@
1
+ import type { IExtendedFilterSchema, IProductListFilters } from 'modules/product-list/product-list.interface';
2
+ export interface ICreateChipsContainerParams {
3
+ currentFilters?: IProductListFilters;
4
+ sanitizedFilters?: IExtendedFilterSchema[];
5
+ onRemoveFilter: (key: string, value: string) => void;
6
+ onClearAllFilters: VoidFunction;
7
+ }
8
+ export interface IActiveFilter {
9
+ key: string;
10
+ value: string;
11
+ label: string;
12
+ }
13
+ export declare function createChipsContainer(params: ICreateChipsContainerParams): HTMLElement;
@@ -0,0 +1,14 @@
1
+ import { FULFILLMENT_OPTIONS } from 'modules/product-list/product-list.constants';
2
+ import type { IProductListFilters } from 'modules/product-list/product-list.interface';
3
+ export interface ICreateFulfillmentFilterParams {
4
+ currentFilters?: IProductListFilters;
5
+ deliveryCollapsed: boolean;
6
+ isSameDayDeliveryDisabled: boolean;
7
+ onFulfillmentOptionsChange?: (value: typeof FULFILLMENT_OPTIONS.ALL | typeof FULFILLMENT_OPTIONS.SHIPPING | typeof FULFILLMENT_OPTIONS.ON_DEMAND) => void;
8
+ onToggleCollapse: () => void;
9
+ }
10
+ export declare function createFulfillmentFilter(params: ICreateFulfillmentFilterParams): {
11
+ elements: HTMLElement[];
12
+ chevronContainer: HTMLElement;
13
+ fulfillmentList: HTMLElement;
14
+ };
@@ -11,7 +11,7 @@ export interface ICreatePriceFilterParams {
11
11
  };
12
12
  priceCollapsed: boolean;
13
13
  onPriceChange?: (min: string, max: string) => void;
14
- onToggleCollapse: () => void;
14
+ onToggleCollapse: VoidFunction;
15
15
  DEFAULT_MIN: string;
16
16
  DEFAULT_MAX: string;
17
17
  }