@liquidcommerce/elements-sdk 2.6.0-beta.9 → 2.6.0-beta.91

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 (226) hide show
  1. package/README.md +84 -2520
  2. package/dist/index.checkout.esm.js +16946 -0
  3. package/dist/index.esm.js +24448 -21193
  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/checkout.d.ts +2 -0
  7. package/dist/types/auto-initialize/shared-utils.d.ts +50 -0
  8. package/dist/types/{elements-base-client.d.ts → clients/base.d.ts} +15 -2
  9. package/dist/types/clients/builder.d.ts +3 -0
  10. package/dist/types/clients/checkout.d.ts +6 -0
  11. package/dist/types/{elements-client-helper.d.ts → clients/helpers.d.ts} +2 -1
  12. package/dist/types/clients/main.d.ts +3 -0
  13. package/dist/types/constants/core.constant.d.ts +2 -6
  14. package/dist/types/core/api/api-client.service.d.ts +20 -18
  15. package/dist/types/core/api/api-result.d.ts +19 -0
  16. package/dist/types/core/api/auth-client.service.d.ts +37 -13
  17. package/dist/types/core/api/http-client.service.d.ts +0 -8
  18. package/dist/types/core/base-component.service.d.ts +2 -1
  19. package/dist/types/core/client/actions/base-action.service.d.ts +22 -0
  20. package/dist/types/core/client/actions/client-address-action.service.d.ts +18 -0
  21. package/dist/types/core/client/actions/client-cart-action.service.d.ts +38 -0
  22. package/dist/types/core/client/actions/client-checkout-action.service.d.ts +69 -0
  23. package/dist/types/core/client/actions/client-product-action.service.d.ts +15 -0
  24. package/dist/types/core/client/client-action.service.d.ts +6 -74
  25. package/dist/types/core/client/client-config.service.d.ts +8 -5
  26. package/dist/types/core/google-tag-manager.service.d.ts +2 -1
  27. package/dist/types/core/logger/logger.service.d.ts +1 -1
  28. package/dist/types/core/pubsub/interfaces/address.interface.d.ts +3 -0
  29. package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +1 -1
  30. package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +36 -51
  31. package/dist/types/core/pubsub/interfaces/core.interface.d.ts +11 -6
  32. package/dist/types/core/pubsub/pubsub.service.d.ts +1 -2
  33. package/dist/types/core/singleton-manager.service.d.ts +12 -8
  34. package/dist/types/core/store/interfaces/cart.interface.d.ts +2 -3
  35. package/dist/types/core/store/interfaces/checkout.interface.d.ts +18 -108
  36. package/dist/types/core/store/interfaces/core.interface.d.ts +12 -2
  37. package/dist/types/core/store/interfaces/metadata.interface.d.ts +11 -0
  38. package/dist/types/core/store/interfaces/product-list.interface.d.ts +30 -0
  39. package/dist/types/core/store/interfaces/product.interface.d.ts +1 -0
  40. package/dist/types/core/store/store.constant.d.ts +5 -0
  41. package/dist/types/core/store/store.service.d.ts +1 -0
  42. package/dist/types/core/telemetry/telemetry.service.d.ts +1 -0
  43. package/dist/types/enums/core.enum.d.ts +39 -1
  44. package/dist/types/enums/index.d.ts +0 -1
  45. package/dist/types/index.checkout.d.ts +8 -0
  46. package/dist/types/index.checkout.umd.d.ts +4 -0
  47. package/dist/types/index.d.ts +8 -3
  48. package/dist/types/interfaces/api/cart.interface.d.ts +12 -7
  49. package/dist/types/interfaces/api/checkout.interface.d.ts +239 -0
  50. package/dist/types/interfaces/api/index.d.ts +5 -0
  51. package/dist/types/interfaces/api/product-list.interface.d.ts +39 -0
  52. package/dist/types/interfaces/api/product.interface.d.ts +10 -4
  53. package/dist/types/interfaces/client.interface.d.ts +72 -0
  54. package/dist/types/interfaces/component.interface.d.ts +7 -0
  55. package/dist/types/interfaces/config.interface.d.ts +40 -0
  56. package/dist/types/interfaces/configs/address.interface.d.ts +1 -1
  57. package/dist/types/interfaces/configs/cart.interface.d.ts +1 -1
  58. package/dist/types/interfaces/configs/checkout.interface.d.ts +2 -1
  59. package/dist/types/interfaces/configs/global.interface.d.ts +5 -3
  60. package/dist/types/interfaces/configs/index.d.ts +1 -0
  61. package/dist/types/interfaces/configs/product-list.interface.d.ts +49 -0
  62. package/dist/types/interfaces/configs/product.interface.d.ts +3 -1
  63. package/dist/types/interfaces/injection.interface.d.ts +49 -0
  64. package/dist/types/modules/address/address.command.d.ts +2 -1
  65. package/dist/types/modules/address/styles/register-styles.d.ts +1 -0
  66. package/dist/types/modules/cart/cart.commands.d.ts +4 -4
  67. package/dist/types/modules/cart/styles/register-styles.d.ts +1 -0
  68. package/dist/types/modules/checkout/checkout.commands.d.ts +26 -10
  69. package/dist/types/modules/checkout/checkout.component.d.ts +2 -0
  70. package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +2 -2
  71. package/dist/types/modules/checkout/components/checkout-completed.component.d.ts +3 -0
  72. package/dist/types/modules/checkout/components/checkout-header.component.d.ts +1 -0
  73. package/dist/types/modules/checkout/components/checkout-item-quantity.component.d.ts +3 -0
  74. package/dist/types/modules/checkout/components/checkout-items.component.d.ts +4 -3
  75. package/dist/types/modules/checkout/components/checkout-payment.component.d.ts +1 -1
  76. package/dist/types/modules/checkout/components/checkout-presale-countdown.component.d.ts +14 -1
  77. package/dist/types/modules/checkout/components/checkout-presale-expired.component.d.ts +7 -1
  78. package/dist/types/modules/checkout/components/checkout-stripe-form.component.d.ts +2 -1
  79. package/dist/types/modules/checkout/components/checkout-tips.component.d.ts +2 -2
  80. package/dist/types/modules/checkout/components/promo-pc-gc.component.d.ts +0 -2
  81. package/dist/types/modules/checkout/constant.d.ts +3 -0
  82. package/dist/types/modules/checkout/styles/register-styles.d.ts +1 -0
  83. package/dist/types/modules/product/components/product-add-to-cart-section.component.d.ts +1 -0
  84. package/dist/types/modules/product/components/product-description.component.d.ts +1 -0
  85. package/dist/types/modules/product/components/product-image-carousel.component.d.ts +3 -0
  86. package/dist/types/modules/product/components/product-options.component.d.ts +2 -1
  87. package/dist/types/modules/product/components/product-retailers-carousel.component.d.ts +3 -0
  88. package/dist/types/modules/product/components/product-retailers-popup-list.component.d.ts +5 -2
  89. package/dist/types/modules/product/product.commands.d.ts +3 -3
  90. package/dist/types/modules/product/styles/register-styles.d.ts +1 -0
  91. package/dist/types/modules/product-list/components/card-components/index.d.ts +5 -0
  92. package/dist/types/modules/product-list/components/card-components/product-badge.d.ts +9 -0
  93. package/dist/types/modules/product-list/components/card-components/product-button.d.ts +11 -0
  94. package/dist/types/modules/product-list/components/card-components/product-price-and-personalization.d.ts +13 -0
  95. package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts +10 -0
  96. package/dist/types/modules/product-list/components/card-components/product-sizes-list.d.ts +13 -0
  97. package/dist/types/modules/product-list/components/filter-components/index.d.ts +7 -0
  98. package/dist/types/modules/product-list/components/filter-components/product-list-apply-filter-button.d.ts +1 -0
  99. package/dist/types/modules/product-list/components/filter-components/product-list-chip.d.ts +5 -0
  100. package/dist/types/modules/product-list/components/filter-components/product-list-filters-chips.d.ts +13 -0
  101. package/dist/types/modules/product-list/components/filter-components/product-list-fulfillment-filter.d.ts +14 -0
  102. 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
  103. package/dist/types/modules/product-list/components/filter-components/product-list-toggle-filters.d.ts +7 -0
  104. package/dist/types/modules/product-list/components/index.d.ts +6 -2
  105. package/dist/types/modules/product-list/components/product-list-card-loading.component.d.ts +3 -1
  106. package/dist/types/modules/product-list/components/product-list-card.component.d.ts +36 -31
  107. package/dist/types/modules/product-list/components/product-list-engraving.component.d.ts +12 -0
  108. package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +55 -36
  109. package/dist/types/modules/product-list/components/product-list-product-engraving-lines.component.d.ts +22 -0
  110. package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts +50 -0
  111. package/dist/types/modules/product-list/components/product-list-search.component.d.ts +25 -0
  112. package/dist/types/modules/product-list/product-list-filter.utils.d.ts +8 -0
  113. package/dist/types/modules/product-list/product-list-query-params.utils.d.ts +3 -0
  114. package/dist/types/modules/product-list/product-list.commands.d.ts +23 -8
  115. package/dist/types/modules/product-list/product-list.component.d.ts +14 -47
  116. package/dist/types/modules/product-list/product-list.constants.d.ts +38 -0
  117. package/dist/types/modules/product-list/product-list.interface.d.ts +20 -35
  118. package/dist/types/modules/product-list/styles/product-list-card.style.d.ts +1 -0
  119. package/dist/types/modules/product-list/styles/product-list-filters.style.d.ts +1 -0
  120. package/dist/types/modules/product-list/styles/register-styles.d.ts +1 -0
  121. package/dist/types/modules/theme-provider/constants/component-groupings.d.ts +1 -0
  122. package/dist/types/modules/theme-provider/constants/css-variable-mappings.d.ts +1 -1
  123. package/dist/types/modules/theme-provider/services/style-registry.service.d.ts +16 -0
  124. package/dist/types/modules/theme-provider/services/stylesheet-generator.service.d.ts +0 -1
  125. package/dist/types/modules/theme-provider/styles/register-styles.d.ts +1 -0
  126. package/dist/types/modules/theme-provider/theme-provider.service.d.ts +2 -2
  127. package/dist/types/modules/ui-components/drawer/drawer.component.d.ts +1 -0
  128. package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +6 -1
  129. package/dist/types/modules/ui-components/engraving/engraving-view.component.d.ts +6 -1
  130. package/dist/types/modules/ui-components/input/index.d.ts +0 -1
  131. package/dist/types/modules/ui-components/input/input.component.d.ts +8 -1
  132. package/dist/types/modules/ui-components/lce-element/lce-element.component.d.ts +2 -1
  133. package/dist/types/modules/ui-components/promo-code-ticker/promo-code-ticker.component.d.ts +1 -1
  134. package/dist/types/modules/ui-components/ui.commands.d.ts +5 -1
  135. package/dist/types/ssr/stub.checkout.d.ts +6 -0
  136. package/dist/types/ssr/stub.d.ts +10 -0
  137. package/dist/types/static/icon/check.icon.d.ts +2 -0
  138. package/dist/types/static/icon/index.d.ts +1 -0
  139. package/dist/types/utils/dom-compat.d.ts +2 -0
  140. package/dist/types/utils/format.d.ts +0 -14
  141. package/dist/types/utils/image-bg-removal.d.ts +3 -0
  142. package/dist/types/utils/product-selection.d.ts +16 -0
  143. package/dist/types/utils/product.d.ts +15 -0
  144. package/docs/v1/README.md +210 -0
  145. package/docs/v1/api/actions/address-actions.md +286 -0
  146. package/docs/v1/api/actions/cart-actions.md +357 -0
  147. package/docs/v1/api/actions/checkout-actions.md +525 -0
  148. package/docs/v1/api/actions/product-actions.md +204 -0
  149. package/docs/v1/api/client.md +517 -0
  150. package/docs/v1/api/configuration.md +532 -0
  151. package/docs/v1/api/injection-methods.md +292 -0
  152. package/docs/v1/api/typescript-types.md +419 -0
  153. package/docs/v1/api/ui-helpers.md +200 -0
  154. package/docs/v1/examples/advanced-patterns.md +199 -0
  155. package/docs/v1/examples/checkout-flow.md +90 -0
  156. package/docs/v1/examples/custom-theming.md +63 -0
  157. package/docs/v1/examples/multi-product-page.md +90 -0
  158. package/docs/v1/examples/simple-product-page.md +89 -0
  159. package/docs/v1/getting-started/concepts.md +502 -0
  160. package/docs/v1/getting-started/installation.md +328 -0
  161. package/docs/v1/getting-started/quick-start.md +405 -0
  162. package/docs/v1/guides/address-component.md +435 -0
  163. package/docs/v1/guides/best-practices.md +365 -0
  164. package/docs/v1/guides/cart-component.md +725 -0
  165. package/docs/v1/guides/checkout-component.md +670 -0
  166. package/docs/v1/guides/events.md +926 -0
  167. package/docs/v1/guides/product-component.md +731 -0
  168. package/docs/v1/guides/product-list-component.md +631 -0
  169. package/docs/v1/guides/theming.md +213 -0
  170. package/docs/v1/integration/angular.md +39 -0
  171. package/docs/v1/integration/laravel.md +41 -0
  172. package/docs/v1/integration/nextjs.md +69 -0
  173. package/docs/v1/integration/proxy-setup.md +106 -0
  174. package/docs/v1/integration/react.md +64 -0
  175. package/docs/v1/integration/vanilla-js.md +84 -0
  176. package/docs/v1/integration/vue.md +58 -0
  177. package/docs/v1/reference/browser-support.md +45 -0
  178. package/docs/v1/reference/error-handling.md +75 -0
  179. package/docs/v1/reference/performance.md +52 -0
  180. package/docs/v1/reference/troubleshooting.md +136 -0
  181. package/package.json +33 -37
  182. package/dist/types/elements-builder-client.d.ts +0 -2
  183. package/dist/types/elements-client.d.ts +0 -2
  184. package/dist/types/enums/cloud.enum.d.ts +0 -106
  185. package/dist/types/interfaces/cloud/catalog.interface.d.ts +0 -42
  186. package/dist/types/interfaces/cloud/checkout.interface.d.ts +0 -218
  187. package/dist/types/interfaces/cloud/core.interface.d.ts +0 -22
  188. package/dist/types/interfaces/cloud/index.d.ts +0 -4
  189. package/dist/types/interfaces/cloud/retailer.interface.d.ts +0 -67
  190. package/dist/types/interfaces/cloud/user.interface.d.ts +0 -100
  191. package/dist/types/interfaces/core.interface.d.ts +0 -111
  192. package/dist/types/modules/checkout/components/checkout.type.d.ts +0 -4
  193. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/index.d.ts +0 -6
  194. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-apply-filter-button.component.d.ts +0 -1
  195. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-delivery-options-filter.components.d.ts +0 -16
  196. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-search.component.d.ts +0 -16
  197. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-toggle-filters.components.d.ts +0 -18
  198. package/dist/types/modules/theme-provider/styles/address/index.d.ts +0 -1
  199. package/dist/types/modules/theme-provider/styles/cart/index.d.ts +0 -1
  200. package/dist/types/modules/theme-provider/styles/checkout/index.d.ts +0 -1
  201. package/dist/types/modules/theme-provider/styles/product/index.d.ts +0 -3
  202. package/dist/types/modules/theme-provider/styles/product-list/index.d.ts +0 -1
  203. package/dist/types/modules/theme-provider/styles/ui/index.d.ts +0 -3
  204. package/dist/types/modules/ui-components/input/birthdate-input.component.d.ts +0 -53
  205. package/dist/types/utils/helper.d.ts +0 -28
  206. package/docs/ACTIONS.md +0 -1300
  207. package/docs/BROWSER_SUPPORT.md +0 -279
  208. package/docs/CONFIGURATION.md +0 -853
  209. package/docs/DOCUMENTATION_INDEX.md +0 -311
  210. package/docs/EVENTS.md +0 -798
  211. package/docs/PROXY.md +0 -228
  212. package/docs/THEMING.md +0 -592
  213. package/docs/TROUBLESHOOTING.md +0 -793
  214. package/umd/elements.js +0 -1
  215. /package/dist/types/{auto-initialize.d.ts → auto-initialize/main.d.ts} +0 -0
  216. /package/dist/types/modules/{theme-provider/styles/address → address/styles}/address.style.d.ts +0 -0
  217. /package/dist/types/modules/{theme-provider/styles/cart → cart/styles}/cart.style.d.ts +0 -0
  218. /package/dist/types/modules/{theme-provider/styles/checkout → checkout/styles}/checkout.style.d.ts +0 -0
  219. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/image-carousel.style.d.ts +0 -0
  220. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/product.style.d.ts +0 -0
  221. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/retailers.style.d.ts +0 -0
  222. /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
  223. /package/dist/types/modules/{theme-provider/styles/product-list → product-list/styles}/product-list.style.d.ts +0 -0
  224. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/drawer.style.d.ts +0 -0
  225. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/loading.style.d.ts +0 -0
  226. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/promo-code-ticker.style.d.ts +0 -0
@@ -0,0 +1,292 @@
1
+ # Injection Methods API
2
+
3
+ Methods for injecting SDK components into your page.
4
+
5
+ ## injectProductElement()
6
+
7
+ Inject one or more product displays.
8
+
9
+ ### Signature
10
+
11
+ ```typescript
12
+ injectProductElement(params: IInjectProductElement[]): Promise<IInjectedComponent[]>
13
+ ```
14
+
15
+ ### Parameters
16
+
17
+ ```typescript
18
+ interface IInjectProductElement {
19
+ containerId: string; // ID of container element
20
+ identifier: string; // Product Identifier
21
+ }
22
+ ```
23
+
24
+ ### Example
25
+
26
+ ```javascript
27
+ await client.injectProductElement([
28
+ { containerId: 'product-1', identifier: '00619947000020' },
29
+ { containerId: 'product-2', identifier: '08504405135' }
30
+ ]);
31
+ ```
32
+
33
+ ### Returns
34
+
35
+ Array of injected component objects.
36
+
37
+ ---
38
+
39
+ ## injectAddressElement()
40
+
41
+ Inject standalone address component.
42
+
43
+ ### Signature
44
+
45
+ ```typescript
46
+ injectAddressElement(
47
+ containerId: string,
48
+ options?: IAddressOptions
49
+ ): Promise<IInjectedComponent | null>
50
+ ```
51
+
52
+ ### Example
53
+
54
+ ```javascript
55
+ await client.injectAddressElement('address-container', {
56
+ showLabel: true
57
+ });
58
+
59
+ // Listen for address changes via the published event (dispatched on window)
60
+ window.addEventListener('lce:actions.address_updated', (event) => {
61
+ console.log('Address set:', event.detail.data);
62
+ });
63
+ ```
64
+
65
+ ---
66
+
67
+ ## injectCartElement()
68
+
69
+ Inject standalone cart (rarely needed - cart drawer is automatic).
70
+
71
+ ### Signature
72
+
73
+ ```typescript
74
+ injectCartElement(containerId: string): Promise<IInjectedComponent | null>
75
+ ```
76
+
77
+ ### Example
78
+
79
+ ```javascript
80
+ await client.injectCartElement('cart-container');
81
+ ```
82
+
83
+ ---
84
+
85
+ ## injectCheckoutElement()
86
+
87
+ Inject hosted checkout page.
88
+
89
+ ### Signature
90
+
91
+ ```typescript
92
+ injectCheckoutElement(params: IInjectCheckoutParams): Promise<IInjectedComponent | null>
93
+ ```
94
+
95
+ ### Parameters
96
+
97
+ ```typescript
98
+ interface IInjectCheckoutParams {
99
+ containerId: string;
100
+ checkoutId?: string; // Optional checkout token to load
101
+ hideHeader?: boolean; // Hide checkout header
102
+ }
103
+ ```
104
+
105
+ ### Example
106
+
107
+ ```javascript
108
+ await client.injectCheckoutElement({
109
+ containerId: 'checkout',
110
+ checkoutId: 'cart_abc123',
111
+ hideHeader: false
112
+ });
113
+ ```
114
+
115
+ ---
116
+
117
+ ## injectProductList()
118
+
119
+ Inject product catalog/listing.
120
+
121
+ ### Signature
122
+
123
+ ```typescript
124
+ injectProductList(params: IInjectProductListParams): Promise<void>
125
+ ```
126
+
127
+ ### Parameters
128
+
129
+ ```typescript
130
+ interface IInjectProductListParams {
131
+ containerId: string;
132
+ slug: string; // Product list slug identifier
133
+ rows?: number; // Default: 4
134
+ columns?: number; // Default: 4
135
+ filters?: ProductListFilterType[];
136
+ productUrl?: PLCProductUrl; // string template OR Record<identifier, url> map
137
+ }
138
+
139
+ // String template: replace {upc} or {grouping} per product.
140
+ // Map: keys are product identifiers (UPC or salsifyGrouping ID); UPC checked first.
141
+ type PLCProductUrl = string | Record<string, string>;
142
+ ```
143
+
144
+ ### Example — string template
145
+
146
+ ```javascript
147
+ await client.injectProductList({
148
+ containerId: 'products',
149
+ slug: 'best-sellers',
150
+ rows: 4,
151
+ columns: 3,
152
+ filters: ['price', 'brands', 'categories'],
153
+ productUrl: '/product/{grouping}'
154
+ });
155
+ ```
156
+
157
+ > The `filters` array also acts as the whitelist for **URL query param filtering** —
158
+ > the product list reads `?brands=...&price=...` etc. from `window.location.search`
159
+ > on first mount and applies them. See
160
+ > [URL Query Param Filters](../guides/product-list-component.md#url-query-param-filters).
161
+
162
+ ### Example — URL map (partner-owned dedicated PDPs)
163
+
164
+ Use this form when each product has a hand-curated URL that can't be derived
165
+ from a single `{upc}` or `{grouping}` token. See the
166
+ [Product List guide](../guides/product-list-component.md#product-url-map) for
167
+ the equivalent declarative `<script type="application/json">` pattern.
168
+
169
+ ```javascript
170
+ await client.injectProductList({
171
+ containerId: 'products',
172
+ slug: 'best-sellers',
173
+ productUrl: {
174
+ 'GROUPING-33277': '/wines/macallan-12-special-edition',
175
+ '00832889005513': '/spirits/cabernet-2018-club-only',
176
+ },
177
+ });
178
+ ```
179
+
180
+ ---
181
+
182
+ ## injectProductListSearch()
183
+
184
+ Inject product search box.
185
+
186
+ ### Signature
187
+
188
+ ```typescript
189
+ injectProductListSearch(params: IInjectProductListSearchParams): Promise<void>
190
+ ```
191
+
192
+ ### Parameters
193
+
194
+ ```typescript
195
+ interface IInjectProductListSearchParams {
196
+ containerId: string;
197
+ slug: string; // Product list slug identifier
198
+ filters?: ProductListFilterType[];
199
+ }
200
+ ```
201
+
202
+ ### Example
203
+
204
+ ```javascript
205
+ await client.injectProductListSearch({
206
+ containerId: 'search-box',
207
+ slug: 'best-sellers'
208
+ });
209
+ ```
210
+
211
+ ---
212
+
213
+ ## injectProductListFilters()
214
+
215
+ Inject product filter panel.
216
+
217
+ ### Signature
218
+
219
+ ```typescript
220
+ injectProductListFilters(params: IInjectProductListFiltersParams): Promise<void>
221
+ ```
222
+
223
+ ### Parameters
224
+
225
+ ```typescript
226
+ interface IInjectProductListFiltersParams {
227
+ containerId: string;
228
+ slug: string; // Product list slug identifier
229
+ filters?: ProductListFilterType[];
230
+ }
231
+ ```
232
+
233
+ ### Example
234
+
235
+ ```javascript
236
+ await client.injectProductListFilters({
237
+ containerId: 'filters',
238
+ slug: 'best-sellers',
239
+ filters: ['price', 'brands', 'fulfillment']
240
+ });
241
+ ```
242
+
243
+ ---
244
+
245
+ ## Component Management
246
+
247
+ ### getInjectedComponents()
248
+
249
+ Retrieve all injected components.
250
+
251
+ ```typescript
252
+ getInjectedComponents(): Map<string, IInjectedComponent>
253
+ ```
254
+
255
+ ```javascript
256
+ const components = client.getInjectedComponents();
257
+
258
+ // Get specific component
259
+ const product = components.get('product-1');
260
+
261
+ // Rerender component
262
+ product.rerender();
263
+
264
+ // Get container element
265
+ const container = product.getElement();
266
+
267
+ // Get component type
268
+ const type = product.getType(); // 'product'
269
+ ```
270
+
271
+ ### IInjectedComponent Interface
272
+
273
+ ```typescript
274
+ interface IInjectedComponent {
275
+ getType(): ComponentType;
276
+ getElement(): HTMLElement;
277
+ rerender(): void;
278
+ destroy(): void;
279
+ }
280
+ ```
281
+
282
+ | Method | Returns | Description |
283
+ |--------|---------|-------------|
284
+ | `getType()` | `ComponentType` | Returns the type of the injected component |
285
+ | `getElement()` | `HTMLElement` | Returns the container element where the component is injected |
286
+ | `rerender()` | `void` | Re-renders the component with the latest data and configurations |
287
+ | `destroy()` | `void` | Removes the component from the DOM and cleans up internal tracking |
288
+
289
+ ## See Also
290
+
291
+ - [Client API](./client.md)
292
+ - [Component Guides](../guides/)
@@ -0,0 +1,419 @@
1
+ # TypeScript Types Reference
2
+
3
+ All public types are exported from the main package entry point. Import them using the `type` keyword for optimal tree-shaking.
4
+
5
+ ## Importing Types
6
+
7
+ ```typescript
8
+ import { Elements } from '@liquidcommerce/elements-sdk';
9
+ import type {
10
+ ILiquidCommerceElementsClient,
11
+ ILiquidCommerceElementsConfig,
12
+ IInjectProductElement,
13
+ IInjectedComponent
14
+ } from '@liquidcommerce/elements-sdk';
15
+ ```
16
+
17
+ For the checkout-only build:
18
+
19
+ ```typescript
20
+ import { ElementsCheckout } from '@liquidcommerce/elements-sdk/checkout';
21
+ import type {
22
+ IElementsCheckoutClient,
23
+ IElementsCheckoutActions,
24
+ ILiquidCommerceElementsCheckoutClientConfig,
25
+ IInjectedComponent
26
+ } from '@liquidcommerce/elements-sdk/checkout';
27
+ ```
28
+
29
+ ---
30
+
31
+ ## Client Types
32
+
33
+ ### ILiquidCommerceElementsClient
34
+
35
+ Main SDK client interface returned by `Elements()`.
36
+
37
+ ```typescript
38
+ interface ILiquidCommerceElementsClient {
39
+ injectProductElement(params: IInjectProductElement[]): Promise<IInjectedComponent[]>;
40
+ injectAddressElement(containerId: string, options?: IAddressOptions): Promise<IInjectedComponent | null>;
41
+ injectCartElement(containerId: string): Promise<IInjectedComponent | null>;
42
+ injectCheckoutElement(params: IInjectCheckoutParams): Promise<IInjectedComponent | null>;
43
+ injectProductList(params: IInjectProductListParams): Promise<void>;
44
+ injectProductListSearch(params: IInjectProductListSearchParams): Promise<void>;
45
+ injectProductListFilters(params: IInjectProductListFiltersParams): Promise<void>;
46
+ ui: ILiquidCommerceElementsUIMethod;
47
+ actions: ILiquidCommerceElementsActions;
48
+ getInjectedComponents(): Map<string, IInjectedComponent>;
49
+ destroy(): void;
50
+ }
51
+ ```
52
+
53
+ ### ILiquidCommerceElementsBuilderClient
54
+
55
+ Builder-pattern client interface returned by `ElementsBuilder()`.
56
+
57
+ ```typescript
58
+ interface ILiquidCommerceElementsBuilderClient {
59
+ updateComponentGlobalConfigs(configs: UpdateComponentGlobalConfigs): Promise<void>;
60
+ updateProductComponent(configs: UpdateProductComponent): Promise<void>;
61
+ updateAddressComponent(configs: UpdateAddressComponent): void;
62
+ updateCartComponent(configs: UpdateCartComponent): void;
63
+ updateCheckoutComponent(configs: UpdateCheckoutComponent): void;
64
+ updateProductListComponent(configs: UpdateProductListComponent): void;
65
+ injectElement(params: IBuilderInjectElementParams): Promise<IInjectedComponent | null>;
66
+ injectProductElement(params: IInjectProductElement[]): Promise<IInjectedComponent[]>;
67
+ injectAddressElement(containerId: string, options?: IAddressOptions): Promise<IInjectedComponent | null>;
68
+ injectCartElement(containerId: string): Promise<IInjectedComponent | null>;
69
+ injectCheckoutElement(params: IInjectCheckoutBuilderParams): Promise<IInjectedComponent | null>;
70
+ injectProductList(params: IInjectProductListParams): Promise<void>;
71
+ actions: ILiquidCommerceElementsActions;
72
+ destroy(): void;
73
+ }
74
+ ```
75
+
76
+ ### IElementsCheckoutClient
77
+
78
+ Checkout-only client interface returned by `ElementsCheckout()`.
79
+
80
+ ```typescript
81
+ interface IElementsCheckoutClient {
82
+ injectCheckout(params: IInjectCheckoutParams): Promise<IInjectedComponent | null>;
83
+ actions: { checkout: IElementsCheckoutActions };
84
+ destroy(): void;
85
+ }
86
+ ```
87
+
88
+ ---
89
+
90
+ ## Configuration Types
91
+
92
+ ### ILiquidCommerceElementsConfig
93
+
94
+ ```typescript
95
+ interface ILiquidCommerceElementsConfig {
96
+ env?: ElementsEnv;
97
+ promoTicker?: IPromoTicker[];
98
+ customTheme?: IClientCustomThemeConfig;
99
+ debugMode?: DebugMode;
100
+ checkout?: ILiquidCommerceElementsCheckoutConfig;
101
+ proxy?: IElementsProxyConfig;
102
+ development?: ILiquidCommerceElementsDevelopmentConfig;
103
+ }
104
+ ```
105
+
106
+ ### ILiquidCommerceElementsBuilderConfig
107
+
108
+ Same shape as `ILiquidCommerceElementsConfig`, used by `ElementsBuilder()`.
109
+
110
+ ### ILiquidCommerceElementsCheckoutClientConfig
111
+
112
+ Same shape as `ILiquidCommerceElementsConfig`, used for the checkout-only client.
113
+
114
+ ### IClientCustomThemeConfig
115
+
116
+ ```typescript
117
+ interface IClientCustomThemeConfig {
118
+ global?: UpdateComponentGlobalConfigs;
119
+ product?: UpdateProductComponent;
120
+ address?: UpdateAddressComponent;
121
+ cart?: UpdateCartComponent;
122
+ checkout?: UpdateCheckoutComponent;
123
+ productList?: UpdateProductListComponent;
124
+ }
125
+ ```
126
+
127
+ ### IElementsProxyConfig
128
+
129
+ ```typescript
130
+ interface IElementsProxyConfig {
131
+ baseUrl: string;
132
+ headers?: Record<string, string>;
133
+ }
134
+ ```
135
+
136
+ ### ILiquidCommerceElementsDevelopmentConfig
137
+
138
+ ```typescript
139
+ interface ILiquidCommerceElementsDevelopmentConfig {
140
+ customApiUrl?: string;
141
+ openShadowDom?: boolean;
142
+ mockMode?: boolean; // when true, sends an 'X-Liquid-Api-Mock-Mode' header to receive mock data
143
+ }
144
+ ```
145
+
146
+ ### ILiquidCommerceElementsCheckoutConfig
147
+
148
+ ```typescript
149
+ interface ILiquidCommerceElementsCheckoutConfig {
150
+ pageUrl?: string;
151
+ }
152
+ ```
153
+
154
+ See [Configuration Reference](./configuration.md) for detailed property descriptions.
155
+
156
+ ---
157
+
158
+ ## Injection Types
159
+
160
+ ### IInjectProductElement
161
+
162
+ ```typescript
163
+ interface IInjectProductElement {
164
+ containerId: string;
165
+ identifier: string;
166
+ }
167
+ ```
168
+
169
+ ### IInjectCheckoutParams
170
+
171
+ ```typescript
172
+ interface IInjectCheckoutParams {
173
+ containerId: string;
174
+ checkoutId?: string;
175
+ hideHeader?: boolean;
176
+ }
177
+ ```
178
+
179
+ ### IInjectCheckoutBuilderParams
180
+
181
+ ```typescript
182
+ interface IInjectCheckoutBuilderParams extends IInjectCheckoutParams {
183
+ simulatePresale?: boolean;
184
+ presaleExpiresInMinutes?: number;
185
+ }
186
+ ```
187
+
188
+ ### IInjectProductListParams
189
+
190
+ ```typescript
191
+ interface IInjectProductListParams {
192
+ containerId: string;
193
+ slug: string;
194
+ rows?: number;
195
+ columns?: number;
196
+ filters?: ProductListFilterType[];
197
+ productUrl?: PLCProductUrl;
198
+ }
199
+ ```
200
+
201
+ ### PLCProductUrl
202
+
203
+ ```typescript
204
+ /**
205
+ * Product card link configuration.
206
+ *
207
+ * - String: template with `{upc}` (selected size's UPC) or `{grouping}`
208
+ * (product's salsifyGrouping ID). Replaced per product card.
209
+ * - Map: keyed by product identifier (UPC or salsifyGrouping ID — same
210
+ * identifier types accepted by `injectProductElement`). The card looks up
211
+ * UPC first, then grouping ID. Use this when partner PDPs have
212
+ * hand-curated URLs that aren't derivable from a single token.
213
+ */
214
+ type PLCProductUrl = string | Record<string, string>;
215
+ ```
216
+
217
+ ### IInjectProductListSearchParams
218
+
219
+ ```typescript
220
+ interface IInjectProductListSearchParams {
221
+ containerId: string;
222
+ slug: string;
223
+ filters?: ProductListFilterType[];
224
+ }
225
+ ```
226
+
227
+ ### IInjectProductListFiltersParams
228
+
229
+ ```typescript
230
+ interface IInjectProductListFiltersParams {
231
+ containerId: string;
232
+ slug: string;
233
+ filters?: ProductListFilterType[];
234
+ }
235
+ ```
236
+
237
+ ### IBuilderInjectElementParams
238
+
239
+ ```typescript
240
+ interface IBuilderInjectElementParams {
241
+ type: ComponentType;
242
+ containerId: string;
243
+ [key: string]: any;
244
+ }
245
+ ```
246
+
247
+ ---
248
+
249
+ ## Component Types
250
+
251
+ ### IInjectedComponent
252
+
253
+ Returned by all injection methods. Provides control over the injected component.
254
+
255
+ ```typescript
256
+ interface IInjectedComponent {
257
+ getType(): ComponentType;
258
+ getElement(): HTMLElement;
259
+ rerender(): void;
260
+ destroy(): void;
261
+ }
262
+ ```
263
+
264
+ ---
265
+
266
+ ## UI Types
267
+
268
+ ### ILiquidCommerceElementsUIMethod
269
+
270
+ ```typescript
271
+ interface ILiquidCommerceElementsUIMethod {
272
+ cartButton(containerId: string, showItemsCount?: boolean): void;
273
+ floatingCartButton(showItemsCount?: boolean): void;
274
+ cartSubtotal(elementId: string): void;
275
+ cartItemsCount(elementId: string, options?: { hideZero: boolean }): void;
276
+ }
277
+ ```
278
+
279
+ ---
280
+
281
+ ## Action Types
282
+
283
+ ### ILiquidCommerceElementsActions
284
+
285
+ ```typescript
286
+ interface ILiquidCommerceElementsActions {
287
+ product: IProductActions;
288
+ address: IAddressActions;
289
+ cart: ICartActions;
290
+ checkout: ICheckoutActions;
291
+ }
292
+ ```
293
+
294
+ ### IElementsCheckoutActions
295
+
296
+ Checkout actions available in the checkout-only client. Omits drawer-related methods.
297
+
298
+ ```typescript
299
+ interface IElementsCheckoutActions extends Omit<ICheckoutActions, 'openCheckout' | 'closeCheckout' | 'toggleCheckout'> {}
300
+ ```
301
+
302
+ See [Actions API](./actions/) for detailed method signatures.
303
+
304
+ ---
305
+
306
+ ## Enum Types
307
+
308
+ ### ElementsEnv
309
+
310
+ ```typescript
311
+ type ElementsEnv = 'development' | 'staging' | 'production';
312
+ ```
313
+
314
+ ### DebugMode
315
+
316
+ ```typescript
317
+ type DebugMode = 'none' | 'console' | 'panel';
318
+ ```
319
+
320
+ ### FulfillmentType
321
+
322
+ ```typescript
323
+ type FulfillmentType = 'onDemand' | 'shipping';
324
+ ```
325
+
326
+ ### ComponentType
327
+
328
+ ```typescript
329
+ type ComponentType =
330
+ | 'address' | 'product' | 'cart' | 'checkout'
331
+ | 'product-list' | 'product-list-card' | 'product-list-filters' | 'product-list-search'
332
+ | 'drawer' | 'input' | 'engraving-form' | 'engraving-view'
333
+ | 'buttons-cart-open' | 'powered-by' | 'lce-element'
334
+ | 'purchase-min-alert' | 'alert' | 'promo-code-ticker'
335
+ // ...and additional internal component types
336
+ ```
337
+
338
+ ### DisplayModeType
339
+
340
+ ```typescript
341
+ type DisplayModeType = 'modal' | 'drawer';
342
+ ```
343
+
344
+ ---
345
+
346
+ ## Theme Configuration Types
347
+
348
+ ### UpdateComponentGlobalConfigs
349
+
350
+ `DeepPartial<IComponentGlobalConfigs>` -- all properties optional.
351
+
352
+ ### UpdateProductComponent
353
+
354
+ `DeepPartial<IProductComponent>` -- all properties optional.
355
+
356
+ ### UpdateCartComponent
357
+
358
+ `DeepPartial<ICartComponent>` -- all properties optional.
359
+
360
+ ### UpdateCheckoutComponent
361
+
362
+ `DeepPartial<ICheckoutComponent>` -- all properties optional.
363
+
364
+ ### UpdateAddressComponent
365
+
366
+ `DeepPartial<IAddressComponent>` -- all properties optional.
367
+
368
+ ### UpdateProductListComponent
369
+
370
+ Special structure for updating product list configuration by slug:
371
+
372
+ ```typescript
373
+ interface UpdateProductListComponent {
374
+ theme?: { backgroundColor?: string };
375
+ layout?: {
376
+ lists?: Record<string, DeepPartial<IPLCList>>;
377
+ };
378
+ }
379
+ ```
380
+
381
+ See [Configuration Reference](./configuration.md) for detailed theme property descriptions.
382
+
383
+ ---
384
+
385
+ ## Promo Ticker Type
386
+
387
+ ### IPromoTicker
388
+
389
+ ```typescript
390
+ interface IPromoTicker {
391
+ promoCode: string;
392
+ text: string[];
393
+ separator: string;
394
+ activeFrom: string; // ISO 8601 UTC
395
+ activeUntil: string; // ISO 8601 UTC
396
+ }
397
+ ```
398
+
399
+ ---
400
+
401
+ ## Utility Types
402
+
403
+ ### DeepPartial
404
+
405
+ Used internally for theme update types. Makes all properties in `T` recursively optional.
406
+
407
+ ```typescript
408
+ type DeepPartial<T> = {
409
+ [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
410
+ };
411
+ ```
412
+
413
+ ---
414
+
415
+ ## See Also
416
+
417
+ - [Client API](./client.md) - Client initialization and usage
418
+ - [Configuration Reference](./configuration.md) - Detailed config options
419
+ - [Injection Methods](./injection-methods.md) - Component injection API