@liquidcommerce/elements-sdk 2.7.2 → 2.7.4
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 +7345 -7451
- package/dist/index.esm.js +12318 -12512
- package/dist/ssr-stub.checkout.esm.js +18 -0
- package/dist/ssr-stub.esm.js +270 -0
- package/dist/types/auto-initialize/shared-utils.d.ts +3 -1
- package/dist/types/clients/base.d.ts +7 -4
- package/dist/types/clients/builder.d.ts +2 -1
- package/dist/types/clients/checkout.d.ts +2 -10
- package/dist/types/clients/helpers.d.ts +1 -1
- package/dist/types/clients/main.d.ts +2 -1
- package/dist/types/constants/core.constant.d.ts +0 -6
- package/dist/types/core/api/api-client.service.d.ts +16 -15
- package/dist/types/core/api/api-result.d.ts +19 -0
- package/dist/types/core/api/auth-client.service.d.ts +13 -5
- package/dist/types/core/client/client-action.service.d.ts +1 -1
- package/dist/types/core/client/client-config.service.d.ts +1 -1
- package/dist/types/core/pubsub/pubsub.service.d.ts +0 -2
- package/dist/types/core/singleton-manager.service.d.ts +12 -8
- package/dist/types/core/store/interfaces/core.interface.d.ts +8 -12
- package/dist/types/core/store/interfaces/product-list.interface.d.ts +12 -28
- package/dist/types/core/store/store.constant.d.ts +2 -1
- 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 +5 -4
- package/dist/types/index.checkout.d.ts +3 -2
- package/dist/types/index.checkout.umd.d.ts +1 -1
- package/dist/types/index.d.ts +4 -1
- package/dist/types/interfaces/api/product-list.interface.d.ts +2 -1
- 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 +46 -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 +1 -1
- package/dist/types/interfaces/configs/global.interface.d.ts +2 -2
- package/dist/types/interfaces/configs/product-list.interface.d.ts +34 -20
- package/dist/types/interfaces/configs/product.interface.d.ts +1 -1
- package/dist/types/interfaces/injection.interface.d.ts +47 -0
- package/dist/types/modules/address/address-input.component.d.ts +0 -11
- package/dist/types/modules/address/address.command.d.ts +1 -1
- package/dist/types/modules/checkout/components/checkout-completed.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-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 +1 -3
- package/dist/types/modules/product-list/components/card-components/index.d.ts +0 -2
- package/dist/types/modules/product-list/components/card-components/product-badge.d.ts +1 -0
- package/dist/types/modules/product-list/components/card-components/product-button.d.ts +1 -3
- package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts +3 -4
- package/dist/types/modules/product-list/components/card-components/product-sizes-list.d.ts +9 -5
- package/dist/types/modules/product-list/components/filter-components/product-list-toggle-filters.d.ts +0 -6
- package/dist/types/modules/product-list/components/index.d.ts +1 -1
- package/dist/types/modules/product-list/components/product-list-engraving.component.d.ts +7 -5
- package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +4 -5
- 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 +32 -14
- package/dist/types/modules/product-list/components/product-list-search.component.d.ts +4 -3
- package/dist/types/modules/product-list/product-list-card.component.d.ts +20 -16
- package/dist/types/modules/product-list/product-list-filter.utils.d.ts +8 -0
- package/dist/types/modules/product-list/product-list.commands.d.ts +16 -62
- package/dist/types/modules/product-list/product-list.component.d.ts +3 -11
- package/dist/types/modules/product-list/product-list.constants.d.ts +0 -1
- package/dist/types/modules/product-list/product-list.interface.d.ts +0 -30
- 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 +2 -10
- package/dist/types/modules/ui-components/engraving/engraving-view.component.d.ts +5 -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 +6 -4
- package/dist/types/ssr/stub.checkout.d.ts +6 -0
- package/dist/types/ssr/stub.d.ts +10 -0
- package/dist/types/utils/product-selection.d.ts +16 -0
- package/dist/types/utils/product.d.ts +10 -0
- package/docs/v1/README.md +2 -2
- package/docs/v1/api/actions/address-actions.md +11 -11
- package/docs/v1/api/actions/cart-actions.md +13 -13
- package/docs/v1/api/actions/checkout-actions.md +23 -23
- package/docs/v1/api/actions/product-actions.md +6 -6
- package/docs/v1/api/client.md +11 -11
- package/docs/v1/api/ui-helpers.md +11 -11
- package/docs/v1/examples/advanced-patterns.md +1 -1
- package/docs/v1/examples/checkout-flow.md +1 -1
- package/docs/v1/getting-started/concepts.md +7 -7
- package/docs/v1/getting-started/installation.md +2 -2
- package/docs/v1/getting-started/quick-start.md +3 -3
- package/docs/v1/guides/address-component.md +11 -11
- package/docs/v1/guides/best-practices.md +14 -14
- package/docs/v1/guides/cart-component.md +23 -23
- package/docs/v1/guides/checkout-component.md +24 -24
- package/docs/v1/guides/product-component.md +5 -5
- package/docs/v1/integration/nextjs.md +11 -2
- package/docs/v1/integration/react.md +3 -3
- package/docs/v1/integration/vanilla-js.md +1 -1
- package/docs/v1/integration/vue.md +24 -0
- package/docs/v1/reference/error-handling.md +2 -2
- package/docs/v1/reference/troubleshooting.md +10 -2
- package/package.json +17 -13
- package/dist/types/interfaces/core.interface.d.ts +0 -140
- package/dist/types/modules/product-list/components/card-components/product-fulfillments.d.ts +0 -12
- package/dist/types/modules/product-list/components/card-components/product-title.d.ts +0 -6
- package/dist/types/modules/product-list/components/product-list-retailers.component.d.ts +0 -26
- package/dist/types/modules/ui-components/modal/modal.component.d.ts +0 -23
- package/dist/types/modules/ui-components/styles/modal.style.d.ts +0 -1
- package/docs/gitbook/actions.md +0 -964
- package/docs/gitbook/address.md +0 -48
- package/docs/gitbook/cart.md +0 -65
- package/docs/gitbook/checkout.md +0 -131
- package/docs/gitbook/events.md +0 -1765
- package/docs/gitbook/overview.md +0 -166
- package/docs/gitbook/product.md +0 -64
- package/docs/gitbook/quick-start-guide.md +0 -393
|
@@ -4,10 +4,4 @@ export interface ICreateEngravingFilterParams {
|
|
|
4
4
|
isPersonalizationDisabled: boolean;
|
|
5
5
|
onEngravingChange?: (enabled: boolean) => void;
|
|
6
6
|
}
|
|
7
|
-
export interface ICreatePresaleFilterParams {
|
|
8
|
-
currentFilters?: IProductListFilters;
|
|
9
|
-
isPresaleDisabled: boolean;
|
|
10
|
-
onPresaleChange?: (enabled: boolean) => void;
|
|
11
|
-
}
|
|
12
7
|
export declare function createEngravingFilter(params: ICreateEngravingFilterParams): HTMLElement[];
|
|
13
|
-
export declare function createPresaleFilter(params: ICreatePresaleFilterParams): HTMLElement[];
|
|
@@ -4,6 +4,6 @@ export * from './filter-components/product-list-apply-filter-button';
|
|
|
4
4
|
export * from './product-list-card-loading.component';
|
|
5
5
|
export * from './product-list-engraving.component';
|
|
6
6
|
export * from './product-list-filters.component';
|
|
7
|
+
export * from './product-list-product-engraving-lines.component';
|
|
7
8
|
export * from './product-list-product-pre-cart.component';
|
|
8
|
-
export * from './product-list-retailers.component';
|
|
9
9
|
export * from './product-list-search.component';
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { BaseComponent } from 'core/base-component.service';
|
|
2
|
+
import type { IProductListComponent } from 'interfaces/configs';
|
|
2
3
|
import type { IEngravingFormComponentParams } from 'modules/ui-components/engraving';
|
|
3
|
-
|
|
4
|
+
interface IProductListEngravingParams extends IEngravingFormComponentParams {
|
|
5
|
+
slug: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class ProductListEngravingComponent extends BaseComponent<IProductListEngravingParams, IProductListComponent> {
|
|
8
|
+
private getListConfig;
|
|
4
9
|
protected template(): HTMLElement[];
|
|
5
10
|
private createHeader;
|
|
6
|
-
private handleClose;
|
|
7
|
-
private handleEngravingComplete;
|
|
8
|
-
private handleEngravingCancel;
|
|
9
|
-
private reopenAddToCartDrawer;
|
|
10
11
|
}
|
|
12
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseComponent } from 'core/base-component.service';
|
|
2
|
-
import type { ProductListFilterType } from 'interfaces/
|
|
2
|
+
import type { ProductListFilterType } from 'interfaces/injection.interface';
|
|
3
3
|
export interface IProductListFiltersParams {
|
|
4
|
+
slug: string;
|
|
4
5
|
filters: ProductListFilterType[];
|
|
5
6
|
}
|
|
6
7
|
export declare class ProductListFiltersComponent extends BaseComponent<IProductListFiltersParams> {
|
|
@@ -15,7 +16,6 @@ export declare class ProductListFiltersComponent extends BaseComponent<IProductL
|
|
|
15
16
|
private isFulfillmentFilterCollapsed;
|
|
16
17
|
private appliedFiltersChipsContainer;
|
|
17
18
|
private engravingFiltersContainer?;
|
|
18
|
-
private presaleFilterContainer?;
|
|
19
19
|
private fulfillmentFilterContainer?;
|
|
20
20
|
private priceFiltersContainer?;
|
|
21
21
|
private dynamicFiltersContainer?;
|
|
@@ -24,13 +24,13 @@ export declare class ProductListFiltersComponent extends BaseComponent<IProductL
|
|
|
24
24
|
private priceFilterChevronIcon?;
|
|
25
25
|
private fulfillmentFilterChevronIcon?;
|
|
26
26
|
private priceSliderWrapper?;
|
|
27
|
-
private
|
|
27
|
+
private boundDrawerClosedHandler;
|
|
28
28
|
private priceFilterDebounceTimer;
|
|
29
29
|
constructor();
|
|
30
30
|
get hostClasses(): string[];
|
|
31
31
|
protected connected(): Promise<void>;
|
|
32
32
|
private setupDrawerCloseListener;
|
|
33
|
-
|
|
33
|
+
protected disconnected(): void;
|
|
34
34
|
private detectIfRenderedInDrawer;
|
|
35
35
|
onStoreWatch(): void;
|
|
36
36
|
private syncFiltersFromStore;
|
|
@@ -49,7 +49,6 @@ export declare class ProductListFiltersComponent extends BaseComponent<IProductL
|
|
|
49
49
|
private handleFilterChange;
|
|
50
50
|
private isEngravingCurrentlyDisabled;
|
|
51
51
|
private buildEngravingFilterElements;
|
|
52
|
-
private buildPresaleFilterElements;
|
|
53
52
|
private isSameDayDeliveryCurrentlyDisabled;
|
|
54
53
|
private toggleFulfillmentFilterCollapse;
|
|
55
54
|
private buildFulfillmentFilterElements;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseComponent } from 'core/base-component.service';
|
|
2
|
+
import type { IProductListComponent } from 'interfaces/configs';
|
|
3
|
+
export interface IProductListProductEngravingLinesComponentParams {
|
|
4
|
+
slug: string;
|
|
5
|
+
identifier: string;
|
|
6
|
+
lines: string[];
|
|
7
|
+
maxLines: number;
|
|
8
|
+
maxCharsPerLine: number;
|
|
9
|
+
location?: string;
|
|
10
|
+
fee: number;
|
|
11
|
+
}
|
|
12
|
+
export declare class ProductListProductEngravingLinesComponent extends BaseComponent<IProductListProductEngravingLinesComponentParams, IProductListComponent> {
|
|
13
|
+
private engravingLines;
|
|
14
|
+
private addEngravingButton;
|
|
15
|
+
constructor();
|
|
16
|
+
protected disconnected?(): void;
|
|
17
|
+
template(): HTMLElement;
|
|
18
|
+
private engravingLinesSection;
|
|
19
|
+
private actionButtonsSection;
|
|
20
|
+
private calculateTotalPrice;
|
|
21
|
+
private addToCartButtonText;
|
|
22
|
+
}
|
package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts
CHANGED
|
@@ -1,28 +1,46 @@
|
|
|
1
|
-
import { BaseComponent } from 'core/base-component.service';
|
|
2
|
-
import type { IProductListProduct } from 'core/store/interfaces/product-list.interface';
|
|
3
|
-
import { type DisplayModeType } from 'enums';
|
|
4
|
-
import type { IFulfillment } from 'interfaces/api/product.interface';
|
|
1
|
+
import { BaseComponent, type IOnStoreChanged } from 'core/base-component.service';
|
|
5
2
|
import type { IProductListComponent } from 'interfaces/configs';
|
|
6
3
|
export interface IProductListProductPreCartComponentParams {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
shippingFulfillment: IFulfillment | null;
|
|
10
|
-
onDemandFulfillment: IFulfillment | null;
|
|
11
|
-
config: IProductListComponent;
|
|
4
|
+
slug: string;
|
|
5
|
+
productId: string;
|
|
12
6
|
}
|
|
13
7
|
export declare class ProductListProductPreCartComponent extends BaseComponent<IProductListProductPreCartComponentParams, IProductListComponent> {
|
|
14
|
-
private
|
|
8
|
+
private showRetailersContent;
|
|
9
|
+
private showEngravingForm;
|
|
10
|
+
private isInitialRender;
|
|
11
|
+
private priceElement;
|
|
12
|
+
private imageElement;
|
|
13
|
+
private fulfillmentTextElement;
|
|
14
|
+
private addToCartButton;
|
|
15
|
+
private personalizeElement;
|
|
16
|
+
private previousSelectedSizeId;
|
|
17
|
+
private previousSelectedFulfillmentId;
|
|
15
18
|
constructor();
|
|
19
|
+
private getListConfig;
|
|
20
|
+
protected afterRender?(): void;
|
|
21
|
+
private handleRetailersBack;
|
|
22
|
+
private handleEngravingBack;
|
|
23
|
+
private handleEngravingEdit;
|
|
24
|
+
protected disconnected?(): void;
|
|
25
|
+
private getSelectedSize;
|
|
26
|
+
onStoreWatch(changes: IOnStoreChanged[]): void;
|
|
27
|
+
private updatePriceDisplay;
|
|
28
|
+
private updateFulfillmentText;
|
|
29
|
+
private updateImage;
|
|
30
|
+
private updatePersonalizeVisibility;
|
|
31
|
+
private updateAddToCartButton;
|
|
32
|
+
private getEngravingFee;
|
|
16
33
|
protected template(): HTMLElement[];
|
|
34
|
+
private createEngravingFormContent;
|
|
35
|
+
private renderPreCartContent;
|
|
36
|
+
private createDeliversToSectionWrapper;
|
|
37
|
+
private createShippingFromSectionWrapper;
|
|
17
38
|
private createCartHeader;
|
|
18
39
|
private createImageSection;
|
|
19
40
|
private createPricePersonalizationSection;
|
|
20
41
|
private createDeliversToSection;
|
|
21
|
-
private createSizesSection;
|
|
22
|
-
private handleDeliveryOptionsClick;
|
|
23
42
|
private createFulfillmentSectionWrapper;
|
|
24
|
-
createFulfillmentTextSection
|
|
43
|
+
private createFulfillmentTextSection;
|
|
25
44
|
private createAddToCartSection;
|
|
26
45
|
private handleAddToCart;
|
|
27
|
-
private createExpectationArrivalInfoSection;
|
|
28
46
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
-
export
|
|
2
|
+
export interface IProductListSearchParams {
|
|
3
|
+
slug: string;
|
|
4
|
+
}
|
|
5
|
+
export declare class ProductListSearchComponent extends BaseComponent<IProductListSearchParams> {
|
|
3
6
|
private searchInput?;
|
|
4
7
|
private clearButton?;
|
|
5
8
|
private debounceTimer;
|
|
@@ -9,9 +12,7 @@ export declare class ProductListSearchComponent extends BaseComponent {
|
|
|
9
12
|
private readonly DEFAULT_DEBOUNCE_MS;
|
|
10
13
|
get hostClasses(): string[];
|
|
11
14
|
disconnectedCallback(): void;
|
|
12
|
-
getCurrentSearchTerm(): string;
|
|
13
15
|
private fetchProducts;
|
|
14
|
-
private buildCurrentFiltersFromState;
|
|
15
16
|
protected template(): HTMLElement[];
|
|
16
17
|
private handleDebouncedSearch;
|
|
17
18
|
private handleClearSearch;
|
|
@@ -1,30 +1,34 @@
|
|
|
1
|
-
import type { IProductListProduct } from 'core/store/interfaces/product-list.interface';
|
|
2
1
|
import type { IProductListComponent } from 'interfaces/configs';
|
|
3
|
-
import { BaseComponent } from '@/core/base-component.service';
|
|
4
|
-
import type { IFulfillment } from '@/interfaces/api/product.interface';
|
|
2
|
+
import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
|
|
5
3
|
export interface IProductListCardParams {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
onDemandFulfillment: IFulfillment | null;
|
|
4
|
+
slug: string;
|
|
5
|
+
productId: string;
|
|
9
6
|
productUrl?: string;
|
|
10
7
|
}
|
|
11
8
|
export declare class ProductListCardComponent extends BaseComponent<IProductListCardParams, IProductListComponent> {
|
|
12
|
-
private
|
|
13
|
-
private
|
|
9
|
+
private imageElement;
|
|
10
|
+
private priceElement;
|
|
11
|
+
private personalizeElement;
|
|
12
|
+
private fulfillmentTextElement;
|
|
13
|
+
private addToCartButton;
|
|
14
|
+
private previousSelectedSizeId;
|
|
15
|
+
private previousSelectedFulfillmentId;
|
|
14
16
|
constructor();
|
|
17
|
+
private getListConfig;
|
|
15
18
|
get hostClasses(): string[];
|
|
16
|
-
protected
|
|
17
|
-
|
|
18
|
-
private
|
|
19
|
+
protected disconnected?(): void;
|
|
20
|
+
onStoreWatch(changes: IOnStoreChanged[]): void;
|
|
21
|
+
private getSelectedSize;
|
|
19
22
|
protected template(): HTMLElement[];
|
|
23
|
+
private updatePriceDisplay;
|
|
24
|
+
private updateFulfillmentText;
|
|
25
|
+
private updateImage;
|
|
26
|
+
private updatePersonalizeVisibility;
|
|
27
|
+
private updateAddToCartButton;
|
|
20
28
|
private generateProductUrl;
|
|
21
|
-
private createVariantStandard;
|
|
22
29
|
private createImageSection;
|
|
23
30
|
private createContentSection;
|
|
24
|
-
private createPricePersonalizationSection;
|
|
25
|
-
private createSizesSection;
|
|
26
|
-
private handleDeliveryOptionsClick;
|
|
27
31
|
private createFulfillmentSectionWrapper;
|
|
28
|
-
createFulfillmentTextSection
|
|
32
|
+
private createFulfillmentTextSection;
|
|
29
33
|
private createAddToCartSection;
|
|
30
34
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IFilterSchema, IProductSearchParams } from '@/interfaces/api/product-list.interface';
|
|
2
|
+
import type { ProductListFilterType } from '@/interfaces/injection.interface';
|
|
3
|
+
import type { IExtendedFilterSchema, IProductListFilters } from './product-list.interface';
|
|
4
|
+
export declare const FILTER_TYPE_MAP: Record<string, string>;
|
|
5
|
+
export declare function getSanitizedFilters(filters: IFilterSchema[], configuredFilters: ProductListFilterType[]): IExtendedFilterSchema[];
|
|
6
|
+
export declare function syncFiltersToAppliedFormat(filters: IProductListFilters): Record<string, string[]>;
|
|
7
|
+
export declare function buildSearchParams(slug: string, page: number, perPage: number, searchTerm: string, currentFilters: IProductListFilters, configuredFilters: ProductListFilterType[]): IProductSearchParams;
|
|
8
|
+
export declare function buildCurrentFiltersFromState(stateFilters: Record<string, string[]>): IProductListFilters;
|
|
@@ -1,76 +1,30 @@
|
|
|
1
|
-
import type { IModalContentConfig } from 'core/store/interfaces/core.interface';
|
|
2
|
-
import type { IProductSizeStore } from 'core/store/interfaces/product.interface';
|
|
3
|
-
import type { IProductListProduct, IProductListStore } from 'core/store/interfaces/product-list.interface';
|
|
4
1
|
import { BaseCommand } from '@/core/command/base-command.service';
|
|
5
2
|
import { type FulfillmentType } from '@/enums';
|
|
6
|
-
import type { IFulfillment, IProduct, IProductSizeAttributes, IRetailer } from '@/interfaces/api/product.interface';
|
|
7
3
|
import type { IFilterSchema, INavigationResponse, IProductSearchParams, IProductSearchResponse } from '@/interfaces/api/product-list.interface';
|
|
8
|
-
import type { ProductListFilterType } from '@/interfaces/
|
|
4
|
+
import type { ProductListFilterType } from '@/interfaces/injection.interface';
|
|
9
5
|
import { type AddItemParams } from '@/modules/cart/cart.commands';
|
|
10
|
-
import type { IExtendedFilterSchema, IPagination,
|
|
11
|
-
type StateListener = (state: IProductListStore) => void;
|
|
6
|
+
import type { IExtendedFilterSchema, IPagination, IProductListFilters } from './product-list.interface';
|
|
12
7
|
export declare class ProductListCommands extends BaseCommand {
|
|
13
8
|
private readonly uiCommands;
|
|
14
9
|
private readonly cartCommands;
|
|
15
|
-
private readonly checkoutCommands;
|
|
16
|
-
private readonly FILTER_TYPE_MAP;
|
|
17
|
-
private listeners;
|
|
18
10
|
constructor();
|
|
19
11
|
static getInstance(): ProductListCommands;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
private initializeProductFulfillment;
|
|
26
|
-
private transformProductVariantsToFulfillments;
|
|
27
|
-
private transformSingleProduct;
|
|
28
|
-
private transformProductSize;
|
|
29
|
-
private addShippingFulfillments;
|
|
30
|
-
private addOnDemandFulfillments;
|
|
31
|
-
loadInitialProducts(page: number, perPage: number, searchTerm: string, currentFilters: IProductListFilters, configuredFilters: ProductListFilterType[]): Promise<void>;
|
|
32
|
-
loadMoreProducts(perPage: number, searchTerm: string, currentFilters: IProductListFilters, configuredFilters: ProductListFilterType[]): Promise<void>;
|
|
12
|
+
initializeListStore(slug: string): void;
|
|
13
|
+
updateSearchTerm(slug: string, searchTerm: string): void;
|
|
14
|
+
setLoading(slug: string, isLoading: boolean): void;
|
|
15
|
+
loadInitialProducts(slug: string, page: number, perPage: number, searchTerm: string, currentFilters: IProductListFilters, configuredFilters: ProductListFilterType[]): Promise<void>;
|
|
16
|
+
loadMoreProducts(slug: string, perPage: number, searchTerm: string, currentFilters: IProductListFilters, configuredFilters: ProductListFilterType[]): Promise<void>;
|
|
33
17
|
getProductList(params: IProductSearchParams): Promise<IProductSearchResponse>;
|
|
34
|
-
syncFiltersFromComponent(filters: IProductListFilters): void;
|
|
18
|
+
syncFiltersFromComponent(slug: string, filters: IProductListFilters): void;
|
|
35
19
|
getSanitizedFilters(filters: IFilterSchema[], configuredFilters: ProductListFilterType[]): IExtendedFilterSchema[];
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
private addToggleFilters;
|
|
39
|
-
private getBooleanFilterValue;
|
|
40
|
-
private addEngravingFilter;
|
|
41
|
-
private addPresaleFilter;
|
|
42
|
-
private addFulfillmentFilter;
|
|
43
|
-
private addPriceFilter;
|
|
44
|
-
private addDynamicFilters;
|
|
45
|
-
setGridConfig(rows: number, columns: number): void;
|
|
46
|
-
getItemsPerPage(): number;
|
|
20
|
+
setGridConfig(slug: string, rows: number, columns: number): void;
|
|
21
|
+
getItemsPerPage(slug: string): number;
|
|
47
22
|
updatePagination(navigation: INavigationResponse | undefined): IPagination;
|
|
48
23
|
createInitialPagination(): IPagination;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
addToCart(params: AddItemParams): Promise<void>;
|
|
56
|
-
addPresaleToCart(params: AddItemParams): Promise<void>;
|
|
57
|
-
trackViewItemList(products: IProduct[]): void;
|
|
58
|
-
trackSelectItem(product: IProductListProduct): void;
|
|
59
|
-
private convertProductToBaseItem;
|
|
60
|
-
openProductListModal(productId: string, contentType: IModalContentConfig['type'], data?: Record<string, any>): void;
|
|
61
|
-
closeProductListModal(productId: string): void;
|
|
62
|
-
selectFulfillmentType: (productId: string, selectedFulfillmentType: FulfillmentType) => Promise<void>;
|
|
63
|
-
selectFulfillment: (productId: string, fulfillmentId: string) => Promise<void>;
|
|
64
|
-
selectSize: (productId: string, sizeId: string) => Promise<void>;
|
|
65
|
-
private getFulfillmentForSize;
|
|
66
|
-
updateQuantity: (productId: string, quantity: number) => void;
|
|
67
|
-
getAvailabilityData(params: {
|
|
68
|
-
product: IProductListProduct;
|
|
69
|
-
size?: IProductSizeStore;
|
|
70
|
-
shippingFulfillment?: IFulfillment | null;
|
|
71
|
-
onDemandFulfillment?: IFulfillment | null;
|
|
72
|
-
state?: string;
|
|
73
|
-
}): IProductAvailabilityData;
|
|
74
|
-
isPresaleActive(sizeAttributes: IProductSizeAttributes): boolean;
|
|
24
|
+
addToCart(slug: string, productId: string, params: AddItemParams): Promise<void>;
|
|
25
|
+
selectSize(slug: string, productId: string, sizeId: string): Promise<void>;
|
|
26
|
+
changeFulfillmentType: (slug: string, productId: string, newFulfillmentType: FulfillmentType) => Promise<void>;
|
|
27
|
+
selectFulfillment: (slug: string, productId: string, selectedFulfillmentId: string) => Promise<void>;
|
|
28
|
+
updateQuantity: (slug: string, productId: string, quantity: number) => void;
|
|
29
|
+
saveEngravingLines(slug: string, productId: string, engravingLines: string[]): void;
|
|
75
30
|
}
|
|
76
|
-
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { IProductListComponent } from 'interfaces/configs';
|
|
2
2
|
import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
|
|
3
|
-
import type { ProductListFilterType } from '@/interfaces/
|
|
3
|
+
import type { ProductListFilterType } from '@/interfaces/injection.interface';
|
|
4
4
|
export interface IProductListComponentParams {
|
|
5
|
+
slug: string;
|
|
5
6
|
rows: number;
|
|
6
7
|
columns: number;
|
|
7
8
|
filters: ProductListFilterType[];
|
|
@@ -9,7 +10,6 @@ export interface IProductListComponentParams {
|
|
|
9
10
|
}
|
|
10
11
|
export declare class ProductListComponent extends BaseComponent<IProductListComponentParams, IProductListComponent> {
|
|
11
12
|
private products;
|
|
12
|
-
private retailers;
|
|
13
13
|
private pagination;
|
|
14
14
|
private cardsContainer;
|
|
15
15
|
private sentinelElement;
|
|
@@ -22,23 +22,15 @@ export declare class ProductListComponent extends BaseComponent<IProductListComp
|
|
|
22
22
|
protected connected(): Promise<void>;
|
|
23
23
|
disconnected(): void;
|
|
24
24
|
private initializeComponent;
|
|
25
|
-
private
|
|
26
|
-
private updateLoadingState;
|
|
27
|
-
private hasProductsChanged;
|
|
28
|
-
private updateProductData;
|
|
29
|
-
private handleProductRendering;
|
|
30
|
-
private renderSimplifiedProducts;
|
|
25
|
+
private toProductArray;
|
|
31
26
|
private setLoadingState;
|
|
32
27
|
private renderCurrentState;
|
|
33
28
|
private loadInitialProducts;
|
|
34
29
|
private loadMoreProducts;
|
|
35
|
-
private buildCurrentFiltersFromState;
|
|
36
|
-
private mapStateFilterToComponentFilter;
|
|
37
30
|
private createCardsContainer;
|
|
38
31
|
private renderLoadingState;
|
|
39
32
|
private renderProducts;
|
|
40
33
|
private appendNewProducts;
|
|
41
|
-
private createProductCard;
|
|
42
34
|
private getResponsiveColumns;
|
|
43
35
|
private setupInfiniteScroll;
|
|
44
36
|
private createScrollSentinel;
|
|
@@ -7,7 +7,6 @@ export declare const FILTER_KEYS: {
|
|
|
7
7
|
readonly VARIETY: "variety";
|
|
8
8
|
readonly ENGRAVING: "engraving";
|
|
9
9
|
readonly PRICE: "price";
|
|
10
|
-
readonly PRESALE: "presale";
|
|
11
10
|
readonly AVAILABILITY: "availability";
|
|
12
11
|
readonly CATEGORIES: "categories";
|
|
13
12
|
readonly SIZES: "sizes";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { IProductFulfillmentStore, IProductSizeStore } from 'core/store/interfaces/product.interface';
|
|
2
1
|
import type { IFilterValue } from '@/interfaces/api/product-list.interface';
|
|
3
2
|
export interface IPriceConfig {
|
|
4
3
|
min?: string;
|
|
@@ -12,9 +11,6 @@ export interface IExtendedFilterSchema {
|
|
|
12
11
|
type: string;
|
|
13
12
|
values: IFilterValue[];
|
|
14
13
|
}
|
|
15
|
-
export interface IProductListSearch {
|
|
16
|
-
searchTerm: string;
|
|
17
|
-
}
|
|
18
14
|
export interface IPagination {
|
|
19
15
|
currentPage: number;
|
|
20
16
|
totalPages: number;
|
|
@@ -58,29 +54,3 @@ export interface IRenderCheckboxItemsParams {
|
|
|
58
54
|
state: ICheckboxLabelStates;
|
|
59
55
|
onCheckboxChange: (value: string, checked: boolean) => void;
|
|
60
56
|
}
|
|
61
|
-
export interface ICreateFiltersContainerParams {
|
|
62
|
-
isDrawerMode?: boolean;
|
|
63
|
-
}
|
|
64
|
-
export interface IProductAvailabilityData {
|
|
65
|
-
hasAvailability: boolean;
|
|
66
|
-
upc: string;
|
|
67
|
-
fulfillmentId: string;
|
|
68
|
-
partNumber: string;
|
|
69
|
-
quantity: number;
|
|
70
|
-
state: string;
|
|
71
|
-
isPresale: boolean;
|
|
72
|
-
isPresaleActive: boolean;
|
|
73
|
-
presaleShipBy: string | null;
|
|
74
|
-
}
|
|
75
|
-
export interface IProductVariantParams {
|
|
76
|
-
image: string;
|
|
77
|
-
name: string;
|
|
78
|
-
size: string | null;
|
|
79
|
-
price: number;
|
|
80
|
-
availability: IProductAvailabilityData;
|
|
81
|
-
hasPersonalization: boolean;
|
|
82
|
-
sizes: Record<string, IProductSizeStore>;
|
|
83
|
-
maxQuantityPerOrder: number;
|
|
84
|
-
shippingVariants: Record<string, IProductFulfillmentStore>;
|
|
85
|
-
onDemandVariants: Record<string, IProductFulfillmentStore>;
|
|
86
|
-
}
|
|
@@ -1,23 +1,15 @@
|
|
|
1
|
-
import type { IProductListProduct } from 'core/store/interfaces/product-list.interface';
|
|
2
|
-
import type { IFulfillment } from 'interfaces/api/product.interface';
|
|
3
1
|
import { BaseComponent } from '@/core/base-component.service';
|
|
4
|
-
import { type DisplayModeType
|
|
5
|
-
import type { IProductListComponent } from '@/interfaces/configs';
|
|
2
|
+
import { type DisplayModeType } from '@/enums';
|
|
6
3
|
export interface IEngravingFormComponentParams {
|
|
7
4
|
identifier: string;
|
|
8
5
|
context: 'product' | 'cart' | 'product-list';
|
|
6
|
+
slug?: string;
|
|
9
7
|
lines: string[];
|
|
10
8
|
maxLines: number;
|
|
11
9
|
maxCharsPerLine: number;
|
|
12
10
|
fee: number;
|
|
13
11
|
location?: string;
|
|
14
12
|
displayMode?: DisplayModeType;
|
|
15
|
-
navigationSource?: NavigationSourceType;
|
|
16
|
-
product?: IProductListProduct;
|
|
17
|
-
shippingFulfillment?: IFulfillment | null;
|
|
18
|
-
onDemandFulfillment?: IFulfillment | null;
|
|
19
|
-
showCollections?: boolean;
|
|
20
|
-
config?: IProductListComponent;
|
|
21
13
|
}
|
|
22
14
|
export declare class EngravingFormComponent extends BaseComponent<IEngravingFormComponentParams, null> {
|
|
23
15
|
get hostClasses(): string[];
|
|
@@ -2,7 +2,11 @@ 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[];
|
|
@@ -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> {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { BaseCommand } from '@/core/command/base-command.service';
|
|
2
|
-
import type { IDrawerContentConfig
|
|
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
|
-
openModal(contentType: IModalContentConfig['type'], data?: Record<string, any>): void;
|
|
8
|
-
closeModal(): void;
|
|
9
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>;
|
|
@@ -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,10 @@
|
|
|
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 prepareApiProductForStore({ context, product, retailers, enableShippingFulfillment, }: IPrepareApiProductForStoreParams): IProductStore | IPLProductStore;
|
package/docs/v1/README.md
CHANGED
|
@@ -125,13 +125,13 @@ await client.injectProductElement([
|
|
|
125
125
|
### Opening the Cart
|
|
126
126
|
|
|
127
127
|
```javascript
|
|
128
|
-
window.elements.actions.cart.openCart();
|
|
128
|
+
window.LiquidCommerce.elements.actions.cart.openCart();
|
|
129
129
|
```
|
|
130
130
|
|
|
131
131
|
### Adding to Cart Programmatically
|
|
132
132
|
|
|
133
133
|
```javascript
|
|
134
|
-
await window.elements.actions.cart.addProduct([
|
|
134
|
+
await window.LiquidCommerce.elements.actions.cart.addProduct([
|
|
135
135
|
{
|
|
136
136
|
identifier: '00619947000020',
|
|
137
137
|
fulfillmentType: 'shipping',
|