@liquidcommerce/elements-sdk 2.6.0-beta.7 → 2.6.0-beta.70

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 (224) hide show
  1. package/README.md +83 -2519
  2. package/dist/index.checkout.esm.js +16607 -0
  3. package/dist/index.esm.js +23330 -20416
  4. package/dist/ssr-stub.checkout.esm.js +18 -0
  5. package/dist/ssr-stub.esm.js +270 -0
  6. package/dist/types/auto-initialize/checkout.d.ts +2 -0
  7. package/dist/types/auto-initialize/shared-utils.d.ts +46 -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} +3 -1
  12. package/dist/types/clients/main.d.ts +3 -0
  13. package/dist/types/constants/core.constant.d.ts +2 -6
  14. package/dist/types/core/api/api-client.service.d.ts +20 -18
  15. package/dist/types/core/api/api-result.d.ts +19 -0
  16. package/dist/types/core/api/auth-client.service.d.ts +40 -13
  17. package/dist/types/core/api/http-client.service.d.ts +0 -1
  18. package/dist/types/core/base-component.service.d.ts +2 -1
  19. package/dist/types/core/client/actions/base-action.service.d.ts +15 -0
  20. package/dist/types/core/client/actions/client-address-action.service.d.ts +18 -0
  21. package/dist/types/core/client/actions/client-cart-action.service.d.ts +37 -0
  22. package/dist/types/core/client/actions/client-checkout-action.service.d.ts +56 -0
  23. package/dist/types/core/client/actions/client-product-action.service.d.ts +15 -0
  24. package/dist/types/core/client/client-action.service.d.ts +6 -70
  25. package/dist/types/core/client/client-config.service.d.ts +8 -2
  26. package/dist/types/core/command/common-command.service.d.ts +1 -0
  27. package/dist/types/core/google-tag-manager.service.d.ts +2 -1
  28. package/dist/types/core/logger/logger.service.d.ts +1 -1
  29. package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +27 -52
  30. package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +45 -51
  31. package/dist/types/core/pubsub/interfaces/core.interface.d.ts +9 -4
  32. package/dist/types/core/pubsub/interfaces/product.interface.d.ts +16 -74
  33. package/dist/types/core/pubsub/pubsub.service.d.ts +1 -2
  34. package/dist/types/core/singleton-manager.service.d.ts +12 -8
  35. package/dist/types/core/store/interfaces/cart.interface.d.ts +3 -4
  36. package/dist/types/core/store/interfaces/checkout.interface.d.ts +17 -108
  37. package/dist/types/core/store/interfaces/core.interface.d.ts +12 -2
  38. package/dist/types/core/store/interfaces/metadata.interface.d.ts +11 -0
  39. package/dist/types/core/store/interfaces/product-list.interface.d.ts +30 -0
  40. package/dist/types/core/store/interfaces/product.interface.d.ts +1 -0
  41. package/dist/types/core/store/store.constant.d.ts +5 -0
  42. package/dist/types/core/store/store.service.d.ts +1 -0
  43. package/dist/types/core/telemetry/telemetry.service.d.ts +1 -0
  44. package/dist/types/enums/core.enum.d.ts +39 -1
  45. package/dist/types/enums/index.d.ts +0 -1
  46. package/dist/types/index.checkout.d.ts +8 -0
  47. package/dist/types/index.checkout.umd.d.ts +4 -0
  48. package/dist/types/index.d.ts +8 -3
  49. package/dist/types/interfaces/api/cart.interface.d.ts +13 -8
  50. package/dist/types/interfaces/api/checkout.interface.d.ts +239 -0
  51. package/dist/types/interfaces/api/index.d.ts +5 -0
  52. package/dist/types/interfaces/api/product-list.interface.d.ts +39 -0
  53. package/dist/types/interfaces/api/product.interface.d.ts +10 -4
  54. package/dist/types/interfaces/client.interface.d.ts +72 -0
  55. package/dist/types/interfaces/component.interface.d.ts +7 -0
  56. package/dist/types/interfaces/config.interface.d.ts +41 -0
  57. package/dist/types/interfaces/configs/address.interface.d.ts +1 -1
  58. package/dist/types/interfaces/configs/cart.interface.d.ts +1 -1
  59. package/dist/types/interfaces/configs/checkout.interface.d.ts +2 -1
  60. package/dist/types/interfaces/configs/global.interface.d.ts +5 -3
  61. package/dist/types/interfaces/configs/index.d.ts +1 -0
  62. package/dist/types/interfaces/configs/product-list.interface.d.ts +47 -0
  63. package/dist/types/interfaces/configs/product.interface.d.ts +4 -1
  64. package/dist/types/interfaces/injection.interface.d.ts +47 -0
  65. package/dist/types/modules/address/address.command.d.ts +2 -1
  66. package/dist/types/modules/address/styles/register-styles.d.ts +1 -0
  67. package/dist/types/modules/cart/cart.commands.d.ts +4 -4
  68. package/dist/types/modules/cart/components/cart-body.component.d.ts +2 -1
  69. package/dist/types/modules/cart/styles/register-styles.d.ts +1 -0
  70. package/dist/types/modules/checkout/checkout.commands.d.ts +23 -9
  71. package/dist/types/modules/checkout/checkout.component.d.ts +2 -0
  72. package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +2 -2
  73. package/dist/types/modules/checkout/components/checkout-completed.component.d.ts +3 -0
  74. package/dist/types/modules/checkout/components/checkout-header.component.d.ts +1 -0
  75. package/dist/types/modules/checkout/components/checkout-items.component.d.ts +4 -3
  76. package/dist/types/modules/checkout/components/checkout-presale-countdown.component.d.ts +14 -1
  77. package/dist/types/modules/checkout/components/checkout-presale-expired.component.d.ts +7 -1
  78. package/dist/types/modules/checkout/components/checkout-stripe-form.component.d.ts +2 -1
  79. package/dist/types/modules/checkout/components/checkout-tips.component.d.ts +2 -2
  80. package/dist/types/modules/checkout/components/promo-pc-gc.component.d.ts +0 -2
  81. package/dist/types/modules/checkout/constant.d.ts +3 -0
  82. package/dist/types/modules/checkout/styles/register-styles.d.ts +1 -0
  83. package/dist/types/modules/product/components/product-add-to-cart-section.component.d.ts +1 -0
  84. package/dist/types/modules/product/components/product-description.component.d.ts +1 -0
  85. package/dist/types/modules/product/components/product-image-carousel.component.d.ts +3 -0
  86. package/dist/types/modules/product/components/product-options.component.d.ts +2 -1
  87. package/dist/types/modules/product/components/product-retailers-carousel.component.d.ts +3 -0
  88. package/dist/types/modules/product/components/product-retailers-popup-list.component.d.ts +5 -2
  89. package/dist/types/modules/product/product.commands.d.ts +2 -3
  90. package/dist/types/modules/product/styles/register-styles.d.ts +1 -0
  91. package/dist/types/modules/product-list/components/card-components/index.d.ts +5 -0
  92. package/dist/types/modules/product-list/components/card-components/product-badge.d.ts +9 -0
  93. package/dist/types/modules/product-list/components/card-components/product-button.d.ts +9 -0
  94. package/dist/types/modules/product-list/components/card-components/product-price-and-personalization.d.ts +13 -0
  95. package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts +9 -0
  96. package/dist/types/modules/product-list/components/card-components/product-sizes-list.d.ts +13 -0
  97. package/dist/types/modules/product-list/components/filter-components/index.d.ts +7 -0
  98. package/dist/types/modules/product-list/components/filter-components/product-list-apply-filter-button.d.ts +1 -0
  99. package/dist/types/modules/product-list/components/filter-components/product-list-chip.d.ts +5 -0
  100. package/dist/types/modules/product-list/components/filter-components/product-list-filters-chips.d.ts +13 -0
  101. package/dist/types/modules/product-list/components/filter-components/product-list-fulfillment-filter.d.ts +14 -0
  102. package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-price-filter.components.d.ts → filter-components/product-list-price-filter.d.ts} +1 -1
  103. package/dist/types/modules/product-list/components/filter-components/product-list-toggle-filters.d.ts +7 -0
  104. package/dist/types/modules/product-list/components/index.d.ts +6 -2
  105. package/dist/types/modules/product-list/components/product-list-card-loading.component.d.ts +2 -1
  106. package/dist/types/modules/product-list/components/product-list-card.component.d.ts +27 -30
  107. package/dist/types/modules/product-list/components/product-list-engraving.component.d.ts +12 -0
  108. package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +55 -36
  109. package/dist/types/modules/product-list/components/product-list-product-engraving-lines.component.d.ts +22 -0
  110. package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts +49 -0
  111. package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-search.component.d.ts → product-list-search.component.d.ts} +11 -4
  112. package/dist/types/modules/product-list/product-list-filter.utils.d.ts +8 -0
  113. package/dist/types/modules/product-list/product-list.commands.d.ts +23 -8
  114. package/dist/types/modules/product-list/product-list.component.d.ts +10 -45
  115. package/dist/types/modules/product-list/product-list.constants.d.ts +38 -0
  116. package/dist/types/modules/product-list/product-list.interface.d.ts +20 -35
  117. package/dist/types/modules/product-list/styles/product-list-card.style.d.ts +1 -0
  118. package/dist/types/modules/product-list/styles/product-list-filters.style.d.ts +1 -0
  119. package/dist/types/modules/product-list/styles/register-styles.d.ts +1 -0
  120. package/dist/types/modules/theme-provider/constants/component-groupings.d.ts +1 -0
  121. package/dist/types/modules/theme-provider/constants/css-variable-mappings.d.ts +1 -1
  122. package/dist/types/modules/theme-provider/services/style-registry.service.d.ts +16 -0
  123. package/dist/types/modules/theme-provider/services/stylesheet-generator.service.d.ts +0 -1
  124. package/dist/types/modules/theme-provider/styles/register-styles.d.ts +1 -0
  125. package/dist/types/modules/theme-provider/theme-provider.service.d.ts +2 -2
  126. package/dist/types/modules/ui-components/drawer/drawer.component.d.ts +1 -0
  127. package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +6 -1
  128. package/dist/types/modules/ui-components/engraving/engraving-view.component.d.ts +6 -1
  129. package/dist/types/modules/ui-components/input/index.d.ts +0 -1
  130. package/dist/types/modules/ui-components/input/input.component.d.ts +8 -1
  131. package/dist/types/modules/ui-components/lce-element/lce-element.component.d.ts +2 -1
  132. package/dist/types/modules/ui-components/promo-code-ticker/promo-code-ticker.component.d.ts +1 -1
  133. package/dist/types/modules/ui-components/ui.commands.d.ts +5 -1
  134. package/dist/types/ssr/stub.checkout.d.ts +6 -0
  135. package/dist/types/ssr/stub.d.ts +10 -0
  136. package/dist/types/static/icon/check.icon.d.ts +2 -0
  137. package/dist/types/static/icon/index.d.ts +1 -0
  138. package/dist/types/utils/dom-compat.d.ts +2 -0
  139. package/dist/types/utils/format.d.ts +0 -14
  140. package/dist/types/utils/product-selection.d.ts +16 -0
  141. package/dist/types/utils/product.d.ts +10 -0
  142. package/docs/v1/README.md +210 -0
  143. package/docs/v1/api/actions/address-actions.md +281 -0
  144. package/docs/v1/api/actions/cart-actions.md +337 -0
  145. package/docs/v1/api/actions/checkout-actions.md +427 -0
  146. package/docs/v1/api/actions/product-actions.md +158 -0
  147. package/docs/v1/api/client.md +495 -0
  148. package/docs/v1/api/configuration.md +528 -0
  149. package/docs/v1/api/injection-methods.md +261 -0
  150. package/docs/v1/api/typescript-types.md +398 -0
  151. package/docs/v1/api/ui-helpers.md +200 -0
  152. package/docs/v1/examples/advanced-patterns.md +198 -0
  153. package/docs/v1/examples/checkout-flow.md +91 -0
  154. package/docs/v1/examples/custom-theming.md +63 -0
  155. package/docs/v1/examples/multi-product-page.md +90 -0
  156. package/docs/v1/examples/simple-product-page.md +89 -0
  157. package/docs/v1/getting-started/concepts.md +507 -0
  158. package/docs/v1/getting-started/installation.md +328 -0
  159. package/docs/v1/getting-started/quick-start.md +405 -0
  160. package/docs/v1/guides/address-component.md +431 -0
  161. package/docs/v1/guides/best-practices.md +353 -0
  162. package/docs/v1/guides/cart-component.md +737 -0
  163. package/docs/v1/guides/checkout-component.md +672 -0
  164. package/docs/v1/guides/events.md +926 -0
  165. package/docs/v1/guides/product-component.md +686 -0
  166. package/docs/v1/guides/product-list-component.md +507 -0
  167. package/docs/v1/guides/theming.md +216 -0
  168. package/docs/v1/integration/angular.md +39 -0
  169. package/docs/v1/integration/laravel.md +41 -0
  170. package/docs/v1/integration/nextjs.md +69 -0
  171. package/docs/v1/integration/proxy-setup.md +89 -0
  172. package/docs/v1/integration/react.md +64 -0
  173. package/docs/v1/integration/vanilla-js.md +84 -0
  174. package/docs/v1/integration/vue.md +58 -0
  175. package/docs/v1/reference/browser-support.md +44 -0
  176. package/docs/v1/reference/error-handling.md +70 -0
  177. package/docs/v1/reference/performance.md +54 -0
  178. package/docs/v1/reference/troubleshooting.md +136 -0
  179. package/package.json +31 -27
  180. package/dist/types/elements-builder-client.d.ts +0 -2
  181. package/dist/types/elements-client.d.ts +0 -2
  182. package/dist/types/enums/cloud.enum.d.ts +0 -106
  183. package/dist/types/interfaces/cloud/catalog.interface.d.ts +0 -42
  184. package/dist/types/interfaces/cloud/checkout.interface.d.ts +0 -218
  185. package/dist/types/interfaces/cloud/core.interface.d.ts +0 -22
  186. package/dist/types/interfaces/cloud/index.d.ts +0 -4
  187. package/dist/types/interfaces/cloud/retailer.interface.d.ts +0 -67
  188. package/dist/types/interfaces/cloud/user.interface.d.ts +0 -100
  189. package/dist/types/interfaces/core.interface.d.ts +0 -111
  190. package/dist/types/modules/cart/cart.commands.helper.d.ts +0 -4
  191. package/dist/types/modules/checkout/components/checkout.type.d.ts +0 -4
  192. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/index.d.ts +0 -6
  193. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-apply-filter-button.component.d.ts +0 -1
  194. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-delivery-options-filter.components.d.ts +0 -16
  195. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-toggle-filters.components.d.ts +0 -18
  196. package/dist/types/modules/theme-provider/styles/address/index.d.ts +0 -1
  197. package/dist/types/modules/theme-provider/styles/cart/index.d.ts +0 -1
  198. package/dist/types/modules/theme-provider/styles/checkout/index.d.ts +0 -1
  199. package/dist/types/modules/theme-provider/styles/product/index.d.ts +0 -3
  200. package/dist/types/modules/theme-provider/styles/product-list/index.d.ts +0 -1
  201. package/dist/types/modules/theme-provider/styles/ui/index.d.ts +0 -3
  202. package/dist/types/modules/ui-components/input/birthdate-input.component.d.ts +0 -53
  203. package/dist/types/utils/helper.d.ts +0 -28
  204. package/docs/ACTIONS.md +0 -1300
  205. package/docs/BROWSER_SUPPORT.md +0 -279
  206. package/docs/CONFIGURATION.md +0 -853
  207. package/docs/DOCUMENTATION_INDEX.md +0 -311
  208. package/docs/EVENTS.md +0 -798
  209. package/docs/PROXY.md +0 -228
  210. package/docs/THEMING.md +0 -592
  211. package/docs/TROUBLESHOOTING.md +0 -793
  212. package/umd/elements.js +0 -1
  213. /package/dist/types/{auto-initialize.d.ts → auto-initialize/main.d.ts} +0 -0
  214. /package/dist/types/modules/{theme-provider/styles/address → address/styles}/address.style.d.ts +0 -0
  215. /package/dist/types/modules/{theme-provider/styles/cart → cart/styles}/cart.style.d.ts +0 -0
  216. /package/dist/types/modules/{theme-provider/styles/checkout → checkout/styles}/checkout.style.d.ts +0 -0
  217. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/image-carousel.style.d.ts +0 -0
  218. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/product.style.d.ts +0 -0
  219. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/retailers.style.d.ts +0 -0
  220. /package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-checkbox-filter.components.d.ts → filter-components/product-list-checkbox-filter.d.ts} +0 -0
  221. /package/dist/types/modules/{theme-provider/styles/product-list → product-list/styles}/product-list.style.d.ts +0 -0
  222. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/drawer.style.d.ts +0 -0
  223. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/loading.style.d.ts +0 -0
  224. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/promo-code-ticker.style.d.ts +0 -0
@@ -0,0 +1,136 @@
1
+ # Troubleshooting
2
+
3
+ Common setup issues and how to resolve them.
4
+
5
+ ## SDK Script Not Loading
6
+
7
+ **Symptoms:** 404/CORS in Network tab, `window.LiquidCommerce.elements` is undefined.
8
+
9
+ **Fixes:**
10
+ - Verify the script URL and that the tag includes `data-liquid-commerce-elements`.
11
+ - Check ad blockers; proxy the API if needed.
12
+ - Confirm `data-env` is set correctly.
13
+
14
+ ## Web Components Error
15
+
16
+ **Symptoms:** Console logs about Custom Elements or Shadow DOM.
17
+
18
+ **Fix:** Add the Web Components polyfill before the SDK:
19
+
20
+ ```html
21
+ <script src="https://cdn.jsdelivr.net/npm/@webcomponents/webcomponentsjs@2/webcomponents-bundle.js"></script>
22
+ <script defer data-liquid-commerce-elements ...></script>
23
+ ```
24
+
25
+ ## Product Not Showing
26
+
27
+ **Symptoms:** Empty container or error view.
28
+
29
+ **Fixes:**
30
+ - Confirm the container ID matches your HTML.
31
+ - Verify the product identifier exists.
32
+ - Check for errors in the console or network tab.
33
+
34
+ ## Cart Drawer Not Opening
35
+
36
+ **Symptoms:** Add to cart works but cart stays closed.
37
+
38
+ **Fixes:**
39
+ - Ensure a cart button is configured or call `window.LiquidCommerce.elements.actions.cart.openCart()`.
40
+ - Check for JavaScript errors in the console.
41
+
42
+ ## Checkout Issues
43
+
44
+ **Symptoms:** Checkout fails to load or submit.
45
+
46
+ **Fixes:**
47
+ - Verify you are on a supported browser.
48
+ - Look for `checkout_*_failed` events in the console.
49
+ - Check for Stripe-related errors in the browser console.
50
+
51
+ ## Address/Availability Problems
52
+
53
+ **Symptoms:** Products show unavailable or address prompts fail.
54
+
55
+ **Fixes:**
56
+ - Make sure the address is set and valid.
57
+ - Listen for `lce:actions.address_failed` to surface errors.
58
+
59
+ ## SSR / Server-Side Rendering
60
+
61
+ **Symptoms:** Console warning "This SDK is designed for the browser. Calls made during SSR return null."
62
+
63
+ This is expected behavior. The SDK ships an SSR stub that is automatically resolved when bundled for Node.js (via the `node` export condition in `package.json`). The stub exports all types and enums for TypeScript compatibility and returns `null` from factory functions (`Elements`, `ElementsBuilder`, `ElementsCheckout`).
64
+
65
+ **No action required** — initialize the SDK in a client-only lifecycle hook (`useEffect`, `onMounted`, etc.) and the real client will activate in the browser.
66
+
67
+ ## Styling Not Applied / CSS Not Working
68
+
69
+ **Symptoms:** Components render but custom styles are ignored, or host page styles leak into components.
70
+
71
+ **Cause:** Components use Shadow DOM for style isolation.
72
+
73
+ **Fixes:**
74
+ - Use `customTheme` in the client configuration to style components -- external CSS cannot penetrate Shadow DOM.
75
+ - For debugging, enable `development.openShadowDom: true` to disable Shadow DOM temporarily.
76
+ - Use the debug panel (`debugMode: 'panel'`) to inspect component state.
77
+
78
+ ## Component Not Updating After Data Changes
79
+
80
+ **Symptoms:** Component shows stale data after an action completes.
81
+
82
+ **Fixes:**
83
+ - Call `.rerender()` on the injected component to force a refresh:
84
+ ```javascript
85
+ const components = client.getInjectedComponents();
86
+ components.get('product-1')?.rerender();
87
+ ```
88
+ - Ensure you're not holding a stale reference -- call `getInjectedComponents()` again after injection.
89
+
90
+ ## Cleanup / Memory Leaks
91
+
92
+ **Symptoms:** Components persist after navigating away in SPA, or duplicate components appear.
93
+
94
+ **Fixes:**
95
+ - Call `destroy()` on individual injected components when removing them:
96
+ ```javascript
97
+ const component = client.getInjectedComponents().get('product-1');
98
+ component?.destroy();
99
+ ```
100
+ - Call `client.destroy()` when tearing down the entire SDK (e.g., on SPA route change).
101
+
102
+ ## Promo Ticker Not Showing
103
+
104
+ **Symptoms:** Promo ticker is configured but not visible.
105
+
106
+ **Fixes:**
107
+ - Verify all 5 required fields are set: `promoCode`, `text`, `separator`, `activeFrom`, `activeUntil`.
108
+ - Check that the current time falls between `activeFrom` and `activeUntil` (ISO 8601 UTC format).
109
+ - Ensure `global.layout.allowPromoCodes` is not set to `false`.
110
+
111
+ ## Ad Blockers Blocking SDK Requests
112
+
113
+ **Symptoms:** Network requests fail, products don't load, but no code errors.
114
+
115
+ **Fixes:**
116
+ - Set up a proxy to route API requests through your own domain:
117
+ ```javascript
118
+ proxy: { baseUrl: 'https://yoursite.com/api/elements-proxy' }
119
+ ```
120
+ - See [Proxy Setup Guide](../integration/proxy-setup.md) for server-side implementation.
121
+
122
+ ## Performance Issues on Large Product Lists
123
+
124
+ **Symptoms:** Slow rendering or high memory usage with many products.
125
+
126
+ **Fixes:**
127
+ - Reduce `rows` and `columns` to load fewer products per page.
128
+ - Limit the number of active filters.
129
+ - Use the checkout-only build on checkout pages to reduce bundle size.
130
+
131
+ ## Related Docs
132
+
133
+ - [Installation](../getting-started/installation.md)
134
+ - [Browser Support](./browser-support.md)
135
+ - [Error Handling](./error-handling.md)
136
+ - [Proxy Setup](../integration/proxy-setup.md)
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "LiquidCommerce Elements SDK",
4
4
  "license": "UNLICENSED",
5
5
  "author": "LiquidCommerce Team",
6
- "version": "2.6.0-beta.7",
6
+ "version": "2.6.0-beta.70",
7
7
  "homepage": "https://docs.liquidcommerce.co/elements-sdk",
8
8
  "repository": {
9
9
  "type": "git",
@@ -13,22 +13,28 @@
13
13
  "url": "https://github.com/liquidcommerce/elements-sdk/issues"
14
14
  },
15
15
  "module": "./dist/index.esm.js",
16
- "browser": "./umd/elements.js",
17
16
  "types": "./dist/types/index.d.ts",
18
- "packageManager": "pnpm@10.0.0",
17
+ "packageManager": "pnpm@10.33.0",
19
18
  "exports": {
20
19
  ".": {
21
20
  "types": "./dist/types/index.d.ts",
21
+ "node": "./dist/ssr-stub.esm.js",
22
+ "browser": "./dist/index.esm.js",
22
23
  "import": "./dist/index.esm.js",
23
- "browser": "./umd/elements.js",
24
24
  "default": "./dist/index.esm.js"
25
25
  },
26
+ "./checkout": {
27
+ "types": "./dist/types/index.checkout.d.ts",
28
+ "node": "./dist/ssr-stub.checkout.esm.js",
29
+ "browser": "./dist/index.checkout.esm.js",
30
+ "import": "./dist/index.checkout.esm.js",
31
+ "default": "./dist/index.checkout.esm.js"
32
+ },
26
33
  "./package.json": "./package.json"
27
34
  },
28
35
  "files": [
29
36
  "dist",
30
- "umd",
31
- "docs",
37
+ "docs/v1",
32
38
  "README.md",
33
39
  "LICENSE"
34
40
  ],
@@ -39,21 +45,22 @@
39
45
  "type": "module",
40
46
  "sideEffects": [
41
47
  "dist/index.esm.js",
48
+ "dist/index.checkout.esm.js",
42
49
  "umd/elements.js",
43
- "src/index.ts",
44
- "src/index.umd.ts"
50
+ "umd/elements-checkout.js"
45
51
  ],
46
52
  "scripts": {
47
53
  "build": "rollup -c",
48
- "build:dev": "rollup -c --environment NODE_ENV:development",
54
+ "build:checkout": "rollup -c rollup.config.checkout.mjs",
55
+ "build:all": "pnpm build && pnpm build:checkout",
49
56
  "dev": "rollup -c -w",
50
57
  "type-check": "tsc --noEmit",
51
58
  "lint": "pnpm biome lint --write",
52
59
  "format": "biome format --write",
53
60
  "check": "pnpm biome check --write .",
54
- "fl": "pnpm check && pnpm build:dev",
61
+ "fl": "pnpm check && pnpm tsc --noEmit",
55
62
  "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
56
- "clean": "rm -rf dist umd node_modules && pnpm install && pnpm build",
63
+ "clean": "rm -rf dist umd node_modules && pnpm install && pnpm build:all",
57
64
  "prepublishOnly": "pnpm run build",
58
65
  "deprecate:old": "npm deprecate @liquidcommerceteam/elements-sdk@\"*\" \"Package moved to @liquidcommerce/elements-sdk\"",
59
66
  "prepare": "husky"
@@ -70,30 +77,30 @@
70
77
  "embeddable commerce"
71
78
  ],
72
79
  "devDependencies": {
73
- "@biomejs/biome": "2.3.5",
74
- "@commitlint/cli": "^20.2.0",
75
- "@commitlint/config-conventional": "^20.2.0",
80
+ "@biomejs/biome": "^2.4.12",
81
+ "@commitlint/cli": "^20.5.0",
82
+ "@commitlint/config-conventional": "^20.5.0",
76
83
  "@rollup/plugin-alias": "^6.0.0",
77
- "@rollup/plugin-commonjs": "^29.0.0",
84
+ "@rollup/plugin-commonjs": "^29.0.2",
78
85
  "@rollup/plugin-json": "^6.1.0",
79
86
  "@rollup/plugin-node-resolve": "^16.0.3",
80
87
  "@rollup/plugin-replace": "^6.0.3",
81
- "@rollup/plugin-terser": "^0.4.4",
88
+ "@rollup/plugin-terser": "^1.0.0",
82
89
  "@semantic-release/changelog": "^6.0.3",
83
90
  "@semantic-release/commit-analyzer": "^13.0.1",
84
91
  "@semantic-release/git": "^10.0.1",
85
- "@semantic-release/github": "^12.0.2",
86
- "@semantic-release/npm": "^13.1.2",
92
+ "@semantic-release/github": "^12.0.6",
93
+ "@semantic-release/npm": "^13.1.5",
87
94
  "@semantic-release/release-notes-generator": "^14.1.0",
88
95
  "@types/core-js": "^2.5.8",
89
- "@types/node": "^24.10.1",
90
- "conventional-changelog-cli": "^5.0.0",
96
+ "@types/node": "^25.6.0",
97
+ "conventional-changelog": "^7.2.0",
91
98
  "husky": "^9.1.7",
92
99
  "process": "^0.11.10",
93
- "rollup": "^4.53.3",
100
+ "rollup": "^4.60.1",
94
101
  "rollup-obfuscator": "^4.1.1",
95
- "rollup-plugin-typescript2": "^0.36.0",
96
- "semantic-release": "^25.0.2",
102
+ "rollup-plugin-typescript2": "^0.37.0",
103
+ "semantic-release": "^25.0.3",
97
104
  "ts-node": "^10.9.2",
98
105
  "typescript": "^5.9.3"
99
106
  },
@@ -107,9 +114,6 @@
107
114
  "onlyBuiltDependencies": [
108
115
  "@biomejs/biome",
109
116
  "javascript-obfuscator"
110
- ],
111
- "overrides": {
112
- "@conventional-changelog/git-client@<2.0.0": ">=2.0.0"
113
- }
117
+ ]
114
118
  }
115
119
  }
@@ -1,2 +0,0 @@
1
- import type { ILiquidCommerceElementsBuilderClient, ILiquidCommerceElementsBuilderConfig } from '@/interfaces/core.interface';
2
- export declare function ElementsBuilder(apiKey: string, config: ILiquidCommerceElementsBuilderConfig): Promise<ILiquidCommerceElementsBuilderClient | null>;
@@ -1,2 +0,0 @@
1
- import type { ILiquidCommerceElementsClient, ILiquidCommerceElementsConfig } from '@/interfaces/core.interface';
2
- export declare function Elements(apiKey: string, config: ILiquidCommerceElementsConfig): Promise<ILiquidCommerceElementsClient | null>;
@@ -1,106 +0,0 @@
1
- export declare enum DAYS_OF_WEEK {
2
- MONDAY = "monday",
3
- TUESDAY = "tuesday",
4
- WEDNESDAY = "wednesday",
5
- THURSDAY = "thursday",
6
- FRIDAY = "friday",
7
- SATURDAY = "saturday",
8
- SUNDAY = "sunday"
9
- }
10
- export declare const CART_EVENT_ENUM: {
11
- readonly OOS: "OutOfStock";
12
- readonly ITEMS_NOT_ADDED: "ItemsNotAdded";
13
- readonly ITEMS_REQUESTED_NOT_ADDED: "ItemsRequestedNotAdded";
14
- readonly ITEM_NOT_ENGRAVED: "ItemEngravingError";
15
- readonly ADDRESS_CHANGE: "AddressChange";
16
- readonly LOCATION_AVAILABILITY: "LocationAvailability";
17
- readonly PARTNER_PRODUCT_CONFIGS: "PartnerProductConfigs";
18
- readonly REMOVED_EXISTING_ITEMS: "RemovedExistingCartItems";
19
- readonly RETAILER_MIN: "RetailerMinNotMet";
20
- readonly NO_ITEMS_IN_CART: "NoItemsInCart";
21
- readonly INVALID_ID: "InvalidId";
22
- readonly NO_ID: "NoId";
23
- readonly CART_CHECKOUT_PROCESSED: "CartCheckoutProcessed";
24
- readonly NEW_CART: "NewCart";
25
- readonly DEFAULT: "CartError";
26
- readonly ITEM_QTY_CHANGE: "ItemQuantityChange";
27
- readonly ITEM_ID_NOT_FOUND: "ItemIdNotFound";
28
- readonly ITEMS_REMOVED: "ItemsRemoved";
29
- readonly COUPON_PROCESSING_ERROR: "CouponProcessingError";
30
- readonly COUPON_NOT_FOUND: "CouponNotFound";
31
- readonly COUPON_EXPIRED: "CouponExpired";
32
- readonly NO_APPLICABLE_DISCOUNT: "NoApplicableDiscount";
33
- readonly COUPON_NOT_STARTED: "CouponNotStarted";
34
- readonly MINIMUM_ORDER_VALUE_NOT_MET: "MinimumOrderValueNotMet";
35
- readonly MINIMUM_ORDER_UNITS_NOT_MET: "MinimumOrderUnitsNotMet";
36
- readonly MINIMUM_DISTINCT_ITEMS_NOT_MET: "MinimumDistinctItemsNotMet";
37
- readonly QUOTA_EXCEEDED: "QuotaExceeded";
38
- readonly USER_LIMIT_EXCEEDED: "UserLimitExceeded";
39
- readonly NOT_FIRST_PURCHASE: "NotFirstPurchase";
40
- readonly INVALID_COUPON: "InvalidCoupon";
41
- readonly INVALID_MEMBERSHIP: "InvalidMembership";
42
- readonly INVALID_DOMAIN: "InvalidDomain";
43
- readonly INVALID_REQUIREMENTS: "InvalidRequirements";
44
- readonly INVALID_ORGANIZATION: "InvalidOrganization";
45
- readonly PRODUCT_NOT_ELIGIBLE: "ProductNotEligible";
46
- readonly NOT_ENOUGH_PREVIOUS_ORDERS: "NotEnoughPreviousOrders";
47
- readonly PRESALE_ITEMS_NOT_ALLOWED: "PresaleItemsNotAllowed";
48
- readonly PRESALE_LIMIT_EXCEEDED: "PresaleLimitExceeded";
49
- readonly PRESALE_NOT_STARTED: "PresaleNotStarted";
50
- readonly PRESALE_EXPIRED: "PresaleExpired";
51
- readonly PRESALE_MIXED_CART: "PresaleMixedCart";
52
- readonly RETAILER_DOES_NOT_ALLOW_PROMOS: "RetailerDoesNotAllowPromos";
53
- readonly RETAILERS_DO_NOT_ALLOW_PROMOS: "RetailersDoNotAllowPromos";
54
- };
55
- export type CartEventEnum = (typeof CART_EVENT_ENUM)[keyof typeof CART_EVENT_ENUM];
56
- export declare const CHECKOUT_EVENT_ENUM: {
57
- readonly ERROR_PROCESSING_GIFT_CARDS: "ErrorProcessingGiftCards";
58
- readonly INVALID_GIFT_CARD_CODE: "InvalidGiftCardCodes";
59
- readonly INVALID_GIFT_CARD_PARTNER: "InvalidGiftCardPartner";
60
- readonly INACTIVE_GIFT_CARD: "InactiveGiftCard";
61
- readonly GIFT_CARD_ALREADY_IN_USE: "GiftCardAlreadyInUse";
62
- readonly GIFT_CARD_EXPIRED: "GiftCardExpired";
63
- readonly GIFT_CARD_BALANCE_DEPLETED: "GiftCardBalanceDepleted";
64
- readonly RETAILER_ONDEMAND_HOURS_NOT_AVAILABLE: "RetailerOnDemandHoursNotAvailable";
65
- readonly ITEM_QTY_CHANGE: "ItemQuantityChange";
66
- readonly MAX_QUANTITY_PER_ORDER_EXCEEDED: "MaxQuantityPerOrderExceeded";
67
- readonly RETAILER_DOES_NOT_ALLOW_PROMOS: "RetailerDoesNotAllowPromos";
68
- readonly RETAILERS_DO_NOT_ALLOW_PROMOS: "RetailersDoNotAllowPromos";
69
- readonly RETAILER_DOES_NOT_ALLOW_GIFT_CARDS: "RetailerDoesNotAllowGiftCards";
70
- readonly RETAILERS_DO_NOT_ALLOW_GIFT_CARDS: "RetailersDoNotAllowGiftCards";
71
- };
72
- export type CheckoutEventEnum = (typeof CHECKOUT_EVENT_ENUM)[keyof typeof CHECKOUT_EVENT_ENUM];
73
- export declare const ENUM_ADDRESS_TYPE: {
74
- readonly SHIPPING: "shipping";
75
- readonly BILLING: "billing";
76
- };
77
- export type AddressType = (typeof ENUM_ADDRESS_TYPE)[keyof typeof ENUM_ADDRESS_TYPE];
78
- export declare enum ENUM_FILTER_KEYS {
79
- BRANDS = "brands",
80
- FLAVOR = "flavor",
81
- FULFILLMENT = "fulfillment",
82
- TAGS = "tags",
83
- REGION = "region",
84
- VARIETY = "variety",
85
- ENGRAVING = "engraving",
86
- PRICE = "price",
87
- PRESALE = "presale",
88
- AVAILABILITY = "availability",
89
- CATEGORIES = "categories",
90
- SIZES = "sizes",
91
- COLORS = "colors",
92
- APPELLATION = "appellation",
93
- COUNTRY = "country",
94
- VINTAGE = "vintage",
95
- MATERIALS = "materials",
96
- COLLECTION_TAGS = "collectionTags"
97
- }
98
- export interface IFilterValue {
99
- value: string;
100
- count: number;
101
- }
102
- export type FacetFilterKeys = ENUM_FILTER_KEYS.BRANDS | ENUM_FILTER_KEYS.FLAVOR | ENUM_FILTER_KEYS.REGION | ENUM_FILTER_KEYS.VARIETY | ENUM_FILTER_KEYS.ENGRAVING | ENUM_FILTER_KEYS.PRESALE | ENUM_FILTER_KEYS.PRICE | ENUM_FILTER_KEYS.AVAILABILITY | ENUM_FILTER_KEYS.CATEGORIES | ENUM_FILTER_KEYS.SIZES | ENUM_FILTER_KEYS.COLORS | ENUM_FILTER_KEYS.APPELLATION | ENUM_FILTER_KEYS.COUNTRY | ENUM_FILTER_KEYS.VINTAGE | ENUM_FILTER_KEYS.MATERIALS | ENUM_FILTER_KEYS.TAGS;
103
- export interface IFilterSchema {
104
- filterCategory: FacetFilterKeys;
105
- filterValues: IFilterValue[];
106
- }
@@ -1,42 +0,0 @@
1
- import type { IProduct, IRetailer } from '@/interfaces/api/product.interface';
2
- export declare enum ENUM_NAVIGATION_ORDER_DIRECTION_TYPE {
3
- ASC = "asc",
4
- DESC = "desc"
5
- }
6
- export declare enum ENUM_ORDER_BY {
7
- PRICE = "price"
8
- }
9
- export interface ICatalogParams {
10
- search?: string;
11
- pageToken?: string;
12
- entity?: string;
13
- page?: number;
14
- perPage?: number;
15
- visitorId?: string;
16
- retailers?: string[];
17
- orderBy?: ENUM_ORDER_BY;
18
- orderDirection?: ENUM_NAVIGATION_ORDER_DIRECTION_TYPE;
19
- filters?: Array<Record<any, any>>;
20
- [key: string]: any;
21
- }
22
- export interface ICatalog {
23
- retailers: Record<string, IRetailer>;
24
- products?: IProduct[];
25
- navigation?: INavigationSchema;
26
- }
27
- export interface ICursorSchema {
28
- nextPageToken: string;
29
- previousPageToken: string;
30
- }
31
- export interface INavigationSchema {
32
- id: string;
33
- correctedQuery: string;
34
- attributionToken: string;
35
- currentPage: number;
36
- totalPages: number;
37
- totalCount: number;
38
- availableOrderBy: ENUM_ORDER_BY[];
39
- availableOrderDirection: ENUM_NAVIGATION_ORDER_DIRECTION_TYPE[];
40
- cursor: ICursorSchema;
41
- filters: any[];
42
- }
@@ -1,218 +0,0 @@
1
- import type { CheckoutEventEnum } from '@/enums';
2
- import type { IAddressAddress } from '@/interfaces/api/address.interface';
3
- import type { ICartItemAttributes } from '@/interfaces/api/cart.interface';
4
- import type { ICoreParams } from '@/interfaces/cloud/core.interface';
5
- import type { IRetailerExpectation } from './retailer.interface';
6
- export interface ICheckoutRecipient {
7
- firstName?: string;
8
- lastName?: string;
9
- email?: string;
10
- phone?: string;
11
- birthDate?: string;
12
- hasAgeVerify?: boolean;
13
- }
14
- export interface IBillingAddress {
15
- firstName?: string;
16
- lastName?: string;
17
- email?: string;
18
- phone?: string;
19
- one?: string;
20
- two?: string;
21
- city?: string;
22
- state?: string;
23
- zip?: string;
24
- country?: string;
25
- }
26
- export interface ICheckoutCustomer {
27
- id?: string;
28
- email?: string;
29
- firstName?: string;
30
- lastName?: string;
31
- company?: string;
32
- phone?: string;
33
- profileImage?: string;
34
- birthDate?: string;
35
- hasAgeVerify?: boolean;
36
- createdAt?: Date;
37
- updatedAt?: Date;
38
- }
39
- interface ICheckoutBaseAddress {
40
- id?: string;
41
- one?: string;
42
- two?: string;
43
- city?: string;
44
- state?: string;
45
- zip?: string;
46
- country?: string;
47
- }
48
- export type ICheckoutBillingAddress = ICheckoutBaseAddress & Omit<ICheckoutCustomer, 'birthDate' | 'id' | 'createdAt' | 'hasAgeVerify' | 'updatedAt' | 'profileImage'>;
49
- export interface ICheckoutGiftOptionsRecipient {
50
- name?: string;
51
- email?: string;
52
- phone?: string;
53
- }
54
- export interface ICheckoutGiftOptions {
55
- message?: string;
56
- recipient?: ICheckoutGiftOptionsRecipient;
57
- }
58
- export interface ICheckoutMarketingPreferences {
59
- canEmail?: boolean;
60
- canSms?: boolean;
61
- }
62
- export interface ICheckoutDeliveryTip {
63
- fulfillmentId: string;
64
- tip: number;
65
- }
66
- export interface ICheckoutDeliveryInstructions {
67
- fulfillmentId: string;
68
- instructions: string;
69
- }
70
- export interface ICheckoutPrepareParams extends ICoreParams {
71
- cartId: string;
72
- customer?: ICheckoutCustomer | string;
73
- recipient?: ICheckoutRecipient;
74
- hasAgeVerify?: boolean;
75
- shippingAddressTwo?: string;
76
- billingAddress?: ICheckoutBillingAddress | IBillingAddress;
77
- hasSubstitutionPolicy?: boolean;
78
- isGift?: boolean;
79
- billingSameAsShipping?: boolean;
80
- giftOptions?: ICheckoutGiftOptions;
81
- marketingPreferences?: ICheckoutMarketingPreferences;
82
- deliveryTips?: ICheckoutDeliveryTip[];
83
- deliveryInstructions?: ICheckoutDeliveryInstructions[];
84
- acceptedAccountCreation?: boolean;
85
- scheduledDelivery?: string;
86
- payment?: string;
87
- promoCode?: string;
88
- giftCards?: string[];
89
- }
90
- export interface ICheckoutTotalAmountsDiscounts {
91
- products: number;
92
- delivery: number;
93
- shipping: number;
94
- engraving: number;
95
- service: number;
96
- }
97
- export interface ICheckoutTotalAmountsTaxes {
98
- bag: number;
99
- bottleDeposits: number;
100
- retailDelivery: number;
101
- products: number;
102
- delivery: number;
103
- shipping: number;
104
- }
105
- export interface ICheckoutTotalAmountsDetails {
106
- taxes: ICheckoutTotalAmountsTaxes;
107
- discounts: ICheckoutTotalAmountsDiscounts;
108
- }
109
- export interface ICheckoutTotalAmounts {
110
- subtotal: number;
111
- engraving: number;
112
- service: number;
113
- shipping: number;
114
- delivery: number;
115
- platform: number;
116
- discounts: number;
117
- giftCards: number;
118
- tax: number;
119
- tip: number;
120
- total: number;
121
- details: ICheckoutTotalAmountsDetails;
122
- }
123
- export interface ICheckoutFulfillment extends ICheckoutTotalAmounts {
124
- id: string;
125
- scheduledFor?: string | Date;
126
- type: 'shipping' | 'onDemand';
127
- expectation: IRetailerExpectation;
128
- items: string[];
129
- }
130
- export interface ICheckoutRetailer extends ICheckoutTotalAmounts {
131
- id: string;
132
- name: string;
133
- address?: IAddressAddress;
134
- fulfillments: ICheckoutFulfillment[];
135
- }
136
- export interface ICheckoutItem {
137
- variantId: string;
138
- cartItemId: string;
139
- liquidId: string;
140
- retailerId: string;
141
- fulfillmentId: string;
142
- salsifyPid?: string;
143
- salsifyGrouping: string;
144
- name: string;
145
- catPath: string;
146
- volume: string;
147
- uom: string;
148
- proof: string;
149
- abv: string;
150
- containerType: string;
151
- container: string;
152
- size: string;
153
- pack: boolean;
154
- packDesc: string;
155
- mainImage: string;
156
- image: string;
157
- brand: string;
158
- partNumber: string;
159
- upc: string;
160
- sku: string;
161
- price: number;
162
- unitPrice: number;
163
- quantity: number;
164
- tax: number;
165
- unitTax: number;
166
- bottleDeposits: number;
167
- attributes: ICartItemAttributes;
168
- }
169
- export interface ICheckoutGiftCard {
170
- code: string;
171
- applied: number;
172
- balance: number;
173
- }
174
- export interface ICheckoutEvents {
175
- type: CheckoutEventEnum;
176
- message: string;
177
- }
178
- export interface ICheckoutAttributesPromoCode {
179
- value: string;
180
- discount: number;
181
- freeDelivery: boolean;
182
- freeServiceFee: boolean;
183
- freeShipping: boolean;
184
- }
185
- export interface ICheckoutPrepareResponse {
186
- token: string;
187
- cartId: string;
188
- customer: ICheckoutCustomer;
189
- hasAgeVerify: boolean;
190
- hasSubstitutionPolicy: boolean;
191
- isGift: boolean;
192
- createdAt: string;
193
- updatedAt: string;
194
- billingSameAsShipping: boolean;
195
- acceptedAccountCreation?: boolean;
196
- giftOptions: ICheckoutGiftOptions;
197
- marketingPreferences: ICheckoutMarketingPreferences;
198
- shippingAddress: IAddressAddress;
199
- billingAddress: ICheckoutBillingAddress;
200
- amounts: ICheckoutTotalAmounts;
201
- items: ICheckoutItem[];
202
- retailers: ICheckoutRetailer[];
203
- payment?: string;
204
- giftCards: ICheckoutGiftCard[];
205
- events: ICheckoutEvents[];
206
- promoCode: ICheckoutAttributesPromoCode;
207
- isPresaleLocked: boolean;
208
- presaleExpiresAt: string | null;
209
- }
210
- export interface ICheckoutCompleteParams extends ICoreParams {
211
- token: string;
212
- payment: string;
213
- }
214
- export interface ICheckoutCompleteResponse {
215
- legacyOrderNumber: string;
216
- referenceId: string;
217
- }
218
- export {};
@@ -1,22 +0,0 @@
1
- export interface ICoreParams {
2
- refresh?: boolean;
3
- isLean?: boolean;
4
- isLegacy?: boolean;
5
- }
6
- export interface ILiquidPaymentToken {
7
- id?: string;
8
- type?: string;
9
- card?: {
10
- brand: string | null;
11
- country: string | null;
12
- expMonth: number | null;
13
- expYear: number | null;
14
- last4: string | null;
15
- funding: string | null;
16
- };
17
- created?: number;
18
- error?: {
19
- message: string;
20
- code?: string;
21
- };
22
- }
@@ -1,4 +0,0 @@
1
- export * from './catalog.interface';
2
- export * from './checkout.interface';
3
- export * from './core.interface';
4
- export * from './retailer.interface';