@liquidcommerce/elements-sdk 2.2.0-beta.24 → 2.2.0-beta.26
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 +72 -15
- package/dist/index.esm.js +8452 -8578
- package/dist/types/core/command/common-command.service.d.ts +2 -0
- package/dist/types/core/pubsub/interfaces/core.interface.d.ts +2 -3
- package/dist/types/core/pubsub/interfaces/product.interface.d.ts +0 -5
- package/dist/types/core/store/interfaces/product.interface.d.ts +0 -1
- package/dist/types/enums/core.enum.d.ts +0 -2
- package/dist/types/modules/cart/components/cart-footer.component.d.ts +1 -0
- package/dist/types/modules/cart/components/cart-item.component.d.ts +2 -6
- package/dist/types/modules/checkout/checkout.commands.d.ts +2 -1
- package/dist/types/modules/checkout/components/summary/checkout-item-quantity.component.d.ts +0 -2
- package/dist/types/modules/checkout/components/summary/checkout-item.component.d.ts +2 -1
- package/dist/types/modules/product/components/index.d.ts +1 -1
- package/dist/types/modules/product/product.commands.d.ts +0 -1
- package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +13 -10
- package/dist/types/modules/ui-components/engraving/engraving-view.component.d.ts +4 -9
- package/docs/ACTIONS.md +1235 -0
- package/docs/BROWSER_SUPPORT.md +279 -0
- package/docs/CONFIGURATION.md +613 -0
- package/docs/DOCUMENTATION_INDEX.md +311 -0
- package/docs/EVENTS.md +532 -0
- package/docs/PROXY.md +228 -0
- package/docs/THEMING.md +592 -0
- package/docs/TROUBLESHOOTING.md +755 -0
- package/package.json +10 -10
- package/umd/elements.js +1 -1
- package/dist/types/modules/product/components/product-engraving.component.d.ts +0 -19
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { ICart } from '@/interfaces/cloud';
|
|
1
2
|
import { BaseCommand } from './base-command.service';
|
|
2
3
|
export declare class CommonCommands extends BaseCommand {
|
|
3
4
|
static getInstance(): CommonCommands;
|
|
5
|
+
syncCartFromResponse(cartApi: ICart, publishEvent?: boolean): void;
|
|
4
6
|
loadCart(): Promise<void>;
|
|
5
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAddressActionEventData, ICartFailedEventData, ICartItemAddedEventData, ICartItemEngravingUpdatedEventData, ICartItemQuantityChangedEventData, ICartItemRemovedEventData, ICartLoadedEventData, ICartProductAddEventData, ICartProductAddFailedEventData, ICartPromoCodeEventData, ICartPromoCodeFailedEventData, ICartUpdatedEventData, ICheckoutFailedEventData, ICheckoutFormUpdatedEventData, ICheckoutGiftCardEventData, ICheckoutGiftCardFailedEventData, ICheckoutItemEngravingUpdatedEventData, ICheckoutItemQuantityChangedEventData, ICheckoutItemRemovedEventData, ICheckoutLoadedEventData, ICheckoutMarketingPreferencesToggleEventData, ICheckoutProductAddEventData, ICheckoutProductAddFailedEventData, ICheckoutPromoCodeEventData, ICheckoutPromoCodeFailedEventData, ICheckoutSubmitCompletedEventData, ICheckoutSubmitFailedEventData, ICheckoutSubmitStartedEventData, ICheckoutTipUpdatedEventData, ICheckoutToggleEventData, IElementsClientIsReadyEventData, IProductAddToCartEventData,
|
|
1
|
+
import type { IAddressActionEventData, ICartFailedEventData, ICartItemAddedEventData, ICartItemEngravingUpdatedEventData, ICartItemQuantityChangedEventData, ICartItemRemovedEventData, ICartLoadedEventData, ICartProductAddEventData, ICartProductAddFailedEventData, ICartPromoCodeEventData, ICartPromoCodeFailedEventData, ICartUpdatedEventData, ICheckoutFailedEventData, ICheckoutFormUpdatedEventData, ICheckoutGiftCardEventData, ICheckoutGiftCardFailedEventData, ICheckoutItemEngravingUpdatedEventData, ICheckoutItemQuantityChangedEventData, ICheckoutItemRemovedEventData, ICheckoutLoadedEventData, ICheckoutMarketingPreferencesToggleEventData, ICheckoutProductAddEventData, ICheckoutProductAddFailedEventData, ICheckoutPromoCodeEventData, ICheckoutPromoCodeFailedEventData, ICheckoutSubmitCompletedEventData, ICheckoutSubmitFailedEventData, ICheckoutSubmitStartedEventData, ICheckoutTipUpdatedEventData, ICheckoutToggleEventData, IElementsClientIsReadyEventData, IProductAddToCartEventData, IProductFulfillmentChangedEventData, IProductFulfillmentTypeChangedEventData, IProductLoadedEventData, IProductQuantityChangedEventData, IProductSizeChangedEventData } from '@/core/pubsub';
|
|
2
2
|
import { ELEMENTS_ACTIONS_EVENT } from '@/enums';
|
|
3
3
|
export interface IEventMetadata {
|
|
4
4
|
eventId: string;
|
|
@@ -21,7 +21,6 @@ export interface IElementsActionsEventsMap {
|
|
|
21
21
|
[ELEMENTS_ACTIONS_EVENT.PRODUCT_SIZE_CHANGED]: IProductSizeChangedEventData;
|
|
22
22
|
[ELEMENTS_ACTIONS_EVENT.PRODUCT_FULFILLMENT_TYPE_CHANGED]: IProductFulfillmentTypeChangedEventData;
|
|
23
23
|
[ELEMENTS_ACTIONS_EVENT.PRODUCT_FULFILLMENT_CHANGED]: IProductFulfillmentChangedEventData;
|
|
24
|
-
[ELEMENTS_ACTIONS_EVENT.PRODUCT_ENGRAVING_UPDATED]: IProductEngravingUpdatedEventData;
|
|
25
24
|
[ELEMENTS_ACTIONS_EVENT.CART_CLOSED]: boolean;
|
|
26
25
|
[ELEMENTS_ACTIONS_EVENT.CART_OPENED]: boolean;
|
|
27
26
|
[ELEMENTS_ACTIONS_EVENT.CART_UPDATED]: ICartUpdatedEventData;
|
|
@@ -71,7 +70,7 @@ export interface IElementsActionsEventsMap {
|
|
|
71
70
|
export type SpecificActionEvent = keyof IElementsActionsEventsMap;
|
|
72
71
|
export interface IFormEventData {
|
|
73
72
|
fieldName: string;
|
|
74
|
-
fieldValue
|
|
73
|
+
fieldValue?: string;
|
|
75
74
|
}
|
|
76
75
|
export interface IElementsFormsEventsMap {
|
|
77
76
|
customer: IFormEventData;
|
|
@@ -84,8 +84,3 @@ export interface IProductFulfillmentChangedEventData {
|
|
|
84
84
|
previousFulfillmentId: string;
|
|
85
85
|
previousFulfillmentType: FulfillmentType;
|
|
86
86
|
}
|
|
87
|
-
export interface IProductEngravingUpdatedEventData {
|
|
88
|
-
identifier: string;
|
|
89
|
-
engravingLines: string[];
|
|
90
|
-
previousEngravingLines: string[];
|
|
91
|
-
}
|
|
@@ -14,7 +14,6 @@ export declare const ELEMENTS_ACTIONS_EVENT: {
|
|
|
14
14
|
readonly PRODUCT_SIZE_CHANGED: "product_size_changed";
|
|
15
15
|
readonly PRODUCT_FULFILLMENT_TYPE_CHANGED: "product_fulfillment_type_changed";
|
|
16
16
|
readonly PRODUCT_FULFILLMENT_CHANGED: "product_fulfillment_changed";
|
|
17
|
-
readonly PRODUCT_ENGRAVING_UPDATED: "product_engraving_updated";
|
|
18
17
|
readonly CART_LOADED: "cart_loaded";
|
|
19
18
|
readonly CART_CLOSED: "cart_closed";
|
|
20
19
|
readonly CART_OPENED: "cart_opened";
|
|
@@ -94,7 +93,6 @@ export declare const COMPONENT_TYPE: {
|
|
|
94
93
|
readonly PRODUCT_ADD_TO_CART_SECTION: "product-add-to-cart-section";
|
|
95
94
|
readonly PRODUCT_DRAWER: "product-drawer";
|
|
96
95
|
readonly PRODUCT_LOADING: "product-loading";
|
|
97
|
-
readonly PRODUCT_ENGRAVING: "product-engraving";
|
|
98
96
|
readonly CART: "cart";
|
|
99
97
|
readonly CART_RETAILER: "cart-retailer";
|
|
100
98
|
readonly CART_ITEM: "cart-item";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseComponent
|
|
1
|
+
import { BaseComponent } from '@/core/base-component.service';
|
|
2
2
|
export interface ICartItemComponentParams {
|
|
3
3
|
itemId: string;
|
|
4
4
|
}
|
|
@@ -6,10 +6,6 @@ export declare class CartItemComponent extends BaseComponent<ICartItemComponentP
|
|
|
6
6
|
get hostClasses(): string[];
|
|
7
7
|
get hostAttributes(): Record<string, string>;
|
|
8
8
|
constructor();
|
|
9
|
-
private
|
|
10
|
-
onStoreChanged(changes: IOnStoreChanged[]): boolean | undefined;
|
|
11
|
-
private handleEngravingElement;
|
|
12
|
-
private updateShippingTime;
|
|
9
|
+
private handleOpenEngravingForm;
|
|
13
10
|
protected template(): HTMLElement[];
|
|
14
|
-
afterRender(): void;
|
|
15
11
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from '@/core/command/base-command.service';
|
|
2
2
|
import type { ICheckoutItemStore, ICheckoutStripeFormStatusStore } from '@/core/store';
|
|
3
|
-
import type { ICheckoutFulfillment, ICheckoutItem, ICheckoutPrepareResponse, ICheckoutRetailer } from '@/interfaces/cloud';
|
|
3
|
+
import type { ICart, ICheckoutFulfillment, ICheckoutItem, ICheckoutPrepareResponse, ICheckoutRetailer } from '@/interfaces/cloud';
|
|
4
4
|
import type { BillingFieldName, CustomerFieldName, GiftFieldName } from '@/modules/checkout/components/checkout.type';
|
|
5
5
|
export declare function buildCheckoutItemStore(apiItem: ICheckoutItem, retailer: ICheckoutRetailer, fulfillment: ICheckoutFulfillment): ICheckoutItemStore;
|
|
6
6
|
export declare class CheckoutCommands extends BaseCommand {
|
|
@@ -13,6 +13,7 @@ export declare class CheckoutCommands extends BaseCommand {
|
|
|
13
13
|
partialLoadCheckout(params?: {
|
|
14
14
|
cartId?: string;
|
|
15
15
|
response?: ICheckoutPrepareResponse;
|
|
16
|
+
cartResponse?: ICart;
|
|
16
17
|
}): Promise<void>;
|
|
17
18
|
toggleIsGift(active?: boolean): Promise<void>;
|
|
18
19
|
toggleBillingSameAsShipping(active?: boolean): Promise<void>;
|
package/dist/types/modules/checkout/components/summary/checkout-item-quantity.component.d.ts
CHANGED
|
@@ -9,11 +9,9 @@ export declare class CheckoutItemQuantityComponent extends BaseComponent<IChecko
|
|
|
9
9
|
get hostClasses(): string[];
|
|
10
10
|
constructor();
|
|
11
11
|
onStoreWatch(changes: IOnStoreChanged[]): void;
|
|
12
|
-
private getCheckoutItemStore;
|
|
13
12
|
private getAvailableQuantity;
|
|
14
13
|
private calculateQuantityLimits;
|
|
15
14
|
private updateButtonStates;
|
|
16
15
|
private handleQuantityChange;
|
|
17
|
-
private createQuantityContainer;
|
|
18
16
|
protected template(): HTMLElement[];
|
|
19
17
|
}
|
|
@@ -6,7 +6,8 @@ export declare class CheckoutItemComponent extends BaseComponent<ICheckoutItemCo
|
|
|
6
6
|
private trashButton;
|
|
7
7
|
get hostClasses(): string[];
|
|
8
8
|
constructor();
|
|
9
|
-
|
|
9
|
+
onStoreChanged(changes: IOnStoreChanged[]): boolean | undefined;
|
|
10
|
+
private updateEngravingElement;
|
|
10
11
|
private setupMinimumPurchaseAlert;
|
|
11
12
|
private updateTrashButtonState;
|
|
12
13
|
private createLoadingOverlay;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
export * from '../../ui-components/engraving/engraving-form.component';
|
|
1
2
|
export * from '../../ui-components/engraving/engraving-view.component';
|
|
2
3
|
export * from './components';
|
|
3
4
|
export * from './product-add-to-cart-section.component';
|
|
4
5
|
export * from './product-description.component';
|
|
5
6
|
export * from './product-drawer.component';
|
|
6
|
-
export * from './product-engraving.component';
|
|
7
7
|
export * from './product-image-carousel.component';
|
|
8
8
|
export * from './product-interactions.component';
|
|
9
9
|
export * from './product-options.component';
|
|
@@ -18,7 +18,6 @@ export declare class ProductCommands extends BaseCommand {
|
|
|
18
18
|
updateQuantity(productId: string, delta: number): Promise<void>;
|
|
19
19
|
changeFulfillmentType(productId: string, selectedFulfillmentType: FulfillmentType): Promise<void>;
|
|
20
20
|
removeProduct(productId: string): Promise<void>;
|
|
21
|
-
updateEngravingLines(productId: string, engravingLines: string[]): Promise<void>;
|
|
22
21
|
openProductDrawer(productId: string, contentType: IProductDrawerContentConfig['type'], data?: Record<string, any>): Promise<void>;
|
|
23
22
|
closeProductDrawer(productId: string): Promise<void>;
|
|
24
23
|
rerenderAllProducts(): Promise<void>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseComponent } from '@/core/base-component.service';
|
|
2
2
|
export interface IEngravingFormComponentParams {
|
|
3
3
|
identifier: string;
|
|
4
|
-
context: 'product' | 'cart'
|
|
4
|
+
context: 'product' | 'cart';
|
|
5
5
|
lines: string[];
|
|
6
6
|
maxLines: number;
|
|
7
7
|
maxCharsPerLine: number;
|
|
@@ -9,15 +9,18 @@ export interface IEngravingFormComponentParams {
|
|
|
9
9
|
location?: string;
|
|
10
10
|
}
|
|
11
11
|
export declare class EngravingFormComponent extends BaseComponent<IEngravingFormComponentParams, null> {
|
|
12
|
-
private inputs;
|
|
13
|
-
private charCountElements;
|
|
14
12
|
get hostClasses(): string[];
|
|
15
|
-
|
|
16
|
-
private
|
|
17
|
-
private
|
|
18
|
-
private
|
|
19
|
-
private
|
|
20
|
-
|
|
21
|
-
private
|
|
13
|
+
private engravingLines;
|
|
14
|
+
private productPriceSpan;
|
|
15
|
+
private addToCartButton;
|
|
16
|
+
private fulfillmentId;
|
|
17
|
+
private partNumber;
|
|
18
|
+
beforeConnected(): void;
|
|
19
|
+
private calculateTotalPrice;
|
|
20
|
+
private productInformationSection;
|
|
21
|
+
private addToCartButtonText;
|
|
22
|
+
private retailersSection;
|
|
23
|
+
private engravingLinesSection;
|
|
24
|
+
private actionButtonsSection;
|
|
22
25
|
protected template(): HTMLElement[];
|
|
23
26
|
}
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
-
import type { StorePaths } from '@/core/store';
|
|
3
2
|
import type { IProductComponent } from '@/interfaces/configs';
|
|
4
3
|
export interface IEngravingViewComponentParams {
|
|
5
4
|
identifier: string;
|
|
6
|
-
context: '
|
|
7
|
-
watchStorePaths?: StorePaths[];
|
|
5
|
+
context: 'cart' | 'checkout';
|
|
8
6
|
}
|
|
9
7
|
export declare class EngravingViewComponent extends BaseComponent<IEngravingViewComponentParams, IProductComponent> {
|
|
10
8
|
get hostClasses(): string[];
|
|
11
|
-
|
|
12
|
-
private createEngravingFormParams;
|
|
13
|
-
private openEngravingDrawer;
|
|
14
|
-
private createEngravingContainer;
|
|
15
|
-
private isEngravingAvailable;
|
|
16
|
-
private engravingFee;
|
|
9
|
+
private engravingQuantityFee;
|
|
17
10
|
private engravingLines;
|
|
11
|
+
private handleEdit;
|
|
12
|
+
private handleRemove;
|
|
18
13
|
protected template(): HTMLElement | HTMLElement[] | string;
|
|
19
14
|
}
|