@liquidcommerce/elements-sdk 2.6.0-beta.41 → 2.6.0-beta.43
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.
- package/README.md +1 -1
- package/dist/index.checkout.esm.js +6634 -6615
- package/dist/index.esm.js +11209 -11112
- package/dist/ssr-stub.checkout.esm.js +18 -0
- package/dist/ssr-stub.esm.js +269 -0
- package/dist/types/auto-initialize/shared-utils.d.ts +3 -1
- package/dist/types/clients/base.d.ts +4 -1
- package/dist/types/clients/builder.d.ts +2 -1
- package/dist/types/clients/checkout.d.ts +2 -10
- package/dist/types/clients/main.d.ts +2 -1
- package/dist/types/core/base-component.service.d.ts +2 -1
- package/dist/types/core/client/client-action.service.d.ts +1 -1
- package/dist/types/core/client/client-config.service.d.ts +1 -1
- package/dist/types/core/pubsub/pubsub.service.d.ts +0 -2
- package/dist/types/core/singleton-manager.service.d.ts +1 -1
- package/dist/types/index.checkout.d.ts +3 -2
- package/dist/types/index.checkout.umd.d.ts +1 -1
- package/dist/types/index.d.ts +4 -1
- package/dist/types/interfaces/client.interface.d.ts +62 -0
- package/dist/types/interfaces/component.interface.d.ts +7 -0
- package/dist/types/interfaces/config.interface.d.ts +45 -0
- package/dist/types/interfaces/configs/address.interface.d.ts +1 -1
- package/dist/types/interfaces/configs/cart.interface.d.ts +1 -1
- package/dist/types/interfaces/configs/checkout.interface.d.ts +1 -1
- package/dist/types/interfaces/configs/global.interface.d.ts +1 -1
- package/dist/types/interfaces/configs/product-list.interface.d.ts +1 -1
- package/dist/types/interfaces/configs/product.interface.d.ts +1 -1
- package/dist/types/interfaces/injection.interface.d.ts +44 -0
- package/dist/types/modules/checkout/components/checkout-stripe-form.component.d.ts +2 -1
- package/dist/types/modules/product/components/product-image-carousel.component.d.ts +3 -0
- package/dist/types/modules/product/components/product-retailers-carousel.component.d.ts +3 -0
- package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +3 -1
- package/dist/types/modules/product-list/product-list.commands.d.ts +1 -1
- package/dist/types/modules/product-list/product-list.component.d.ts +1 -1
- package/dist/types/modules/ui-components/lce-element/lce-element.component.d.ts +2 -1
- package/dist/types/ssr/stub.checkout.d.ts +6 -0
- package/dist/types/ssr/stub.d.ts +10 -0
- package/dist/types/utils/dom-compat.d.ts +2 -0
- package/docs/v1/README.md +2 -2
- package/docs/v1/api/actions/address-actions.md +11 -11
- package/docs/v1/api/actions/cart-actions.md +13 -13
- package/docs/v1/api/actions/checkout-actions.md +23 -23
- package/docs/v1/api/actions/product-actions.md +6 -6
- package/docs/v1/api/client.md +11 -11
- package/docs/v1/api/ui-helpers.md +11 -11
- package/docs/v1/examples/advanced-patterns.md +1 -1
- package/docs/v1/examples/checkout-flow.md +1 -1
- package/docs/v1/getting-started/concepts.md +7 -7
- package/docs/v1/getting-started/installation.md +2 -2
- package/docs/v1/getting-started/quick-start.md +3 -3
- package/docs/v1/guides/address-component.md +11 -11
- package/docs/v1/guides/best-practices.md +14 -14
- package/docs/v1/guides/cart-component.md +23 -23
- package/docs/v1/guides/checkout-component.md +24 -24
- package/docs/v1/guides/events.md +812 -77
- package/docs/v1/guides/product-component.md +5 -5
- package/docs/v1/integration/nextjs.md +11 -2
- package/docs/v1/integration/react.md +3 -3
- package/docs/v1/integration/vanilla-js.md +1 -1
- package/docs/v1/integration/vue.md +24 -0
- package/docs/v1/reference/browser-support.md +9 -0
- package/docs/v1/reference/error-handling.md +2 -2
- package/docs/v1/reference/troubleshooting.md +10 -2
- package/package.json +13 -9
- package/dist/types/interfaces/core.interface.d.ts +0 -139
- package/docs/gitbook/actions.md +0 -160
- package/docs/gitbook/address.md +0 -48
- package/docs/gitbook/cart.md +0 -65
- package/docs/gitbook/checkout.md +0 -131
- package/docs/gitbook/events.md +0 -137
- package/docs/gitbook/overview.md +0 -166
- package/docs/gitbook/product.md +0 -64
- package/docs/gitbook/quick-start-guide.md +0 -393
|
@@ -90,19 +90,19 @@ The `{token}` placeholder is replaced with the checkout token.
|
|
|
90
90
|
### Open Checkout
|
|
91
91
|
|
|
92
92
|
```javascript
|
|
93
|
-
window.elements.actions.checkout.openCheckout();
|
|
93
|
+
window.LiquidCommerce.elements.actions.checkout.openCheckout();
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
### Close Checkout
|
|
97
97
|
|
|
98
98
|
```javascript
|
|
99
|
-
window.elements.actions.checkout.closeCheckout();
|
|
99
|
+
window.LiquidCommerce.elements.actions.checkout.closeCheckout();
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
### Toggle Checkout
|
|
103
103
|
|
|
104
104
|
```javascript
|
|
105
|
-
window.elements.actions.checkout.toggleCheckout();
|
|
105
|
+
window.LiquidCommerce.elements.actions.checkout.toggleCheckout();
|
|
106
106
|
```
|
|
107
107
|
|
|
108
108
|
### Exit Checkout
|
|
@@ -110,7 +110,7 @@ window.elements.actions.checkout.toggleCheckout();
|
|
|
110
110
|
Navigate away from checkout (requires `exitUrl` configuration):
|
|
111
111
|
|
|
112
112
|
```javascript
|
|
113
|
-
window.elements.actions.checkout.exitCheckout();
|
|
113
|
+
window.LiquidCommerce.elements.actions.checkout.exitCheckout();
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
Configure exit URL:
|
|
@@ -130,7 +130,7 @@ customTheme: {
|
|
|
130
130
|
Skip the cart and go directly to checkout:
|
|
131
131
|
|
|
132
132
|
```javascript
|
|
133
|
-
await window.elements.actions.checkout.addProduct([
|
|
133
|
+
await window.LiquidCommerce.elements.actions.checkout.addProduct([
|
|
134
134
|
{
|
|
135
135
|
identifier: '00619947000020',
|
|
136
136
|
fulfillmentType: 'shipping',
|
|
@@ -142,25 +142,25 @@ await window.elements.actions.checkout.addProduct([
|
|
|
142
142
|
### Apply Promo Code
|
|
143
143
|
|
|
144
144
|
```javascript
|
|
145
|
-
await window.elements.actions.checkout.applyPromoCode('WELCOME10');
|
|
145
|
+
await window.LiquidCommerce.elements.actions.checkout.applyPromoCode('WELCOME10');
|
|
146
146
|
```
|
|
147
147
|
|
|
148
148
|
### Remove Promo Code
|
|
149
149
|
|
|
150
150
|
```javascript
|
|
151
|
-
await window.elements.actions.checkout.removePromoCode();
|
|
151
|
+
await window.LiquidCommerce.elements.actions.checkout.removePromoCode();
|
|
152
152
|
```
|
|
153
153
|
|
|
154
154
|
### Apply Gift Card
|
|
155
155
|
|
|
156
156
|
```javascript
|
|
157
|
-
await window.elements.actions.checkout.applyGiftCard('GIFT-1234-5678');
|
|
157
|
+
await window.LiquidCommerce.elements.actions.checkout.applyGiftCard('GIFT-1234-5678');
|
|
158
158
|
```
|
|
159
159
|
|
|
160
160
|
### Remove Gift Card
|
|
161
161
|
|
|
162
162
|
```javascript
|
|
163
|
-
await window.elements.actions.checkout.removeGiftCard('GIFT-1234-5678');
|
|
163
|
+
await window.LiquidCommerce.elements.actions.checkout.removeGiftCard('GIFT-1234-5678');
|
|
164
164
|
```
|
|
165
165
|
|
|
166
166
|
### Toggle Gift Mode
|
|
@@ -169,33 +169,33 @@ Enable/disable "Send as Gift" mode:
|
|
|
169
169
|
|
|
170
170
|
```javascript
|
|
171
171
|
// Enable gift mode
|
|
172
|
-
await window.elements.actions.checkout.toggleIsGift(true);
|
|
172
|
+
await window.LiquidCommerce.elements.actions.checkout.toggleIsGift(true);
|
|
173
173
|
|
|
174
174
|
// Disable gift mode
|
|
175
|
-
await window.elements.actions.checkout.toggleIsGift(false);
|
|
175
|
+
await window.LiquidCommerce.elements.actions.checkout.toggleIsGift(false);
|
|
176
176
|
|
|
177
177
|
// Toggle current state
|
|
178
|
-
await window.elements.actions.checkout.toggleIsGift();
|
|
178
|
+
await window.LiquidCommerce.elements.actions.checkout.toggleIsGift();
|
|
179
179
|
```
|
|
180
180
|
|
|
181
181
|
### Toggle Billing Same As Shipping
|
|
182
182
|
|
|
183
183
|
```javascript
|
|
184
184
|
// Use shipping address for billing
|
|
185
|
-
await window.elements.actions.checkout.toggleBillingSameAsShipping(true);
|
|
185
|
+
await window.LiquidCommerce.elements.actions.checkout.toggleBillingSameAsShipping(true);
|
|
186
186
|
|
|
187
187
|
// Use different billing address
|
|
188
|
-
await window.elements.actions.checkout.toggleBillingSameAsShipping(false);
|
|
188
|
+
await window.LiquidCommerce.elements.actions.checkout.toggleBillingSameAsShipping(false);
|
|
189
189
|
```
|
|
190
190
|
|
|
191
191
|
### Toggle Marketing Preferences
|
|
192
192
|
|
|
193
193
|
```javascript
|
|
194
194
|
// Opt into email marketing
|
|
195
|
-
await window.elements.actions.checkout.toggleMarketingPreferences('canEmail', true);
|
|
195
|
+
await window.LiquidCommerce.elements.actions.checkout.toggleMarketingPreferences('canEmail', true);
|
|
196
196
|
|
|
197
197
|
// Opt into SMS marketing
|
|
198
|
-
await window.elements.actions.checkout.toggleMarketingPreferences('canSms', true);
|
|
198
|
+
await window.LiquidCommerce.elements.actions.checkout.toggleMarketingPreferences('canSms', true);
|
|
199
199
|
```
|
|
200
200
|
|
|
201
201
|
### Update Customer Information
|
|
@@ -203,7 +203,7 @@ await window.elements.actions.checkout.toggleMarketingPreferences('canSms', true
|
|
|
203
203
|
Pre-fill customer information:
|
|
204
204
|
|
|
205
205
|
```javascript
|
|
206
|
-
window.elements.actions.checkout.updateCustomerInfo({
|
|
206
|
+
window.LiquidCommerce.elements.actions.checkout.updateCustomerInfo({
|
|
207
207
|
firstName: 'John',
|
|
208
208
|
lastName: 'Doe',
|
|
209
209
|
email: 'john@example.com',
|
|
@@ -225,7 +225,7 @@ window.elements.actions.checkout.updateCustomerInfo({
|
|
|
225
225
|
Pre-fill gift recipient information:
|
|
226
226
|
|
|
227
227
|
```javascript
|
|
228
|
-
window.elements.actions.checkout.updateGiftInfo({
|
|
228
|
+
window.LiquidCommerce.elements.actions.checkout.updateGiftInfo({
|
|
229
229
|
firstName: 'Jane',
|
|
230
230
|
lastName: 'Smith',
|
|
231
231
|
email: 'jane@example.com',
|
|
@@ -246,7 +246,7 @@ window.elements.actions.checkout.updateGiftInfo({
|
|
|
246
246
|
Pre-fill billing address:
|
|
247
247
|
|
|
248
248
|
```javascript
|
|
249
|
-
window.elements.actions.checkout.updateBillingInfo({
|
|
249
|
+
window.LiquidCommerce.elements.actions.checkout.updateBillingInfo({
|
|
250
250
|
firstName: 'John',
|
|
251
251
|
lastName: 'Doe',
|
|
252
252
|
email: 'john@example.com',
|
|
@@ -268,7 +268,7 @@ window.elements.actions.checkout.updateBillingInfo({
|
|
|
268
268
|
### Get Checkout Details
|
|
269
269
|
|
|
270
270
|
```javascript
|
|
271
|
-
const checkoutData = window.elements.actions.checkout.getDetails();
|
|
271
|
+
const checkoutData = window.LiquidCommerce.elements.actions.checkout.getDetails();
|
|
272
272
|
|
|
273
273
|
console.log(checkoutData);
|
|
274
274
|
// {
|
|
@@ -532,7 +532,7 @@ If you have customer data, pre-fill it:
|
|
|
532
532
|
// After user logs in
|
|
533
533
|
if (userIsLoggedIn) {
|
|
534
534
|
window.addEventListener('lce:actions.checkout_opened', () => {
|
|
535
|
-
window.elements.actions.checkout.updateCustomerInfo({
|
|
535
|
+
window.LiquidCommerce.elements.actions.checkout.updateCustomerInfo({
|
|
536
536
|
firstName: currentUser.firstName,
|
|
537
537
|
lastName: currentUser.lastName,
|
|
538
538
|
email: currentUser.email,
|
|
@@ -637,10 +637,10 @@ checkout: {
|
|
|
637
637
|
|
|
638
638
|
### Checkout Not Opening
|
|
639
639
|
|
|
640
|
-
1. Verify cart has items: `window.elements.actions.cart.getDetails()`
|
|
640
|
+
1. Verify cart has items: `window.LiquidCommerce.elements.actions.cart.getDetails()`
|
|
641
641
|
2. Check for JavaScript errors in console
|
|
642
|
-
3. Ensure SDK is initialized: `window.elements`
|
|
643
|
-
4. Try manually: `window.elements.actions.checkout.openCheckout()`
|
|
642
|
+
3. Ensure SDK is initialized: `window.LiquidCommerce.elements`
|
|
643
|
+
4. Try manually: `window.LiquidCommerce.elements.actions.checkout.openCheckout()`
|
|
644
644
|
|
|
645
645
|
### Payment Form Not Loading
|
|
646
646
|
|