@liquidcommerce/elements-sdk 2.6.0-beta.95 → 2.6.0-beta.97
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 +20 -4
- package/dist/index.checkout.esm.js +7970 -7403
- package/dist/index.esm.js +12979 -12066
- package/dist/types/core/a11y/glyph-button.d.ts +8 -0
- package/dist/types/core/a11y/index.d.ts +2 -0
- package/dist/types/core/a11y/single-select.d.ts +16 -0
- package/dist/types/modules/address/address-display.component.d.ts +3 -1
- package/dist/types/modules/product/components/components.d.ts +6 -1
- package/dist/types/modules/product/components/product-add-to-cart-section.component.d.ts +6 -1
- package/dist/types/modules/product/components/product-image-carousel.component.d.ts +1 -0
- package/dist/types/modules/product/components/product-retailers-carousel.component.d.ts +1 -0
- package/dist/types/modules/product/components/product-retailers-popup-list.component.d.ts +5 -0
- package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts +2 -1
- package/dist/types/modules/theme-provider/services/contrast-guard.service.d.ts +19 -0
- package/dist/types/modules/ui-components/input/input.component.d.ts +1 -0
- package/dist/types/modules/ui-components/lce-element/lce-element.component.d.ts +9 -1
- package/dist/types/static/icon/arrow-right.icon.d.ts +1 -1
- package/dist/types/static/icon/bag.icon.d.ts +1 -1
- package/dist/types/static/icon/check.icon.d.ts +1 -1
- package/dist/types/static/icon/checkbox.icon.d.ts +1 -1
- package/dist/types/static/icon/chevron-down.icon.d.ts +1 -1
- package/dist/types/static/icon/chevron-left.icon.d.ts +1 -1
- package/dist/types/static/icon/chevron-up.icon.d.ts +1 -1
- package/dist/types/static/icon/close.icon.d.ts +1 -1
- package/dist/types/static/icon/error-info.icon.d.ts +1 -1
- package/dist/types/static/icon/filter.icon.d.ts +1 -1
- package/dist/types/static/icon/icon.a11y.d.ts +1 -0
- package/dist/types/static/icon/icon.types.d.ts +1 -0
- package/dist/types/static/icon/index.d.ts +1 -0
- package/dist/types/static/icon/info.icon.d.ts +1 -1
- package/dist/types/static/icon/loading-spinner.icon.d.ts +1 -1
- package/dist/types/static/icon/search.icon.d.ts +1 -1
- package/dist/types/static/icon/success.icon.d.ts +1 -1
- package/dist/types/static/icon/trash.icon.d.ts +1 -1
- package/dist/types/static/icon/warning.icon.d.ts +1 -1
- package/dist/types/utils/color-contrast.d.ts +16 -0
- package/docs/v1/README.md +3 -0
- package/docs/v1/api/actions/address-actions.md +1 -1
- package/docs/v1/api/client.md +4 -3
- package/docs/v1/api/configuration.md +13 -0
- package/docs/v1/api/ui-helpers.md +2 -2
- package/docs/v1/getting-started/concepts.md +24 -7
- package/docs/v1/getting-started/installation.md +2 -2
- package/docs/v1/getting-started/quick-start.md +8 -3
- package/docs/v1/guides/accessibility.md +190 -0
- package/docs/v1/guides/address-component.md +3 -3
- package/docs/v1/guides/best-practices.md +1 -1
- package/docs/v1/guides/cart-component.md +3 -3
- package/docs/v1/guides/events.md +18 -5
- package/docs/v1/guides/theming.md +6 -1
- package/docs/v1/integration/vanilla-js.md +1 -1
- package/docs/v1/reference/error-handling.md +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -58,10 +58,14 @@ npm install @liquidcommerce/elements-sdk
|
|
|
58
58
|
```javascript
|
|
59
59
|
import { Elements } from '@liquidcommerce/elements-sdk';
|
|
60
60
|
|
|
61
|
+
// Elements() resolves to `null` if initialization fails — it never throws.
|
|
61
62
|
const client = await Elements('YOUR_API_KEY', { env: 'production' });
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
|
|
64
|
+
if (client) {
|
|
65
|
+
await client.injectProductElement([
|
|
66
|
+
{ containerId: 'product', identifier: '00619947000020' }
|
|
67
|
+
]);
|
|
68
|
+
}
|
|
65
69
|
```
|
|
66
70
|
|
|
67
71
|
## Core Concepts (Short)
|
|
@@ -83,8 +87,10 @@ await client.injectProductElement([
|
|
|
83
87
|
## Key Methods (High Level)
|
|
84
88
|
|
|
85
89
|
- `injectProductElement`, `injectCartElement`, `injectCheckoutElement`, `injectAddressElement`
|
|
90
|
+
- `injectProductList`, `injectProductListFilters`, `injectProductListSearch`
|
|
86
91
|
- `ui.cartButton`, `ui.floatingCartButton`, `ui.cartSubtotal`, `ui.cartItemsCount`
|
|
87
92
|
- `actions.product`, `actions.cart`, `actions.checkout`, `actions.address`
|
|
93
|
+
- `getInjectedComponents`, `destroy`
|
|
88
94
|
|
|
89
95
|
```javascript
|
|
90
96
|
// Example: add a product and open cart
|
|
@@ -103,7 +109,7 @@ window.addEventListener('lce:actions.product_loaded', (event) => {
|
|
|
103
109
|
});
|
|
104
110
|
|
|
105
111
|
window.addEventListener('lce:actions.checkout_submit_completed', (event) => {
|
|
106
|
-
console.log('Order:', event.detail.data.
|
|
112
|
+
console.log('Order:', event.detail.data.orderNumber);
|
|
107
113
|
});
|
|
108
114
|
```
|
|
109
115
|
|
|
@@ -140,10 +146,20 @@ Works with any framework. See:
|
|
|
140
146
|
- [Start Here](./docs/v1/README.md)
|
|
141
147
|
- [Getting Started](./docs/v1/getting-started/installation.md)
|
|
142
148
|
- [Guides](./docs/v1/guides/)
|
|
149
|
+
- [Accessibility](./docs/v1/guides/accessibility.md)
|
|
143
150
|
- [API Reference](./docs/v1/api/)
|
|
144
151
|
- [Examples](./docs/v1/examples/)
|
|
145
152
|
- [Reference](./docs/v1/reference/)
|
|
146
153
|
|
|
154
|
+
## Accessibility
|
|
155
|
+
|
|
156
|
+
Elements target WCAG 2.1 AA out of the box: single-tab-stop keyboard groups with arrow-key
|
|
157
|
+
navigation, managed focus for every overlay, screen-reader announcements for content that changes
|
|
158
|
+
without navigation, and a runtime guard that corrects theme colours which fail contrast.
|
|
159
|
+
|
|
160
|
+
See the [Accessibility Guide](./docs/v1/guides/accessibility.md) for the keyboard map, the list of
|
|
161
|
+
announcements, and what your page is responsible for.
|
|
162
|
+
|
|
147
163
|
## Browser Support
|
|
148
164
|
|
|
149
165
|
Chrome 66+, Firefox 60+, Safari 12+, Edge 79+.
|