@liquidcommerce/elements-sdk 2.6.0-beta.9 → 2.6.0-beta.91
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 +84 -2520
- package/dist/index.checkout.esm.js +16946 -0
- package/dist/index.esm.js +24448 -21193
- 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 +2 -6
- package/dist/types/core/api/api-client.service.d.ts +20 -18
- package/dist/types/core/api/api-result.d.ts +19 -0
- package/dist/types/core/api/auth-client.service.d.ts +37 -13
- package/dist/types/core/api/http-client.service.d.ts +0 -8
- package/dist/types/core/base-component.service.d.ts +2 -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 -74
- package/dist/types/core/client/client-config.service.d.ts +8 -5
- package/dist/types/core/google-tag-manager.service.d.ts +2 -1
- package/dist/types/core/logger/logger.service.d.ts +1 -1
- package/dist/types/core/pubsub/interfaces/address.interface.d.ts +3 -0
- package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +1 -1
- package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +36 -51
- package/dist/types/core/pubsub/interfaces/core.interface.d.ts +11 -6
- 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/cart.interface.d.ts +2 -3
- package/dist/types/core/store/interfaces/checkout.interface.d.ts +18 -108
- package/dist/types/core/store/interfaces/core.interface.d.ts +12 -2
- 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 +1 -0
- package/dist/types/core/store/store.constant.d.ts +5 -0
- package/dist/types/core/store/store.service.d.ts +1 -0
- package/dist/types/core/telemetry/telemetry.service.d.ts +1 -0
- package/dist/types/enums/core.enum.d.ts +39 -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/cart.interface.d.ts +12 -7
- package/dist/types/interfaces/api/checkout.interface.d.ts +239 -0
- package/dist/types/interfaces/api/index.d.ts +5 -0
- package/dist/types/interfaces/api/product-list.interface.d.ts +39 -0
- package/dist/types/interfaces/api/product.interface.d.ts +10 -4
- 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/global.interface.d.ts +5 -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 +3 -1
- package/dist/types/interfaces/injection.interface.d.ts +49 -0
- package/dist/types/modules/address/address.command.d.ts +2 -1
- package/dist/types/modules/address/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/cart/cart.commands.d.ts +4 -4
- package/dist/types/modules/cart/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/checkout/checkout.commands.d.ts +26 -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 +3 -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 +3 -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 +1 -1
- 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/product-add-to-cart-section.component.d.ts +1 -0
- package/dist/types/modules/product/components/product-description.component.d.ts +1 -0
- package/dist/types/modules/product/components/product-image-carousel.component.d.ts +3 -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 +3 -0
- package/dist/types/modules/product/components/product-retailers-popup-list.component.d.ts +5 -2
- package/dist/types/modules/product/product.commands.d.ts +3 -3
- 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 +13 -0
- package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts +10 -0
- package/dist/types/modules/product-list/components/card-components/product-sizes-list.d.ts +13 -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-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 +14 -0
- package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-price-filter.components.d.ts → filter-components/product-list-price-filter.d.ts} +1 -1
- 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 -2
- 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 -31
- 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 +55 -36
- 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 +50 -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 -8
- package/dist/types/modules/product-list/product-list.component.d.ts +14 -47
- package/dist/types/modules/product-list/product-list.constants.d.ts +38 -0
- package/dist/types/modules/product-list/product-list.interface.d.ts +20 -35
- 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/drawer/drawer.component.d.ts +1 -0
- package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +6 -1
- package/dist/types/modules/ui-components/engraving/engraving-view.component.d.ts +6 -1
- package/dist/types/modules/ui-components/input/index.d.ts +0 -1
- package/dist/types/modules/ui-components/input/input.component.d.ts +8 -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/ui.commands.d.ts +5 -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/check.icon.d.ts +2 -0
- package/dist/types/static/icon/index.d.ts +1 -0
- package/dist/types/utils/dom-compat.d.ts +2 -0
- package/dist/types/utils/format.d.ts +0 -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 +210 -0
- package/docs/v1/api/actions/address-actions.md +286 -0
- package/docs/v1/api/actions/cart-actions.md +357 -0
- package/docs/v1/api/actions/checkout-actions.md +525 -0
- package/docs/v1/api/actions/product-actions.md +204 -0
- package/docs/v1/api/client.md +517 -0
- package/docs/v1/api/configuration.md +532 -0
- package/docs/v1/api/injection-methods.md +292 -0
- package/docs/v1/api/typescript-types.md +419 -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 +502 -0
- package/docs/v1/getting-started/installation.md +328 -0
- package/docs/v1/getting-started/quick-start.md +405 -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 +725 -0
- package/docs/v1/guides/checkout-component.md +670 -0
- package/docs/v1/guides/events.md +926 -0
- package/docs/v1/guides/product-component.md +731 -0
- package/docs/v1/guides/product-list-component.md +631 -0
- package/docs/v1/guides/theming.md +213 -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/browser-support.md +45 -0
- package/docs/v1/reference/error-handling.md +75 -0
- package/docs/v1/reference/performance.md +52 -0
- package/docs/v1/reference/troubleshooting.md +136 -0
- package/package.json +33 -37
- 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 -106
- package/dist/types/interfaces/cloud/catalog.interface.d.ts +0 -42
- package/dist/types/interfaces/cloud/checkout.interface.d.ts +0 -218
- package/dist/types/interfaces/cloud/core.interface.d.ts +0 -22
- package/dist/types/interfaces/cloud/index.d.ts +0 -4
- 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/checkout/components/checkout.type.d.ts +0 -4
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/index.d.ts +0 -6
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-apply-filter-button.component.d.ts +0 -1
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-delivery-options-filter.components.d.ts +0 -16
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-search.component.d.ts +0 -16
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-toggle-filters.components.d.ts +0 -18
- 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/utils/helper.d.ts +0 -28
- 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 -592
- 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/product-list/components/{product-list-filters-subcomponents/product-list-checkbox-filter.components.d.ts → filter-components/product-list-checkbox-filter.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
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
+
import { type DisplayModeType } from '@/enums';
|
|
2
3
|
export interface IEngravingFormComponentParams {
|
|
3
4
|
identifier: string;
|
|
4
|
-
context: 'product' | 'cart';
|
|
5
|
+
context: 'product' | 'cart' | 'product-list';
|
|
6
|
+
slug?: string;
|
|
5
7
|
lines: string[];
|
|
6
8
|
maxLines: number;
|
|
7
9
|
maxCharsPerLine: number;
|
|
8
10
|
fee: number;
|
|
9
11
|
location?: string;
|
|
12
|
+
displayMode?: DisplayModeType;
|
|
10
13
|
}
|
|
11
14
|
export declare class EngravingFormComponent extends BaseComponent<IEngravingFormComponentParams, null> {
|
|
12
15
|
get hostClasses(): string[];
|
|
@@ -15,10 +18,12 @@ export declare class EngravingFormComponent extends BaseComponent<IEngravingForm
|
|
|
15
18
|
private addToCartButton;
|
|
16
19
|
private fulfillmentId;
|
|
17
20
|
private partNumber;
|
|
21
|
+
private isPresale;
|
|
18
22
|
beforeConnected(): void;
|
|
19
23
|
private calculateTotalPrice;
|
|
20
24
|
private productInformationSection;
|
|
21
25
|
private addToCartButtonText;
|
|
26
|
+
private getFulfillmentData;
|
|
22
27
|
private retailersSection;
|
|
23
28
|
private engravingLinesSection;
|
|
24
29
|
private actionButtonsSection;
|
|
@@ -2,12 +2,17 @@ import { BaseComponent } from '@/core/base-component.service';
|
|
|
2
2
|
import type { IProductComponent } from '@/interfaces/configs';
|
|
3
3
|
export interface IEngravingViewComponentParams {
|
|
4
4
|
identifier: string;
|
|
5
|
-
context: 'cart' | 'checkout';
|
|
5
|
+
context: 'cart' | 'checkout' | 'product-list';
|
|
6
|
+
slug?: string;
|
|
7
|
+
productListMaxLines?: number;
|
|
8
|
+
productListMaxCharsPerLine?: number;
|
|
9
|
+
productListLocation?: string;
|
|
6
10
|
}
|
|
7
11
|
export declare class EngravingViewComponent extends BaseComponent<IEngravingViewComponentParams, IProductComponent> {
|
|
8
12
|
get hostClasses(): string[];
|
|
9
13
|
private engravingQuantityFee;
|
|
10
14
|
private engravingLines;
|
|
15
|
+
private isEngravingRequired;
|
|
11
16
|
private handleEdit;
|
|
12
17
|
private handleRemove;
|
|
13
18
|
protected template(): HTMLElement | HTMLElement[] | string;
|
|
@@ -5,9 +5,13 @@ export interface IInputValidation {
|
|
|
5
5
|
max?: number;
|
|
6
6
|
pattern?: string;
|
|
7
7
|
customValidator?: (value: string) => string | null;
|
|
8
|
+
minYear?: number;
|
|
9
|
+
maxYear?: number;
|
|
10
|
+
minAge?: number;
|
|
11
|
+
maxAge?: number;
|
|
8
12
|
}
|
|
9
13
|
export interface IInputComponentParams {
|
|
10
|
-
inputType: 'text' | 'number' | 'email' | 'tel' | 'date';
|
|
14
|
+
inputType: 'text' | 'number' | 'email' | 'tel' | 'date' | 'birthdate';
|
|
11
15
|
value?: string | null;
|
|
12
16
|
placeholder?: string;
|
|
13
17
|
className?: string;
|
|
@@ -31,6 +35,9 @@ export declare class InputComponent extends BaseComponent<IInputComponentParams,
|
|
|
31
35
|
private validateEmail;
|
|
32
36
|
private validateTel;
|
|
33
37
|
private validateDate;
|
|
38
|
+
private parseDateString;
|
|
39
|
+
private calculateAge;
|
|
40
|
+
private validateDateConstraints;
|
|
34
41
|
private isFieldComplete;
|
|
35
42
|
private validateInput;
|
|
36
43
|
private scheduleValidation;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ComponentType } from '@/enums';
|
|
2
|
-
|
|
2
|
+
import { SafeHTMLElement } from '@/utils/dom-compat';
|
|
3
|
+
export declare class LceElementComponent extends SafeHTMLElement {
|
|
3
4
|
private _initialized;
|
|
4
5
|
protected _container: ShadowRoot | null;
|
|
5
6
|
private _wrappedComponentRerender;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
|
|
2
2
|
import type { IPromoTicker } from '@/interfaces/configs';
|
|
3
3
|
export interface IPromoCodeTickerParams {
|
|
4
|
-
context: 'cart'
|
|
4
|
+
context: 'cart';
|
|
5
5
|
tickers: IPromoTicker[];
|
|
6
6
|
}
|
|
7
7
|
export declare class PromoCodeTickerComponent extends BaseComponent<IPromoCodeTickerParams, null> {
|
|
@@ -2,6 +2,10 @@ import { BaseCommand } from '@/core/command/base-command.service';
|
|
|
2
2
|
import type { IDrawerContentConfig } from '@/core/store/interfaces/core.interface';
|
|
3
3
|
export declare class UICommands extends BaseCommand {
|
|
4
4
|
static getInstance(): UICommands;
|
|
5
|
-
openDrawer(
|
|
5
|
+
openDrawer({ mode, contentType, data, }: {
|
|
6
|
+
mode?: 'drawer' | 'modal';
|
|
7
|
+
contentType: IDrawerContentConfig['type'];
|
|
8
|
+
data?: Record<string, any>;
|
|
9
|
+
}): void;
|
|
6
10
|
closeDrawer(): void;
|
|
7
11
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { DebugMode, ElementsEnv } from '../enums/core.enum';
|
|
2
|
+
export { DEBUG_MODE, ELEMENTS_ENV } from '../enums/core.enum';
|
|
3
|
+
export type { IElementsCheckoutActions, IElementsCheckoutClient, } from '../interfaces/client.interface';
|
|
4
|
+
export type { IInjectedComponent } from '../interfaces/component.interface';
|
|
5
|
+
export type { ILiquidCommerceElementsCheckoutClientConfig } from '../interfaces/config.interface';
|
|
6
|
+
export declare function ElementsCheckout(..._args: any[]): Promise<null>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { SDKError, isSDKError } from '../core/sdk-error-handler';
|
|
2
|
+
export type { CartEventLevel, CartEventType, CheckoutEventLevel, CheckoutEventType, ComponentType, DebugMode, DisplayModeType, ElementsEnv, FulfillmentType, NavigationSourceType, } from '../enums/core.enum';
|
|
3
|
+
export { CART_EVENT_LEVEL, CART_EVENT_TYPE, CHECKOUT_EVENT_LEVEL, CHECKOUT_EVENT_TYPE, COMPONENT_TYPE, DEBUG_MODE, DISPLAY_MODE, ELEMENTS_ACTIONS_EVENT, ELEMENTS_ENV, ELEMENTS_FORM, FULFILLMENT_TYPE, NAVIGATION_SOURCE, } from '../enums/core.enum';
|
|
4
|
+
export type { ILiquidCommerceElementsActions, ILiquidCommerceElementsBuilderClient, ILiquidCommerceElementsClient, } from '../interfaces/client.interface';
|
|
5
|
+
export type { IInjectedComponent } from '../interfaces/component.interface';
|
|
6
|
+
export type { IElementsProxyConfig, ILiquidCommerceElementsBuilderConfig, ILiquidCommerceElementsCheckoutConfig, ILiquidCommerceElementsConfig, ILiquidCommerceElementsDevelopmentConfig, } from '../interfaces/config.interface';
|
|
7
|
+
export type * from '../interfaces/configs';
|
|
8
|
+
export type { IBuilderInjectElementParams, IInjectCheckoutBuilderParams, IInjectCheckoutParams, IInjectProductElement, IInjectProductListFiltersParams, IInjectProductListParams, IInjectProductListSearchParams, ProductListFilterType, } from '../interfaces/injection.interface';
|
|
9
|
+
export declare function Elements(..._args: any[]): Promise<null>;
|
|
10
|
+
export declare function ElementsBuilder(..._args: any[]): Promise<null>;
|
|
@@ -1,21 +1,7 @@
|
|
|
1
1
|
export declare function centToDollar(cent: number): number;
|
|
2
2
|
export declare function formatCentToDollarText(cent: number, showZeroDecimals?: boolean): string;
|
|
3
3
|
export declare function htmlStringToElement(htmlString: string): HTMLElement;
|
|
4
|
-
export declare function format24TimeTo12(time24h: string): string;
|
|
5
4
|
export declare function formatISODateToMMDDYYYY(isoDateString: string | null | undefined): string;
|
|
6
|
-
export declare function validateMinimumAge(birthDate: string | Date | null | undefined, minimumAge?: number, minimumYear?: number): {
|
|
7
|
-
isValid: boolean;
|
|
8
|
-
age: number | null;
|
|
9
|
-
error?: string;
|
|
10
|
-
};
|
|
11
|
-
export declare function buildFormattedAddressString(address: {
|
|
12
|
-
one: string;
|
|
13
|
-
two: string;
|
|
14
|
-
city: string;
|
|
15
|
-
state: string;
|
|
16
|
-
zip: string;
|
|
17
|
-
country?: string;
|
|
18
|
-
}): string;
|
|
19
5
|
export declare function capitalizeFirstLetter(text: string): string;
|
|
20
6
|
export declare function splitCategoryPath(catPath?: string): {
|
|
21
7
|
category: string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { IProductFulfillmentStore, IProductSizeStore } from '@/core/store/interfaces/product.interface';
|
|
2
|
+
import { type FulfillmentType } from '@/enums';
|
|
3
|
+
export interface ISizeSelectionResult {
|
|
4
|
+
selectedFulfillmentType: FulfillmentType;
|
|
5
|
+
selectedFulfillment: IProductFulfillmentStore | null;
|
|
6
|
+
selectedFulfillmentId: string | null;
|
|
7
|
+
productHasAvailability: boolean;
|
|
8
|
+
fulfillmentHasAvailability: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface IFulfillmentTypeChangeResult {
|
|
11
|
+
selectedFulfillment: IProductFulfillmentStore | null;
|
|
12
|
+
selectedFulfillmentId: string | null;
|
|
13
|
+
fulfillmentHasAvailability: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function calculateSizeSelection(productSize: IProductSizeStore, currentFulfillmentType: FulfillmentType): ISizeSelectionResult;
|
|
16
|
+
export declare function calculateFulfillmentTypeChange(productSize: IProductSizeStore, newFulfillmentType: FulfillmentType): IFulfillmentTypeChangeResult | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { IProductStore } from '@/core/store/interfaces/product.interface';
|
|
2
|
+
import type { IPLProductStore } from '@/core/store/interfaces/product-list.interface';
|
|
3
|
+
import type { IProduct, IProductAvailabilityResponse } from '@/interfaces/api/product.interface';
|
|
4
|
+
export interface IPrepareApiProductForStoreParams {
|
|
5
|
+
context: 'product-list' | 'product-page';
|
|
6
|
+
product: IProduct;
|
|
7
|
+
retailers: IProductAvailabilityResponse['retailers'];
|
|
8
|
+
enableShippingFulfillment: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function buildSizeLabel(size: {
|
|
11
|
+
size: string;
|
|
12
|
+
pack: boolean;
|
|
13
|
+
packDesc: string;
|
|
14
|
+
}): string;
|
|
15
|
+
export declare function prepareApiProductForStore({ context, product, retailers, enableShippingFulfillment, }: IPrepareApiProductForStoreParams): IProductStore | IPLProductStore;
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# Elements SDK v1 Documentation
|
|
2
|
+
|
|
3
|
+
Welcome to the comprehensive documentation for the LiquidCommerce Elements SDK v1.
|
|
4
|
+
|
|
5
|
+
## What is Elements SDK?
|
|
6
|
+
|
|
7
|
+
The Elements SDK is a Web Components-based e-commerce SDK that allows you to add product displays, shopping carts, and checkout flows to any website with minimal code.
|
|
8
|
+
|
|
9
|
+
## Quick Links
|
|
10
|
+
|
|
11
|
+
- **[Installation](./getting-started/installation.md)** - Get started in minutes
|
|
12
|
+
- **[Quick Start](./getting-started/quick-start.md)** - Build your first product page
|
|
13
|
+
- **[API Reference](./api/client.md)** - Complete API documentation
|
|
14
|
+
|
|
15
|
+
## Documentation Sections
|
|
16
|
+
|
|
17
|
+
### Getting Started
|
|
18
|
+
|
|
19
|
+
Essential guides for new users:
|
|
20
|
+
|
|
21
|
+
- **[Installation](./getting-started/installation.md)** - CDN, NPM, and framework integration
|
|
22
|
+
- **[Quick Start](./getting-started/quick-start.md)** - Your first product page in 5 minutes
|
|
23
|
+
- **[Core Concepts](./getting-started/concepts.md)** - Understand how the SDK works
|
|
24
|
+
|
|
25
|
+
### Component Guides
|
|
26
|
+
|
|
27
|
+
In-depth guides for each major component:
|
|
28
|
+
|
|
29
|
+
- **[Product Component](./guides/product-component.md)** - Display products with add-to-cart functionality
|
|
30
|
+
- **[Cart Component](./guides/cart-component.md)** - Shopping cart and item management
|
|
31
|
+
- **[Checkout Component](./guides/checkout-component.md)** - Complete purchase flow
|
|
32
|
+
- **[Address Component](./guides/address-component.md)** - Delivery location management
|
|
33
|
+
- **[Product List Component](./guides/product-list-component.md)** - Filterable product catalogs
|
|
34
|
+
- **[Theming](./guides/theming.md)** - Customize appearance and branding
|
|
35
|
+
- **[Events](./guides/events.md)** - Event system and subscriptions
|
|
36
|
+
- **[Best Practices](./guides/best-practices.md)** - Patterns, tips, and recommendations
|
|
37
|
+
|
|
38
|
+
### API Reference
|
|
39
|
+
|
|
40
|
+
Complete API documentation:
|
|
41
|
+
|
|
42
|
+
**Core API:**
|
|
43
|
+
- **[Client API](./api/client.md)** - Main SDK client interface
|
|
44
|
+
- **[Injection Methods](./api/injection-methods.md)** - Component injection
|
|
45
|
+
- **[UI Helpers](./api/ui-helpers.md)** - Cart buttons and UI elements
|
|
46
|
+
- **[Configuration](./api/configuration.md)** - All configuration options
|
|
47
|
+
- **[TypeScript Types](./api/typescript-types.md)** - Type definitions
|
|
48
|
+
|
|
49
|
+
**Actions API:**
|
|
50
|
+
- **[Product Actions](./api/actions/product-actions.md)** - `actions.product.*`
|
|
51
|
+
- **[Address Actions](./api/actions/address-actions.md)** - `actions.address.*`
|
|
52
|
+
- **[Cart Actions](./api/actions/cart-actions.md)** - `actions.cart.*`
|
|
53
|
+
- **[Checkout Actions](./api/actions/checkout-actions.md)** - `actions.checkout.*`
|
|
54
|
+
|
|
55
|
+
### Architecture (To Be Done In Future Versions)
|
|
56
|
+
|
|
57
|
+
Deep dive into SDK internals:
|
|
58
|
+
|
|
59
|
+
- **[Overview](./architecture/overview.md)** - System architecture
|
|
60
|
+
- **[Initialization](./architecture/initialization.md)** - Phased initialization process
|
|
61
|
+
- **[State Management](./architecture/state-management.md)** - Store service and persistence
|
|
62
|
+
- **[Event System](./architecture/event-system.md)** - PubSub architecture
|
|
63
|
+
- **[Web Components](./architecture/web-components.md)** - Component factory and Shadow DOM
|
|
64
|
+
- **[Build System](./architecture/build-system.md)** - Bundles and tree-shaking
|
|
65
|
+
|
|
66
|
+
### Framework Integration
|
|
67
|
+
|
|
68
|
+
Integration guides for popular frameworks:
|
|
69
|
+
|
|
70
|
+
- **[React](./integration/react.md)** - React integration patterns and hooks
|
|
71
|
+
- **[Next.js](./integration/nextjs.md)** - Next.js setup with SSR considerations
|
|
72
|
+
- **[Vue](./integration/vue.md)** - Vue component integration
|
|
73
|
+
- **[Angular](./integration/angular.md)** - Angular client-only setup
|
|
74
|
+
- **[Laravel](./integration/laravel.md)** - Blade + CDN integration
|
|
75
|
+
- **[Vanilla JavaScript](./integration/vanilla-js.md)** - Pure JavaScript integration
|
|
76
|
+
- **[Proxy Setup](./integration/proxy-setup.md)** - Ad blocker avoidance
|
|
77
|
+
|
|
78
|
+
### Reference
|
|
79
|
+
|
|
80
|
+
Technical reference and troubleshooting:
|
|
81
|
+
|
|
82
|
+
- **[Browser Support](./reference/browser-support.md)** - Compatibility matrix
|
|
83
|
+
- **[Troubleshooting](./reference/troubleshooting.md)** - Common issues and solutions
|
|
84
|
+
- **[Error Handling](./reference/error-handling.md)** - Error types and debugging
|
|
85
|
+
- **[Performance](./reference/performance.md)** - Optimization tips and best practices
|
|
86
|
+
|
|
87
|
+
### Examples
|
|
88
|
+
|
|
89
|
+
Practical examples with working code:
|
|
90
|
+
|
|
91
|
+
- **[Simple Product Page](./examples/simple-product-page.md)** - Basic PDP implementation
|
|
92
|
+
- **[Multi-Product Page](./examples/multi-product-page.md)** - Multiple products on one page
|
|
93
|
+
- **[Complete Checkout Flow](./examples/checkout-flow.md)** - Full e-commerce flow
|
|
94
|
+
- **[Custom Theming](./examples/custom-theming.md)** - Brand customization examples
|
|
95
|
+
- **[Advanced Patterns](./examples/advanced-patterns.md)** - Complex integration scenarios
|
|
96
|
+
|
|
97
|
+
## Common Tasks
|
|
98
|
+
|
|
99
|
+
### Adding a Product
|
|
100
|
+
|
|
101
|
+
**Declarative (HTML):**
|
|
102
|
+
```html
|
|
103
|
+
<script
|
|
104
|
+
defer
|
|
105
|
+
data-liquid-commerce-elements
|
|
106
|
+
data-token="YOUR_API_KEY"
|
|
107
|
+
data-env="production"
|
|
108
|
+
data-container-1="product"
|
|
109
|
+
data-product-1="00619947000020"
|
|
110
|
+
type="text/javascript"
|
|
111
|
+
src="https://elements.reservebar-worker.workers.dev/all/elements.js"
|
|
112
|
+
></script>
|
|
113
|
+
|
|
114
|
+
<div id="product"></div>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Programmatic (JavaScript):**
|
|
118
|
+
```javascript
|
|
119
|
+
const client = await Elements('YOUR_API_KEY', { env: 'production' });
|
|
120
|
+
await client.injectProductElement([
|
|
121
|
+
{ containerId: 'product', identifier: '00619947000020' }
|
|
122
|
+
]);
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Opening the Cart
|
|
126
|
+
|
|
127
|
+
```javascript
|
|
128
|
+
window.LiquidCommerce.elements.actions.cart.openCart();
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Adding to Cart Programmatically
|
|
132
|
+
|
|
133
|
+
```javascript
|
|
134
|
+
await window.LiquidCommerce.elements.actions.cart.addProduct([
|
|
135
|
+
{
|
|
136
|
+
identifier: '00619947000020',
|
|
137
|
+
fulfillmentType: 'shipping',
|
|
138
|
+
quantity: 1
|
|
139
|
+
}
|
|
140
|
+
], true); // true = open cart after adding
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Listening for Events
|
|
144
|
+
|
|
145
|
+
```javascript
|
|
146
|
+
window.addEventListener('lce:actions.cart_item_added', (event) => {
|
|
147
|
+
console.log('Item added to cart:', event.detail.data);
|
|
148
|
+
});
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Customizing Theme
|
|
152
|
+
|
|
153
|
+
```javascript
|
|
154
|
+
const client = await Elements('YOUR_API_KEY', {
|
|
155
|
+
env: 'production',
|
|
156
|
+
customTheme: {
|
|
157
|
+
global: {
|
|
158
|
+
theme: {
|
|
159
|
+
primaryColor: '#007bff',
|
|
160
|
+
buttonCornerRadius: '8px'
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Key Concepts
|
|
168
|
+
|
|
169
|
+
### Web Components
|
|
170
|
+
The SDK uses native Web Components for framework-agnostic integration and style encapsulation.
|
|
171
|
+
|
|
172
|
+
### Shadow DOM
|
|
173
|
+
Components use Shadow DOM to prevent CSS conflicts and ensure consistent styling.
|
|
174
|
+
|
|
175
|
+
### Auto-Initialization
|
|
176
|
+
When using the CDN, the SDK automatically initializes based on HTML data attributes.
|
|
177
|
+
|
|
178
|
+
### Event-Driven
|
|
179
|
+
The SDK publishes events for all user interactions, allowing you to react to changes.
|
|
180
|
+
|
|
181
|
+
### State Persistence
|
|
182
|
+
Cart and address data persist across sessions using localStorage with API fallback.
|
|
183
|
+
|
|
184
|
+
## Browser Requirements
|
|
185
|
+
|
|
186
|
+
- Chrome 66+ (March 2018)
|
|
187
|
+
- Firefox 60+ (May 2018)
|
|
188
|
+
- Safari 12+ (September 2018)
|
|
189
|
+
- Edge 79+ (January 2020)
|
|
190
|
+
|
|
191
|
+
Requires Web Components and Shadow DOM support.
|
|
192
|
+
|
|
193
|
+
## Support
|
|
194
|
+
|
|
195
|
+
For assistance, contact your LiquidCommerce representative.
|
|
196
|
+
|
|
197
|
+
## Version History
|
|
198
|
+
|
|
199
|
+
This is the v1 documentation. Future versions will be documented in separate directories (`v2/`, `v3/`, etc.).
|
|
200
|
+
|
|
201
|
+
## Contributing
|
|
202
|
+
|
|
203
|
+
Found an issue in the documentation? Contact your LiquidCommerce representative with suggestions.
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Navigation
|
|
208
|
+
|
|
209
|
+
- [← Back to Repository](../)
|
|
210
|
+
- [Getting Started →](./getting-started/installation.md)
|