@liquidcommerce/elements-sdk 2.5.11 → 2.6.0-beta.10
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 -0
- package/dist/index.esm.js +10852 -10205
- package/dist/types/constants/core.constant.d.ts +11 -0
- package/dist/types/core/{api-client.service.d.ts → api/api-client.service.d.ts} +13 -13
- package/dist/types/core/{auth.service.d.ts → api/auth-client.service.d.ts} +5 -16
- package/dist/types/core/api/http-client.service.d.ts +45 -0
- package/dist/types/core/client/client-action.service.d.ts +18 -11
- package/dist/types/core/client/client-config.service.d.ts +3 -0
- package/dist/types/core/command/base-command.service.d.ts +3 -3
- package/dist/types/core/command/common-command.service.d.ts +2 -1
- package/dist/types/core/debug-panel/debug-panel.styles.d.ts +1 -1
- package/dist/types/core/google-tag-manager.service.d.ts +12 -10
- package/dist/types/core/pubsub/interfaces/address.interface.d.ts +3 -12
- package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +26 -63
- package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +11 -1
- package/dist/types/core/pubsub/interfaces/product.interface.d.ts +16 -81
- package/dist/types/core/store/interfaces/address.interface.d.ts +3 -12
- package/dist/types/core/store/interfaces/cart.interface.d.ts +16 -54
- package/dist/types/core/store/interfaces/checkout.interface.d.ts +4 -2
- package/dist/types/core/store/interfaces/core.interface.d.ts +5 -4
- package/dist/types/core/store/interfaces/product.interface.d.ts +12 -66
- package/dist/types/core/store/store.constant.d.ts +1 -1
- package/dist/types/core/telemetry/telemetry.interface.d.ts +0 -1
- package/dist/types/elements-base-client.d.ts +4 -4
- package/dist/types/enums/cloud.enum.d.ts +20 -0
- package/dist/types/enums/core.enum.d.ts +1 -0
- package/dist/types/interfaces/api/address.interface.d.ts +28 -0
- package/dist/types/interfaces/api/cart.interface.d.ts +91 -0
- package/dist/types/interfaces/api/product-list.interface.d.ts +30 -0
- package/dist/types/interfaces/api/product.interface.d.ts +106 -0
- package/dist/types/interfaces/cloud/checkout.interface.d.ts +14 -10
- package/dist/types/interfaces/cloud/index.d.ts +0 -4
- package/dist/types/interfaces/cloud/retailer.interface.d.ts +2 -2
- package/dist/types/interfaces/configs/configurations.interface.d.ts +5 -5
- package/dist/types/interfaces/configs/global.interface.d.ts +1 -0
- package/dist/types/interfaces/configs/product.interface.d.ts +1 -0
- package/dist/types/interfaces/core.interface.d.ts +1 -0
- package/dist/types/modules/address/address.command.d.ts +2 -3
- package/dist/types/modules/address/address.interface.d.ts +0 -7
- package/dist/types/modules/cart/cart.commands.d.ts +0 -1
- package/dist/types/modules/cart/components/cart-body.component.d.ts +2 -1
- package/dist/types/modules/cart/components/cart-footer.component.d.ts +0 -1
- package/dist/types/modules/cart/components/cart-fulfillment.component.d.ts +0 -2
- package/dist/types/modules/product/components/components.d.ts +2 -4
- package/dist/types/modules/product/product.commands.d.ts +2 -2
- package/dist/types/modules/product-list/components/index.d.ts +2 -0
- package/dist/types/modules/product-list/components/product-list-card.component.d.ts +3 -2
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/index.d.ts +6 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-apply-filter-button.component.d.ts +1 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-checkbox-filter.components.d.ts +7 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-delivery-options-filter.components.d.ts +16 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-price-filter.components.d.ts +22 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-search.component.d.ts +16 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-toggle-filters.components.d.ts +18 -0
- package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +27 -5
- package/dist/types/modules/product-list/product-list.commands.d.ts +3 -2
- package/dist/types/modules/product-list/product-list.component.d.ts +13 -5
- package/dist/types/modules/product-list/product-list.interface.d.ts +77 -0
- package/dist/types/modules/ui-components/purchase-min-alert/index.d.ts +0 -1
- package/dist/types/static/icon/chevron-up.icon.d.ts +2 -0
- package/dist/types/static/icon/filter.icon.d.ts +2 -0
- package/dist/types/static/icon/index.d.ts +1 -0
- package/dist/types/utils/helper.d.ts +2 -1
- package/docs/THEMING.md +3 -0
- package/package.json +5 -6
- package/umd/elements.js +1 -1
- package/dist/types/core/utils.d.ts +0 -23
- package/dist/types/interfaces/cloud/address.interface.d.ts +0 -36
- package/dist/types/interfaces/cloud/cart.interface.d.ts +0 -132
- package/dist/types/interfaces/cloud/catalog.interface.d.ts +0 -43
- package/dist/types/interfaces/cloud/product.interface.d.ts +0 -158
- package/dist/types/modules/cart/cart.commands.helper.d.ts +0 -9
- package/dist/types/modules/product/utils/helpers.d.ts +0 -3
- package/dist/types/modules/product/utils/retailer-hours.d.ts +0 -9
- package/dist/types/modules/ui-components/purchase-min-alert/helpers.d.ts +0 -7
|
@@ -10,6 +10,17 @@ export declare const PRODUCT_LIST_FILTER_TYPES: {
|
|
|
10
10
|
PERSONALIZATION: string;
|
|
11
11
|
PRE_ORDER: string;
|
|
12
12
|
DELIVERY_OPTIONS: string;
|
|
13
|
+
PRICE: string;
|
|
14
|
+
BRANDS: string;
|
|
15
|
+
CATEGORIES: string;
|
|
16
|
+
FLAVOR: string;
|
|
17
|
+
REGION: string;
|
|
18
|
+
VARIETY: string;
|
|
19
|
+
VINTAGE: string;
|
|
20
|
+
COUNTRY: string;
|
|
21
|
+
APPELLATION: string;
|
|
22
|
+
MATERIALS: string;
|
|
23
|
+
SIZES: string;
|
|
13
24
|
};
|
|
14
25
|
export declare const Z_INDEX: {
|
|
15
26
|
readonly DRAWER_WRAPPER: 2147483640;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AuthClientService } from '@/core/api/auth-client.service';
|
|
2
2
|
import type { IPersistedStore } from '@/core/store/interfaces/core.interface';
|
|
3
|
-
import type { IAddressAutocompleteResult, IAddressDetailsResult,
|
|
3
|
+
import type { IAddressAutocompleteResult, IAddressDetailsResult, ILocation } from '@/interfaces/api/address.interface';
|
|
4
|
+
import type { ICart, ICartUpdateParams } from '@/interfaces/api/cart.interface';
|
|
5
|
+
import type { IProductAvailabilityResponse } from '@/interfaces/api/product.interface';
|
|
6
|
+
import type { IProductSearchParams, IProductSearchResponse } from '@/interfaces/api/product-list.interface';
|
|
7
|
+
import type { ICheckoutCompleteParams, ICheckoutCompleteResponse, ICheckoutPrepareParams, ICheckoutPrepareResponse, ILiquidPaymentToken } from '@/interfaces/cloud';
|
|
4
8
|
import type { IUserPaymentSession, IUserSession } from '@/interfaces/cloud/user.interface';
|
|
5
9
|
import type { IAllConfigs } from '@/interfaces/configs';
|
|
6
10
|
export declare class ApiClientService {
|
|
@@ -8,23 +12,19 @@ export declare class ApiClientService {
|
|
|
8
12
|
private readonly logger;
|
|
9
13
|
constructor();
|
|
10
14
|
static getInstance(): ApiClientService;
|
|
11
|
-
setClient(client:
|
|
15
|
+
setClient(client: AuthClientService): Promise<void>;
|
|
12
16
|
getAllConfigs(): Promise<IAllConfigs>;
|
|
13
17
|
setPersistedStore(userDeviceId: string, data: IPersistedStore): Promise<void>;
|
|
14
18
|
getPersistedStore(userDeviceId: string): Promise<IPersistedStore | null>;
|
|
15
19
|
deletePersistedStore(userDeviceId: string): Promise<void>;
|
|
16
|
-
|
|
17
|
-
getCartData(id: string | null): Promise<ICart>;
|
|
18
|
-
updateCart(params: ICartUpdateParams & {
|
|
19
|
-
loc?: ILoc;
|
|
20
|
-
}): Promise<ICart>;
|
|
21
|
-
getAddressSuggestions(query: string): Promise<IAddressAutocompleteResult[]>;
|
|
20
|
+
getAddressSuggestions(input: string): Promise<IAddressAutocompleteResult[]>;
|
|
22
21
|
getAddressDetails(id: string): Promise<IAddressDetailsResult>;
|
|
22
|
+
getProductsData(identifier: string[], location?: ILocation): Promise<IProductAvailabilityResponse | null>;
|
|
23
|
+
catalogSearch(params: IProductSearchParams): Promise<IProductSearchResponse>;
|
|
24
|
+
getCartData(id: string | null): Promise<ICart>;
|
|
25
|
+
updateCart(params: ICartUpdateParams): Promise<ICart>;
|
|
23
26
|
prepareCheckout(params: ICheckoutPrepareParams): Promise<ICheckoutPrepareResponse>;
|
|
24
27
|
getPaymentSession(params: IUserPaymentSession): Promise<IUserSession>;
|
|
25
28
|
confirmPaymentSession(confirmationTokenId: string, setupIntentId: string): Promise<ILiquidPaymentToken>;
|
|
26
|
-
checkoutComplete(params: Partial<ICheckoutCompleteParams>): Promise<ICheckoutCompleteResponse
|
|
27
|
-
catalogSearch(params: ICatalogParams): Promise<ICatalog>;
|
|
28
|
-
private validResponseData;
|
|
29
|
-
private ensureClientInitialized;
|
|
29
|
+
checkoutComplete(params: Partial<ICheckoutCompleteParams>): Promise<ICheckoutCompleteResponse>;
|
|
30
30
|
}
|
|
@@ -13,23 +13,14 @@ export interface IAuth {
|
|
|
13
13
|
exp: number;
|
|
14
14
|
type: 'ACCESS_TOKEN';
|
|
15
15
|
}
|
|
16
|
-
export interface IResponseMetadata {
|
|
17
|
-
languages: string[];
|
|
18
|
-
timestamp: number;
|
|
19
|
-
timezone: string;
|
|
20
|
-
requestId: string;
|
|
21
|
-
path: string;
|
|
22
|
-
version: string;
|
|
23
|
-
}
|
|
24
16
|
export interface IApiResponseBase {
|
|
25
|
-
statusCode: number;
|
|
26
17
|
message: string;
|
|
27
|
-
metadata: IResponseMetadata;
|
|
28
18
|
}
|
|
29
|
-
export
|
|
19
|
+
export interface IApiResponse<T> {
|
|
20
|
+
message: string;
|
|
30
21
|
data: T;
|
|
31
|
-
}
|
|
32
|
-
export declare class
|
|
22
|
+
}
|
|
23
|
+
export declare class AuthClientService {
|
|
33
24
|
private readonly apiKey;
|
|
34
25
|
private readonly baseUrl;
|
|
35
26
|
private readonly env;
|
|
@@ -40,7 +31,7 @@ export declare class AuthService {
|
|
|
40
31
|
private readonly logger;
|
|
41
32
|
private readonly clientConfig;
|
|
42
33
|
private constructor();
|
|
43
|
-
static getInstance(config: IAuthConfig):
|
|
34
|
+
static getInstance(config: IAuthConfig): AuthClientService;
|
|
44
35
|
authenticate(): Promise<boolean>;
|
|
45
36
|
isTokenExpired(): boolean;
|
|
46
37
|
private request;
|
|
@@ -48,6 +39,4 @@ export declare class AuthService {
|
|
|
48
39
|
private getProxyHeaders;
|
|
49
40
|
get<T = any>(path: string, options?: IHttpRequestOptions): Promise<T>;
|
|
50
41
|
post<T = any>(path: string, options?: IHttpRequestOptions): Promise<T>;
|
|
51
|
-
put<T = any>(path: string, options?: IHttpRequestOptions): Promise<T>;
|
|
52
|
-
delete<T = any>(path: string, options?: IHttpRequestOptions): Promise<T>;
|
|
53
42
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export type FetchFunction = typeof fetch;
|
|
2
|
+
export interface IHttpClientOptions {
|
|
3
|
+
method: string;
|
|
4
|
+
headers: Record<string, string>;
|
|
5
|
+
body?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ICustomResponse {
|
|
8
|
+
ok: boolean;
|
|
9
|
+
status: number;
|
|
10
|
+
statusText: string;
|
|
11
|
+
headers: Record<string, string>;
|
|
12
|
+
json: () => Promise<any>;
|
|
13
|
+
text: () => Promise<string>;
|
|
14
|
+
_bodyText?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface IRequestOptions {
|
|
17
|
+
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
18
|
+
headers?: Record<string, string>;
|
|
19
|
+
body?: any;
|
|
20
|
+
}
|
|
21
|
+
export interface IHttpRequestConfig {
|
|
22
|
+
url: string;
|
|
23
|
+
options: IHttpClientOptions;
|
|
24
|
+
retryConfig?: {
|
|
25
|
+
maxRetries: number;
|
|
26
|
+
retryDelay: number;
|
|
27
|
+
shouldRetry?: (error: any, response?: ICustomResponse) => boolean;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export declare class HttpClientService {
|
|
31
|
+
private readonly fetchImpl;
|
|
32
|
+
private readonly logger;
|
|
33
|
+
constructor();
|
|
34
|
+
request(config: IHttpRequestConfig): Promise<ICustomResponse>;
|
|
35
|
+
private defaultShouldRetry;
|
|
36
|
+
private logFailedResponse;
|
|
37
|
+
private logNetworkError;
|
|
38
|
+
private diagnosePossibleCauses;
|
|
39
|
+
private enhanceError;
|
|
40
|
+
private sanitizeHeaders;
|
|
41
|
+
private delay;
|
|
42
|
+
private getFetchImplementation;
|
|
43
|
+
private fetchAdapter;
|
|
44
|
+
private xhrFetch;
|
|
45
|
+
}
|
|
@@ -2,22 +2,19 @@ import type { IBaseCartEventData } from '@/core/pubsub/interfaces/cart.interface
|
|
|
2
2
|
import type { ICheckoutDetailsEventData } from '@/core/pubsub/interfaces/checkout.interface';
|
|
3
3
|
import type { IBaseProductEventData } from '@/core/pubsub/interfaces/product.interface';
|
|
4
4
|
import { type FulfillmentType } from '@/enums';
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
export interface
|
|
8
|
-
|
|
5
|
+
import type { IAddressAddress, IAddressCoordinates, IAddressData } from '@/interfaces/api/address.interface';
|
|
6
|
+
import type { BillingFieldName, CustomerFieldName, GiftFieldName } from '@/modules/checkout/components/checkout.type';
|
|
7
|
+
export interface IAddProductParams {
|
|
8
|
+
identifier: string;
|
|
9
|
+
fulfillmentType: FulfillmentType;
|
|
10
|
+
quantity: number;
|
|
9
11
|
}
|
|
10
12
|
export interface IAddressActions {
|
|
11
13
|
setAddressByPlacesId: (placesId: string) => Promise<void>;
|
|
12
|
-
setAddressManually: (address:
|
|
14
|
+
setAddressManually: (address: IAddressAddress, coordinates: IAddressCoordinates) => Promise<void>;
|
|
13
15
|
clear: () => Promise<void>;
|
|
14
16
|
getDetails: () => IAddressData | null;
|
|
15
17
|
}
|
|
16
|
-
export interface IAddProductParams {
|
|
17
|
-
identifier: string;
|
|
18
|
-
fulfillmentType: FulfillmentType;
|
|
19
|
-
quantity: number;
|
|
20
|
-
}
|
|
21
18
|
export interface ICartActions {
|
|
22
19
|
openCart: () => void;
|
|
23
20
|
closeCart: () => void;
|
|
@@ -40,9 +37,15 @@ export interface ICheckoutActions {
|
|
|
40
37
|
removeGiftCard: (code: string) => Promise<void>;
|
|
41
38
|
toggleIsGift: (active?: boolean) => Promise<void>;
|
|
42
39
|
toggleBillingSameAsShipping: (active?: boolean) => Promise<void>;
|
|
43
|
-
toggleMarketingPreferences: (field: 'canEmail' | 'canSms', active: boolean) => void
|
|
40
|
+
toggleMarketingPreferences: (field: 'canEmail' | 'canSms', active: boolean) => Promise<void>;
|
|
41
|
+
updateCustomerInfo: (params: Record<CustomerFieldName, string>) => void;
|
|
42
|
+
updateBillingInfo: (params: Record<BillingFieldName, string>) => void;
|
|
43
|
+
updateGiftInfo: (params: Record<GiftFieldName, string>) => void;
|
|
44
44
|
getDetails: () => ICheckoutDetailsEventData;
|
|
45
45
|
}
|
|
46
|
+
export interface IProductActions {
|
|
47
|
+
getDetails: (identifier: string) => IBaseProductEventData;
|
|
48
|
+
}
|
|
46
49
|
export declare class ClientActionService {
|
|
47
50
|
private readonly pubSub;
|
|
48
51
|
private readonly command;
|
|
@@ -50,6 +53,9 @@ export declare class ClientActionService {
|
|
|
50
53
|
private readonly api;
|
|
51
54
|
private readonly themeProvider;
|
|
52
55
|
private readonly logger;
|
|
56
|
+
private readonly allowedCustomerFields;
|
|
57
|
+
private readonly allowedBillingFields;
|
|
58
|
+
private readonly allowedGiftFields;
|
|
53
59
|
private pendingCartParams;
|
|
54
60
|
private pendingCartOpenFlag;
|
|
55
61
|
constructor();
|
|
@@ -58,6 +64,7 @@ export declare class ClientActionService {
|
|
|
58
64
|
private retryPendingCartOperation;
|
|
59
65
|
private clearPendingCartOperation;
|
|
60
66
|
private getLocation;
|
|
67
|
+
private normalizeCheckoutFieldValue;
|
|
61
68
|
private productActions;
|
|
62
69
|
private addressActions;
|
|
63
70
|
private cartActions;
|
|
@@ -20,6 +20,8 @@ export interface IClientConfigs {
|
|
|
20
20
|
clientPrepared: boolean;
|
|
21
21
|
promoTicker: IPromoTicker[] | null;
|
|
22
22
|
paymentMethodId?: string;
|
|
23
|
+
openShadowDom?: boolean;
|
|
24
|
+
hasCustomApiUrl?: boolean;
|
|
23
25
|
}
|
|
24
26
|
export interface IClientConfigInput {
|
|
25
27
|
env?: ElementsEnv;
|
|
@@ -31,6 +33,7 @@ export interface IClientConfigInput {
|
|
|
31
33
|
development?: {
|
|
32
34
|
customApiUrl?: string;
|
|
33
35
|
paymentMethodId?: string;
|
|
36
|
+
openShadowDom?: boolean;
|
|
34
37
|
};
|
|
35
38
|
}
|
|
36
39
|
export declare class ClientConfigService {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ApiClientService } from '@/core/api-client.service';
|
|
1
|
+
import { ApiClientService } from '@/core/api/api-client.service';
|
|
2
2
|
import { ClientConfigService } from '@/core/client/client-config.service';
|
|
3
3
|
import { GoogleTagManagerService } from '@/core/google-tag-manager.service';
|
|
4
4
|
import { LoggerFactory } from '@/core/logger/logger-factory';
|
|
5
5
|
import { PubSubService } from '@/core/pubsub/pubsub.service';
|
|
6
6
|
import { StoreService } from '@/core/store/store.service';
|
|
7
|
-
import type {
|
|
7
|
+
import type { ILocation } from '@/interfaces/api/address.interface';
|
|
8
8
|
import { ThemeProviderService } from '@/modules/theme-provider/theme-provider.service';
|
|
9
9
|
export declare abstract class BaseCommand {
|
|
10
10
|
protected store: StoreService;
|
|
@@ -15,5 +15,5 @@ export declare abstract class BaseCommand {
|
|
|
15
15
|
protected clientConfig: ClientConfigService;
|
|
16
16
|
protected themeProvider: ThemeProviderService;
|
|
17
17
|
constructor();
|
|
18
|
-
protected getLocation():
|
|
18
|
+
protected getLocation(): ILocation | undefined;
|
|
19
19
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { ICart } from '@/interfaces/
|
|
1
|
+
import type { ICart } from '@/interfaces/api/cart.interface';
|
|
2
2
|
import { BaseCommand } from './base-command.service';
|
|
3
3
|
export declare class CommonCommands extends BaseCommand {
|
|
4
4
|
static getInstance(): CommonCommands;
|
|
5
5
|
syncCartFromResponse(cartApi: ICart, publishEvent?: boolean): void;
|
|
6
|
+
private buildCartLoadedEventData;
|
|
6
7
|
loadCart(): Promise<void>;
|
|
7
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const DEBUG_PANEL_STYLES = "\n :host {\n position: fixed;\n z-index: 2147483647;\n display: block;\n }\n\n .panel {\n position: relative;\n background: rgba(15, 23, 42, 0.95);\n backdrop-filter: blur(10px);\n border: 1px solid rgba(148, 163, 184, 0.2);\n border-radius: 12px;\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);\n font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;\n font-size: 12px;\n color: #e2e8f0;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n user-select: none;\n transition: all 0.2s ease;\n width: 100%;\n height: 100%;\n }\n\n .panel:hover {\n border-color: rgba(148, 163, 184, 0.4);\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);\n }\n\n .header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px 16px;\n border-bottom: 1px solid rgba(148, 163, 184, 0.2);\n background: rgba(30, 41, 59, 0.5);\n cursor: move;\n }\n\n .icon {\n font-size: 14px;\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 20px;\n }\n\n .title-container {\n display: flex;\n flex-direction: column;\n
|
|
1
|
+
export declare const DEBUG_PANEL_STYLES = "\n :host {\n position: fixed;\n z-index: 2147483647;\n display: block;\n }\n\n .panel {\n position: relative;\n background: rgba(15, 23, 42, 0.95);\n backdrop-filter: blur(10px);\n border: 1px solid rgba(148, 163, 184, 0.2);\n border-radius: 12px;\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);\n font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;\n font-size: 12px;\n color: #e2e8f0;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n user-select: none;\n transition: all 0.2s ease;\n width: 100%;\n height: 100%;\n }\n\n .panel:hover {\n border-color: rgba(148, 163, 184, 0.4);\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);\n }\n\n .header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px 16px;\n border-bottom: 1px solid rgba(148, 163, 184, 0.2);\n background: rgba(30, 41, 59, 0.5);\n cursor: move;\n }\n\n .icon {\n font-size: 14px;\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 20px;\n }\n\n .title-container {\n display: flex;\n flex-direction: column;\n flex: 1;\n margin: 0 12px;\n }\n \n .title-container > *:not(:first-child) {\n margin-top: 2px;\n }\n\n .title {\n font-weight: 600;\n color: #f1f5f9;\n font-size: 13px;\n }\n\n\n .subtitle {\n font-size: 10px;\n color: #94a3b8;\n }\n\n .minimize {\n background: none;\n border: none;\n color: #94a3b8;\n font-size: 18px;\n cursor: pointer;\n padding: 4px;\n border-radius: 4px;\n transition: all 0.2s ease;\n line-height: 1;\n font-weight: bold;\n }\n\n .minimize:hover {\n background: rgba(148, 163, 184, 0.1);\n color: #cbd5e1;\n }\n\n .toggles {\n display: flex;\n padding: 8px 16px;\n border-bottom: 1px solid rgba(148, 163, 184, 0.2);\n background: rgba(30, 41, 59, 0.3);\n align-items: center;\n }\n\n .toggles > *:not(:last-child) {\n margin-right: 12px;\n }\n\n .toggle {\n display: flex;\n align-items: center;\n cursor: pointer;\n font-size: 11px;\n color: #cbd5e1;\n transition: color 0.2s ease;\n }\n \n .toggle > *:not(:last-child) {\n margin-right: 6px;\n }\n\n .toggle:hover {\n color: #f1f5f9;\n }\n\n .toggle input[type=\"checkbox\"] {\n width: 12px;\n height: 12px;\n accent-color: #3b82f6;\n cursor: pointer;\n }\n\n .clear-btn {\n background: none;\n border: none;\n color: #ef4444;\n font-size: 14px;\n padding: 0;\n cursor: pointer;\n transition: all 0.2s ease;\n margin-left: auto;\n min-width: 20px;\n height: 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .clear-btn:hover {\n transform: scale(1.1);\n color: #dc2626;\n }\n\n .logs {\n flex: 1;\n overflow-y: auto;\n overflow-x: hidden;\n padding: 8px;\n background: rgba(15, 23, 42, 0.8);\n min-height: 0;\n max-height: 100%;\n }\n\n .log-entry {\n display: flex;\n align-items: flex-start;\n padding: 8px 12px;\n margin-bottom: 2px;\n border-radius: 6px;\n font-size: 11px;\n line-height: 1.4;\n transition: background-color 0.2s ease;\n user-select: text;\n }\n \n .log-entry > *:not(:last-child) {\n margin-right: 8px;\n }\n\n .log-entry:hover {\n background-color: rgba(148, 163, 184, 0.1);\n }\n\n /* Event type background colors */\n .log-entry.event {\n background: rgba(59, 130, 246, 0.1);\n }\n\n .log-entry.action {\n background: rgba(16, 185, 129, 0.1);\n }\n\n .log-entry.gtm {\n background: rgba(245, 158, 11, 0.1);\n }\n\n .log-entry.logger {\n background: rgba(139, 92, 246, 0.1);\n }\n\n\n .log-meta {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n min-width: 50px;\n }\n \n .log-meta > *:not(:first-child) {\n margin-top: 2px;\n }\n\n .log-type {\n font-weight: 600;\n font-size: 9px;\n padding: 2px 0;\n border-radius: 3px;\n white-space: nowrap;\n text-align: center;\n line-height: 1;\n font-weight: bold;\n letter-spacing: 0.5px;\n }\n\n .log-timestamp {\n color: #64748b;\n font-size: 9px;\n white-space: nowrap;\n line-height: 1;\n }\n\n .log-type.event {\n background: rgba(59, 130, 246, 0.2);\n color: #60a5fa;\n }\n\n .log-type.action {\n color: #34d399;\n }\n\n .log-type.gtm {\n color: #fbbf24;\n }\n\n .log-type.logger {\n color: #a78bfa;\n }\n\n .log-message {\n flex: 1;\n word-break: break-word;\n user-select: text;\n }\n\n .log-context {\n color: #94a3b8;\n font-size: 10px;\n margin-top: 2px;\n font-style: italic;\n }\n\n .log-data {\n background: rgba(30, 41, 59, 0.6);\n border: 1px solid rgba(148, 163, 184, 0.2);\n border-radius: 4px;\n padding: 8px;\n margin-top: 6px;\n font-size: 10px;\n color: #cbd5e1;\n max-height: 120px;\n overflow-y: auto;\n font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;\n user-select: text;\n }\n\n .log-data pre {\n margin: 0;\n white-space: pre-wrap;\n word-break: break-word;\n }\n\n .resize-handle {\n position: absolute;\n bottom: 0;\n right: 0;\n width: 12px;\n height: 12px;\n background: linear-gradient(-45deg, transparent 30%, rgba(148, 163, 184, 0.3) 30%, rgba(148, 163, 184, 0.3) 70%, transparent 70%);\n cursor: nw-resize;\n border-radius: 0 0 12px 0;\n }\n\n .resize-handle:hover {\n background: linear-gradient(-45deg, transparent 30%, rgba(148, 163, 184, 0.7) 30%, rgba(148, 163, 184, 0.7) 70%, transparent 70%);\n transform: scale(1.1);\n }\n\n .resize-handle:active {\n background: linear-gradient(-45deg, transparent 30%, rgba(148, 163, 184, 0.9) 30%, rgba(148, 163, 184, 0.9) 70%, transparent 70%);\n }\n\n /* Scrollbar styling */\n .logs::-webkit-scrollbar {\n width: 6px;\n }\n\n .logs::-webkit-scrollbar-track {\n background: rgba(30, 41, 59, 0.3);\n border-radius: 3px;\n }\n\n .logs::-webkit-scrollbar-thumb {\n background: rgba(148, 163, 184, 0.3);\n border-radius: 3px;\n }\n\n .logs::-webkit-scrollbar-thumb:hover {\n background: rgba(148, 163, 184, 0.5);\n }\n\n .log-data::-webkit-scrollbar {\n width: 4px;\n }\n\n .log-data::-webkit-scrollbar-track {\n background: rgba(30, 41, 59, 0.3);\n border-radius: 2px;\n }\n\n .log-data::-webkit-scrollbar-thumb {\n background: rgba(148, 163, 184, 0.3);\n border-radius: 2px;\n }\n\n .log-data::-webkit-scrollbar-thumb:hover {\n background: rgba(148, 163, 184, 0.5);\n }\n\n /* Floating button styles */\n .floating-btn {\n position: absolute;\n top: 20px;\n left: 20px;\n width: 40px;\n height: 40px;\n background: rgba(15, 23, 42, 0.95);\n border: 1px solid rgba(148, 163, 184, 0.2);\n border-radius: 50%;\n display: none;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n font-size: 18px;\n user-select: none;\n z-index: 1;\n }\n\n .floating-btn:hover {\n background: rgba(30, 41, 59, 0.95);\n border-color: rgba(148, 163, 184, 0.4);\n }\n\n /* Mobile Responsiveness */\n @media (max-width: 768px) {\n .panel {\n font-size: 11px;\n border-radius: 8px;\n }\n\n .header {\n padding: 8px 12px;\n }\n\n .title {\n font-size: 12px;\n }\n\n .subtitle {\n font-size: 9px;\n }\n\n .toggles {\n padding: 6px 12px;\n flex-wrap: wrap;\n }\n \n .toggles > *:not(:last-child) {\n margin-right: 8px;\n }\n\n .toggle {\n font-size: 10px;\n }\n\n .toggle input[type=\"checkbox\"] {\n width: 10px;\n height: 10px;\n }\n\n .logs {\n padding: 6px;\n }\n\n .log-entry {\n padding: 6px 8px;\n font-size: 10px;\n }\n\n .log-type {\n font-size: 8px;\n }\n\n .log-timestamp {\n font-size: 8px;\n }\n\n .log-data {\n font-size: 9px;\n padding: 6px;\n max-height: 80px;\n }\n\n .floating-btn {\n width: 36px;\n height: 36px;\n font-size: 16px;\n top: 15px;\n left: 15px;\n }\n }\n\n @media (max-width: 480px) {\n .panel {\n font-size: 10px;\n border-radius: 6px;\n }\n\n .header {\n padding: 6px 10px;\n }\n\n .title {\n font-size: 11px;\n }\n\n .subtitle {\n font-size: 8px;\n }\n\n .toggles {\n padding: 4px 10px;\n }\n \n .toggles > *:not(:first-child) {\n margin-right: 6px;\n }\n\n .toggle {\n font-size: 9px;\n }\n\n .logs {\n padding: 4px;\n }\n\n .log-entry {\n padding: 4px 6px;\n font-size: 9px;\n }\n \n .log-entry > *:not(:first-child) {\n margin-top: 4px;\n }\n\n .log-meta {\n min-width: 40px;\n }\n\n .log-type {\n font-size: 7px;\n }\n\n .log-timestamp {\n font-size: 7px;\n }\n\n .log-data {\n font-size: 8px;\n padding: 4px;\n max-height: 60px;\n }\n\n .floating-btn {\n width: 32px;\n height: 32px;\n font-size: 14px;\n top: 10px;\n left: 10px;\n }\n }\n";
|
|
@@ -6,10 +6,11 @@ declare global {
|
|
|
6
6
|
}
|
|
7
7
|
interface GTMConfig {
|
|
8
8
|
partnerName: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
partnerCode: string;
|
|
10
|
+
partnerGTMId?: string;
|
|
11
|
+
enablePartnerGTM: boolean;
|
|
12
|
+
enableLiquidCommerceGTM: boolean;
|
|
13
|
+
liquidCommerceGTMId: string;
|
|
13
14
|
}
|
|
14
15
|
interface BaseItem {
|
|
15
16
|
item_id?: string;
|
|
@@ -47,10 +48,11 @@ interface PurchaseData {
|
|
|
47
48
|
}
|
|
48
49
|
export declare class GoogleTagManagerService {
|
|
49
50
|
private partnerName?;
|
|
50
|
-
private
|
|
51
|
-
private
|
|
52
|
-
private
|
|
53
|
-
private
|
|
51
|
+
private partnerCode?;
|
|
52
|
+
private partnerGTMId?;
|
|
53
|
+
private liquidCommerceGTMId?;
|
|
54
|
+
private enablePartnerGTM;
|
|
55
|
+
private enableLiquidCommerceGTM;
|
|
54
56
|
private isInitialized;
|
|
55
57
|
private isInitializing;
|
|
56
58
|
private initializationPromise?;
|
|
@@ -108,8 +110,8 @@ export declare class GoogleTagManagerService {
|
|
|
108
110
|
country?: string;
|
|
109
111
|
};
|
|
110
112
|
coordinates?: {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
+
latitude: number;
|
|
114
|
+
longitude: number;
|
|
113
115
|
};
|
|
114
116
|
}): void;
|
|
115
117
|
addressFailed(errorData: {
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
+
import type { IAddressAddress, IAddressCoordinates } from '@/interfaces/api/address.interface';
|
|
1
2
|
export interface IAddressActionEventData {
|
|
2
3
|
googlePlacesId: string;
|
|
3
4
|
formattedAddress: string;
|
|
4
|
-
address:
|
|
5
|
-
|
|
6
|
-
two: string;
|
|
7
|
-
city: string;
|
|
8
|
-
state: string;
|
|
9
|
-
zip: string;
|
|
10
|
-
country: string;
|
|
11
|
-
};
|
|
12
|
-
coordinates: {
|
|
13
|
-
lat: number;
|
|
14
|
-
long: number;
|
|
15
|
-
};
|
|
5
|
+
address: IAddressAddress;
|
|
6
|
+
coordinates: IAddressCoordinates;
|
|
16
7
|
}
|
|
@@ -1,67 +1,23 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
id: string;
|
|
4
|
-
variantId: string;
|
|
5
|
-
liquidId: string;
|
|
6
|
-
retailerId: string;
|
|
7
|
-
partNumber: string;
|
|
8
|
-
fulfillmentId: string;
|
|
9
|
-
upc: string;
|
|
10
|
-
sku: string;
|
|
11
|
-
salsifyGrouping: string;
|
|
12
|
-
catPath: string;
|
|
13
|
-
volume: string;
|
|
14
|
-
uom: string;
|
|
15
|
-
pack: boolean;
|
|
16
|
-
packDesc: string;
|
|
17
|
-
container: string;
|
|
18
|
-
containerType: string;
|
|
19
|
-
name: string;
|
|
20
|
-
brand: string;
|
|
21
|
-
size: string;
|
|
22
|
-
price: number;
|
|
23
|
-
quantity: number;
|
|
24
|
-
maxQuantity: number;
|
|
25
|
-
unitPrice: number;
|
|
26
|
-
mainImage: string;
|
|
27
|
-
attributes: ICartItemAttributes;
|
|
28
|
-
}
|
|
1
|
+
import type { IAddressAddress, IAddressCoordinates } from '@/interfaces/api/address.interface';
|
|
2
|
+
import type { ICartItem, ICartRetailer } from '@/interfaces/api/cart.interface';
|
|
29
3
|
export interface IBaseCartEventData {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
4
|
+
cartId: string;
|
|
5
|
+
promoCodeDiscount: number | null;
|
|
6
|
+
subtotal: number;
|
|
7
|
+
itemCount: number;
|
|
8
|
+
items: Record<string, ICartItem>;
|
|
9
|
+
retailers: Record<string, ICartRetailer>;
|
|
33
10
|
location: {
|
|
34
11
|
placesId: string;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
state: string;
|
|
40
|
-
zip: string;
|
|
41
|
-
country: string;
|
|
42
|
-
};
|
|
43
|
-
coordinates: {
|
|
44
|
-
latitude: number;
|
|
45
|
-
longitude: number;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
amounts: {
|
|
49
|
-
deliveryFee: number;
|
|
50
|
-
discounts: number;
|
|
51
|
-
engravingFee: number;
|
|
52
|
-
giftCardTotal: number;
|
|
53
|
-
platformFee: number;
|
|
54
|
-
shippingFee: number;
|
|
55
|
-
subtotal: number;
|
|
56
|
-
total: number;
|
|
57
|
-
};
|
|
58
|
-
itemCount: number;
|
|
59
|
-
updatedAt: string;
|
|
60
|
-
createdAt: string;
|
|
12
|
+
formattedAddress: string;
|
|
13
|
+
address: IAddressAddress;
|
|
14
|
+
coordinates: IAddressCoordinates;
|
|
15
|
+
} | null;
|
|
61
16
|
}
|
|
62
17
|
export interface ICartLoadedEventData extends IBaseCartEventData {
|
|
63
18
|
}
|
|
64
19
|
export interface ICartFailedEventData {
|
|
20
|
+
cartId: string;
|
|
65
21
|
message: string;
|
|
66
22
|
}
|
|
67
23
|
export interface ICartUpdatedEventData {
|
|
@@ -69,38 +25,45 @@ export interface ICartUpdatedEventData {
|
|
|
69
25
|
current: IBaseCartEventData;
|
|
70
26
|
}
|
|
71
27
|
export interface ICartItemAddedEventData {
|
|
72
|
-
|
|
73
|
-
|
|
28
|
+
cartId: string;
|
|
29
|
+
itemId: string;
|
|
74
30
|
fulfillmentId: string;
|
|
75
31
|
partNumber: string;
|
|
76
32
|
quantity: number;
|
|
77
33
|
engravingLines?: string[];
|
|
78
34
|
}
|
|
79
35
|
export interface ICartItemRemovedEventData {
|
|
80
|
-
|
|
36
|
+
cartId: string;
|
|
37
|
+
itemId: string;
|
|
81
38
|
}
|
|
82
39
|
export interface ICartItemQuantityChangedEventData {
|
|
83
|
-
|
|
40
|
+
cartId: string;
|
|
41
|
+
itemId: string;
|
|
84
42
|
quantity: number;
|
|
85
43
|
previousQuantity: number;
|
|
86
44
|
}
|
|
87
45
|
export interface ICartItemEngravingUpdatedEventData {
|
|
88
|
-
|
|
46
|
+
cartId: string;
|
|
47
|
+
itemId: string;
|
|
89
48
|
engravingLines: string[];
|
|
90
49
|
previousEngravingLines: string[];
|
|
91
50
|
}
|
|
92
51
|
export interface ICartPromoCodeEventData {
|
|
52
|
+
cartId: string;
|
|
93
53
|
discountAmount?: number;
|
|
94
|
-
|
|
54
|
+
newSubtotal?: number;
|
|
95
55
|
}
|
|
96
56
|
export interface ICartPromoCodeFailedEventData {
|
|
57
|
+
cartId: string;
|
|
97
58
|
error: string;
|
|
98
59
|
}
|
|
99
60
|
export interface ICartProductAddEventData {
|
|
61
|
+
cartId: string;
|
|
100
62
|
itemsAdded: number;
|
|
101
63
|
identifiers: string[];
|
|
102
64
|
}
|
|
103
65
|
export interface ICartProductAddFailedEventData {
|
|
66
|
+
cartId: string;
|
|
104
67
|
identifiers: string[];
|
|
105
68
|
error: string;
|
|
106
69
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { ICartItemAttributes
|
|
1
|
+
import type { ICartItemAttributes } from '@/interfaces/api/cart.interface';
|
|
2
|
+
import type { ICheckoutTotalAmounts } from '@/interfaces/cloud';
|
|
2
3
|
export interface IBaseCheckoutEventData {
|
|
3
4
|
cartId: string;
|
|
4
5
|
}
|
|
@@ -31,37 +32,46 @@ export interface ICheckoutSubmitFailedEventData {
|
|
|
31
32
|
message: string;
|
|
32
33
|
}
|
|
33
34
|
export interface ICheckoutItemQuantityChangedEventData {
|
|
35
|
+
cartId: string;
|
|
34
36
|
cartItemId: string;
|
|
35
37
|
quantity: number;
|
|
36
38
|
previousQuantity: number;
|
|
37
39
|
}
|
|
38
40
|
export interface ICheckoutItemRemovedEventData {
|
|
41
|
+
cartId: string;
|
|
39
42
|
cartItemId: string;
|
|
40
43
|
}
|
|
41
44
|
export interface ICheckoutItemEngravingUpdatedEventData {
|
|
45
|
+
cartId: string;
|
|
42
46
|
cartItemId: string;
|
|
43
47
|
engravingLines: string[];
|
|
44
48
|
previousEngravingLines: string[];
|
|
45
49
|
}
|
|
46
50
|
export interface ICheckoutPromoCodeEventData {
|
|
51
|
+
cartId: string;
|
|
47
52
|
discountAmount?: number;
|
|
48
53
|
newTotal?: number;
|
|
49
54
|
}
|
|
50
55
|
export interface ICheckoutPromoCodeFailedEventData {
|
|
56
|
+
cartId: string;
|
|
51
57
|
error: string;
|
|
52
58
|
}
|
|
53
59
|
export interface ICheckoutGiftCardEventData {
|
|
60
|
+
cartId: string;
|
|
54
61
|
newTotal?: number;
|
|
55
62
|
}
|
|
56
63
|
export interface ICheckoutGiftCardFailedEventData {
|
|
64
|
+
cartId: string;
|
|
57
65
|
error: string;
|
|
58
66
|
}
|
|
59
67
|
export interface ICheckoutProductAddEventData {
|
|
68
|
+
cartId: string;
|
|
60
69
|
itemsAdded: number;
|
|
61
70
|
identifiers: string[];
|
|
62
71
|
isPresale?: boolean;
|
|
63
72
|
}
|
|
64
73
|
export interface ICheckoutProductAddFailedEventData {
|
|
74
|
+
cartId: string;
|
|
65
75
|
identifiers: string[];
|
|
66
76
|
error: string;
|
|
67
77
|
isPresale?: boolean;
|