@liquidcommerce/elements-sdk 2.6.0-beta.11 → 2.6.0-beta.111

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 (270) hide show
  1. package/README.md +99 -2518
  2. package/dist/index.checkout.esm.js +18212 -0
  3. package/dist/index.esm.js +26222 -20637
  4. package/dist/ssr-stub.checkout.esm.js +17 -0
  5. package/dist/ssr-stub.esm.js +269 -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 +13 -18
  14. package/dist/types/core/a11y/announcer.service.d.ts +16 -0
  15. package/dist/types/core/a11y/focus-manager.service.d.ts +21 -0
  16. package/dist/types/core/a11y/focusable.d.ts +5 -0
  17. package/dist/types/core/a11y/glyph-button.d.ts +8 -0
  18. package/dist/types/core/a11y/index.d.ts +6 -0
  19. package/dist/types/core/a11y/required.d.ts +1 -0
  20. package/dist/types/core/a11y/single-select.d.ts +20 -0
  21. package/dist/types/core/api/api-client.service.d.ts +19 -18
  22. package/dist/types/core/api/api-result.d.ts +19 -0
  23. package/dist/types/core/api/auth-client.service.d.ts +37 -13
  24. package/dist/types/core/api/http-client.service.d.ts +0 -8
  25. package/dist/types/core/base-component.service.d.ts +4 -1
  26. package/dist/types/core/client/actions/base-action.service.d.ts +22 -0
  27. package/dist/types/core/client/actions/client-address-action.service.d.ts +18 -0
  28. package/dist/types/core/client/actions/client-cart-action.service.d.ts +38 -0
  29. package/dist/types/core/client/actions/client-checkout-action.service.d.ts +69 -0
  30. package/dist/types/core/client/actions/client-product-action.service.d.ts +15 -0
  31. package/dist/types/core/client/client-action.service.d.ts +6 -74
  32. package/dist/types/core/client/client-config.service.d.ts +8 -5
  33. package/dist/types/core/debug-panel/debug-panel.styles.d.ts +1 -1
  34. package/dist/types/core/google-tag-manager.service.d.ts +3 -1
  35. package/dist/types/core/logger/logger.service.d.ts +1 -1
  36. package/dist/types/core/pubsub/interfaces/address.interface.d.ts +3 -0
  37. package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +1 -1
  38. package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +36 -51
  39. package/dist/types/core/pubsub/interfaces/core.interface.d.ts +11 -6
  40. package/dist/types/core/pubsub/pubsub.service.d.ts +1 -2
  41. package/dist/types/core/singleton-manager.service.d.ts +12 -8
  42. package/dist/types/core/store/interfaces/cart.interface.d.ts +2 -3
  43. package/dist/types/core/store/interfaces/checkout.interface.d.ts +19 -108
  44. package/dist/types/core/store/interfaces/core.interface.d.ts +12 -2
  45. package/dist/types/core/store/interfaces/metadata.interface.d.ts +11 -0
  46. package/dist/types/core/store/interfaces/product-list.interface.d.ts +30 -0
  47. package/dist/types/core/store/interfaces/product.interface.d.ts +1 -0
  48. package/dist/types/core/store/store.constant.d.ts +5 -0
  49. package/dist/types/core/store/store.service.d.ts +1 -0
  50. package/dist/types/core/telemetry/telemetry.service.d.ts +1 -0
  51. package/dist/types/enums/core.enum.d.ts +39 -2
  52. package/dist/types/enums/index.d.ts +0 -1
  53. package/dist/types/index.checkout.d.ts +8 -0
  54. package/dist/types/index.checkout.umd.d.ts +4 -0
  55. package/dist/types/index.d.ts +8 -3
  56. package/dist/types/interfaces/api/cart.interface.d.ts +12 -7
  57. package/dist/types/interfaces/api/checkout.interface.d.ts +239 -0
  58. package/dist/types/interfaces/api/index.d.ts +5 -0
  59. package/dist/types/interfaces/api/product-list.interface.d.ts +15 -6
  60. package/dist/types/interfaces/api/product.interface.d.ts +10 -4
  61. package/dist/types/interfaces/client.interface.d.ts +72 -0
  62. package/dist/types/interfaces/component.interface.d.ts +7 -0
  63. package/dist/types/interfaces/config.interface.d.ts +40 -0
  64. package/dist/types/interfaces/configs/address.interface.d.ts +1 -1
  65. package/dist/types/interfaces/configs/cart.interface.d.ts +1 -1
  66. package/dist/types/interfaces/configs/checkout.interface.d.ts +2 -1
  67. package/dist/types/interfaces/configs/global.interface.d.ts +9 -3
  68. package/dist/types/interfaces/configs/index.d.ts +1 -0
  69. package/dist/types/interfaces/configs/product-list.interface.d.ts +49 -0
  70. package/dist/types/interfaces/configs/product.interface.d.ts +5 -1
  71. package/dist/types/interfaces/injection.interface.d.ts +50 -0
  72. package/dist/types/modules/address/address-display.component.d.ts +3 -1
  73. package/dist/types/modules/address/address-input.component.d.ts +10 -1
  74. package/dist/types/modules/address/address.command.d.ts +2 -1
  75. package/dist/types/modules/address/styles/register-styles.d.ts +1 -0
  76. package/dist/types/modules/cart/cart.commands.d.ts +4 -4
  77. package/dist/types/modules/cart/components/cart-body.component.d.ts +1 -0
  78. package/dist/types/modules/cart/components/cart-item-quantity-price.component.d.ts +5 -0
  79. package/dist/types/modules/cart/components/cart-item.component.d.ts +6 -0
  80. package/dist/types/modules/cart/styles/register-styles.d.ts +1 -0
  81. package/dist/types/modules/checkout/checkout.commands.d.ts +34 -11
  82. package/dist/types/modules/checkout/checkout.component.d.ts +6 -1
  83. package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +5 -2
  84. package/dist/types/modules/checkout/components/checkout-completed.component.d.ts +5 -0
  85. package/dist/types/modules/checkout/components/checkout-header.component.d.ts +1 -0
  86. package/dist/types/modules/checkout/components/checkout-item-quantity.component.d.ts +4 -0
  87. package/dist/types/modules/checkout/components/checkout-items.component.d.ts +4 -3
  88. package/dist/types/modules/checkout/components/checkout-order-summary.component.d.ts +2 -0
  89. package/dist/types/modules/checkout/components/checkout-payment.component.d.ts +2 -1
  90. package/dist/types/modules/checkout/components/checkout-place-order-button.component.d.ts +2 -0
  91. package/dist/types/modules/checkout/components/checkout-presale-countdown.component.d.ts +15 -1
  92. package/dist/types/modules/checkout/components/checkout-presale-expired.component.d.ts +7 -1
  93. package/dist/types/modules/checkout/components/checkout-send-as-gift.component.d.ts +3 -0
  94. package/dist/types/modules/checkout/components/checkout-stripe-form.component.d.ts +4 -2
  95. package/dist/types/modules/checkout/components/checkout-tips.component.d.ts +4 -2
  96. package/dist/types/modules/checkout/components/promo-pc-gc.component.d.ts +0 -2
  97. package/dist/types/modules/checkout/components/required-fields-legend.d.ts +1 -0
  98. package/dist/types/modules/checkout/constant.d.ts +3 -0
  99. package/dist/types/modules/checkout/payment-session-error.d.ts +4 -0
  100. package/dist/types/modules/checkout/styles/register-styles.d.ts +1 -0
  101. package/dist/types/modules/product/components/components.d.ts +26 -2
  102. package/dist/types/modules/product/components/product-add-to-cart-section.component.d.ts +7 -1
  103. package/dist/types/modules/product/components/product-description.component.d.ts +1 -0
  104. package/dist/types/modules/product/components/product-drawer.component.d.ts +6 -0
  105. package/dist/types/modules/product/components/product-image-carousel.component.d.ts +5 -0
  106. package/dist/types/modules/product/components/product-options.component.d.ts +2 -1
  107. package/dist/types/modules/product/components/product-retailers-carousel.component.d.ts +6 -0
  108. package/dist/types/modules/product/components/product-retailers-popup-list.component.d.ts +12 -2
  109. package/dist/types/modules/product/product.commands.d.ts +5 -5
  110. package/dist/types/modules/product/styles/register-styles.d.ts +1 -0
  111. package/dist/types/modules/product-list/components/card-components/index.d.ts +5 -0
  112. package/dist/types/modules/product-list/components/card-components/product-badge.d.ts +9 -0
  113. package/dist/types/modules/product-list/components/card-components/product-button.d.ts +11 -0
  114. package/dist/types/modules/product-list/components/card-components/product-price-and-personalization.d.ts +14 -0
  115. package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts +11 -0
  116. package/dist/types/modules/product-list/components/card-components/product-sizes-list.d.ts +14 -0
  117. package/dist/types/modules/product-list/components/filter-components/index.d.ts +7 -0
  118. package/dist/types/modules/product-list/components/filter-components/product-list-apply-filter-button.d.ts +1 -0
  119. 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} +1 -0
  120. package/dist/types/modules/product-list/components/filter-components/product-list-chip.d.ts +5 -0
  121. package/dist/types/modules/product-list/components/filter-components/product-list-filters-chips.d.ts +13 -0
  122. package/dist/types/modules/product-list/components/filter-components/product-list-fulfillment-filter.d.ts +15 -0
  123. 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} +2 -1
  124. package/dist/types/modules/product-list/components/filter-components/product-list-toggle-filters.d.ts +7 -0
  125. package/dist/types/modules/product-list/components/index.d.ts +6 -2
  126. package/dist/types/modules/product-list/components/product-list-card-loading.component.d.ts +3 -1
  127. package/dist/types/modules/product-list/components/product-list-card.component.d.ts +37 -31
  128. package/dist/types/modules/product-list/components/product-list-engraving.component.d.ts +12 -0
  129. package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +58 -36
  130. package/dist/types/modules/product-list/components/product-list-product-engraving-lines.component.d.ts +22 -0
  131. package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts +53 -0
  132. package/dist/types/modules/product-list/components/product-list-search.component.d.ts +25 -0
  133. package/dist/types/modules/product-list/product-list-filter.registry.d.ts +42 -0
  134. package/dist/types/modules/product-list/product-list-filter.utils.d.ts +7 -0
  135. package/dist/types/modules/product-list/product-list-order.utils.d.ts +3 -0
  136. package/dist/types/modules/product-list/product-list-query-params.utils.d.ts +3 -0
  137. package/dist/types/modules/product-list/product-list.commands.d.ts +22 -7
  138. package/dist/types/modules/product-list/product-list.component.d.ts +23 -47
  139. package/dist/types/modules/product-list/product-list.constants.d.ts +38 -0
  140. package/dist/types/modules/product-list/product-list.interface.d.ts +17 -28
  141. package/dist/types/modules/product-list/styles/product-list-card.style.d.ts +1 -0
  142. package/dist/types/modules/product-list/styles/product-list-filters.style.d.ts +1 -0
  143. package/dist/types/modules/product-list/styles/register-styles.d.ts +1 -0
  144. package/dist/types/modules/theme-provider/constants/component-groupings.d.ts +1 -0
  145. package/dist/types/modules/theme-provider/constants/css-variable-mappings.d.ts +1 -1
  146. package/dist/types/modules/theme-provider/services/style-registry.service.d.ts +16 -0
  147. package/dist/types/modules/theme-provider/services/stylesheet-generator.service.d.ts +0 -1
  148. package/dist/types/modules/theme-provider/styles/register-styles.d.ts +1 -0
  149. package/dist/types/modules/theme-provider/theme-provider.service.d.ts +2 -2
  150. package/dist/types/modules/ui-components/alert/alert.component.d.ts +1 -1
  151. package/dist/types/modules/ui-components/buttons/buttons-open-cart.component.d.ts +5 -0
  152. package/dist/types/modules/ui-components/drawer/drawer.component.d.ts +15 -0
  153. package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +8 -1
  154. package/dist/types/modules/ui-components/engraving/engraving-view.component.d.ts +7 -1
  155. package/dist/types/modules/ui-components/input/index.d.ts +0 -1
  156. package/dist/types/modules/ui-components/input/input.component.d.ts +14 -1
  157. package/dist/types/modules/ui-components/lce-element/lce-element.component.d.ts +2 -1
  158. package/dist/types/modules/ui-components/promo-code-ticker/promo-code-ticker.component.d.ts +1 -1
  159. package/dist/types/modules/ui-components/ui.commands.d.ts +7 -1
  160. package/dist/types/ssr/stub.checkout.d.ts +6 -0
  161. package/dist/types/ssr/stub.d.ts +10 -0
  162. package/dist/types/static/icon/arrow-right.icon.d.ts +1 -1
  163. package/dist/types/static/icon/bag.icon.d.ts +1 -1
  164. package/dist/types/static/icon/check.icon.d.ts +2 -0
  165. package/dist/types/static/icon/checkbox.icon.d.ts +1 -1
  166. package/dist/types/static/icon/chevron-down.icon.d.ts +1 -1
  167. package/dist/types/static/icon/chevron-left.icon.d.ts +1 -1
  168. package/dist/types/static/icon/chevron-up.icon.d.ts +1 -1
  169. package/dist/types/static/icon/close.icon.d.ts +1 -1
  170. package/dist/types/static/icon/error-info.icon.d.ts +1 -1
  171. package/dist/types/static/icon/filter.icon.d.ts +1 -1
  172. package/dist/types/static/icon/icon.a11y.d.ts +1 -0
  173. package/dist/types/static/icon/icon.types.d.ts +1 -0
  174. package/dist/types/static/icon/index.d.ts +2 -0
  175. package/dist/types/static/icon/info.icon.d.ts +1 -1
  176. package/dist/types/static/icon/loading-spinner.icon.d.ts +1 -1
  177. package/dist/types/static/icon/search.icon.d.ts +1 -1
  178. package/dist/types/static/icon/success.icon.d.ts +1 -1
  179. package/dist/types/static/icon/trash.icon.d.ts +1 -1
  180. package/dist/types/static/icon/warning.icon.d.ts +1 -1
  181. package/dist/types/utils/dom-compat.d.ts +2 -0
  182. package/dist/types/utils/format.d.ts +5 -14
  183. package/dist/types/utils/image-bg-removal.d.ts +3 -0
  184. package/dist/types/utils/product-selection.d.ts +16 -0
  185. package/dist/types/utils/product.d.ts +18 -0
  186. package/dist/types/utils/timezone.d.ts +6 -0
  187. package/docs/v1/README.md +213 -0
  188. package/docs/v1/api/actions/address-actions.md +286 -0
  189. package/docs/v1/api/actions/cart-actions.md +364 -0
  190. package/docs/v1/api/actions/checkout-actions.md +527 -0
  191. package/docs/v1/api/actions/product-actions.md +204 -0
  192. package/docs/v1/api/client.md +596 -0
  193. package/docs/v1/api/configuration.md +557 -0
  194. package/docs/v1/api/injection-methods.md +331 -0
  195. package/docs/v1/api/typescript-types.md +424 -0
  196. package/docs/v1/api/ui-helpers.md +200 -0
  197. package/docs/v1/examples/advanced-patterns.md +199 -0
  198. package/docs/v1/examples/checkout-flow.md +90 -0
  199. package/docs/v1/examples/custom-theming.md +63 -0
  200. package/docs/v1/examples/multi-product-page.md +90 -0
  201. package/docs/v1/examples/simple-product-page.md +89 -0
  202. package/docs/v1/getting-started/concepts.md +521 -0
  203. package/docs/v1/getting-started/installation.md +349 -0
  204. package/docs/v1/getting-started/quick-start.md +410 -0
  205. package/docs/v1/guides/accessibility.md +219 -0
  206. package/docs/v1/guides/address-component.md +435 -0
  207. package/docs/v1/guides/best-practices.md +365 -0
  208. package/docs/v1/guides/cart-component.md +757 -0
  209. package/docs/v1/guides/checkout-component.md +670 -0
  210. package/docs/v1/guides/events.md +939 -0
  211. package/docs/v1/guides/product-component.md +736 -0
  212. package/docs/v1/guides/product-list-component.md +730 -0
  213. package/docs/v1/guides/theming.md +229 -0
  214. package/docs/v1/integration/angular.md +39 -0
  215. package/docs/v1/integration/laravel.md +41 -0
  216. package/docs/v1/integration/nextjs.md +69 -0
  217. package/docs/v1/integration/proxy-setup.md +106 -0
  218. package/docs/v1/integration/react.md +64 -0
  219. package/docs/v1/integration/vanilla-js.md +84 -0
  220. package/docs/v1/integration/vue.md +58 -0
  221. package/docs/v1/reference/analytics.md +107 -0
  222. package/docs/v1/reference/browser-support.md +47 -0
  223. package/docs/v1/reference/error-handling.md +83 -0
  224. package/docs/v1/reference/performance.md +52 -0
  225. package/docs/v1/reference/telemetry.md +85 -0
  226. package/docs/v1/reference/troubleshooting.md +135 -0
  227. package/package.json +75 -45
  228. package/dist/types/elements-builder-client.d.ts +0 -2
  229. package/dist/types/elements-client.d.ts +0 -2
  230. package/dist/types/enums/cloud.enum.d.ts +0 -97
  231. package/dist/types/interfaces/cloud/checkout.interface.d.ts +0 -218
  232. package/dist/types/interfaces/cloud/core.interface.d.ts +0 -22
  233. package/dist/types/interfaces/cloud/index.d.ts +0 -3
  234. package/dist/types/interfaces/cloud/retailer.interface.d.ts +0 -67
  235. package/dist/types/interfaces/cloud/user.interface.d.ts +0 -100
  236. package/dist/types/interfaces/core.interface.d.ts +0 -111
  237. package/dist/types/modules/checkout/components/checkout.type.d.ts +0 -4
  238. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/index.d.ts +0 -6
  239. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-apply-filter-button.component.d.ts +0 -1
  240. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-delivery-options-filter.components.d.ts +0 -16
  241. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-search.component.d.ts +0 -16
  242. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-toggle-filters.components.d.ts +0 -18
  243. package/dist/types/modules/theme-provider/styles/address/index.d.ts +0 -1
  244. package/dist/types/modules/theme-provider/styles/cart/index.d.ts +0 -1
  245. package/dist/types/modules/theme-provider/styles/checkout/index.d.ts +0 -1
  246. package/dist/types/modules/theme-provider/styles/product/index.d.ts +0 -3
  247. package/dist/types/modules/theme-provider/styles/product-list/index.d.ts +0 -1
  248. package/dist/types/modules/theme-provider/styles/ui/index.d.ts +0 -3
  249. package/dist/types/modules/ui-components/input/birthdate-input.component.d.ts +0 -53
  250. package/dist/types/utils/helper.d.ts +0 -28
  251. package/docs/ACTIONS.md +0 -1300
  252. package/docs/BROWSER_SUPPORT.md +0 -279
  253. package/docs/CONFIGURATION.md +0 -853
  254. package/docs/DOCUMENTATION_INDEX.md +0 -311
  255. package/docs/EVENTS.md +0 -798
  256. package/docs/PROXY.md +0 -228
  257. package/docs/THEMING.md +0 -592
  258. package/docs/TROUBLESHOOTING.md +0 -793
  259. package/umd/elements.js +0 -1
  260. /package/dist/types/{auto-initialize.d.ts → auto-initialize/main.d.ts} +0 -0
  261. /package/dist/types/modules/{theme-provider/styles/address → address/styles}/address.style.d.ts +0 -0
  262. /package/dist/types/modules/{theme-provider/styles/cart → cart/styles}/cart.style.d.ts +0 -0
  263. /package/dist/types/modules/{theme-provider/styles/checkout → checkout/styles}/checkout.style.d.ts +0 -0
  264. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/image-carousel.style.d.ts +0 -0
  265. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/product.style.d.ts +0 -0
  266. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/retailers.style.d.ts +0 -0
  267. /package/dist/types/modules/{theme-provider/styles/product-list → product-list/styles}/product-list.style.d.ts +0 -0
  268. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/drawer.style.d.ts +0 -0
  269. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/loading.style.d.ts +0 -0
  270. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/promo-code-ticker.style.d.ts +0 -0
@@ -0,0 +1,939 @@
1
+ # Events Guide
2
+
3
+ The SDK publishes browser events for user interactions and state changes. Use them to react to product selections, cart updates, and checkout progress.
4
+
5
+ ## Event Format
6
+
7
+ All SDK events are dispatched as native `CustomEvent` objects. The payload lives in `event.detail`:
8
+
9
+ ```javascript
10
+ window.addEventListener('lce:actions.client_ready', (event) => {
11
+ const { data, metadata } = event.detail;
12
+
13
+ const {
14
+ event: eventName,
15
+ namespace,
16
+ originalEvent,
17
+ actionNamespace,
18
+ eventId,
19
+ timestamp,
20
+ sdkVersion,
21
+ env,
22
+ tenantName,
23
+ tenantCode
24
+ } = metadata;
25
+ }, { once: true });
26
+ ```
27
+
28
+ `data` is event-specific. `metadata` carries the same ten fields on **every** event — including
29
+ `sdkVersion`, `env`, `tenantName` and `tenantCode`, so partner/tenant identification is already
30
+ present and does not need to be re-derived in your analytics layer.
31
+
32
+ ## Event Namespaces
33
+
34
+ - `lce:actions.*` - User actions and state changes
35
+ - `lce:forms.*` - Form field interactions (checkout)
36
+ - `lce:actions` - All action events (namespace-level listener)
37
+ - `lce:forms` - All form events (namespace-level listener)
38
+
39
+ Example: listen to every action event:
40
+
41
+ ```javascript
42
+ window.addEventListener('lce:actions', (event) => {
43
+ const { metadata } = event.detail;
44
+ console.log('Action event:', metadata.event);
45
+ });
46
+ ```
47
+
48
+ ## Core Events
49
+
50
+ ### `lce:actions.client_ready`
51
+
52
+ Fires when the SDK finishes initializing and is ready for actions.
53
+
54
+ > **Always register this listener with `{ once: true }`.** The specific topic
55
+ > `lce:actions.client_ready` is dispatched **twice** — once synchronously, and once again on a
56
+ > microtask, so that listeners attached immediately after `await Elements(...)` resolves still catch
57
+ > it. Without `{ once: true }`, a handler registered before initialization runs **twice**, which
58
+ > double-injects components and double-counts analytics. (The namespace-level `lce:actions` listener
59
+ > receives it only once.)
60
+
61
+ **Data includes:** `isReady`, `message`, `timestamp`, `version`.
62
+
63
+ **Example**
64
+
65
+ ```javascript
66
+ window.addEventListener('lce:actions.client_ready', (event) => {
67
+ const { data } = event.detail;
68
+ if (data.isReady) {
69
+ console.log('Elements SDK ready', data.version);
70
+ }
71
+ }, { once: true });
72
+ ```
73
+
74
+ ## Product Events
75
+
76
+ ### `lce:actions.product_loaded`
77
+
78
+ Fires when a product component finishes loading and product data is available.
79
+
80
+ **Data includes:** `identifier`, `name`, `priceInfo`, `selectedSizeId`, `selectedFulfillmentType`.
81
+
82
+ **Example**
83
+
84
+ ```javascript
85
+ window.addEventListener('lce:actions.product_loaded', (event) => {
86
+ const { data } = event.detail;
87
+ console.log(`Loaded ${data.name} (${data.identifier})`);
88
+ });
89
+ ```
90
+
91
+ ### `lce:actions.product_add_to_cart`
92
+
93
+ Fires when the user triggers add-to-cart from a product component. Use cart events to confirm success or failure.
94
+
95
+ **Data includes:** `identifier`, `quantity`, `fulfillmentId`, `partNumber`, `engravingLines`.
96
+
97
+ **Example**
98
+
99
+ ```javascript
100
+ window.addEventListener('lce:actions.product_add_to_cart', (event) => {
101
+ const { data } = event.detail;
102
+ gtag('event', 'add_to_cart_click', { item_id: data.identifier, quantity: data.quantity });
103
+ });
104
+ ```
105
+
106
+ ### `lce:actions.product_size_changed`
107
+
108
+ Fires when the user changes the selected size.
109
+
110
+ **Data includes:** `identifier`, `selectedSizeId`, `selectedSize`, `previousSizeId`, `previousSize`.
111
+
112
+ **Example**
113
+
114
+ ```javascript
115
+ window.addEventListener('lce:actions.product_size_changed', (event) => {
116
+ const { data } = event.detail;
117
+ console.log(`Size changed to ${data.selectedSize}`);
118
+ });
119
+ ```
120
+
121
+ ### `lce:actions.product_fulfillment_type_changed`
122
+
123
+ Fires when the user switches between fulfillment types (for example shipping vs onDemand).
124
+
125
+ **Data includes:** `identifier`, `selectedFulfillmentType`, `previousFulfillmentType`, `selectedFulfillmentId`, `previousFulfillmentId`.
126
+
127
+ **Example**
128
+
129
+ ```javascript
130
+ window.addEventListener('lce:actions.product_fulfillment_type_changed', (event) => {
131
+ const { data } = event.detail;
132
+ console.log('Fulfillment type:', data.selectedFulfillmentType);
133
+ });
134
+ ```
135
+
136
+ ### `lce:actions.product_fulfillment_changed`
137
+
138
+ Fires when the user selects a different fulfillment option or retailer.
139
+
140
+ **Data includes:** `identifier`, `selectedFulfillmentId`, `previousFulfillmentId`, `selectedFulfillmentType`, `previousFulfillmentType`.
141
+
142
+ **Example**
143
+
144
+ ```javascript
145
+ window.addEventListener('lce:actions.product_fulfillment_changed', (event) => {
146
+ const { data } = event.detail;
147
+ console.log('Fulfillment changed:', data.selectedFulfillmentId);
148
+ });
149
+ ```
150
+
151
+ ### `lce:actions.product_quantity_increase`
152
+
153
+ Fires when the product quantity is increased.
154
+
155
+ **Data includes:** `identifier`, `quantity`, `previousQuantity`.
156
+
157
+ **Example**
158
+
159
+ ```javascript
160
+ window.addEventListener('lce:actions.product_quantity_increase', (event) => {
161
+ const { data } = event.detail;
162
+ console.log('Quantity increased to', data.quantity);
163
+ });
164
+ ```
165
+
166
+ ### `lce:actions.product_quantity_decrease`
167
+
168
+ Fires when the product quantity is decreased.
169
+
170
+ **Data includes:** `identifier`, `quantity`, `previousQuantity`.
171
+
172
+ **Example**
173
+
174
+ ```javascript
175
+ window.addEventListener('lce:actions.product_quantity_decrease', (event) => {
176
+ const { data } = event.detail;
177
+ console.log('Quantity decreased to', data.quantity);
178
+ });
179
+ ```
180
+
181
+ ## Address Events
182
+
183
+ ### `lce:actions.address_updated`
184
+
185
+ Fires when an address is successfully set.
186
+
187
+ **Data includes:** `googlePlacesId`, `formattedAddress`, `address`, `coordinates`.
188
+
189
+ **Example**
190
+
191
+ ```javascript
192
+ window.addEventListener('lce:actions.address_updated', (event) => {
193
+ const { data } = event.detail;
194
+ console.log('Address set:', data.formattedAddress);
195
+ });
196
+ ```
197
+
198
+ ### `lce:actions.address_cleared`
199
+
200
+ Fires when the current address is cleared.
201
+
202
+ **Data includes:** `true`.
203
+
204
+ **Example**
205
+
206
+ ```javascript
207
+ window.addEventListener('lce:actions.address_cleared', () => {
208
+ console.log('Address cleared');
209
+ });
210
+ ```
211
+
212
+ ### `lce:actions.address_failed`
213
+
214
+ Fires when setting the address fails.
215
+
216
+ **Data includes:** `googlePlacesId`, `formattedAddress`, `address`, `coordinates`, `error`.
217
+
218
+ **Example**
219
+
220
+ ```javascript
221
+ window.addEventListener('lce:actions.address_failed', (event) => {
222
+ const { data } = event.detail;
223
+ console.error('Address error:', data.error);
224
+ });
225
+ ```
226
+
227
+ ## Cart Events
228
+
229
+ ### `lce:actions.cart_loaded`
230
+
231
+ Fires when the cart is fully loaded or synced.
232
+
233
+ **Data includes:** `cartId`, `itemCount`, `subtotal`, `items`, `promoCodeDiscount`.
234
+
235
+ **Example**
236
+
237
+ ```javascript
238
+ window.addEventListener('lce:actions.cart_loaded', (event) => {
239
+ const { data } = event.detail;
240
+ console.log(`Cart ${data.cartId} has ${data.itemCount} items`);
241
+ });
242
+ ```
243
+
244
+ ### `lce:actions.cart_opened`
245
+
246
+ Fires when the cart drawer opens.
247
+
248
+ **Data includes:** `true`.
249
+
250
+ **Example**
251
+
252
+ ```javascript
253
+ window.addEventListener('lce:actions.cart_opened', () => {
254
+ document.body.classList.add('cart-open');
255
+ });
256
+ ```
257
+
258
+ ### `lce:actions.cart_closed`
259
+
260
+ Fires when the cart drawer closes.
261
+
262
+ **Data includes:** `true`.
263
+
264
+ **Example**
265
+
266
+ ```javascript
267
+ window.addEventListener('lce:actions.cart_closed', () => {
268
+ document.body.classList.remove('cart-open');
269
+ });
270
+ ```
271
+
272
+ ### `lce:actions.cart_updated`
273
+
274
+ Fires when cart contents or totals change.
275
+
276
+ **Data includes:** `previous`, `current`.
277
+
278
+ **Example**
279
+
280
+ ```javascript
281
+ window.addEventListener('lce:actions.cart_updated', (event) => {
282
+ const { data } = event.detail;
283
+ const delta = data.current.itemCount - data.previous.itemCount;
284
+ if (delta !== 0) {
285
+ console.log('Item count changed by', delta);
286
+ }
287
+ });
288
+ ```
289
+
290
+ ### `lce:actions.cart_reset`
291
+
292
+ Fires when the cart is cleared.
293
+
294
+ **Data includes:** `true`.
295
+
296
+ **Example**
297
+
298
+ ```javascript
299
+ window.addEventListener('lce:actions.cart_reset', () => {
300
+ console.log('Cart reset');
301
+ });
302
+ ```
303
+
304
+ ### `lce:actions.cart_failed`
305
+
306
+ Fires when a cart operation fails.
307
+
308
+ **Data includes:** `cartId`, `message`.
309
+
310
+ **Example**
311
+
312
+ ```javascript
313
+ window.addEventListener('lce:actions.cart_failed', (event) => {
314
+ const { data } = event.detail;
315
+ console.error('Cart error:', data.message);
316
+ });
317
+ ```
318
+
319
+ ### `lce:actions.cart_item_added`
320
+
321
+ Fires when an item is added to the cart.
322
+
323
+ **Data includes:** `cartId`, `itemId`, `quantity`, `fulfillmentId`, `partNumber`.
324
+
325
+ **Example**
326
+
327
+ ```javascript
328
+ window.addEventListener('lce:actions.cart_item_added', (event) => {
329
+ const { data } = event.detail;
330
+ console.log(`Added item ${data.itemId} (qty ${data.quantity})`);
331
+ });
332
+ ```
333
+
334
+ ### `lce:actions.cart_item_removed`
335
+
336
+ Fires when an item is removed from the cart.
337
+
338
+ **Data includes:** `cartId`, `itemId`.
339
+
340
+ **Example**
341
+
342
+ ```javascript
343
+ window.addEventListener('lce:actions.cart_item_removed', (event) => {
344
+ const { data } = event.detail;
345
+ console.log('Removed item', data.itemId);
346
+ });
347
+ ```
348
+
349
+ ### `lce:actions.cart_item_quantity_increase`
350
+
351
+ Fires when a cart item quantity increases.
352
+
353
+ **Data includes:** `cartId`, `itemId`, `quantity`, `previousQuantity`.
354
+
355
+ **Example**
356
+
357
+ ```javascript
358
+ window.addEventListener('lce:actions.cart_item_quantity_increase', (event) => {
359
+ const { data } = event.detail;
360
+ console.log('Quantity increased to', data.quantity);
361
+ });
362
+ ```
363
+
364
+ ### `lce:actions.cart_item_quantity_decrease`
365
+
366
+ Fires when a cart item quantity decreases.
367
+
368
+ **Data includes:** `cartId`, `itemId`, `quantity`, `previousQuantity`.
369
+
370
+ **Example**
371
+
372
+ ```javascript
373
+ window.addEventListener('lce:actions.cart_item_quantity_decrease', (event) => {
374
+ const { data } = event.detail;
375
+ console.log('Quantity decreased to', data.quantity);
376
+ });
377
+ ```
378
+
379
+ ### `lce:actions.cart_item_engraving_updated`
380
+
381
+ Fires when engraving text is updated for a cart item.
382
+
383
+ **Data includes:** `cartId`, `itemId`, `engravingLines`, `previousEngravingLines`.
384
+
385
+ **Example**
386
+
387
+ ```javascript
388
+ window.addEventListener('lce:actions.cart_item_engraving_updated', (event) => {
389
+ const { data } = event.detail;
390
+ console.log('Updated engraving for', data.itemId);
391
+ });
392
+ ```
393
+
394
+ ### `lce:actions.cart_promo_code_applied`
395
+
396
+ Fires when a promo code is applied to the cart.
397
+
398
+ **Data includes:** `cartId`, `discount`, `newSubtotal`.
399
+
400
+ **Example**
401
+
402
+ ```javascript
403
+ window.addEventListener('lce:actions.cart_promo_code_applied', (event) => {
404
+ const { data } = event.detail;
405
+ console.log('Promo applied, discount:', data.discount);
406
+ });
407
+ ```
408
+
409
+ ### `lce:actions.cart_promo_code_removed`
410
+
411
+ Fires when a promo code is removed from the cart.
412
+
413
+ **Data includes:** `cartId`, `discount`, `newSubtotal`.
414
+
415
+ **Example**
416
+
417
+ ```javascript
418
+ window.addEventListener('lce:actions.cart_promo_code_removed', (event) => {
419
+ const { data } = event.detail;
420
+ console.log('Promo removed');
421
+ });
422
+ ```
423
+
424
+ ### `lce:actions.cart_promo_code_failed`
425
+
426
+ Fires when a promo code fails to apply.
427
+
428
+ **Data includes:** `cartId`, `error`.
429
+
430
+ **Example**
431
+
432
+ ```javascript
433
+ window.addEventListener('lce:actions.cart_promo_code_failed', (event) => {
434
+ const { data } = event.detail;
435
+ console.error('Promo code failed:', data.error);
436
+ });
437
+ ```
438
+
439
+ ### `lce:actions.cart_product_add_success`
440
+
441
+ Fires when adding products via the actions API succeeds.
442
+
443
+ **Data includes:** `cartId`, `itemsAdded`, `identifiers`.
444
+
445
+ **Example**
446
+
447
+ ```javascript
448
+ window.addEventListener('lce:actions.cart_product_add_success', (event) => {
449
+ const { data } = event.detail;
450
+ console.log(`Added ${data.itemsAdded} products`);
451
+ });
452
+ ```
453
+
454
+ ### `lce:actions.cart_product_add_failed`
455
+
456
+ Fires when adding products via the actions API fails.
457
+
458
+ **Data includes:** `cartId`, `identifiers`, `error`.
459
+
460
+ **Example**
461
+
462
+ ```javascript
463
+ window.addEventListener('lce:actions.cart_product_add_failed', (event) => {
464
+ const { data } = event.detail;
465
+ console.error('Product add failed:', data.error);
466
+ });
467
+ ```
468
+
469
+ ## Checkout Events
470
+
471
+ ### `lce:actions.checkout_loaded`
472
+
473
+ Fires when checkout data loads.
474
+
475
+ **Data includes:** `cartId`, `amounts`, `itemCount`, `isGift`, `billingSameAsShipping`.
476
+
477
+ **Example**
478
+
479
+ ```javascript
480
+ window.addEventListener('lce:actions.checkout_loaded', (event) => {
481
+ const { data } = event.detail;
482
+ console.log('Checkout loaded for cart', data.cartId);
483
+ });
484
+ ```
485
+
486
+ ### `lce:actions.checkout_opened`
487
+
488
+ Fires when the checkout drawer opens.
489
+
490
+ **Data includes:** `true`.
491
+
492
+ **Example**
493
+
494
+ ```javascript
495
+ window.addEventListener('lce:actions.checkout_opened', () => {
496
+ console.log('Checkout opened');
497
+ });
498
+ ```
499
+
500
+ ### `lce:actions.checkout_closed`
501
+
502
+ Fires when the checkout drawer closes.
503
+
504
+ **Data includes:** `true`.
505
+
506
+ **Example**
507
+
508
+ ```javascript
509
+ window.addEventListener('lce:actions.checkout_closed', () => {
510
+ console.log('Checkout closed');
511
+ });
512
+ ```
513
+
514
+ ### `lce:actions.checkout_failed`
515
+
516
+ Fires when checkout fails to load or operate.
517
+
518
+ **Data includes:** `message`.
519
+
520
+ **Example**
521
+
522
+ ```javascript
523
+ window.addEventListener('lce:actions.checkout_failed', (event) => {
524
+ const { data } = event.detail;
525
+ console.error('Checkout error:', data.message);
526
+ });
527
+ ```
528
+
529
+ ### `lce:actions.checkout_customer_information_updated`
530
+
531
+ Fires when customer info (email, phone, name) is updated.
532
+
533
+ **Data includes:** `cartId`.
534
+
535
+ **Example**
536
+
537
+ ```javascript
538
+ window.addEventListener('lce:actions.checkout_customer_information_updated', (event) => {
539
+ const { data } = event.detail;
540
+ console.log('Customer info updated for cart', data.cartId);
541
+ });
542
+ ```
543
+
544
+ ### `lce:actions.checkout_billing_information_updated`
545
+
546
+ Fires when billing info is updated.
547
+
548
+ **Data includes:** `cartId`.
549
+
550
+ **Example**
551
+
552
+ ```javascript
553
+ window.addEventListener('lce:actions.checkout_billing_information_updated', (event) => {
554
+ const { data } = event.detail;
555
+ console.log('Billing info updated for cart', data.cartId);
556
+ });
557
+ ```
558
+
559
+ ### `lce:actions.checkout_gift_information_updated`
560
+
561
+ Fires when gift recipient info is updated.
562
+
563
+ **Data includes:** `cartId`.
564
+
565
+ **Example**
566
+
567
+ ```javascript
568
+ window.addEventListener('lce:actions.checkout_gift_information_updated', (event) => {
569
+ const { data } = event.detail;
570
+ console.log('Gift info updated for cart', data.cartId);
571
+ });
572
+ ```
573
+
574
+ ### `lce:actions.checkout_is_gift_toggled`
575
+
576
+ Fires when gift mode is toggled.
577
+
578
+ **Data includes:** `cartId`, `isActive`, `previousIsActive`.
579
+
580
+ **Example**
581
+
582
+ ```javascript
583
+ window.addEventListener('lce:actions.checkout_is_gift_toggled', (event) => {
584
+ const { data } = event.detail;
585
+ console.log('Gift mode:', data.isActive);
586
+ });
587
+ ```
588
+
589
+ ### `lce:actions.checkout_billing_same_as_shipping_toggled`
590
+
591
+ Fires when the billing same-as-shipping option is toggled.
592
+
593
+ **Data includes:** `cartId`, `isActive`, `previousIsActive`.
594
+
595
+ **Example**
596
+
597
+ ```javascript
598
+ window.addEventListener('lce:actions.checkout_billing_same_as_shipping_toggled', (event) => {
599
+ const { data } = event.detail;
600
+ console.log('Billing same as shipping:', data.isActive);
601
+ });
602
+ ```
603
+
604
+ ### `lce:actions.checkout_marketing_preferences_toggled`
605
+
606
+ Fires when a marketing preference is toggled.
607
+
608
+ **Data includes:** `cartId`, `fieldName`, `isActive`, `previousIsActive`.
609
+
610
+ **Example**
611
+
612
+ ```javascript
613
+ window.addEventListener('lce:actions.checkout_marketing_preferences_toggled', (event) => {
614
+ const { data } = event.detail;
615
+ console.log(`Marketing ${data.fieldName}:`, data.isActive);
616
+ });
617
+ ```
618
+
619
+ ### `lce:actions.checkout_item_removed`
620
+
621
+ Fires when an item is removed during checkout.
622
+
623
+ **Data includes:** `cartId`, `cartItemId`.
624
+
625
+ **Example**
626
+
627
+ ```javascript
628
+ window.addEventListener('lce:actions.checkout_item_removed', (event) => {
629
+ const { data } = event.detail;
630
+ console.log('Checkout item removed', data.cartItemId);
631
+ });
632
+ ```
633
+
634
+ ### `lce:actions.checkout_item_quantity_increase`
635
+
636
+ Fires when a checkout item quantity increases.
637
+
638
+ **Data includes:** `cartId`, `cartItemId`, `quantity`, `previousQuantity`.
639
+
640
+ **Example**
641
+
642
+ ```javascript
643
+ window.addEventListener('lce:actions.checkout_item_quantity_increase', (event) => {
644
+ const { data } = event.detail;
645
+ console.log('Checkout quantity increased to', data.quantity);
646
+ });
647
+ ```
648
+
649
+ ### `lce:actions.checkout_item_quantity_decrease`
650
+
651
+ Fires when a checkout item quantity decreases.
652
+
653
+ **Data includes:** `cartId`, `cartItemId`, `quantity`, `previousQuantity`.
654
+
655
+ **Example**
656
+
657
+ ```javascript
658
+ window.addEventListener('lce:actions.checkout_item_quantity_decrease', (event) => {
659
+ const { data } = event.detail;
660
+ console.log('Checkout quantity decreased to', data.quantity);
661
+ });
662
+ ```
663
+
664
+ ### `lce:actions.checkout_item_engraving_updated`
665
+
666
+ Fires when engraving text is updated for a checkout item.
667
+
668
+ **Data includes:** `cartId`, `cartItemId`, `engravingLines`, `previousEngravingLines`.
669
+
670
+ **Example**
671
+
672
+ ```javascript
673
+ window.addEventListener('lce:actions.checkout_item_engraving_updated', (event) => {
674
+ const { data } = event.detail;
675
+ console.log('Checkout engraving updated for', data.cartItemId);
676
+ });
677
+ ```
678
+
679
+ ### `lce:actions.checkout_tip_updated`
680
+
681
+ Fires when delivery tips are updated.
682
+
683
+ **Data includes:** `cartId`, `deliveryTips`, `previousDeliveryTips`.
684
+
685
+ **Example**
686
+
687
+ ```javascript
688
+ window.addEventListener('lce:actions.checkout_tip_updated', (event) => {
689
+ const { data } = event.detail;
690
+ console.log('Tips updated for cart', data.cartId);
691
+ });
692
+ ```
693
+
694
+ ### `lce:actions.checkout_submit_started`
695
+
696
+ Fires when checkout submission starts.
697
+
698
+ **Data includes:** `started`.
699
+
700
+ **Example**
701
+
702
+ ```javascript
703
+ window.addEventListener('lce:actions.checkout_submit_started', (event) => {
704
+ const { data } = event.detail;
705
+ if (data.started) {
706
+ console.log('Checkout submission started');
707
+ }
708
+ });
709
+ ```
710
+
711
+ ### `lce:actions.checkout_submit_completed`
712
+
713
+ Fires when checkout submission completes successfully.
714
+
715
+ **Data includes:** `orderNumber`, `orderTotal`.
716
+
717
+ **Example**
718
+
719
+ ```javascript
720
+ window.addEventListener('lce:actions.checkout_submit_completed', (event) => {
721
+ const { data } = event.detail;
722
+ console.log('Order completed:', data.orderNumber);
723
+ });
724
+ ```
725
+
726
+ ### `lce:actions.checkout_submit_failed`
727
+
728
+ Fires when checkout submission fails.
729
+
730
+ **Data includes:** `message`.
731
+
732
+ **Example**
733
+
734
+ ```javascript
735
+ window.addEventListener('lce:actions.checkout_submit_failed', (event) => {
736
+ const { data } = event.detail;
737
+ console.error('Checkout submit failed:', data.message);
738
+ });
739
+ ```
740
+
741
+ ### `lce:actions.checkout_promo_code_applied`
742
+
743
+ Fires when a promo code is applied during checkout.
744
+
745
+ **Data includes:** `cartId`, `discount`, `newTotal`.
746
+
747
+ **Example**
748
+
749
+ ```javascript
750
+ window.addEventListener('lce:actions.checkout_promo_code_applied', (event) => {
751
+ const { data } = event.detail;
752
+ console.log('Checkout promo applied:', data.discount);
753
+ });
754
+ ```
755
+
756
+ ### `lce:actions.checkout_promo_code_removed`
757
+
758
+ Fires when a promo code is removed during checkout.
759
+
760
+ **Data includes:** `cartId`, `discount`, `newTotal`.
761
+
762
+ **Example**
763
+
764
+ ```javascript
765
+ window.addEventListener('lce:actions.checkout_promo_code_removed', (event) => {
766
+ const { data } = event.detail;
767
+ console.log('Checkout promo removed');
768
+ });
769
+ ```
770
+
771
+ ### `lce:actions.checkout_promo_code_failed`
772
+
773
+ Fires when a promo code fails during checkout.
774
+
775
+ **Data includes:** `cartId`, `error`.
776
+
777
+ **Example**
778
+
779
+ ```javascript
780
+ window.addEventListener('lce:actions.checkout_promo_code_failed', (event) => {
781
+ const { data } = event.detail;
782
+ console.error('Checkout promo failed:', data.error);
783
+ });
784
+ ```
785
+
786
+ ### `lce:actions.checkout_gift_card_applied`
787
+
788
+ Fires when a gift card is applied during checkout.
789
+
790
+ **Data includes:** `cartId`, `newTotal`.
791
+
792
+ **Example**
793
+
794
+ ```javascript
795
+ window.addEventListener('lce:actions.checkout_gift_card_applied', (event) => {
796
+ const { data } = event.detail;
797
+ console.log('Gift card applied, new total:', data.newTotal);
798
+ });
799
+ ```
800
+
801
+ ### `lce:actions.checkout_gift_card_removed`
802
+
803
+ Fires when a gift card is removed during checkout.
804
+
805
+ **Data includes:** `cartId`, `newTotal`.
806
+
807
+ **Example**
808
+
809
+ ```javascript
810
+ window.addEventListener('lce:actions.checkout_gift_card_removed', (event) => {
811
+ const { data } = event.detail;
812
+ console.log('Gift card removed');
813
+ });
814
+ ```
815
+
816
+ ### `lce:actions.checkout_gift_card_failed`
817
+
818
+ Fires when a gift card fails during checkout.
819
+
820
+ **Data includes:** `cartId`, `error`.
821
+
822
+ **Example**
823
+
824
+ ```javascript
825
+ window.addEventListener('lce:actions.checkout_gift_card_failed', (event) => {
826
+ const { data } = event.detail;
827
+ console.error('Gift card failed:', data.error);
828
+ });
829
+ ```
830
+
831
+ ### `lce:actions.checkout_product_add_success`
832
+
833
+ Fires when products are added to checkout via the actions API.
834
+
835
+ **Data includes:** `cartId`, `itemsAdded`, `identifiers`.
836
+
837
+ **Example**
838
+
839
+ ```javascript
840
+ window.addEventListener('lce:actions.checkout_product_add_success', (event) => {
841
+ const { data } = event.detail;
842
+ console.log(`Checkout added ${data.itemsAdded} products`);
843
+ });
844
+ ```
845
+
846
+ ### `lce:actions.checkout_product_add_failed`
847
+
848
+ Fires when adding products to checkout via the actions API fails.
849
+
850
+ **Data includes:** `cartId`, `identifiers`, `error`.
851
+
852
+ **Example**
853
+
854
+ ```javascript
855
+ window.addEventListener('lce:actions.checkout_product_add_failed', (event) => {
856
+ const { data } = event.detail;
857
+ console.error('Checkout product add failed:', data.error);
858
+ });
859
+ ```
860
+
861
+ ## Form Events
862
+
863
+ ### `lce:forms.customer`
864
+
865
+ Fires when a customer form field changes in checkout.
866
+
867
+ **Data includes:** `fieldName`, `fieldValue`.
868
+
869
+ **Example**
870
+
871
+ ```javascript
872
+ window.addEventListener('lce:forms.customer', (event) => {
873
+ const { data } = event.detail;
874
+ console.log('Customer field changed:', data.fieldName);
875
+ });
876
+ ```
877
+
878
+ ### `lce:forms.billing`
879
+
880
+ Fires when a billing form field changes in checkout.
881
+
882
+ **Data includes:** `fieldName`, `fieldValue`.
883
+
884
+ **Example**
885
+
886
+ ```javascript
887
+ window.addEventListener('lce:forms.billing', (event) => {
888
+ const { data } = event.detail;
889
+ console.log('Billing field changed:', data.fieldName);
890
+ });
891
+ ```
892
+
893
+ ### `lce:forms.gift`
894
+
895
+ Fires when a gift form field changes in checkout.
896
+
897
+ **Data includes:** `fieldName`, `fieldValue`.
898
+
899
+ **Example**
900
+
901
+ ```javascript
902
+ window.addEventListener('lce:forms.gift', (event) => {
903
+ const { data } = event.detail;
904
+ console.log('Gift field changed:', data.fieldName);
905
+ });
906
+ ```
907
+
908
+ ## Use Cases
909
+
910
+ ### Analytics Integration
911
+
912
+ ```javascript
913
+ // Track product views
914
+ window.addEventListener('lce:actions.product_loaded', (event) => {
915
+ const { data } = event.detail;
916
+ gtag('event', 'view_item', {
917
+ items: [{
918
+ item_id: data.identifier,
919
+ item_name: data.name,
920
+ price: data.priceInfo?.minimum / 100
921
+ }]
922
+ });
923
+ });
924
+
925
+ // Track purchases
926
+ window.addEventListener('lce:actions.checkout_submit_completed', (event) => {
927
+ const { data } = event.detail;
928
+ gtag('event', 'purchase', {
929
+ transaction_id: data.orderNumber,
930
+ value: data.orderTotal / 100,
931
+ currency: 'USD'
932
+ });
933
+ });
934
+ ```
935
+
936
+ ## See Also
937
+
938
+ - [Component Guides](../guides/)
939
+ - [Actions API](../api/actions/)