@liquidcommerce/elements-sdk 2.6.0-beta.1 → 2.6.0-beta.100
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 +99 -2517
- package/dist/index.checkout.esm.js +17794 -0
- package/dist/index.esm.js +26010 -20601
- package/dist/ssr-stub.checkout.esm.js +18 -0
- package/dist/ssr-stub.esm.js +270 -0
- package/dist/types/auto-initialize/checkout.d.ts +2 -0
- package/dist/types/auto-initialize/shared-utils.d.ts +50 -0
- package/dist/types/{elements-base-client.d.ts → clients/base.d.ts} +15 -2
- package/dist/types/clients/builder.d.ts +3 -0
- package/dist/types/clients/checkout.d.ts +6 -0
- package/dist/types/{elements-client-helper.d.ts → clients/helpers.d.ts} +2 -1
- package/dist/types/clients/main.d.ts +3 -0
- package/dist/types/constants/core.constant.d.ts +13 -6
- package/dist/types/core/a11y/announcer.service.d.ts +16 -0
- package/dist/types/core/a11y/focus-manager.service.d.ts +21 -0
- package/dist/types/core/a11y/focusable.d.ts +5 -0
- package/dist/types/core/a11y/glyph-button.d.ts +8 -0
- package/dist/types/core/a11y/index.d.ts +5 -0
- package/dist/types/core/a11y/single-select.d.ts +16 -0
- package/dist/types/core/api/api-client.service.d.ts +23 -22
- package/dist/types/core/api/api-result.d.ts +19 -0
- package/dist/types/core/api/auth-client.service.d.ts +39 -26
- package/dist/types/core/api/http-client.service.d.ts +0 -8
- package/dist/types/core/base-component.service.d.ts +4 -1
- package/dist/types/core/client/actions/base-action.service.d.ts +22 -0
- package/dist/types/core/client/actions/client-address-action.service.d.ts +18 -0
- package/dist/types/core/client/actions/client-cart-action.service.d.ts +38 -0
- package/dist/types/core/client/actions/client-checkout-action.service.d.ts +69 -0
- package/dist/types/core/client/actions/client-product-action.service.d.ts +15 -0
- package/dist/types/core/client/client-action.service.d.ts +6 -67
- package/dist/types/core/client/client-config.service.d.ts +9 -5
- package/dist/types/core/command/base-command.service.d.ts +2 -2
- package/dist/types/core/command/common-command.service.d.ts +2 -1
- package/dist/types/core/google-tag-manager.service.d.ts +15 -11
- package/dist/types/core/logger/logger.service.d.ts +1 -1
- package/dist/types/core/pubsub/interfaces/address.interface.d.ts +6 -12
- package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +27 -64
- package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +45 -50
- package/dist/types/core/pubsub/interfaces/core.interface.d.ts +11 -6
- package/dist/types/core/pubsub/interfaces/product.interface.d.ts +16 -81
- package/dist/types/core/pubsub/pubsub.service.d.ts +1 -2
- package/dist/types/core/singleton-manager.service.d.ts +12 -8
- package/dist/types/core/store/interfaces/address.interface.d.ts +3 -12
- package/dist/types/core/store/interfaces/cart.interface.d.ts +16 -55
- package/dist/types/core/store/interfaces/checkout.interface.d.ts +18 -108
- package/dist/types/core/store/interfaces/core.interface.d.ts +16 -5
- package/dist/types/core/store/interfaces/metadata.interface.d.ts +11 -0
- package/dist/types/core/store/interfaces/product-list.interface.d.ts +30 -0
- package/dist/types/core/store/interfaces/product.interface.d.ts +13 -66
- package/dist/types/core/store/store.constant.d.ts +6 -1
- package/dist/types/core/store/store.service.d.ts +1 -0
- package/dist/types/core/telemetry/telemetry.interface.d.ts +0 -1
- package/dist/types/core/telemetry/telemetry.service.d.ts +1 -0
- package/dist/types/enums/core.enum.d.ts +40 -1
- package/dist/types/enums/index.d.ts +0 -1
- package/dist/types/index.checkout.d.ts +8 -0
- package/dist/types/index.checkout.umd.d.ts +4 -0
- package/dist/types/index.d.ts +8 -3
- package/dist/types/interfaces/api/address.interface.d.ts +28 -0
- package/dist/types/interfaces/api/cart.interface.d.ts +96 -0
- package/dist/types/interfaces/api/checkout.interface.d.ts +239 -0
- package/dist/types/interfaces/{cloud → api}/index.d.ts +1 -3
- package/dist/types/interfaces/api/product-list.interface.d.ts +39 -0
- package/dist/types/interfaces/api/product.interface.d.ts +112 -0
- package/dist/types/interfaces/client.interface.d.ts +72 -0
- package/dist/types/interfaces/component.interface.d.ts +7 -0
- package/dist/types/interfaces/config.interface.d.ts +40 -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 +2 -1
- package/dist/types/interfaces/configs/configurations.interface.d.ts +5 -5
- package/dist/types/interfaces/configs/global.interface.d.ts +10 -3
- package/dist/types/interfaces/configs/index.d.ts +1 -0
- package/dist/types/interfaces/configs/product-list.interface.d.ts +49 -0
- package/dist/types/interfaces/configs/product.interface.d.ts +4 -1
- package/dist/types/interfaces/injection.interface.d.ts +49 -0
- package/dist/types/modules/address/address-display.component.d.ts +3 -1
- package/dist/types/modules/address/address-input.component.d.ts +10 -1
- package/dist/types/modules/address/address.command.d.ts +4 -4
- package/dist/types/modules/address/address.interface.d.ts +0 -7
- package/dist/types/modules/address/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/cart/cart.commands.d.ts +4 -5
- package/dist/types/modules/cart/components/cart-body.component.d.ts +3 -1
- package/dist/types/modules/cart/components/cart-footer.component.d.ts +0 -1
- package/dist/types/modules/cart/components/cart-fulfillment.component.d.ts +0 -2
- package/dist/types/modules/cart/components/cart-item-quantity-price.component.d.ts +5 -0
- package/dist/types/modules/cart/components/cart-item.component.d.ts +6 -0
- package/dist/types/modules/cart/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/checkout/checkout.commands.d.ts +27 -10
- package/dist/types/modules/checkout/checkout.component.d.ts +2 -0
- package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +2 -2
- package/dist/types/modules/checkout/components/checkout-completed.component.d.ts +5 -0
- package/dist/types/modules/checkout/components/checkout-header.component.d.ts +1 -0
- package/dist/types/modules/checkout/components/checkout-item-quantity.component.d.ts +4 -0
- package/dist/types/modules/checkout/components/checkout-items.component.d.ts +4 -3
- package/dist/types/modules/checkout/components/checkout-payment.component.d.ts +2 -1
- package/dist/types/modules/checkout/components/checkout-place-order-button.component.d.ts +2 -0
- package/dist/types/modules/checkout/components/checkout-presale-countdown.component.d.ts +14 -1
- package/dist/types/modules/checkout/components/checkout-presale-expired.component.d.ts +7 -1
- package/dist/types/modules/checkout/components/checkout-stripe-form.component.d.ts +2 -1
- package/dist/types/modules/checkout/components/checkout-tips.component.d.ts +2 -2
- package/dist/types/modules/checkout/components/promo-pc-gc.component.d.ts +0 -2
- package/dist/types/modules/checkout/constant.d.ts +3 -0
- package/dist/types/modules/checkout/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/product/components/components.d.ts +7 -4
- package/dist/types/modules/product/components/product-add-to-cart-section.component.d.ts +7 -1
- package/dist/types/modules/product/components/product-description.component.d.ts +1 -0
- package/dist/types/modules/product/components/product-drawer.component.d.ts +6 -0
- package/dist/types/modules/product/components/product-image-carousel.component.d.ts +5 -0
- package/dist/types/modules/product/components/product-options.component.d.ts +2 -1
- package/dist/types/modules/product/components/product-retailers-carousel.component.d.ts +4 -0
- package/dist/types/modules/product/components/product-retailers-popup-list.component.d.ts +10 -2
- package/dist/types/modules/product/product.commands.d.ts +7 -7
- package/dist/types/modules/product/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/product-list/components/card-components/index.d.ts +5 -0
- package/dist/types/modules/product-list/components/card-components/product-badge.d.ts +9 -0
- package/dist/types/modules/product-list/components/card-components/product-button.d.ts +11 -0
- package/dist/types/modules/product-list/components/card-components/product-price-and-personalization.d.ts +14 -0
- package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts +11 -0
- package/dist/types/modules/product-list/components/card-components/product-sizes-list.d.ts +14 -0
- package/dist/types/modules/product-list/components/filter-components/index.d.ts +7 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-apply-filter-button.d.ts +1 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-checkbox-filter.d.ts +7 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-chip.d.ts +5 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-filters-chips.d.ts +13 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-fulfillment-filter.d.ts +15 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-price-filter.d.ts +22 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-toggle-filters.d.ts +7 -0
- package/dist/types/modules/product-list/components/index.d.ts +6 -0
- package/dist/types/modules/product-list/components/product-list-card-loading.component.d.ts +3 -1
- package/dist/types/modules/product-list/components/product-list-card.component.d.ts +36 -30
- package/dist/types/modules/product-list/components/product-list-engraving.component.d.ts +12 -0
- package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +56 -14
- package/dist/types/modules/product-list/components/product-list-product-engraving-lines.component.d.ts +22 -0
- package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts +53 -0
- package/dist/types/modules/product-list/components/product-list-search.component.d.ts +25 -0
- package/dist/types/modules/product-list/product-list-filter.utils.d.ts +8 -0
- package/dist/types/modules/product-list/product-list-query-params.utils.d.ts +3 -0
- package/dist/types/modules/product-list/product-list.commands.d.ts +23 -7
- package/dist/types/modules/product-list/product-list.component.d.ts +17 -39
- package/dist/types/modules/product-list/product-list.constants.d.ts +38 -0
- package/dist/types/modules/product-list/product-list.interface.d.ts +65 -0
- package/dist/types/modules/product-list/styles/product-list-card.style.d.ts +1 -0
- package/dist/types/modules/product-list/styles/product-list-filters.style.d.ts +1 -0
- package/dist/types/modules/product-list/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/theme-provider/constants/component-groupings.d.ts +1 -0
- package/dist/types/modules/theme-provider/constants/css-variable-mappings.d.ts +1 -1
- package/dist/types/modules/theme-provider/services/style-registry.service.d.ts +16 -0
- package/dist/types/modules/theme-provider/services/stylesheet-generator.service.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/theme-provider/theme-provider.service.d.ts +2 -2
- package/dist/types/modules/ui-components/alert/alert.component.d.ts +1 -1
- package/dist/types/modules/ui-components/buttons/buttons-open-cart.component.d.ts +5 -0
- package/dist/types/modules/ui-components/drawer/drawer.component.d.ts +15 -0
- package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +8 -1
- package/dist/types/modules/ui-components/engraving/engraving-view.component.d.ts +7 -1
- package/dist/types/modules/ui-components/input/index.d.ts +0 -1
- package/dist/types/modules/ui-components/input/input.component.d.ts +14 -1
- package/dist/types/modules/ui-components/lce-element/lce-element.component.d.ts +2 -1
- package/dist/types/modules/ui-components/promo-code-ticker/promo-code-ticker.component.d.ts +1 -1
- package/dist/types/modules/ui-components/purchase-min-alert/index.d.ts +0 -1
- package/dist/types/modules/ui-components/ui.commands.d.ts +7 -1
- package/dist/types/ssr/stub.checkout.d.ts +6 -0
- package/dist/types/ssr/stub.d.ts +10 -0
- 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 +2 -0
- 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 +2 -0
- 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 +2 -0
- 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 +3 -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/dom-compat.d.ts +2 -0
- package/dist/types/utils/format.d.ts +4 -14
- package/dist/types/utils/image-bg-removal.d.ts +3 -0
- package/dist/types/utils/product-selection.d.ts +16 -0
- package/dist/types/utils/product.d.ts +15 -0
- package/docs/v1/README.md +213 -0
- package/docs/v1/api/actions/address-actions.md +286 -0
- package/docs/v1/api/actions/cart-actions.md +364 -0
- package/docs/v1/api/actions/checkout-actions.md +527 -0
- package/docs/v1/api/actions/product-actions.md +204 -0
- package/docs/v1/api/client.md +596 -0
- package/docs/v1/api/configuration.md +555 -0
- package/docs/v1/api/injection-methods.md +292 -0
- package/docs/v1/api/typescript-types.md +423 -0
- package/docs/v1/api/ui-helpers.md +200 -0
- package/docs/v1/examples/advanced-patterns.md +199 -0
- package/docs/v1/examples/checkout-flow.md +90 -0
- package/docs/v1/examples/custom-theming.md +63 -0
- package/docs/v1/examples/multi-product-page.md +90 -0
- package/docs/v1/examples/simple-product-page.md +89 -0
- package/docs/v1/getting-started/concepts.md +521 -0
- package/docs/v1/getting-started/installation.md +349 -0
- package/docs/v1/getting-started/quick-start.md +410 -0
- package/docs/v1/guides/accessibility.md +173 -0
- package/docs/v1/guides/address-component.md +435 -0
- package/docs/v1/guides/best-practices.md +365 -0
- package/docs/v1/guides/cart-component.md +757 -0
- package/docs/v1/guides/checkout-component.md +670 -0
- package/docs/v1/guides/events.md +939 -0
- package/docs/v1/guides/product-component.md +735 -0
- package/docs/v1/guides/product-list-component.md +630 -0
- package/docs/v1/guides/theming.md +228 -0
- package/docs/v1/integration/angular.md +39 -0
- package/docs/v1/integration/laravel.md +41 -0
- package/docs/v1/integration/nextjs.md +69 -0
- package/docs/v1/integration/proxy-setup.md +106 -0
- package/docs/v1/integration/react.md +64 -0
- package/docs/v1/integration/vanilla-js.md +84 -0
- package/docs/v1/integration/vue.md +58 -0
- package/docs/v1/reference/analytics.md +108 -0
- package/docs/v1/reference/browser-support.md +47 -0
- package/docs/v1/reference/error-handling.md +83 -0
- package/docs/v1/reference/performance.md +52 -0
- package/docs/v1/reference/telemetry.md +85 -0
- package/docs/v1/reference/troubleshooting.md +135 -0
- package/package.json +69 -45
- package/dist/types/elements-builder-client.d.ts +0 -2
- package/dist/types/elements-client.d.ts +0 -2
- package/dist/types/enums/cloud.enum.d.ts +0 -77
- package/dist/types/interfaces/cloud/address.interface.d.ts +0 -36
- package/dist/types/interfaces/cloud/cart.interface.d.ts +0 -132
- package/dist/types/interfaces/cloud/catalog.interface.d.ts +0 -43
- package/dist/types/interfaces/cloud/checkout.interface.d.ts +0 -214
- package/dist/types/interfaces/cloud/core.interface.d.ts +0 -22
- package/dist/types/interfaces/cloud/product.interface.d.ts +0 -158
- package/dist/types/interfaces/cloud/retailer.interface.d.ts +0 -67
- package/dist/types/interfaces/cloud/user.interface.d.ts +0 -100
- package/dist/types/interfaces/core.interface.d.ts +0 -111
- package/dist/types/modules/cart/cart.commands.helper.d.ts +0 -9
- package/dist/types/modules/checkout/components/checkout.type.d.ts +0 -4
- package/dist/types/modules/product/utils/helpers.d.ts +0 -3
- package/dist/types/modules/product/utils/retailer-hours.d.ts +0 -9
- package/dist/types/modules/theme-provider/styles/address/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/cart/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/checkout/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/product/index.d.ts +0 -3
- package/dist/types/modules/theme-provider/styles/product-list/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/ui/index.d.ts +0 -3
- package/dist/types/modules/ui-components/input/birthdate-input.component.d.ts +0 -53
- package/dist/types/modules/ui-components/purchase-min-alert/helpers.d.ts +0 -7
- package/dist/types/utils/helper.d.ts +0 -27
- package/docs/ACTIONS.md +0 -1300
- package/docs/BROWSER_SUPPORT.md +0 -279
- package/docs/CONFIGURATION.md +0 -853
- package/docs/DOCUMENTATION_INDEX.md +0 -311
- package/docs/EVENTS.md +0 -798
- package/docs/PROXY.md +0 -228
- package/docs/THEMING.md +0 -589
- package/docs/TROUBLESHOOTING.md +0 -793
- package/umd/elements.js +0 -1
- /package/dist/types/{auto-initialize.d.ts → auto-initialize/main.d.ts} +0 -0
- /package/dist/types/modules/{theme-provider/styles/address → address/styles}/address.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/cart → cart/styles}/cart.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/checkout → checkout/styles}/checkout.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product → product/styles}/image-carousel.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product → product/styles}/product.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product → product/styles}/retailers.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product-list → product-list/styles}/product-list.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/drawer.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/loading.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/promo-code-ticker.style.d.ts +0 -0
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
# Injection Methods API
|
|
2
|
+
|
|
3
|
+
Methods for injecting SDK components into your page.
|
|
4
|
+
|
|
5
|
+
## injectProductElement()
|
|
6
|
+
|
|
7
|
+
Inject one or more product displays.
|
|
8
|
+
|
|
9
|
+
### Signature
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
injectProductElement(params: IInjectProductElement[]): Promise<IInjectedComponent[]>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Parameters
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
interface IInjectProductElement {
|
|
19
|
+
containerId: string; // ID of container element
|
|
20
|
+
identifier: string; // Product Identifier
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Example
|
|
25
|
+
|
|
26
|
+
```javascript
|
|
27
|
+
await client.injectProductElement([
|
|
28
|
+
{ containerId: 'product-1', identifier: '00619947000020' },
|
|
29
|
+
{ containerId: 'product-2', identifier: '08504405135' }
|
|
30
|
+
]);
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Returns
|
|
34
|
+
|
|
35
|
+
Array of injected component objects.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## injectAddressElement()
|
|
40
|
+
|
|
41
|
+
Inject standalone address component.
|
|
42
|
+
|
|
43
|
+
### Signature
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
injectAddressElement(
|
|
47
|
+
containerId: string,
|
|
48
|
+
options?: IAddressOptions
|
|
49
|
+
): Promise<IInjectedComponent | null>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Example
|
|
53
|
+
|
|
54
|
+
```javascript
|
|
55
|
+
await client.injectAddressElement('address-container', {
|
|
56
|
+
showLabel: true
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// Listen for address changes via the published event (dispatched on window)
|
|
60
|
+
window.addEventListener('lce:actions.address_updated', (event) => {
|
|
61
|
+
console.log('Address set:', event.detail.data);
|
|
62
|
+
});
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## injectCartElement()
|
|
68
|
+
|
|
69
|
+
Inject standalone cart (rarely needed - cart drawer is automatic).
|
|
70
|
+
|
|
71
|
+
### Signature
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
injectCartElement(containerId: string): Promise<IInjectedComponent | null>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Example
|
|
78
|
+
|
|
79
|
+
```javascript
|
|
80
|
+
await client.injectCartElement('cart-container');
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## injectCheckoutElement()
|
|
86
|
+
|
|
87
|
+
Inject hosted checkout page.
|
|
88
|
+
|
|
89
|
+
### Signature
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
injectCheckoutElement(params: IInjectCheckoutParams): Promise<IInjectedComponent | null>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Parameters
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
interface IInjectCheckoutParams {
|
|
99
|
+
containerId: string;
|
|
100
|
+
checkoutId?: string; // Optional checkout token to load
|
|
101
|
+
hideHeader?: boolean; // Hide checkout header
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Example
|
|
106
|
+
|
|
107
|
+
```javascript
|
|
108
|
+
await client.injectCheckoutElement({
|
|
109
|
+
containerId: 'checkout',
|
|
110
|
+
checkoutId: 'cart_abc123',
|
|
111
|
+
hideHeader: false
|
|
112
|
+
});
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## injectProductList()
|
|
118
|
+
|
|
119
|
+
Inject product catalog/listing.
|
|
120
|
+
|
|
121
|
+
### Signature
|
|
122
|
+
|
|
123
|
+
```typescript
|
|
124
|
+
injectProductList(params: IInjectProductListParams): Promise<void>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Parameters
|
|
128
|
+
|
|
129
|
+
```typescript
|
|
130
|
+
interface IInjectProductListParams {
|
|
131
|
+
containerId: string;
|
|
132
|
+
slug: string; // Product list slug identifier
|
|
133
|
+
rows?: number; // Default: 4
|
|
134
|
+
columns?: number; // Default: 4
|
|
135
|
+
filters?: ProductListFilterType[];
|
|
136
|
+
productUrl?: PLCProductUrl; // string template OR Record<identifier, url> map
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// String template: replace {upc} or {grouping} per product.
|
|
140
|
+
// Map: keys are product identifiers (UPC or salsifyGrouping ID); UPC checked first.
|
|
141
|
+
type PLCProductUrl = string | Record<string, string>;
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Example — string template
|
|
145
|
+
|
|
146
|
+
```javascript
|
|
147
|
+
await client.injectProductList({
|
|
148
|
+
containerId: 'products',
|
|
149
|
+
slug: 'best-sellers',
|
|
150
|
+
rows: 4,
|
|
151
|
+
columns: 3,
|
|
152
|
+
filters: ['price', 'brands', 'categories'],
|
|
153
|
+
productUrl: '/product/{grouping}'
|
|
154
|
+
});
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
> The `filters` array also acts as the whitelist for **URL query param filtering** —
|
|
158
|
+
> the product list reads `?brands=...&price=...` etc. from `window.location.search`
|
|
159
|
+
> on first mount and applies them. See
|
|
160
|
+
> [URL Query Param Filters](../guides/product-list-component.md#url-query-param-filters).
|
|
161
|
+
|
|
162
|
+
### Example — URL map (partner-owned dedicated PDPs)
|
|
163
|
+
|
|
164
|
+
Use this form when each product has a hand-curated URL that can't be derived
|
|
165
|
+
from a single `{upc}` or `{grouping}` token. See the
|
|
166
|
+
[Product List guide](../guides/product-list-component.md#product-url-map) for
|
|
167
|
+
the equivalent declarative `<script type="application/json">` pattern.
|
|
168
|
+
|
|
169
|
+
```javascript
|
|
170
|
+
await client.injectProductList({
|
|
171
|
+
containerId: 'products',
|
|
172
|
+
slug: 'best-sellers',
|
|
173
|
+
productUrl: {
|
|
174
|
+
'GROUPING-33277': '/wines/macallan-12-special-edition',
|
|
175
|
+
'00832889005513': '/spirits/cabernet-2018-club-only',
|
|
176
|
+
},
|
|
177
|
+
});
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## injectProductListSearch()
|
|
183
|
+
|
|
184
|
+
Inject product search box.
|
|
185
|
+
|
|
186
|
+
### Signature
|
|
187
|
+
|
|
188
|
+
```typescript
|
|
189
|
+
injectProductListSearch(params: IInjectProductListSearchParams): Promise<void>
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Parameters
|
|
193
|
+
|
|
194
|
+
```typescript
|
|
195
|
+
interface IInjectProductListSearchParams {
|
|
196
|
+
containerId: string;
|
|
197
|
+
slug: string; // Product list slug identifier
|
|
198
|
+
filters?: ProductListFilterType[];
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Example
|
|
203
|
+
|
|
204
|
+
```javascript
|
|
205
|
+
await client.injectProductListSearch({
|
|
206
|
+
containerId: 'search-box',
|
|
207
|
+
slug: 'best-sellers'
|
|
208
|
+
});
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## injectProductListFilters()
|
|
214
|
+
|
|
215
|
+
Inject product filter panel.
|
|
216
|
+
|
|
217
|
+
### Signature
|
|
218
|
+
|
|
219
|
+
```typescript
|
|
220
|
+
injectProductListFilters(params: IInjectProductListFiltersParams): Promise<void>
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Parameters
|
|
224
|
+
|
|
225
|
+
```typescript
|
|
226
|
+
interface IInjectProductListFiltersParams {
|
|
227
|
+
containerId: string;
|
|
228
|
+
slug: string; // Product list slug identifier
|
|
229
|
+
filters?: ProductListFilterType[];
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Example
|
|
234
|
+
|
|
235
|
+
```javascript
|
|
236
|
+
await client.injectProductListFilters({
|
|
237
|
+
containerId: 'filters',
|
|
238
|
+
slug: 'best-sellers',
|
|
239
|
+
filters: ['price', 'brands', 'fulfillment']
|
|
240
|
+
});
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## Component Management
|
|
246
|
+
|
|
247
|
+
### getInjectedComponents()
|
|
248
|
+
|
|
249
|
+
Retrieve all injected components.
|
|
250
|
+
|
|
251
|
+
```typescript
|
|
252
|
+
getInjectedComponents(): Map<string, IInjectedComponent>
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
```javascript
|
|
256
|
+
const components = client.getInjectedComponents();
|
|
257
|
+
|
|
258
|
+
// Get specific component
|
|
259
|
+
const product = components.get('product-1');
|
|
260
|
+
|
|
261
|
+
// Rerender component
|
|
262
|
+
product.rerender();
|
|
263
|
+
|
|
264
|
+
// Get container element
|
|
265
|
+
const container = product.getElement();
|
|
266
|
+
|
|
267
|
+
// Get component type
|
|
268
|
+
const type = product.getType(); // 'product'
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### IInjectedComponent Interface
|
|
272
|
+
|
|
273
|
+
```typescript
|
|
274
|
+
interface IInjectedComponent {
|
|
275
|
+
getType(): ComponentType;
|
|
276
|
+
getElement(): HTMLElement;
|
|
277
|
+
rerender(): void;
|
|
278
|
+
destroy(): void;
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
| Method | Returns | Description |
|
|
283
|
+
|--------|---------|-------------|
|
|
284
|
+
| `getType()` | `ComponentType` | Returns the type of the injected component |
|
|
285
|
+
| `getElement()` | `HTMLElement` | Returns the container element where the component is injected |
|
|
286
|
+
| `rerender()` | `void` | Re-renders the component with the latest data and configurations |
|
|
287
|
+
| `destroy()` | `void` | Removes the component from the DOM and cleans up internal tracking |
|
|
288
|
+
|
|
289
|
+
## See Also
|
|
290
|
+
|
|
291
|
+
- [Client API](./client.md)
|
|
292
|
+
- [Component Guides](../guides/)
|
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
# TypeScript Types Reference
|
|
2
|
+
|
|
3
|
+
All public types are exported from the main package entry point. Import them using the `type` keyword for optimal tree-shaking.
|
|
4
|
+
|
|
5
|
+
## Importing Types
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { Elements } from '@liquidcommerce/elements-sdk';
|
|
9
|
+
import type {
|
|
10
|
+
ILiquidCommerceElementsClient,
|
|
11
|
+
ILiquidCommerceElementsConfig,
|
|
12
|
+
IInjectProductElement,
|
|
13
|
+
IInjectedComponent
|
|
14
|
+
} from '@liquidcommerce/elements-sdk';
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
For the checkout-only build:
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import { ElementsCheckout } from '@liquidcommerce/elements-sdk/checkout';
|
|
21
|
+
import type {
|
|
22
|
+
IElementsCheckoutClient,
|
|
23
|
+
IElementsCheckoutActions,
|
|
24
|
+
ILiquidCommerceElementsCheckoutClientConfig,
|
|
25
|
+
IInjectedComponent
|
|
26
|
+
} from '@liquidcommerce/elements-sdk/checkout';
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Client Types
|
|
32
|
+
|
|
33
|
+
### ILiquidCommerceElementsClient
|
|
34
|
+
|
|
35
|
+
Main SDK client interface returned by `Elements()`.
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
interface ILiquidCommerceElementsClient {
|
|
39
|
+
injectProductElement(params: IInjectProductElement[]): Promise<IInjectedComponent[]>;
|
|
40
|
+
injectAddressElement(containerId: string, options?: IAddressOptions): Promise<IInjectedComponent | null>;
|
|
41
|
+
injectCartElement(containerId: string): Promise<IInjectedComponent | null>;
|
|
42
|
+
injectCheckoutElement(params: IInjectCheckoutParams): Promise<IInjectedComponent | null>;
|
|
43
|
+
injectProductList(params: IInjectProductListParams): Promise<void>;
|
|
44
|
+
injectProductListSearch(params: IInjectProductListSearchParams): Promise<void>;
|
|
45
|
+
injectProductListFilters(params: IInjectProductListFiltersParams): Promise<void>;
|
|
46
|
+
ui: ILiquidCommerceElementsUIMethod;
|
|
47
|
+
actions: ILiquidCommerceElementsActions;
|
|
48
|
+
getInjectedComponents(): Map<string, IInjectedComponent>;
|
|
49
|
+
destroy(): void;
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### ILiquidCommerceElementsBuilderClient
|
|
54
|
+
|
|
55
|
+
Builder-pattern client interface returned by `ElementsBuilder()`.
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
interface ILiquidCommerceElementsBuilderClient {
|
|
59
|
+
updateComponentGlobalConfigs(configs: UpdateComponentGlobalConfigs): Promise<void>;
|
|
60
|
+
updateProductComponent(configs: UpdateProductComponent): Promise<void>;
|
|
61
|
+
updateAddressComponent(configs: UpdateAddressComponent): void;
|
|
62
|
+
updateCartComponent(configs: UpdateCartComponent): void;
|
|
63
|
+
updateCheckoutComponent(configs: UpdateCheckoutComponent): void;
|
|
64
|
+
updateProductListComponent(configs: UpdateProductListComponent): void;
|
|
65
|
+
injectElement(params: IBuilderInjectElementParams): Promise<IInjectedComponent | null>;
|
|
66
|
+
injectProductElement(params: IInjectProductElement[]): Promise<IInjectedComponent[]>;
|
|
67
|
+
injectAddressElement(containerId: string, options?: IAddressOptions): Promise<IInjectedComponent | null>;
|
|
68
|
+
injectCartElement(containerId: string): Promise<IInjectedComponent | null>;
|
|
69
|
+
injectCheckoutElement(params: IInjectCheckoutBuilderParams): Promise<IInjectedComponent | null>;
|
|
70
|
+
injectProductList(params: IInjectProductListParams): Promise<void>;
|
|
71
|
+
actions: ILiquidCommerceElementsActions;
|
|
72
|
+
destroy(): void;
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### IElementsCheckoutClient
|
|
77
|
+
|
|
78
|
+
Checkout-only client interface returned by `ElementsCheckout()`.
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
interface IElementsCheckoutClient {
|
|
82
|
+
injectCheckout(params: IInjectCheckoutParams): Promise<IInjectedComponent | null>;
|
|
83
|
+
actions: { checkout: IElementsCheckoutActions };
|
|
84
|
+
destroy(): void;
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Configuration Types
|
|
91
|
+
|
|
92
|
+
### ILiquidCommerceElementsConfig
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
interface ILiquidCommerceElementsConfig {
|
|
96
|
+
env?: ElementsEnv;
|
|
97
|
+
promoTicker?: IPromoTicker[];
|
|
98
|
+
customTheme?: IClientCustomThemeConfig;
|
|
99
|
+
debugMode?: DebugMode;
|
|
100
|
+
checkout?: ILiquidCommerceElementsCheckoutConfig;
|
|
101
|
+
proxy?: IElementsProxyConfig;
|
|
102
|
+
development?: ILiquidCommerceElementsDevelopmentConfig;
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### ILiquidCommerceElementsBuilderConfig
|
|
107
|
+
|
|
108
|
+
Same shape as `ILiquidCommerceElementsConfig`, used by `ElementsBuilder()`.
|
|
109
|
+
|
|
110
|
+
### ILiquidCommerceElementsCheckoutClientConfig
|
|
111
|
+
|
|
112
|
+
Same shape as `ILiquidCommerceElementsConfig`, used for the checkout-only client.
|
|
113
|
+
|
|
114
|
+
### IClientCustomThemeConfig
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
interface IClientCustomThemeConfig {
|
|
118
|
+
global?: UpdateComponentGlobalConfigs;
|
|
119
|
+
product?: UpdateProductComponent;
|
|
120
|
+
address?: UpdateAddressComponent;
|
|
121
|
+
cart?: UpdateCartComponent;
|
|
122
|
+
checkout?: UpdateCheckoutComponent;
|
|
123
|
+
productList?: UpdateProductListComponent;
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### IElementsProxyConfig
|
|
128
|
+
|
|
129
|
+
```typescript
|
|
130
|
+
interface IElementsProxyConfig {
|
|
131
|
+
baseUrl: string;
|
|
132
|
+
headers?: Record<string, string>;
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### ILiquidCommerceElementsDevelopmentConfig
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
interface ILiquidCommerceElementsDevelopmentConfig {
|
|
140
|
+
customApiUrl?: string;
|
|
141
|
+
openShadowDom?: boolean;
|
|
142
|
+
mockMode?: boolean; // when true, sends an 'X-Liquid-Api-Mock-Mode' header to receive mock data
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### ILiquidCommerceElementsCheckoutConfig
|
|
147
|
+
|
|
148
|
+
```typescript
|
|
149
|
+
interface ILiquidCommerceElementsCheckoutConfig {
|
|
150
|
+
pageUrl?: string;
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
See [Configuration Reference](./configuration.md) for detailed property descriptions.
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Injection Types
|
|
159
|
+
|
|
160
|
+
### IInjectProductElement
|
|
161
|
+
|
|
162
|
+
```typescript
|
|
163
|
+
interface IInjectProductElement {
|
|
164
|
+
containerId: string;
|
|
165
|
+
identifier: string;
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### IInjectCheckoutParams
|
|
170
|
+
|
|
171
|
+
```typescript
|
|
172
|
+
interface IInjectCheckoutParams {
|
|
173
|
+
containerId: string;
|
|
174
|
+
checkoutId?: string;
|
|
175
|
+
hideHeader?: boolean;
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### IInjectCheckoutBuilderParams
|
|
180
|
+
|
|
181
|
+
`simulatePresale` and `presaleExpiresInMinutes` are builder-only preview controls (presale lock defaults to 15 minutes) and only take effect via `ElementsBuilder().injectCheckoutElement()`.
|
|
182
|
+
|
|
183
|
+
```typescript
|
|
184
|
+
interface IInjectCheckoutBuilderParams extends IInjectCheckoutParams {
|
|
185
|
+
simulatePresale?: boolean;
|
|
186
|
+
presaleExpiresInMinutes?: number;
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### IInjectProductListParams
|
|
191
|
+
|
|
192
|
+
```typescript
|
|
193
|
+
interface IInjectProductListParams {
|
|
194
|
+
containerId: string;
|
|
195
|
+
slug: string;
|
|
196
|
+
rows?: number;
|
|
197
|
+
columns?: number;
|
|
198
|
+
filters?: ProductListFilterType[];
|
|
199
|
+
productUrl?: PLCProductUrl;
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### PLCProductUrl
|
|
204
|
+
|
|
205
|
+
```typescript
|
|
206
|
+
/**
|
|
207
|
+
* Product card link configuration.
|
|
208
|
+
*
|
|
209
|
+
* - String: template with `{upc}` (selected size's UPC) or `{grouping}`
|
|
210
|
+
* (product's salsifyGrouping ID). Replaced per product card.
|
|
211
|
+
* - Map: keyed by product identifier (UPC or salsifyGrouping ID — same
|
|
212
|
+
* identifier types accepted by `injectProductElement`). The card looks up
|
|
213
|
+
* UPC first, then grouping ID. Use this when partner PDPs have
|
|
214
|
+
* hand-curated URLs that aren't derivable from a single token.
|
|
215
|
+
*/
|
|
216
|
+
type PLCProductUrl = string | Record<string, string>;
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### IInjectProductListSearchParams
|
|
220
|
+
|
|
221
|
+
```typescript
|
|
222
|
+
interface IInjectProductListSearchParams {
|
|
223
|
+
containerId: string;
|
|
224
|
+
slug: string;
|
|
225
|
+
filters?: ProductListFilterType[];
|
|
226
|
+
}
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### IInjectProductListFiltersParams
|
|
230
|
+
|
|
231
|
+
```typescript
|
|
232
|
+
interface IInjectProductListFiltersParams {
|
|
233
|
+
containerId: string;
|
|
234
|
+
slug: string;
|
|
235
|
+
filters?: ProductListFilterType[];
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### IBuilderInjectElementParams
|
|
240
|
+
|
|
241
|
+
```typescript
|
|
242
|
+
interface IBuilderInjectElementParams {
|
|
243
|
+
type: ComponentType;
|
|
244
|
+
containerId: string;
|
|
245
|
+
[key: string]: any;
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## Component Types
|
|
252
|
+
|
|
253
|
+
### IInjectedComponent
|
|
254
|
+
|
|
255
|
+
Returned by all injection methods. Provides control over the injected component.
|
|
256
|
+
|
|
257
|
+
```typescript
|
|
258
|
+
interface IInjectedComponent {
|
|
259
|
+
getType(): ComponentType;
|
|
260
|
+
getElement(): HTMLElement;
|
|
261
|
+
rerender(): void;
|
|
262
|
+
destroy(): void;
|
|
263
|
+
}
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## UI Types
|
|
269
|
+
|
|
270
|
+
### ILiquidCommerceElementsUIMethod
|
|
271
|
+
|
|
272
|
+
```typescript
|
|
273
|
+
interface ILiquidCommerceElementsUIMethod {
|
|
274
|
+
cartButton(containerId: string, showItemsCount?: boolean): void;
|
|
275
|
+
floatingCartButton(showItemsCount?: boolean): void;
|
|
276
|
+
cartSubtotal(elementId: string): void;
|
|
277
|
+
cartItemsCount(elementId: string, options?: { hideZero: boolean }): void;
|
|
278
|
+
}
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
## Action Types
|
|
284
|
+
|
|
285
|
+
### ILiquidCommerceElementsActions
|
|
286
|
+
|
|
287
|
+
```typescript
|
|
288
|
+
interface ILiquidCommerceElementsActions {
|
|
289
|
+
product: IProductActions;
|
|
290
|
+
address: IAddressActions;
|
|
291
|
+
cart: ICartActions;
|
|
292
|
+
checkout: ICheckoutActions;
|
|
293
|
+
}
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### IElementsCheckoutActions
|
|
297
|
+
|
|
298
|
+
Checkout actions available in the checkout-only client. This is `ICheckoutActions` with `openCheckout`, `closeCheckout`, and `toggleCheckout` omitted -- the checkout-only client renders checkout independently and has no drawer navigation to open, close, or toggle.
|
|
299
|
+
|
|
300
|
+
```typescript
|
|
301
|
+
interface IElementsCheckoutActions extends Omit<ICheckoutActions, 'openCheckout' | 'closeCheckout' | 'toggleCheckout'> {}
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
See [Actions API](./actions/) for detailed method signatures.
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
## Enum Types
|
|
309
|
+
|
|
310
|
+
### ElementsEnv
|
|
311
|
+
|
|
312
|
+
```typescript
|
|
313
|
+
type ElementsEnv = 'development' | 'staging' | 'production';
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### DebugMode
|
|
317
|
+
|
|
318
|
+
```typescript
|
|
319
|
+
type DebugMode = 'none' | 'console' | 'panel';
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
### FulfillmentType
|
|
323
|
+
|
|
324
|
+
```typescript
|
|
325
|
+
type FulfillmentType = 'onDemand' | 'shipping';
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### ComponentType
|
|
329
|
+
|
|
330
|
+
```typescript
|
|
331
|
+
type ComponentType =
|
|
332
|
+
| 'address' | 'product' | 'cart' | 'checkout'
|
|
333
|
+
| 'product-list' | 'product-list-card' | 'product-list-filters' | 'product-list-search'
|
|
334
|
+
| 'drawer' | 'input' | 'engraving-form' | 'engraving-view'
|
|
335
|
+
| 'buttons-cart-open' | 'powered-by' | 'lce-element'
|
|
336
|
+
| 'purchase-min-alert' | 'alert' | 'promo-code-ticker'
|
|
337
|
+
// ...and additional internal component types
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### DisplayModeType
|
|
341
|
+
|
|
342
|
+
```typescript
|
|
343
|
+
type DisplayModeType = 'modal' | 'drawer';
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
## Theme Configuration Types
|
|
349
|
+
|
|
350
|
+
### UpdateComponentGlobalConfigs
|
|
351
|
+
|
|
352
|
+
`DeepPartial<IComponentGlobalConfigs>` -- all properties optional.
|
|
353
|
+
|
|
354
|
+
### UpdateProductComponent
|
|
355
|
+
|
|
356
|
+
`DeepPartial<IProductComponent>` -- all properties optional.
|
|
357
|
+
|
|
358
|
+
### UpdateCartComponent
|
|
359
|
+
|
|
360
|
+
`DeepPartial<ICartComponent>` -- all properties optional.
|
|
361
|
+
|
|
362
|
+
### UpdateCheckoutComponent
|
|
363
|
+
|
|
364
|
+
`DeepPartial<ICheckoutComponent>` -- all properties optional.
|
|
365
|
+
|
|
366
|
+
### UpdateAddressComponent
|
|
367
|
+
|
|
368
|
+
`DeepPartial<IAddressComponent>` -- all properties optional.
|
|
369
|
+
|
|
370
|
+
### UpdateProductListComponent
|
|
371
|
+
|
|
372
|
+
Special structure for updating product list configuration by slug:
|
|
373
|
+
|
|
374
|
+
```typescript
|
|
375
|
+
interface UpdateProductListComponent {
|
|
376
|
+
theme?: { backgroundColor?: string };
|
|
377
|
+
layout?: {
|
|
378
|
+
lists?: Record<string, DeepPartial<IPLCList>>;
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
These `Update*Component` types are the arguments to the `ElementsBuilder()` client's `update*Component` methods; see [Client API](./client.md) for their behavior and usage.
|
|
384
|
+
|
|
385
|
+
See [Configuration Reference](./configuration.md) for detailed theme property descriptions.
|
|
386
|
+
|
|
387
|
+
---
|
|
388
|
+
|
|
389
|
+
## Promo Ticker Type
|
|
390
|
+
|
|
391
|
+
### IPromoTicker
|
|
392
|
+
|
|
393
|
+
```typescript
|
|
394
|
+
interface IPromoTicker {
|
|
395
|
+
promoCode: string;
|
|
396
|
+
text: string[];
|
|
397
|
+
separator: string;
|
|
398
|
+
activeFrom: string; // ISO 8601 UTC
|
|
399
|
+
activeUntil: string; // ISO 8601 UTC
|
|
400
|
+
}
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
---
|
|
404
|
+
|
|
405
|
+
## Utility Types
|
|
406
|
+
|
|
407
|
+
### DeepPartial
|
|
408
|
+
|
|
409
|
+
Used internally for theme update types. Makes all properties in `T` recursively optional.
|
|
410
|
+
|
|
411
|
+
```typescript
|
|
412
|
+
type DeepPartial<T> = {
|
|
413
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
414
|
+
};
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
---
|
|
418
|
+
|
|
419
|
+
## See Also
|
|
420
|
+
|
|
421
|
+
- [Client API](./client.md) - Client initialization and usage
|
|
422
|
+
- [Configuration Reference](./configuration.md) - Detailed config options
|
|
423
|
+
- [Injection Methods](./injection-methods.md) - Component injection API
|