@liquidcommerce/elements-sdk 2.6.0-beta.84 → 2.6.0-beta.86
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 +7211 -7124
- package/dist/index.esm.js +11411 -11328
- package/dist/types/core/pubsub/interfaces/address.interface.d.ts +3 -0
- package/dist/types/core/pubsub/interfaces/core.interface.d.ts +2 -2
- package/docs/v1/api/actions/address-actions.md +20 -15
- package/docs/v1/api/actions/cart-actions.md +22 -23
- package/docs/v1/api/actions/checkout-actions.md +72 -25
- package/docs/v1/api/actions/product-actions.md +61 -15
- package/docs/v1/api/client.md +38 -14
- package/docs/v1/api/configuration.md +5 -1
- package/docs/v1/api/injection-methods.md +8 -4
- package/docs/v1/api/typescript-types.md +6 -0
- package/docs/v1/examples/advanced-patterns.md +7 -6
- package/docs/v1/examples/checkout-flow.md +1 -2
- package/docs/v1/getting-started/concepts.md +20 -25
- package/docs/v1/getting-started/installation.md +4 -4
- package/docs/v1/guides/address-component.md +12 -8
- package/docs/v1/guides/best-practices.md +5 -5
- package/docs/v1/guides/cart-component.md +27 -39
- package/docs/v1/guides/checkout-component.md +27 -29
- package/docs/v1/guides/events.md +4 -4
- package/docs/v1/guides/product-component.md +56 -19
- package/docs/v1/guides/product-list-component.md +8 -9
- package/docs/v1/guides/theming.md +6 -9
- package/docs/v1/integration/proxy-setup.md +22 -5
- package/docs/v1/reference/browser-support.md +2 -1
- package/docs/v1/reference/error-handling.md +12 -7
- package/docs/v1/reference/performance.md +1 -3
- package/docs/v1/reference/troubleshooting.md +3 -3
- package/package.json +8 -17
|
@@ -157,6 +157,20 @@ For products with multiple sizes:
|
|
|
157
157
|
- Availability checking per size
|
|
158
158
|
- Out-of-stock indication
|
|
159
159
|
|
|
160
|
+
#### Preselect a Size via URL
|
|
161
|
+
|
|
162
|
+
Use the `lce_size` query parameter to preselect a size when the product page loads:
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
https://yoursite.com/products/buffalo-trace?lce_size=750ml
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
- The value is matched against each size's display value (e.g. `750ml`).
|
|
169
|
+
- Matching is case-insensitive and ignores whitespace, so `750 ML`, `750ml`, and `750ML` all select a `750ml` size.
|
|
170
|
+
- If the value matches no size, the default size selection is used.
|
|
171
|
+
|
|
172
|
+
`lce_size` is a fixed parameter name (not configured through a script attribute) and only applies to the product page.
|
|
173
|
+
|
|
160
174
|
### Fulfillment Types
|
|
161
175
|
|
|
162
176
|
Two fulfillment options:
|
|
@@ -183,7 +197,7 @@ For products with multiple retailers:
|
|
|
183
197
|
- Select with one tap
|
|
184
198
|
|
|
185
199
|
**Popup View**
|
|
186
|
-
- "
|
|
200
|
+
- "See Delivery Options" button (shows the available fulfillment count, e.g. "See Delivery Options (3)")
|
|
187
201
|
- Modal with full retailer list
|
|
188
202
|
- Filter and search capabilities
|
|
189
203
|
|
|
@@ -218,17 +232,38 @@ console.log(productData);
|
|
|
218
232
|
// {
|
|
219
233
|
// identifier: '00619947000020',
|
|
220
234
|
// name: 'Premium Whiskey',
|
|
221
|
-
//
|
|
222
|
-
//
|
|
235
|
+
// priceInfo: { currency: 'USD', minimum: 4999, average: 4999, maximum: 4999 },
|
|
236
|
+
// selectedSizeId: '750ml',
|
|
223
237
|
// selectedFulfillmentType: 'shipping',
|
|
224
|
-
//
|
|
225
|
-
//
|
|
238
|
+
// selectedFulfillmentId: 'fulfillment_123',
|
|
239
|
+
// productHasAvailability: true,
|
|
240
|
+
// fulfillmentHasAvailability: true,
|
|
241
|
+
// sizes: { '750ml': { ... } },
|
|
226
242
|
// ...
|
|
227
243
|
// }
|
|
228
244
|
```
|
|
229
245
|
|
|
230
246
|
**Note:** The product must be injected and loaded before calling `getDetails()`. If the product hasn't been loaded, an error is thrown.
|
|
231
247
|
|
|
248
|
+
### Get Product Availability by State
|
|
249
|
+
|
|
250
|
+
Check availability for one or more products in a given state. Returns a `Promise<IProductAvailabilityResponse>`:
|
|
251
|
+
|
|
252
|
+
```javascript
|
|
253
|
+
const availability = await window.LiquidCommerce.elements.actions.product.getProductAvailabilityByState(
|
|
254
|
+
['00619947000020', '08504405135'],
|
|
255
|
+
'NY'
|
|
256
|
+
);
|
|
257
|
+
|
|
258
|
+
console.log(availability);
|
|
259
|
+
// {
|
|
260
|
+
// products: [...],
|
|
261
|
+
// retailers: { ... }
|
|
262
|
+
// }
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
The `state` argument is optional; at least one product identifier is required.
|
|
266
|
+
|
|
232
267
|
## Events
|
|
233
268
|
|
|
234
269
|
Listen for product-related events:
|
|
@@ -239,8 +274,8 @@ Fired when product data is successfully loaded:
|
|
|
239
274
|
|
|
240
275
|
```javascript
|
|
241
276
|
window.addEventListener('lce:actions.product_loaded', (event) => {
|
|
242
|
-
const { identifier, name,
|
|
243
|
-
console.log(`Product loaded: ${name} - $${
|
|
277
|
+
const { identifier, name, priceInfo } = event.detail.data;
|
|
278
|
+
console.log(`Product loaded: ${name} - $${priceInfo.minimum / 100}`);
|
|
244
279
|
});
|
|
245
280
|
```
|
|
246
281
|
|
|
@@ -250,8 +285,8 @@ Fired when user clicks "Add to Cart":
|
|
|
250
285
|
|
|
251
286
|
```javascript
|
|
252
287
|
window.addEventListener('lce:actions.product_add_to_cart', (event) => {
|
|
253
|
-
const { identifier, quantity,
|
|
254
|
-
console.log(`Adding ${quantity}x ${identifier} (${
|
|
288
|
+
const { identifier, quantity, fulfillmentId } = event.detail.data;
|
|
289
|
+
console.log(`Adding ${quantity}x ${identifier} (${fulfillmentId})`);
|
|
255
290
|
});
|
|
256
291
|
```
|
|
257
292
|
|
|
@@ -261,8 +296,8 @@ Fired when user selects a different size:
|
|
|
261
296
|
|
|
262
297
|
```javascript
|
|
263
298
|
window.addEventListener('lce:actions.product_size_changed', (event) => {
|
|
264
|
-
const { identifier,
|
|
265
|
-
console.log(`Size changed to ${selectedSize
|
|
299
|
+
const { identifier, selectedSizeId, selectedSize } = event.detail.data;
|
|
300
|
+
console.log(`Size changed to ${selectedSize} (${selectedSizeId})`);
|
|
266
301
|
});
|
|
267
302
|
```
|
|
268
303
|
|
|
@@ -272,8 +307,8 @@ Fired when user switches between shipping and on-demand:
|
|
|
272
307
|
|
|
273
308
|
```javascript
|
|
274
309
|
window.addEventListener('lce:actions.product_fulfillment_type_changed', (event) => {
|
|
275
|
-
const { identifier,
|
|
276
|
-
console.log(`Fulfillment type changed to: ${
|
|
310
|
+
const { identifier, selectedFulfillmentType } = event.detail.data;
|
|
311
|
+
console.log(`Fulfillment type changed to: ${selectedFulfillmentType}`);
|
|
277
312
|
});
|
|
278
313
|
```
|
|
279
314
|
|
|
@@ -283,8 +318,8 @@ Fired when user selects a different retailer:
|
|
|
283
318
|
|
|
284
319
|
```javascript
|
|
285
320
|
window.addEventListener('lce:actions.product_fulfillment_changed', (event) => {
|
|
286
|
-
const { identifier,
|
|
287
|
-
console.log(`
|
|
321
|
+
const { identifier, selectedFulfillmentId, selectedFulfillmentType } = event.detail.data;
|
|
322
|
+
console.log(`Fulfillment changed to ${selectedFulfillmentId} (${selectedFulfillmentType})`);
|
|
288
323
|
});
|
|
289
324
|
```
|
|
290
325
|
|
|
@@ -397,7 +432,8 @@ await window.LiquidCommerce.elements.actions.address.setAddressManually(
|
|
|
397
432
|
two: 'Apt 4',
|
|
398
433
|
city: 'New York',
|
|
399
434
|
state: 'NY',
|
|
400
|
-
zip: '10001'
|
|
435
|
+
zip: '10001',
|
|
436
|
+
country: 'US'
|
|
401
437
|
},
|
|
402
438
|
{
|
|
403
439
|
latitude: 40.7128,
|
|
@@ -458,8 +494,9 @@ console.log(container); // <div id="product-1">...</div>
|
|
|
458
494
|
If a product identifier doesn't exist:
|
|
459
495
|
|
|
460
496
|
```javascript
|
|
461
|
-
// An error view is shown in the container
|
|
462
|
-
//
|
|
497
|
+
// An error view is shown in the container, and the store entry's `error`
|
|
498
|
+
// is set to 'Product data not found'. In debug/logging mode the SDK warns:
|
|
499
|
+
// "No product data found for the provided product IDs."
|
|
463
500
|
```
|
|
464
501
|
|
|
465
502
|
### No Availability
|
|
@@ -535,7 +572,7 @@ window.addEventListener('lce:actions.product_loaded', (event) => {
|
|
|
535
572
|
items: [{
|
|
536
573
|
item_id: event.detail.data.identifier,
|
|
537
574
|
item_name: event.detail.data.name,
|
|
538
|
-
price: event.detail.data.
|
|
575
|
+
price: event.detail.data.priceInfo.minimum / 100
|
|
539
576
|
}]
|
|
540
577
|
});
|
|
541
578
|
});
|
|
@@ -39,7 +39,7 @@ Use data attributes to configure the product list:
|
|
|
39
39
|
|
|
40
40
|
**Attributes:**
|
|
41
41
|
- `data-liquid-commerce-elements-products-list`: Product list container; value is the collection slug
|
|
42
|
-
- `data-rows`: Number of rows to display (default:
|
|
42
|
+
- `data-rows`: Number of rows to display (default: 4)
|
|
43
43
|
- `data-columns`: Number of columns (default: 4)
|
|
44
44
|
- `data-filters`: Comma-separated filter types
|
|
45
45
|
- `data-product-url`: URL pattern for product detail pages (optional)
|
|
@@ -138,8 +138,8 @@ Only filter keys that are configured for the list are honored — anything else
|
|
|
138
138
|
|
|
139
139
|
1. `data-filters` on `<div data-liquid-commerce-elements-products-list>` (use this when the page does **not** mount a filters UI but you still want URL filtering — e.g. a curated category page).
|
|
140
140
|
2. `data-filters` on the matching `<... -products-list-filters>` container (the common case when a filters panel is mounted).
|
|
141
|
-
3. `
|
|
142
|
-
4. `
|
|
141
|
+
3. `filters` array passed to `injectProductList(...)` programmatically.
|
|
142
|
+
4. `availableFilters` from the theme config for the list slug (fallback only).
|
|
143
143
|
|
|
144
144
|
### Supported formats
|
|
145
145
|
|
|
@@ -190,10 +190,9 @@ The search component provides full-text search across:
|
|
|
190
190
|
|
|
191
191
|
### Search Behavior
|
|
192
192
|
|
|
193
|
-
- Real-time search as user types (
|
|
194
|
-
-
|
|
195
|
-
-
|
|
196
|
-
- Shows result count
|
|
193
|
+
- Real-time search as user types (500ms debounce; fires on any non-empty input — no minimum character count)
|
|
194
|
+
- Input is limited to 100 characters; allowed characters: letters, numbers, spaces, and `- _ ' . , & ( )`
|
|
195
|
+
- Server-side filtering by the search term
|
|
197
196
|
- "Clear search" button appears when active
|
|
198
197
|
|
|
199
198
|
### Programmatic Search
|
|
@@ -262,7 +261,7 @@ Each product card shows:
|
|
|
262
261
|
- Brand
|
|
263
262
|
- Price (or price range for multiple sizes)
|
|
264
263
|
- Rating (if available)
|
|
265
|
-
-
|
|
264
|
+
- Clickable image/card linking to the product detail page (when `productUrl` is configured)
|
|
266
265
|
- "Add to Cart" button (optional)
|
|
267
266
|
- Availability indicator
|
|
268
267
|
|
|
@@ -619,7 +618,7 @@ await client.injectProductList({
|
|
|
619
618
|
|
|
620
619
|
### Search Not Finding Products
|
|
621
620
|
|
|
622
|
-
1. Verify
|
|
621
|
+
1. Verify the input uses allowed characters and is under the 100-character limit
|
|
623
622
|
2. Check search is not case-sensitive (it shouldn't be)
|
|
624
623
|
3. Ensure products have searchable text fields
|
|
625
624
|
4. Look for API errors in network tab
|
|
@@ -77,8 +77,7 @@ customTheme: {
|
|
|
77
77
|
personalizationCardStyle: 'outlined', // or 'filled'
|
|
78
78
|
allowPromoCodes: true,
|
|
79
79
|
inputFieldStyle: 'outlined', // or 'filled'
|
|
80
|
-
|
|
81
|
-
poweredByMode: 'light' // or 'dark'
|
|
80
|
+
poweredByMode: 'light' // or 'dark' (note: showPoweredBy is controlled server-side and cannot be overridden via customTheme)
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
83
|
}
|
|
@@ -152,16 +151,15 @@ customTheme: {
|
|
|
152
151
|
text: 'Receive SMS updates about your order and exclusive deals.'
|
|
153
152
|
},
|
|
154
153
|
allowGiftCards: true,
|
|
155
|
-
legalMessage: 'By placing your order, you agree to our Terms of Service and Privacy Policy.',
|
|
154
|
+
legalMessage: { show: true, text: 'By placing your order, you agree to our Terms of Service and Privacy Policy.' },
|
|
156
155
|
continueShoppingUrl: 'https://yoursite.com/shop',
|
|
157
156
|
exitUrl: 'https://yoursite.com',
|
|
158
157
|
thankYouButtonText: 'Continue Shopping',
|
|
159
158
|
drawerHeaderText: 'Checkout',
|
|
160
159
|
placeOrderButtonText: 'Place Order',
|
|
161
160
|
checkoutCompleted: {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
161
|
+
customLogo: 'https://yoursite.com/logo.png',
|
|
162
|
+
customText: 'Thank you for your purchase! Your order has been received.'
|
|
165
163
|
}
|
|
166
164
|
}
|
|
167
165
|
}
|
|
@@ -191,8 +189,7 @@ const client = await Elements('YOUR_API_KEY', {
|
|
|
191
189
|
},
|
|
192
190
|
layout: {
|
|
193
191
|
allowPromoCodes: true,
|
|
194
|
-
inputFieldStyle: 'outlined'
|
|
195
|
-
showPoweredBy: false
|
|
192
|
+
inputFieldStyle: 'outlined'
|
|
196
193
|
}
|
|
197
194
|
},
|
|
198
195
|
product: {
|
|
@@ -203,7 +200,7 @@ const client = await Elements('YOUR_API_KEY', {
|
|
|
203
200
|
},
|
|
204
201
|
cart: {
|
|
205
202
|
layout: {
|
|
206
|
-
|
|
203
|
+
goToCheckoutButtonText: 'Checkout Now'
|
|
207
204
|
}
|
|
208
205
|
}
|
|
209
206
|
}
|
|
@@ -12,7 +12,12 @@ import { Elements } from '@liquidcommerce/elements-sdk';
|
|
|
12
12
|
const client = await Elements('YOUR_API_KEY', {
|
|
13
13
|
env: 'production',
|
|
14
14
|
proxy: {
|
|
15
|
-
|
|
15
|
+
// Must be an ABSOLUTE URL ending with a trailing slash — the SDK resolves
|
|
16
|
+
// each request as `new URL('api' + path, baseUrl)`, so a missing trailing
|
|
17
|
+
// slash drops the last path segment.
|
|
18
|
+
baseUrl: 'https://yoursite.com/api/elements-proxy/',
|
|
19
|
+
// Optional: extra headers merged into every proxied request (e.g. credentials)
|
|
20
|
+
headers: { 'X-My-Auth': '...' }
|
|
16
21
|
}
|
|
17
22
|
});
|
|
18
23
|
```
|
|
@@ -30,7 +35,8 @@ export default function ProductPage() {
|
|
|
30
35
|
(async () => {
|
|
31
36
|
const client = await Elements('YOUR_API_KEY', {
|
|
32
37
|
env: 'production',
|
|
33
|
-
|
|
38
|
+
// Absolute URL with a trailing slash (see note above)
|
|
39
|
+
proxy: { baseUrl: 'https://yoursite.com/api/elements-proxy/' }
|
|
34
40
|
});
|
|
35
41
|
|
|
36
42
|
await client.injectProductElement([
|
|
@@ -47,6 +53,8 @@ export default function ProductPage() {
|
|
|
47
53
|
|
|
48
54
|
Your endpoint should forward requests to the LiquidCommerce Elements API, preserving method, headers, and body.
|
|
49
55
|
|
|
56
|
+
The SDK does not hardcode the upstream host in the proxy path. Instead, it sends the correct environment-specific upstream base URL in the `X-Liquid-Proxy-Target` request header (along with `X-Liquid-Proxy: true`). Forward to that header value rather than to a literal host — this keeps the proxy environment-agnostic. The SDK calls your proxy at `<baseUrl>/api/<endpoint>`, so the path captured after your proxy mount is exactly the `api/<endpoint>` to append to the target.
|
|
57
|
+
|
|
50
58
|
### Minimal Express Example
|
|
51
59
|
|
|
52
60
|
```javascript
|
|
@@ -56,15 +64,24 @@ import fetch from 'node-fetch';
|
|
|
56
64
|
const app = express();
|
|
57
65
|
app.use(express.json());
|
|
58
66
|
|
|
67
|
+
// Proxy is mounted at the path of your proxy.baseUrl ('/api/elements-proxy/').
|
|
59
68
|
app.all('/api/elements-proxy/*', async (req, res) => {
|
|
60
|
-
|
|
61
|
-
|
|
69
|
+
// Upstream base URL the SDK wants this request forwarded to
|
|
70
|
+
// (e.g. https://elements-services-production-948630220003.us-central1.run.app)
|
|
71
|
+
const upstream = req.headers['x-liquid-proxy-target'];
|
|
72
|
+
if (!upstream) {
|
|
73
|
+
return res.status(400).send('Missing X-Liquid-Proxy-Target header');
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Everything after the proxy mount, e.g. 'api/auth/authenticate'
|
|
77
|
+
const forwardedPath = req.params[0];
|
|
78
|
+
const targetUrl = `${upstream}/${forwardedPath}`;
|
|
62
79
|
|
|
63
80
|
const response = await fetch(targetUrl, {
|
|
64
81
|
method: req.method,
|
|
65
82
|
headers: {
|
|
66
83
|
...req.headers,
|
|
67
|
-
host:
|
|
84
|
+
host: new URL(upstream).host
|
|
68
85
|
},
|
|
69
86
|
body: ['GET', 'HEAD'].includes(req.method) ? undefined : JSON.stringify(req.body)
|
|
70
87
|
});
|
|
@@ -15,7 +15,8 @@ The Elements SDK requires modern browser features (Web Components + Shadow DOM).
|
|
|
15
15
|
- Shadow DOM
|
|
16
16
|
- ES2018 JavaScript
|
|
17
17
|
- Fetch API
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
**LocalStorage (optional, recommended):** used as a fast path for session persistence (cart/address). When unavailable (incognito, Safari/Firefox private mode, in-app webviews, cross-origin iframes), the SDK falls back to a generated device fingerprint plus server-side session persistence, so functionality is preserved.
|
|
19
20
|
|
|
20
21
|
## Server-Side Rendering (SSR)
|
|
21
22
|
|
|
@@ -19,9 +19,9 @@ class SDKError extends Error {
|
|
|
19
19
|
|
|
20
20
|
```javascript
|
|
21
21
|
try {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
]);
|
|
22
|
+
// Structural input errors throw a catchable SDKError — e.g. a non-array
|
|
23
|
+
// argument or an empty array:
|
|
24
|
+
await window.LiquidCommerce.elements.injectProductElement([]);
|
|
25
25
|
} catch (error) {
|
|
26
26
|
if (error.name === 'SDKError') {
|
|
27
27
|
console.error('SDK Error:', error);
|
|
@@ -29,13 +29,18 @@ try {
|
|
|
29
29
|
}
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
+
> A well-formed entry with an invalid product identifier does **not** throw — it renders an error view inside the component and sets an error in the store. `try/catch` here only catches structural input errors (a non-array argument or an empty array).
|
|
33
|
+
|
|
32
34
|
## Error Isolation
|
|
33
35
|
|
|
34
|
-
|
|
36
|
+
Component failures are contained — a component that fails to load renders an error view and logs to the console without crashing your page. Action methods (like `cart.addProduct`) emit a `*_FAILED` event on failure, and re-throw only on an unexpected error; several soft-failure paths (e.g. no product found, no items added) emit the failure event but still resolve. Wrap calls in try/catch **and** listen for the corresponding `*_failed` event to reliably detect failures:
|
|
35
37
|
|
|
36
38
|
```javascript
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
try {
|
|
40
|
+
await window.LiquidCommerce.elements.actions.cart.addProduct([/* invalid */]);
|
|
41
|
+
} catch (error) {
|
|
42
|
+
console.log('Handled add-to-cart failure');
|
|
43
|
+
}
|
|
39
44
|
```
|
|
40
45
|
|
|
41
46
|
## Error Events
|
|
@@ -55,7 +60,7 @@ window.addEventListener('lce:actions.address_failed', (event) => {
|
|
|
55
60
|
|
|
56
61
|
// Checkout submit failed
|
|
57
62
|
window.addEventListener('lce:actions.checkout_submit_failed', (event) => {
|
|
58
|
-
console.error('Checkout failed:', event.detail.data.
|
|
63
|
+
console.error('Checkout failed:', event.detail.data.message);
|
|
59
64
|
});
|
|
60
65
|
```
|
|
61
66
|
|
|
@@ -44,9 +44,7 @@ setTimeout(async () => {
|
|
|
44
44
|
## 5) Let the SDK Handle Media Optimization
|
|
45
45
|
|
|
46
46
|
The SDK automatically:
|
|
47
|
-
- Lazy loads images
|
|
48
|
-
- Uses responsive image sizes
|
|
49
|
-
- Virtualizes carousel images
|
|
47
|
+
- Lazy loads carousel/thumbnail images (native `loading="lazy"`)
|
|
50
48
|
|
|
51
49
|
## Related Docs
|
|
52
50
|
|
|
@@ -60,7 +60,7 @@ Common setup issues and how to resolve them.
|
|
|
60
60
|
|
|
61
61
|
**Symptoms:** Console warning "This SDK is designed for the browser. Calls made during SSR return null."
|
|
62
62
|
|
|
63
|
-
This is expected behavior. The SDK ships
|
|
63
|
+
This is expected behavior. The SDK ships SSR stubs that are automatically resolved when bundled for Node.js (via the `node` export condition in `package.json`). There are two: the main build's stub (the `.` export) provides `Elements` and `ElementsBuilder` and warns with the `[LiquidCommerce Elements]` prefix; the checkout build's stub (the `./checkout` export) provides `ElementsCheckout` and warns with the `[LiquidCommerce Checkout]` prefix. Both re-export their types and enums for TypeScript compatibility and return `null` from the factory functions.
|
|
64
64
|
|
|
65
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
66
|
|
|
@@ -72,8 +72,8 @@ This is expected behavior. The SDK ships an SSR stub that is automatically resol
|
|
|
72
72
|
|
|
73
73
|
**Fixes:**
|
|
74
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
|
|
76
|
-
- Use the debug panel (`debugMode: 'panel'`) to inspect component state.
|
|
75
|
+
- For debugging, enable `development.openShadowDom: true` to make the shadow root open (`mode: 'open'`) so you can inspect component internals in DevTools (via `element.shadowRoot`). This does **not** disable style isolation — external CSS still cannot reach the components; use `customTheme` to style them. (Forced off in production.)
|
|
76
|
+
- Use the debug panel (`debugMode: 'panel'`) to inspect SDK logs, events, and GTM activity in real time — it surfaces a live stream of logger output and pubsub/GTM events (not component internal state), and auto-enables only in non-production environments.
|
|
77
77
|
|
|
78
78
|
## Component Not Updating After Data Changes
|
|
79
79
|
|
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.86",
|
|
7
7
|
"homepage": "https://docs.liquidcommerce.co/elements-sdk",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"module": "./dist/index.esm.js",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
|
-
"packageManager": "pnpm@
|
|
17
|
+
"packageManager": "pnpm@11.8.0",
|
|
18
18
|
"exports": {
|
|
19
19
|
".": {
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"embeddable commerce"
|
|
78
78
|
],
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"@biomejs/biome": "^2.
|
|
80
|
+
"@biomejs/biome": "^2.5.0",
|
|
81
81
|
"@commitlint/cli": "^21.0.2",
|
|
82
82
|
"@commitlint/config-conventional": "^21.0.2",
|
|
83
83
|
"@rollup/plugin-alias": "^6.0.0",
|
|
@@ -93,27 +93,18 @@
|
|
|
93
93
|
"@semantic-release/npm": "^13.1.5",
|
|
94
94
|
"@semantic-release/release-notes-generator": "^14.1.1",
|
|
95
95
|
"@types/core-js": "^2.5.8",
|
|
96
|
-
"@types/node": "^
|
|
97
|
-
"conventional-changelog": "^7.2.
|
|
96
|
+
"@types/node": "^26.0.0",
|
|
97
|
+
"conventional-changelog": "^7.2.1",
|
|
98
98
|
"husky": "^9.1.7",
|
|
99
99
|
"process": "^0.11.10",
|
|
100
|
-
"rollup": "^4.
|
|
100
|
+
"rollup": "^4.62.2",
|
|
101
101
|
"rollup-obfuscator": "^4.1.1",
|
|
102
102
|
"rollup-plugin-typescript2": "^0.37.0",
|
|
103
|
-
"semantic-release": "^25.0.
|
|
103
|
+
"semantic-release": "^25.0.5",
|
|
104
104
|
"ts-node": "^10.9.2",
|
|
105
|
-
"typescript": "
|
|
105
|
+
"typescript": "6.0.3"
|
|
106
106
|
},
|
|
107
107
|
"engines": {
|
|
108
108
|
"node": ">=22"
|
|
109
|
-
},
|
|
110
|
-
"pnpm": {
|
|
111
|
-
"peerDependencyRules": {
|
|
112
|
-
"ignoreMissing": []
|
|
113
|
-
},
|
|
114
|
-
"onlyBuiltDependencies": [
|
|
115
|
-
"@biomejs/biome",
|
|
116
|
-
"javascript-obfuscator"
|
|
117
|
-
]
|
|
118
109
|
}
|
|
119
110
|
}
|