@liquidcommerce/elements-sdk 2.6.0-beta.12 → 2.6.0-beta.120

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