@liquidcommerce/elements-sdk 2.6.0-beta.45 → 2.6.0-beta.47
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/dist/index.checkout.esm.js +7254 -7409
- package/dist/index.esm.js +11995 -12602
- package/dist/ssr-stub.esm.js +4 -5
- package/dist/types/clients/base.d.ts +2 -2
- package/dist/types/clients/helpers.d.ts +1 -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/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 -30
- 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 +4 -5
- package/dist/types/interfaces/api/product-list.interface.d.ts +2 -1
- package/dist/types/interfaces/client.interface.d.ts +11 -1
- package/dist/types/interfaces/config.interface.d.ts +2 -1
- package/dist/types/interfaces/configs/global.interface.d.ts +1 -1
- package/dist/types/interfaces/configs/product-list.interface.d.ts +33 -19
- package/dist/types/interfaces/injection.interface.d.ts +4 -1
- 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-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 +0 -2
- package/dist/types/modules/product-list/components/product-list-engraving.component.d.ts +6 -6
- package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +1 -4
- package/dist/types/modules/product-list/components/product-list-product-engraving-lines.component.d.ts +1 -0
- package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts +17 -15
- 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 +15 -62
- package/dist/types/modules/product-list/product-list.component.d.ts +2 -10
- 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 +1 -0
- package/dist/types/modules/ui-components/engraving/engraving-view.component.d.ts +1 -2
- 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/utils/product-selection.d.ts +16 -0
- package/dist/types/utils/product.d.ts +10 -0
- package/package.json +8 -8
- 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-content.component.d.ts +0 -22
- package/dist/types/modules/product-list/components/product-list-retailers.component.d.ts +0 -22
- 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
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import type { ProductListCardCornerRadius } from 'interfaces/configs';
|
|
2
1
|
export interface IAddToCartButtonParams {
|
|
3
2
|
isPresale: boolean;
|
|
4
3
|
hasAvailability: boolean;
|
|
5
4
|
state: string;
|
|
6
5
|
disabled?: boolean;
|
|
7
|
-
borderRadius: ProductListCardCornerRadius;
|
|
8
6
|
hasAddress: boolean;
|
|
9
7
|
onClick?: (e: MouseEvent) => void | Promise<void>;
|
|
10
8
|
}
|
|
11
|
-
export declare const createAddToCartButton: ({ isPresale, hasAvailability, state, disabled,
|
|
9
|
+
export declare const createAddToCartButton: ({ isPresale, hasAvailability, state, disabled, hasAddress, onClick, }: IAddToCartButtonParams) => HTMLElement;
|
package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PLCCardStyle } from 'interfaces/configs/product-list.interface';
|
|
2
2
|
export interface IQuantitySelectorParams {
|
|
3
3
|
initialQuantity: number;
|
|
4
4
|
minQuantity: number;
|
|
5
5
|
maxQuantity: number;
|
|
6
|
-
|
|
7
|
-
cardStyle: ProductListCardStyle;
|
|
6
|
+
cardStyle: PLCCardStyle;
|
|
8
7
|
onChange: (quantity: number) => void;
|
|
9
8
|
}
|
|
10
|
-
export declare const createQuantitySelector: ({ initialQuantity, minQuantity, maxQuantity,
|
|
9
|
+
export declare const createQuantitySelector: ({ initialQuantity, minQuantity, maxQuantity, cardStyle, onChange }: IQuantitySelectorParams) => HTMLElement;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import type { IProductSizeStore } from 'core/store/interfaces/product.interface';
|
|
2
|
-
import
|
|
3
|
-
export interface
|
|
2
|
+
import { BaseComponent } from '@/core/base-component.service';
|
|
3
|
+
export interface IProductListSizeSelectorParams {
|
|
4
4
|
sizes: Record<string, IProductSizeStore>;
|
|
5
|
-
|
|
6
|
-
cornerRadius: ProductListCardCornerRadius;
|
|
5
|
+
selectedSizeId: string | null;
|
|
7
6
|
onSelect?: (size: IProductSizeStore) => void;
|
|
8
7
|
}
|
|
9
|
-
export declare
|
|
8
|
+
export declare class ProductListSizeSelectorComponent extends BaseComponent<IProductListSizeSelectorParams> {
|
|
9
|
+
private onOutsideClick;
|
|
10
|
+
get hostClasses(): string[];
|
|
11
|
+
protected disconnected?(): void;
|
|
12
|
+
protected template(): HTMLElement[];
|
|
13
|
+
}
|
|
@@ -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[];
|
|
@@ -6,6 +6,4 @@ export * from './product-list-engraving.component';
|
|
|
6
6
|
export * from './product-list-filters.component';
|
|
7
7
|
export * from './product-list-product-engraving-lines.component';
|
|
8
8
|
export * from './product-list-product-pre-cart.component';
|
|
9
|
-
export * from './product-list-retailers.component';
|
|
10
|
-
export * from './product-list-retailers-content.component';
|
|
11
9
|
export * from './product-list-search.component';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { BaseComponent } from 'core/base-component.service';
|
|
2
2
|
import type { IProductListComponent } from 'interfaces/configs';
|
|
3
3
|
import type { IEngravingFormComponentParams } from 'modules/ui-components/engraving';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
interface IProductListEngravingParams extends IEngravingFormComponentParams {
|
|
5
|
+
slug: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class ProductListEngravingComponent extends BaseComponent<IProductListEngravingParams, IProductListComponent> {
|
|
8
|
+
private getListConfig;
|
|
9
9
|
protected template(): HTMLElement[];
|
|
10
10
|
private createHeader;
|
|
11
|
-
private handleClose;
|
|
12
11
|
}
|
|
12
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseComponent } from 'core/base-component.service';
|
|
2
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,7 +24,6 @@ export declare class ProductListFiltersComponent extends BaseComponent<IProductL
|
|
|
24
24
|
private priceFilterChevronIcon?;
|
|
25
25
|
private fulfillmentFilterChevronIcon?;
|
|
26
26
|
private priceSliderWrapper?;
|
|
27
|
-
private resizeHandler;
|
|
28
27
|
private boundDrawerClosedHandler;
|
|
29
28
|
private priceFilterDebounceTimer;
|
|
30
29
|
constructor();
|
|
@@ -32,7 +31,6 @@ export declare class ProductListFiltersComponent extends BaseComponent<IProductL
|
|
|
32
31
|
protected connected(): Promise<void>;
|
|
33
32
|
private setupDrawerCloseListener;
|
|
34
33
|
protected disconnected(): void;
|
|
35
|
-
private setupResizeListener;
|
|
36
34
|
private detectIfRenderedInDrawer;
|
|
37
35
|
onStoreWatch(): void;
|
|
38
36
|
private syncFiltersFromStore;
|
|
@@ -51,7 +49,6 @@ export declare class ProductListFiltersComponent extends BaseComponent<IProductL
|
|
|
51
49
|
private handleFilterChange;
|
|
52
50
|
private isEngravingCurrentlyDisabled;
|
|
53
51
|
private buildEngravingFilterElements;
|
|
54
|
-
private buildPresaleFilterElements;
|
|
55
52
|
private isSameDayDeliveryCurrentlyDisabled;
|
|
56
53
|
private toggleFulfillmentFilterCollapse;
|
|
57
54
|
private buildFulfillmentFilterElements;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseComponent } from 'core/base-component.service';
|
|
2
2
|
import type { IProductListComponent } from 'interfaces/configs';
|
|
3
3
|
export interface IProductListProductEngravingLinesComponentParams {
|
|
4
|
+
slug: string;
|
|
4
5
|
identifier: string;
|
|
5
6
|
lines: string[];
|
|
6
7
|
maxLines: number;
|
package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts
CHANGED
|
@@ -1,32 +1,36 @@
|
|
|
1
|
-
import { BaseComponent } from 'core/base-component.service';
|
|
2
|
-
import type { IProductListProduct } from 'core/store/interfaces/product-list.interface';
|
|
3
|
-
import type { IFulfillment } from 'interfaces/api/product.interface';
|
|
1
|
+
import { BaseComponent, type IOnStoreChanged } from 'core/base-component.service';
|
|
4
2
|
import type { IProductListComponent } from 'interfaces/configs';
|
|
5
3
|
export interface IProductListProductPreCartComponentParams {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
onDemandFulfillment: IFulfillment | null;
|
|
4
|
+
slug: string;
|
|
5
|
+
productId: string;
|
|
9
6
|
}
|
|
10
7
|
export declare class ProductListProductPreCartComponent extends BaseComponent<IProductListProductPreCartComponentParams, IProductListComponent> {
|
|
11
|
-
private selectedSize;
|
|
12
8
|
private showRetailersContent;
|
|
13
9
|
private showEngravingForm;
|
|
14
10
|
private isInitialRender;
|
|
15
11
|
private priceElement;
|
|
16
|
-
private
|
|
12
|
+
private imageElement;
|
|
13
|
+
private fulfillmentTextElement;
|
|
14
|
+
private addToCartButton;
|
|
15
|
+
private personalizeElement;
|
|
16
|
+
private previousSelectedSizeId;
|
|
17
|
+
private previousSelectedFulfillmentId;
|
|
17
18
|
constructor();
|
|
19
|
+
private getListConfig;
|
|
18
20
|
protected afterRender?(): void;
|
|
19
21
|
private handleRetailersBack;
|
|
20
22
|
private handleEngravingBack;
|
|
21
23
|
private handleEngravingEdit;
|
|
22
|
-
private handleResize;
|
|
23
24
|
protected disconnected?(): void;
|
|
24
|
-
|
|
25
|
+
private getSelectedSize;
|
|
26
|
+
onStoreWatch(changes: IOnStoreChanged[]): void;
|
|
25
27
|
private updatePriceDisplay;
|
|
28
|
+
private updateFulfillmentText;
|
|
29
|
+
private updateImage;
|
|
30
|
+
private updatePersonalizeVisibility;
|
|
31
|
+
private updateAddToCartButton;
|
|
26
32
|
private getEngravingFee;
|
|
27
|
-
private formatPrice;
|
|
28
33
|
protected template(): HTMLElement[];
|
|
29
|
-
private createRetailersContent;
|
|
30
34
|
private createEngravingFormContent;
|
|
31
35
|
private renderPreCartContent;
|
|
32
36
|
private createDeliversToSectionWrapper;
|
|
@@ -35,10 +39,8 @@ export declare class ProductListProductPreCartComponent extends BaseComponent<IP
|
|
|
35
39
|
private createImageSection;
|
|
36
40
|
private createPricePersonalizationSection;
|
|
37
41
|
private createDeliversToSection;
|
|
38
|
-
private createSizesSection;
|
|
39
42
|
private createFulfillmentSectionWrapper;
|
|
40
|
-
createFulfillmentTextSection
|
|
43
|
+
private createFulfillmentTextSection;
|
|
41
44
|
private createAddToCartSection;
|
|
42
45
|
private handleAddToCart;
|
|
43
|
-
private createExpectationArrivalInfoSection;
|
|
44
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,77 +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
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;
|
|
75
|
-
saveEngravingLines: (productId: string, engravingLines: string[]) => void;
|
|
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;
|
|
76
30
|
}
|
|
77
|
-
export {};
|
|
@@ -2,6 +2,7 @@ import type { IProductListComponent } from 'interfaces/configs';
|
|
|
2
2
|
import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
|
|
3
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,10 +1,9 @@
|
|
|
1
|
-
import type { IUserProducts } from 'core/store/interfaces/product-list.interface';
|
|
2
1
|
import { BaseComponent } from '@/core/base-component.service';
|
|
3
2
|
import type { IProductComponent } from '@/interfaces/configs';
|
|
4
3
|
export interface IEngravingViewComponentParams {
|
|
5
4
|
identifier: string;
|
|
6
5
|
context: 'cart' | 'checkout' | 'product-list';
|
|
7
|
-
|
|
6
|
+
slug?: string;
|
|
8
7
|
productListMaxLines?: number;
|
|
9
8
|
productListMaxCharsPerLine?: number;
|
|
10
9
|
productListLocation?: 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,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/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "LiquidCommerce Elements SDK",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"author": "LiquidCommerce Team",
|
|
6
|
-
"version": "2.6.0-beta.
|
|
6
|
+
"version": "2.6.0-beta.47",
|
|
7
7
|
"homepage": "https://docs.liquidcommerce.co/elements-sdk",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -56,15 +56,15 @@
|
|
|
56
56
|
"scripts": {
|
|
57
57
|
"build": "rollup -c",
|
|
58
58
|
"build:checkout": "rollup -c rollup.config.checkout.mjs",
|
|
59
|
-
"build:
|
|
59
|
+
"build:all": "pnpm build && pnpm build:checkout",
|
|
60
60
|
"dev": "rollup -c -w",
|
|
61
61
|
"type-check": "tsc --noEmit",
|
|
62
62
|
"lint": "pnpm biome lint --write",
|
|
63
63
|
"format": "biome format --write",
|
|
64
64
|
"check": "pnpm biome check --write .",
|
|
65
|
-
"fl": "pnpm check && pnpm
|
|
65
|
+
"fl": "pnpm check && pnpm tsc --noEmit",
|
|
66
66
|
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
|
|
67
|
-
"clean": "rm -rf dist umd node_modules && pnpm install && pnpm build
|
|
67
|
+
"clean": "rm -rf dist umd node_modules && pnpm install && pnpm build:all",
|
|
68
68
|
"prepublishOnly": "pnpm run build",
|
|
69
69
|
"deprecate:old": "npm deprecate @liquidcommerceteam/elements-sdk@\"*\" \"Package moved to @liquidcommerce/elements-sdk\"",
|
|
70
70
|
"prepare": "husky"
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"embeddable commerce"
|
|
82
82
|
],
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@biomejs/biome": "2.3.
|
|
84
|
+
"@biomejs/biome": "^2.3.14",
|
|
85
85
|
"@commitlint/cli": "^20.4.1",
|
|
86
86
|
"@commitlint/config-conventional": "^20.4.1",
|
|
87
87
|
"@rollup/plugin-alias": "^6.0.0",
|
|
@@ -93,11 +93,11 @@
|
|
|
93
93
|
"@semantic-release/changelog": "^6.0.3",
|
|
94
94
|
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
95
95
|
"@semantic-release/git": "^10.0.1",
|
|
96
|
-
"@semantic-release/github": "^12.0.
|
|
97
|
-
"@semantic-release/npm": "^13.1.
|
|
96
|
+
"@semantic-release/github": "^12.0.5",
|
|
97
|
+
"@semantic-release/npm": "^13.1.4",
|
|
98
98
|
"@semantic-release/release-notes-generator": "^14.1.0",
|
|
99
99
|
"@types/core-js": "^2.5.8",
|
|
100
|
-
"@types/node": "^25.2.
|
|
100
|
+
"@types/node": "^25.2.3",
|
|
101
101
|
"conventional-changelog-cli": "^5.0.0",
|
|
102
102
|
"husky": "^9.1.7",
|
|
103
103
|
"process": "^0.11.10",
|
package/dist/types/modules/product-list/components/card-components/product-fulfillments.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { IProductFulfillmentStore } from 'core/store/interfaces/product.interface';
|
|
2
|
-
import { type NavigationSourceType } from 'enums';
|
|
3
|
-
export interface IFulfillmentSectionParams {
|
|
4
|
-
shippingVariants: Record<string, IProductFulfillmentStore>;
|
|
5
|
-
onDemandVariants: Record<string, IProductFulfillmentStore>;
|
|
6
|
-
enableShippingFulfillment: boolean;
|
|
7
|
-
enableOnDemandFulfillment: boolean;
|
|
8
|
-
productId: string;
|
|
9
|
-
navigationSource?: NavigationSourceType;
|
|
10
|
-
onDeliveryOptionsClick: (productId: string) => void | Promise<void>;
|
|
11
|
-
}
|
|
12
|
-
export declare const createFulfillmentSection: (params: IFulfillmentSectionParams) => HTMLElement;
|