@liquidcommerce/elements-sdk 2.6.0-beta.111 → 2.6.0-beta.113
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/dist/index.checkout.esm.js +8099 -7664
- package/dist/index.esm.js +12879 -12427
- package/dist/ssr-stub.esm.js +1 -0
- package/dist/types/clients/helpers.d.ts +2 -0
- package/dist/types/core/client/actions/client-checkout-action.service.d.ts +8 -2
- package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +5 -0
- package/dist/types/core/pubsub/interfaces/core.interface.d.ts +2 -1
- package/dist/types/core/store/interfaces/checkout.interface.d.ts +1 -0
- package/dist/types/enums/core.enum.d.ts +1 -0
- package/dist/types/interfaces/configs/cart.interface.d.ts +1 -0
- package/dist/types/modules/cart/cart.commands.d.ts +5 -1
- package/dist/types/modules/cart/components/cart-fulfillment.component.d.ts +1 -1
- package/dist/types/modules/checkout/checkout.commands.d.ts +26 -1
- package/dist/types/modules/checkout/components/checkout-order-summary.component.d.ts +1 -0
- package/dist/types/modules/checkout/components/checkout-payment.component.d.ts +4 -0
- package/dist/types/modules/checkout/components/checkout-stripe-form.component.d.ts +3 -0
- package/dist/types/modules/checkout/customer-prefill.d.ts +2 -0
- package/dist/types/modules/product/components/product-retailers-popup.component.d.ts +1 -0
- package/docs/v1/api/actions/checkout-actions.md +58 -1
- package/docs/v1/api/configuration.md +2 -0
- package/docs/v1/api/typescript-types.md +57 -0
- package/docs/v1/examples/custom-theming.md +13 -0
- package/docs/v1/guides/accessibility.md +36 -7
- package/docs/v1/guides/cart-component.md +43 -0
- package/docs/v1/guides/checkout-component.md +57 -0
- package/docs/v1/guides/events.md +30 -0
- package/docs/v1/guides/theming.md +13 -0
- package/package.json +9 -9
package/docs/v1/guides/events.md
CHANGED
|
@@ -226,6 +226,36 @@ window.addEventListener('lce:actions.address_failed', (event) => {
|
|
|
226
226
|
|
|
227
227
|
## Cart Events
|
|
228
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
|
+
|
|
229
259
|
### `lce:actions.cart_loaded`
|
|
230
260
|
|
|
231
261
|
Fires when the cart is fully loaded or synced.
|
|
@@ -138,6 +138,7 @@ customTheme: {
|
|
|
138
138
|
backgroundColor: '#ffffff'
|
|
139
139
|
},
|
|
140
140
|
layout: {
|
|
141
|
+
showShopRetailerButton: false, // Enable only with a cart_shop_retailer event handler
|
|
141
142
|
showQuantityCounter: true,
|
|
142
143
|
quantityCounterStyle: 'outlined',
|
|
143
144
|
drawerHeaderText: 'Your Shopping Cart',
|
|
@@ -227,3 +228,15 @@ const client = await Elements('YOUR_API_KEY', {
|
|
|
227
228
|
|
|
228
229
|
- [Configuration Reference](../api/configuration.md)
|
|
229
230
|
- [Component Guides](../guides/)
|
|
231
|
+
|
|
232
|
+
### Shop the same retailer
|
|
233
|
+
|
|
234
|
+
Set `customTheme.cart.layout.showShopRetailerButton: true` to show a native **Shop {retailer}**
|
|
235
|
+
button beside each unmet order-minimum warning (below it on mobile). The default is `false`,
|
|
236
|
+
including when the server theme predates this option. It only appears for a current, nonempty
|
|
237
|
+
`onDemand` or `shipping` fulfillment with a positive amount remaining and valid retailer ownership.
|
|
238
|
+
|
|
239
|
+
Handle `ELEMENTS_ACTIONS_EVENT.CART_SHOP_RETAILER` (`lce:actions.cart_shop_retailer`) to close the
|
|
240
|
+
cart and open your retailer-filtered catalog. The SDK emits identifiers only and performs no
|
|
241
|
+
navigation. Revalidate them against `client.actions.cart.getDetails()` before navigating; see
|
|
242
|
+
[Events](./events.md) for the payload.
|
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.
|
|
6
|
+
"version": "2.6.0-beta.113",
|
|
7
7
|
"homepage": "https://docs.liquidcommerce.co/elements-sdk",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -109,10 +109,10 @@
|
|
|
109
109
|
"theming"
|
|
110
110
|
],
|
|
111
111
|
"devDependencies": {
|
|
112
|
-
"@biomejs/biome": "^2.5.
|
|
113
|
-
"@commitlint/cli": "^21.2.
|
|
114
|
-
"@commitlint/config-conventional": "^21.2.
|
|
115
|
-
"@playwright/test": "1.
|
|
112
|
+
"@biomejs/biome": "^2.5.14",
|
|
113
|
+
"@commitlint/cli": "^21.2.3",
|
|
114
|
+
"@commitlint/config-conventional": "^21.2.3",
|
|
115
|
+
"@playwright/test": "1.63.0",
|
|
116
116
|
"@rollup/plugin-alias": "^6.0.0",
|
|
117
117
|
"@rollup/plugin-commonjs": "^29.0.3",
|
|
118
118
|
"@rollup/plugin-json": "^6.1.0",
|
|
@@ -126,18 +126,18 @@
|
|
|
126
126
|
"@semantic-release/npm": "^13.1.5",
|
|
127
127
|
"@semantic-release/release-notes-generator": "^14.1.1",
|
|
128
128
|
"@types/core-js": "^2.5.8",
|
|
129
|
-
"@types/node": "^26.
|
|
129
|
+
"@types/node": "^26.6.2",
|
|
130
130
|
"conventional-changelog": "8.1.3",
|
|
131
131
|
"husky": "^9.1.7",
|
|
132
|
-
"jsdom": "
|
|
132
|
+
"jsdom": "30.1.0",
|
|
133
133
|
"process": "^0.11.10",
|
|
134
|
-
"rollup": "^4.63.
|
|
134
|
+
"rollup": "^4.63.4",
|
|
135
135
|
"rollup-obfuscator": "^4.1.1",
|
|
136
136
|
"rollup-plugin-typescript2": "^0.37.0",
|
|
137
137
|
"semantic-release": "^25.0.9",
|
|
138
138
|
"ts-node": "^10.9.2",
|
|
139
139
|
"typescript": "6.0.3",
|
|
140
|
-
"vitest": "
|
|
140
|
+
"vitest": "5.0.1"
|
|
141
141
|
},
|
|
142
142
|
"engines": {
|
|
143
143
|
"node": ">=22"
|