@ikas/storefront 5.0.0-beta.27 → 5.0.0-beta.29
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/build/analytics/events.d.ts +2 -2
- package/build/components/checkout/components/address-form/model.d.ts +1 -1
- package/build/components/checkout/components/adyen/index.d.ts +1 -1
- package/build/components/checkout/components/button/index.d.ts +1 -1
- package/build/components/checkout/components/cart-summary/cart-item/index.d.ts +1 -1
- package/build/components/checkout/components/cart-summary/index.d.ts +1 -1
- package/build/components/checkout/components/checkbox/check.d.ts +1 -1
- package/build/components/checkout/components/checkbox/index.d.ts +1 -1
- package/build/components/checkout/components/credit-card-form/index.d.ts +1 -1
- package/build/components/checkout/components/credit-card-form/model.d.ts +1 -1
- package/build/components/checkout/components/credit-card-form/svg/amex.d.ts +1 -1
- package/build/components/checkout/components/credit-card-form/svg/master-card.d.ts +1 -1
- package/build/components/checkout/components/credit-card-form/svg/troy.d.ts +1 -1
- package/build/components/checkout/components/credit-card-form/svg/visa.d.ts +1 -1
- package/build/components/checkout/components/customer-addresses/index.d.ts +4 -4
- package/build/components/checkout/components/customer-addresses/model.d.ts +1 -1
- package/build/components/checkout/components/delivery-methods/icon-button/index.d.ts +1 -1
- package/build/components/checkout/components/delivery-methods/icons/box.d.ts +1 -1
- package/build/components/checkout/components/delivery-methods/icons/store.d.ts +1 -1
- package/build/components/checkout/components/delivery-methods/index.d.ts +1 -1
- package/build/components/checkout/components/epaykolay-button/index.d.ts +1 -1
- package/build/components/checkout/components/error/customer-login-required-error/index.d.ts +1 -1
- package/build/components/checkout/components/error/index.d.ts +1 -1
- package/build/components/checkout/components/error/payment-error/index.d.ts +1 -1
- package/build/components/checkout/components/error/stock-error/index.d.ts +1 -1
- package/build/components/checkout/components/error/unknown-error/index.d.ts +1 -1
- package/build/components/checkout/components/expandable-section/index.d.ts +2 -1
- package/build/components/checkout/components/form-item/caret-down.d.ts +1 -1
- package/build/components/checkout/components/form-item/model.d.ts +1 -1
- package/build/components/checkout/components/input-with-button/index.d.ts +1 -1
- package/build/components/checkout/components/klarna/index.d.ts +1 -1
- package/build/components/checkout/components/master-pass/credit-card-form/index.d.ts +1 -1
- package/build/components/checkout/components/master-pass/link-card-to-client/index.d.ts +1 -1
- package/build/components/checkout/components/master-pass/modal/index.d.ts +1 -1
- package/build/components/checkout/components/master-pass/modal-otp/index.d.ts +1 -1
- package/build/components/checkout/components/master-pass/modal-response/index.d.ts +1 -1
- package/build/components/checkout/components/master-pass/modal-success/index.d.ts +2 -2
- package/build/components/checkout/components/master-pass/payment-gateway/svg/master-card.js +1 -1
- package/build/components/checkout/components/master-pass/payment-gateway/svg/troy.d.ts +1 -1
- package/build/components/checkout/components/master-pass/payment-gateway/svg/visa.d.ts +1 -1
- package/build/components/checkout/components/modal/index.d.ts +1 -1
- package/build/components/checkout/components/modal/useEscape.d.ts +1 -1
- package/build/components/checkout/components/notification-box/index.d.ts +1 -1
- package/build/components/checkout/components/offer-product/index.d.ts +1 -1
- package/build/components/checkout/components/offer-product/select/arrows.d.ts +1 -1
- package/build/components/checkout/components/offer-product/select/index.d.ts +1 -1
- package/build/components/checkout/components/paypal/index.d.ts +1 -1
- package/build/components/checkout/components/phone-number-input/get-countries.d.ts +1 -1
- package/build/components/checkout/components/phone-number-input/index.d.ts +1 -1
- package/build/components/checkout/components/quick-registration/completed.d.ts +1 -1
- package/build/components/checkout/components/quick-registration/index.d.ts +1 -1
- package/build/components/checkout/components/select-box/index.d.ts +1 -1
- package/build/components/checkout/components/step-container/index.d.ts +1 -1
- package/build/components/checkout/components/stripe/checkout-form.d.ts +1 -1
- package/build/components/checkout/components/stripe/index.d.ts +1 -1
- package/build/components/checkout/components/svg/arrow-down.d.ts +1 -1
- package/build/components/checkout/components/svg/arrow-left.d.ts +1 -1
- package/build/components/checkout/components/svg/arrow-right.d.ts +1 -1
- package/build/components/checkout/components/svg/cross.d.ts +1 -1
- package/build/components/checkout/components/svg/discount.d.ts +1 -1
- package/build/components/checkout/components/svg/epaykolay.d.ts +1 -1
- package/build/components/checkout/components/svg/external.d.ts +1 -1
- package/build/components/checkout/components/svg/gift.d.ts +1 -1
- package/build/components/checkout/components/svg/ikas.d.ts +1 -1
- package/build/components/checkout/components/svg/lock.d.ts +1 -1
- package/build/components/checkout/components/svg/shopping-cart.d.ts +1 -1
- package/build/components/checkout/components/svg/success-circle.d.ts +1 -1
- package/build/components/checkout/components/svg/tag.d.ts +1 -1
- package/build/components/checkout/components/svg/warning.d.ts +1 -1
- package/build/components/checkout/components/toggle/index.d.ts +1 -1
- package/build/components/checkout/components/tooltip/index.d.ts +1 -1
- package/build/components/checkout/index.d.ts +2 -2
- package/build/components/checkout/model.d.ts +1 -1
- package/build/components/checkout/modelMasterPass.d.ts +12 -12
- package/build/components/checkout/steps/step-info/index.d.ts +1 -1
- package/build/components/checkout/steps/step-payment/billing-address/index.d.ts +1 -1
- package/build/components/checkout/steps/step-payment/index.d.ts +1 -1
- package/build/components/checkout/steps/step-payment/payment-gateways/index.d.ts +1 -1
- package/build/components/checkout/steps/step-payment/payment-gateways/installments/index.d.ts +1 -1
- package/build/components/checkout/steps/step-shipping/index.d.ts +1 -1
- package/build/components/checkout/steps/step-success/index.d.ts +1 -1
- package/build/components/checkout/types.d.ts +3 -3
- package/build/components/google-captcha/index.d.ts +1 -1
- package/build/components/image/index.d.ts +2 -1
- package/build/components/link/index.d.ts +5 -14
- package/build/components/link/index.js +1 -1
- package/build/components/page/ThemeComponent.d.ts +1 -1
- package/build/components/page/head.d.ts +1 -1
- package/build/components/page/index.d.ts +1 -1
- package/build/components/page-editor/ThemeComponentEditor.d.ts +1 -1
- package/build/components/page-editor/loader/index.d.ts +1 -1
- package/build/components/page-editor/model.js +1 -1
- package/build/models/data/checkout/index.d.ts +1 -1
- package/build/models/data/localized-customer-address/functions.d.ts +2 -0
- package/build/models/data/localized-customer-address/index.d.ts +1 -1
- package/build/models/data/localized-order-address/functions.d.ts +2 -0
- package/build/models/data/localized-order-address/index.d.ts +1 -1
- package/build/models/data/review-form/index.d.ts +1 -1
- package/build/models/ui/blog-category-list/index.d.ts +1 -1
- package/build/models/ui/blog-list/index.d.ts +1 -1
- package/build/models/ui/brand-list/index.d.ts +1 -1
- package/build/models/ui/category-list/index.d.ts +1 -1
- package/build/models/ui/component-renderer/index.d.ts +1 -1
- package/build/models/ui/customer-review-list/index.d.ts +1 -1
- package/build/models/ui/customer-review-summary-list/index.d.ts +1 -1
- package/build/models/ui/list-commons/index.d.ts +1 -1
- package/build/models/ui/navigation-link/index.d.ts +1 -1
- package/build/models/ui/product-list/index.d.ts +1 -1
- package/build/models/ui/raffle-list/index.d.ts +1 -1
- package/build/models/ui/validator/form/account-info.d.ts +2 -2
- package/build/models/ui/validator/form/address.d.ts +2 -2
- package/build/models/ui/validator/form/contact-form.d.ts +2 -2
- package/build/models/ui/validator/form/customer-review.d.ts +2 -2
- package/build/models/ui/validator/form/forgot-password.d.ts +2 -2
- package/build/models/ui/validator/form/ikas-address.d.ts +7 -2
- package/build/models/ui/validator/form/login.d.ts +2 -2
- package/build/models/ui/validator/form/raffle-form.d.ts +2 -2
- package/build/models/ui/validator/form/recover-password.d.ts +2 -2
- package/build/models/ui/validator/form/register.d.ts +5 -5
- package/build/models/ui/validator/index.d.ts +2 -2
- package/build/models/ui/validator/rules/index.d.ts +2 -2
- package/build/pages/checkout.d.ts +1 -1
- package/build/pages/editor.d.ts +1 -1
- package/build/store/base/index.d.ts +3 -3
- package/build/store/cart/index.d.ts +2 -2
- package/build/store/customer/index.d.ts +1 -1
- package/build/store/customer/index.js +1 -1
- package/build/utils/i18n.d.ts +2 -2
- package/package.json +10 -13
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { IkasCheckoutSettings } from "../../models";
|
|
3
3
|
import { IkasCheckout } from "../../models/data/checkout";
|
|
4
|
-
export
|
|
4
|
+
export type IkasCheckoutPageProps = {
|
|
5
5
|
checkout: IkasCheckout;
|
|
6
6
|
checkoutSettings: IkasCheckoutSettings;
|
|
7
7
|
customizationProps?: IkasCheckoutCustomizationProps;
|
|
@@ -11,7 +11,7 @@ export declare type IkasCheckoutPageProps = {
|
|
|
11
11
|
imprint: string;
|
|
12
12
|
shippingPolicy: string;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type IkasCheckoutCustomizationProps = {
|
|
15
15
|
showTax?: boolean;
|
|
16
16
|
buttonBgColor?: string;
|
|
17
17
|
buttonTextColor?: string;
|
|
@@ -11,7 +11,7 @@ import { LocalizedAddressModel } from "@ikas/localized-address";
|
|
|
11
11
|
import { IkasCheckoutSettings, IkasPaymentGateway, IkasStorefront } from "@ikas/storefront-models";
|
|
12
12
|
import { IkasCheckout } from "../../models/data/checkout";
|
|
13
13
|
import { CampaignOfferType, CheckoutError, CheckoutStep } from "./types";
|
|
14
|
-
export
|
|
14
|
+
export type IUnavailableItems = {
|
|
15
15
|
item: IkasOrderLineItem;
|
|
16
16
|
stockCount: number;
|
|
17
17
|
};
|
|
@@ -5,13 +5,13 @@ import { MasterPassOperationTypeEnum } from "@ikas/storefront-api";
|
|
|
5
5
|
import { IkasCheckout } from "../../models/data/checkout";
|
|
6
6
|
export declare const MFS_ELEMENT_ID = "ikasMasterPass";
|
|
7
7
|
export declare const MFS_SCRIPT_URL = "https://cdn.myikas.com/sf/scripts/mfs-client-nojquery.min.js";
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
type MFS_CB_HOC_TYPE_SOURCE = "checkMasterPass" | "register" | "resendOtp" | "linkCardToClient" | "validateTransaction" | "listCards" | "deleteCard";
|
|
9
|
+
type MFS_CB_HOC_TYPE = (params: {
|
|
10
10
|
source: MFS_CB_HOC_TYPE_SOURCE;
|
|
11
11
|
checkout: IkasCheckout;
|
|
12
12
|
callback?: () => void;
|
|
13
13
|
}) => MFS_CB_TYPE;
|
|
14
|
-
|
|
14
|
+
type MFS_CB_TYPE = (status: any, response: {
|
|
15
15
|
responseCode: /* register success */ "0000" | /* register success */ "" | /* banka tarafindan otp dogrulamasi yapilir */ "5001" | /* masterpass tarafindan otp dogrulamasi yapilir*/ "5008" | /* Bu kredi kartı bu kullanıcıya daha önceden kaydedilmiştir. */ "5196" | /* Tek kullanımlık şifre doğrulanamadı. */ "1409" | /* External hesap bulunamadı. */ "1999" | string;
|
|
16
16
|
responseDescription?: string;
|
|
17
17
|
transactionId: string;
|
|
@@ -19,7 +19,7 @@ declare type MFS_CB_TYPE = (status: any, response: {
|
|
|
19
19
|
url3D: string;
|
|
20
20
|
cards: number | Array<Card>;
|
|
21
21
|
}) => void;
|
|
22
|
-
|
|
22
|
+
type MFS = {
|
|
23
23
|
checkMasterPass: (formData: FormData, cb: MFS_CB_TYPE) => void;
|
|
24
24
|
setClientId: (a: string) => void;
|
|
25
25
|
register: (formData: FormData, cb: MFS_CB_TYPE) => void;
|
|
@@ -31,7 +31,7 @@ declare type MFS = {
|
|
|
31
31
|
deleteCard: (formData: FormData, cb: MFS_CB_TYPE) => void;
|
|
32
32
|
setAddress: (a: string) => void;
|
|
33
33
|
};
|
|
34
|
-
export
|
|
34
|
+
export type Card = {
|
|
35
35
|
BankIca: string;
|
|
36
36
|
CardStatus: string;
|
|
37
37
|
EftCode: string;
|
|
@@ -109,7 +109,7 @@ export default class MasterPassModel {
|
|
|
109
109
|
* Send object return value is FormData
|
|
110
110
|
* @returns FormData
|
|
111
111
|
*/
|
|
112
|
-
prepareFormData<T
|
|
112
|
+
prepareFormData<T extends Record<string, any>>(data: T): FormData;
|
|
113
113
|
clearSaveCardToMasterPassForm: () => void;
|
|
114
114
|
/**
|
|
115
115
|
* MFS (MasterPass js library) response handler.
|
|
@@ -159,7 +159,7 @@ export default class MasterPassModel {
|
|
|
159
159
|
listCards: ({ checkout }: ListCardsParams) => Promise<void>;
|
|
160
160
|
deleteCard: ({ checkout, card }: DeleteCardParams) => Promise<void>;
|
|
161
161
|
}
|
|
162
|
-
|
|
162
|
+
type RegisterParams = {
|
|
163
163
|
creditCard: {
|
|
164
164
|
rtaPan: string;
|
|
165
165
|
expiryDate: string;
|
|
@@ -171,23 +171,23 @@ declare type RegisterParams = {
|
|
|
171
171
|
checkout: IkasCheckout;
|
|
172
172
|
callback: () => void;
|
|
173
173
|
};
|
|
174
|
-
|
|
174
|
+
type CheckMasterPassParams = {
|
|
175
175
|
checkout: IkasCheckout;
|
|
176
176
|
};
|
|
177
|
-
|
|
177
|
+
type LinkCardToClientParams = {
|
|
178
178
|
cartId: string;
|
|
179
179
|
checkout: IkasCheckout;
|
|
180
180
|
callback?: () => void;
|
|
181
181
|
};
|
|
182
|
-
|
|
182
|
+
type ValidateTransactionParams = {
|
|
183
183
|
validationCode: string;
|
|
184
184
|
checkout: IkasCheckout;
|
|
185
185
|
callback: () => void;
|
|
186
186
|
};
|
|
187
|
-
|
|
187
|
+
type ListCardsParams = {
|
|
188
188
|
checkout: IkasCheckout;
|
|
189
189
|
};
|
|
190
|
-
|
|
190
|
+
type DeleteCardParams = {
|
|
191
191
|
checkout: IkasCheckout;
|
|
192
192
|
card: Card;
|
|
193
193
|
};
|
|
@@ -13,15 +13,15 @@ export declare enum ErrorType {
|
|
|
13
13
|
NO_SHIPPING_ERROR = 4,
|
|
14
14
|
CUSTOMER_LOGIN_REQUIRED_ERROR = 5
|
|
15
15
|
}
|
|
16
|
-
export
|
|
16
|
+
export type CheckoutError = {
|
|
17
17
|
type: ErrorType;
|
|
18
18
|
data?: any;
|
|
19
19
|
};
|
|
20
|
-
export
|
|
20
|
+
export type StockErrorData = {
|
|
21
21
|
variant: IkasOrderLineVariant;
|
|
22
22
|
availableQuantity: number;
|
|
23
23
|
};
|
|
24
|
-
export
|
|
24
|
+
export type CampaignOfferType = {
|
|
25
25
|
product: IkasProduct;
|
|
26
26
|
variants: IkasProductVariant[];
|
|
27
27
|
campaignOffer: IkasCartCampaignOffer;
|
|
@@ -2,9 +2,10 @@ import * as React from "react";
|
|
|
2
2
|
import { ImageProps as NextImageProps } from "next/image.js";
|
|
3
3
|
import { IkasImage } from "@ikas/storefront-models";
|
|
4
4
|
export declare const Image: React.FC<ImageProps>;
|
|
5
|
-
|
|
5
|
+
type ImageProps = Omit<NextImageProps, "src" | "srcSet" | "blurDataURL" | "placeholder" | "loader" | "quality" | "alt"> & {
|
|
6
6
|
priority?: boolean;
|
|
7
7
|
image: IkasImage;
|
|
8
8
|
useBlur?: boolean;
|
|
9
|
+
alt?: string;
|
|
9
10
|
};
|
|
10
11
|
export {};
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import React from "react";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
shallow?: boolean | undefined;
|
|
9
|
-
passHref?: boolean | undefined;
|
|
10
|
-
prefetch?: boolean | undefined;
|
|
11
|
-
locale?: string | false | undefined;
|
|
12
|
-
legacyBehavior?: boolean | undefined;
|
|
13
|
-
onMouseEnter?: ((e: any) => void) | undefined;
|
|
14
|
-
onClick?: ((e: any) => void) | undefined;
|
|
15
|
-
}>;
|
|
2
|
+
import { LinkProps } from "next/link";
|
|
3
|
+
type Props = {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
} & LinkProps;
|
|
6
|
+
declare const _default: React.FunctionComponent<Props>;
|
|
16
7
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as t}from'./../../ext/tslib/tslib.es6.js';import r,{useState as o}from"react";import
|
|
1
|
+
import{__assign as t}from'./../../ext/tslib/tslib.es6.js';import r,{useState as o}from"react";import e from"next/link";import{observer as s}from"mobx-react-lite";import{IkasBaseStore as i}from"../../store/base/index.js";import"@ikas/storefront-api";import"@ikas/storefront-config";import"lodash/flatten";import"lodash/sortBy";import"@ikas/storefront-model-functions";import"../../store/cart/index.js";import"../checkout/types.js";import"../../store/customer/index.js";import"../../analytics/events.js";import"lodash/cloneDeep";import"../../store/analytics/index.js";import"../../analytics/ikas.js";import"../../store/customer/consent/data.js";import"../../analytics/head/index.js";import"../../store/customer/account-auth/data.js";import"../../store/customer/captcha/data.js";import"../../store/customer/product/data.js";import"lodash/xorBy";import"@ikas/fe-api-client";import"@ikas/storefront-models";import"@ikas/localized-address";import"../../store/customer/marketing/data.js";import"../../store/customer/order/data.js";import"@ikas/storefront-providers";var a=s((function(s){var a=o(!1),m=a[0],n=a[1];return r.useEffect((function(){var t="string"==typeof s.href,r=i.spaLinksDisabled;n(r&&t)}),[i.spaLinksDisabled]),m?r.createElement("a",{href:s.href},s.children):r.createElement(e,t({legacyBehavior:!0},s),s.children)}));export{a as default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { IkasPageComponentPropValue } from "@ikas/storefront-providers";
|
|
3
3
|
import { IkasThemeJsonSettings } from "@ikas/storefront-models";
|
|
4
|
-
|
|
4
|
+
type Props = {
|
|
5
5
|
pageComponentPropValue: IkasPageComponentPropValue;
|
|
6
6
|
index: number;
|
|
7
7
|
settings: IkasThemeJsonSettings;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { IkasCustomerReviewSummary, IkasMerchantSettings, IkasThemeJsonPageType } from "../../models/data";
|
|
3
|
-
|
|
3
|
+
type Props = {
|
|
4
4
|
pageType: IkasThemeJsonPageType;
|
|
5
5
|
pageTitle?: string | null;
|
|
6
6
|
pageDescription?: string | null;
|
|
@@ -4,7 +4,7 @@ import { IkasCustomerReviewSummary, IkasThemeJsonPageType } from "../../models/d
|
|
|
4
4
|
import { IkasThemeJsonComponent } from "@ikas/storefront-models";
|
|
5
5
|
import { IkasThemeJsonCustomData } from "../../models/data/theme-json/custom-data";
|
|
6
6
|
import { IkasThemeJsonSettings } from "../../models/data/theme-json/settings";
|
|
7
|
-
export
|
|
7
|
+
export type IkasPageProps = {
|
|
8
8
|
propValues: IkasSimplePageComponentPropValue[];
|
|
9
9
|
themeJsonComponents: IkasThemeJsonComponent[];
|
|
10
10
|
customDataList: IkasThemeJsonCustomData[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import{IkasStorefrontConfig as n}from"@ikas/storefront-config";import{IkasThemeJsonPageType as i,IkasBlogMetaDataTargetType as o,IkasHTMLMetaDataTargetType as s}from"@ikas/storefront-models";import"@ikas/localized-address";import{reaction as a,makeAutoObservable as r,runInAction as d}from"mobx";import{listRaffleMetaData as c,listBlogMetaData as p,listHTMLMetaData as u,setAPIClientConfig as l,listCustomerSettings as m,searchProducts as g}from"@ikas/storefront-api";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/product-list/functions.js";import"../../models/ui/product-list/index.js";import{IkasPageDataProvider as h}from"@ikas/storefront-providers";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import{IkasPageDataInit as f}from"../../page-data-init/index.js";import{IkasVariantTypeFunctions as E,IkasVariantValueFunctions as v}from"@ikas/storefront-model-functions";import"../../store/cart/index.js";import"../checkout/types.js";import"../../store/customer/index.js";import"../../analytics/events.js";import"lodash/cloneDeep";import"../../store/analytics/index.js";import"../../analytics/ikas.js";import"../../store/customer/consent/data.js";import"../../analytics/head/index.js";import"../page/index.js";import"../page/head.js";import"react";import"next/image.js";import"../link/index.js";import"./loader/style.module.scss.js";import"../google-captcha/index.js";import{IkasBaseStore as P}from"../../store/base/index.js";import"lodash/flatten";import"lodash/sortBy";import"../../store/customer/account-auth/data.js";import"../../store/customer/captcha/data.js";import"../../store/customer/product/data.js";import"lodash/xorBy";import"@ikas/fe-api-client";import"../../store/customer/marketing/data.js";import"../../store/customer/order/data.js";import"../../pages/home.js";import"../../pages/_slug_/index.js";import"../../pages/pages/_slug_.js";import"../../pages/checkout.js";import"../../pages/account/index.js";import"../../pages/account/addresses.js";import"../../pages/account/orders/index.js";import"../../pages/account/orders/_id_.js";import"../../pages/account/login.js";import"../../pages/account/register.js";import"../../pages/account/forgot-password.js";import"../../pages/account/recover-password.js";import"../../pages/cart.js";import"../../pages/editor.js";import"../../pages/account/favorite-products.js";import"../../pages/search.js";import"next/error.js";import"../../pages/blog/index.js";import"../../pages/blog/_slug_.js";import"../../pages/raffle/_slug_.js";import"../../pages/raffle/index.js";import"../../pages/account/raffles.js";import"../../pages/account/activate.js";import"lodash/get";import{IkasThemeJson as O}from"../../models/data/theme-json/index.js";import{IkasThemeJsonPageComponent as T}from"../../models/data/theme-json/page/component/index.js";import{IkasThemeJsonComponent as C}from"../../models/data/theme-json/component/index.js";import{IkasThemeJsonSettings as _}from"../../models/data/theme-json/settings/index.js";var D,A=function(){function A(a){var g=this;this.theme=null,this.page=null,this.selectedPageComponentId=null,this.hoveredPageComponentId=null,this.componentRefs={},this.isLoading=!1,this.updateId="",this.locale="en",this.pageParams={},this.apiKey=null,this.pageDataProvider=null,this.initializedPropValues=[],this.startMessaging=function(){window.addEventListener("message",g.onMessage,!1),g.sendMessage(D.FRAME_DID_LOAD,"4.5.0"),g.createLoadingListener()},this.onMessage=function(n){return e(g,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:switch(e=n.data.type,i=n.data.data,e){case D.UPDATE_FRAME_DATA:return[3,1];case D.UPDATE_THEME_JSON:return[3,3];case D.UPDATE_PROP_VALUE:return[3,5];case D.UPDATE_PAGE_PARAMS:return[3,7];case D.UPDATE_PAGE_COMPONENT_ORDER:return[3,9];case D.ADD_COMPONENT:return[3,11];case D.DELETE_COMPONENT:return[3,12];case D.UPDATE_COMPONENT:return[3,13];case D.ADD_PAGE_COMPONENT:return[3,14];case D.DELETE_PAGE_COMPONENT:return[3,16];case D.SET_SELECTED_COMPONENT:return[3,17];case D.SET_HOVERED_COMPONENT:return[3,18];case D.SCROLL_TO_COMPONENT:return[3,19];case D.EDITOR_RELOAD:return[3,20];case D.UPDATE_THEME_SETTINGS:return[3,21]}return[3,22];case 1:return[4,this.handleUpdateFrameData(i)];case 2:case 4:case 6:case 8:case 10:case 15:return t.sent(),[3,23];case 3:return[4,this.handleUpdateThemeJson(i)];case 5:return[4,this.handleUpdatePropValue(i)];case 7:return[4,this.handleUpdatePageParams(i)];case 9:return[4,this.handleUpdatePageComponentOrder(i)];case 11:return this.handleAddNewComponent(i),[3,23];case 12:return this.handleDeleteComponent(i),[3,23];case 13:return this.handleUpdateComponent(i),[3,23];case 14:return[4,this.handleAddNewPageComponent(i)];case 16:return this.handleDeletePageComponent(i),[3,23];case 17:return this.handleSetSelectedComponent(i),[3,23];case 18:return this.handleSetHoveredComponent(i),[3,23];case 19:return this.handleScrollToComponent(i),[3,23];case 20:return this.handleEditorReload(),[3,23];case 21:return this.updateThemeSettings(i),[3,23];case 22:return[3,23];case 23:return[2]}}))}))},this.onClick=function(e){g.sendMessage(D.COMPONENT_CLICK,{componentId:e})},this.onMouseOver=function(e){g.sendMessage(D.COMPONENT_MOUSE_OVER,{componentId:e})},this.onMouseLeave=function(e){g.sendMessage(D.COMPONENT_MOUSE_LEAVE,{componentId:e})},this.onPageChange=function(n){return e(g,void 0,void 0,(function(){var e,a,r,l,m,g,h,f,E,v,O,T,C,_=this;return t(this,(function(t){switch(t.label){case 0:return e=n.slice(1),a=e.split("?"),e=a[0],r=a[1],this.pageParams={},n.startsWith("/account/orders/")?l=i.ORDER_DETAIL:n.startsWith("/account/orders")?l=i.ORDERS:n.startsWith("/account/addresses")?l=i.ADDRESSES:n.startsWith("/account/favorite-products")?l=i.FAVORITE_PRODUCTS:n.startsWith("/account/forgot-password")?l=i.FORGOT_PASSWORD:n.startsWith("/account/login")?l=i.LOGIN:n.startsWith("/account/raffles")?l=i.RAFFLE_ACCOUNT:n.startsWith("/account/recover-password")?l=i.RECOVER_PASSWORD:n.startsWith("/account/activate")?l=i.ACTIVATE_CUSTOMER:n.startsWith("/account/register")?l=i.REGISTER:n.startsWith("/account")?l=i.ACCOUNT:n.startsWith("/blog/")?l=i.BLOG:n.startsWith("/blog")?l=i.BLOG_INDEX:n.startsWith("/pages")?(l=i.CUSTOM,this.pageParams={slug:e.split("/")[1]}):l=n.startsWith("/raffle/")?i.RAFFLE_DETAIL:n.startsWith("/raffle")?i.RAFFLE:n.startsWith("/404")?i.NOT_FOUND:n.startsWith("/cart")?i.CART:n.startsWith("/checkout")?i.CHECKOUT:"/"===n?i.INDEX:n.startsWith("/search")?i.SEARCH:i.PRODUCT,l!==i.PRODUCT?[3,6]:[4,u({slug:{eq:e}})];case 1:return(g=t.sent()).isSuccess&&(null===(E=g.data)||void 0===E?void 0:E.length)?(h=g.data[0]).targetType!==s.PRODUCT?[3,3]:[4,this.getVariantIdFromParams(h.targetId,r)]:[3,5];case 2:return m=t.sent(),this.pageParams={productId:h.targetId,variantId:m,slug:e},[3,4];case 3:if(h.targetType===s.CATEGORY)l=i.CATEGORY,this.pageParams={categoryId:h.targetId,slug:e};else{if(h.targetType!==s.BRAND)return[2];l=i.BRAND,this.pageParams={brandId:h.targetId,slug:e}}t.label=4;case 4:return[3,6];case 5:return[2];case 6:return l!==i.BLOG?[3,8]:[4,p({slug:{eq:e}})];case 7:if(!(g=t.sent()).isSuccess||!(null===(O=null===(v=g.data)||void 0===v?void 0:v.data)||void 0===O?void 0:O.length))return[2];if((h=g.data.data[0]).targetType===o.BLOG)this.pageParams={blogId:h.targetId,slug:e};else{if(h.targetType!==o.BLOG_CATEGORY)return[2];l=i.BLOG_CATEGORY,this.pageParams={blogCategoryId:h.targetId,slug:e}}t.label=8;case 8:return l!==i.RAFFLE_DETAIL?[3,10]:[4,c({slug:{eq:e}})];case 9:if(!(g=t.sent()).isSuccess||!(null===(T=g.data)||void 0===T?void 0:T.length))return[2];h=g.data[0],this.pageParams={raffleId:h.targetId,slug:e},t.label=10;case 10:return this.isLoading=!0,[4,this.getPagePropValues(this.theme,l,this.pageParams)];case 11:return f=t.sent(),d((function(){var e,t;P.currentPageType=l,_.pageDataProvider=f,l===i.CUSTOM?_.page=null===(e=_.theme)||void 0===e?void 0:e.pages.find((function(e){return e.type===l&&e.slug===_.pageParams.slug})):_.page=null===(t=_.theme)||void 0===t?void 0:t.pages.find((function(e){return e.type===l})),requestAnimationFrame((function(){document.body.scrollTop=0,document.scrollingElement&&(document.scrollingElement.scrollTop=0)}))})),this.sendMessage(D.EDITOR_PAGE_CHANGE,{pageType:l,pageParams:this.pageParams,pageSpecificData:(null===(C=this.pageDataProvider)||void 0===C?void 0:C.pageSpecificData)||null}),this.isLoading=!1,[2]}}))}))},this.onLoadingChange=function(){g.sendMessage(D.EDITOR_LOADING_CHANGE,{isLoading:g.isLoading})},this.sendMessage=function(e,t){window.parent.postMessage({type:e,data:JSON.parse(JSON.stringify(t))},"*")},this.getPagePropValues=function(n,o,s){return e(g,void 0,void 0,(function(){var e,a,r;return t(this,(function(t){switch(t.label){case 0:return e=new h(n,s,o),(s.blogId||s.blogCategoryId)&&(e.possiblePageTypes=[i.BLOG,i.BLOG_CATEGORY]),s.raffleId&&(e.possiblePageTypes=[i.RAFFLE_DETAIL]),[4,e.getPageData()];case 1:return t.sent(),e.pageSpecificData?(f.setPageSpecificData(e.pageSpecificData,o,!0),o===i.PRODUCT&&f.pageSpecificData&&(a=f.pageSpecificData,(r=a.variants.find((function(e){return e.id===s.variantId})))&&(a.selectedVariantValues=r.variantValues))):f.pageSpecificData=void 0,this.initializedPropValues=f.initPagePropValues(e.$pageComponentPropValues,n.components,n.customData,n.settings,!1),[2,e]}}))}))},this.setComponentRef=function(e,t){g.componentRefs[t.id]=e},this.isScrolledIntoView=function(e){var t=e.getBoundingClientRect(),n=t.top,i=t.bottom;return n<window.innerHeight&&i>=0&&i<window.innerHeight&&n>0},this.handleUpdateFrameData=function(i){return e(g,void 0,void 0,(function(){var e,o,s,a,r,d,c=this;return t(this,(function(t){switch(t.label){case 0:return this.theme=new O(i.theme),this.page=null===(r=this.theme)||void 0===r?void 0:r.pages.find((function(e){return e.id===i.selectedPage.id})),this.pageParams=i.pageParams,this.apiKey=i.apiKey,this.locale=i.locale||"en",this.translations=i.translations||void 0,this.page?((e=i.storefront?i.storefront:null)&&(o=e.routings.find((function(e){return e.locale===c.locale})),n.init({storefrontId:e.id,storefrontRoutingId:null==o?void 0:o.id,storefrontThemeId:e.mainStorefrontThemeId||void 0,salesChannelId:e.salesChannelId||void 0,priceListId:(null==o?void 0:o.priceListId)||void 0,routings:e.routings,stockPreference:null===(d=this.theme)||void 0===d?void 0:d.settings.stockPreference,translations:this.translations||n.getTranslations(),isEditor:!0,apiKey:i.apiKey,apiUrl:i.apiUrl,cdnUrl:i.cdnUrl,merchantSettings:i.merchantSettings}),l(),this.setCustomerSettings()),s=Date.now()+"",this.updateId=s,this.isLoading=!0,[4,this.getPagePropValues(this.theme,this.page.type,this.pageParams||{})]):[2];case 1:return a=t.sent(),this.updateId===s&&(this.pageDataProvider=a,this.isLoading=!1),[2]}}))}))},this.setCustomerSettings=function(){return e(g,void 0,void 0,(function(){var e,i,o;return t(this,(function(t){switch(t.label){case 0:return n.getCustomerSettings()?[3,2]:[4,m({storefrontId:{eq:n.getStorefrontId()}})];case 1:(e=t.sent()).isSuccess&&(null===(o=e.data)||void 0===o?void 0:o.data.length)&&(i=e.data.data[0],n.init({customerSettings:i})),t.label=2;case 2:return[2]}}))}))},this.handleUpdateThemeJson=function(n){return e(g,void 0,void 0,(function(){return t(this,(function(e){return this.theme=new O(n.theme),[2]}))}))},this.handleUpdatePropValue=function(n){return e(g,void 0,void 0,(function(){var e,i,o,s,a,r,d,c=this;return t(this,(function(t){switch(t.label){case 0:return e=n.propName,i=n.value,(o=null===(d=null===(r=this.selectedComponent)||void 0===r?void 0:r.props)||void 0===d?void 0:d.find((function(t){return t.name===e})))&&this.selectedPageComponent?(s=this.initializedPropValues.find((function(e){return e.pageComponent.id===c.selectedPageComponentId})),this.pageDataProvider&&s?(this.selectedPageComponent.propValues[e]=i,[4,this.pageDataProvider.getPageComponentPropValue(this.selectedPageComponent,o)]):[2]):[2];case 1:return(a=t.sent())&&JSON.stringify(a).includes("href")?[4,this.pageDataProvider.setLinkSlugs()]:[3,3];case 2:t.sent(),t.label=3;case 3:return s.propValues[e]=f.initPropValue(o,a,this.theme.settings,!0),[2]}}))}))},this.handleUpdatePageParams=function(n){return e(g,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.pageParams=n.pageParams,this.isLoading=!0,[4,this.getPagePropValues(this.theme,this.page.type,this.pageParams||{})];case 1:return e=t.sent(),this.pageDataProvider=e,this.isLoading=!1,[2]}}))}))},this.handleUpdatePageComponentOrder=function(n){return e(g,void 0,void 0,(function(){return t(this,(function(e){return this.specification?this.specification.components=n.pageComponents.map((function(e){return new T(e)})):this.page.components=n.pageComponents.map((function(e){return new T(e)})),[2]}))}))},this.handleAddNewComponent=function(e){var t,n=new C(e.component);null===(t=g.theme)||void 0===t||t.components.push(n)},this.handleDeleteComponent=function(e){var t,n;(null===(t=g.theme)||void 0===t?void 0:t.components)&&(g.theme.components=g.theme.components.filter((function(t){return t.id!==e.componentId})));var i=g.pageComponents.filter((function(t){return t.componentId!==e.componentId}))||[];g.specification&&g.specification.components&&(g.specification.components=i),!g.specification&&(null===(n=g.page)||void 0===n?void 0:n.components)&&(g.page.components=i)},this.handleUpdateComponent=function(e){var t=g.theme.components.findIndex((function(t){return t.id===e.component.id}));-1!==t&&(g.theme.components[t]=new C(e.component))},this.handleAddNewPageComponent=function(n){return e(g,void 0,void 0,(function(){var e,o,s,a,r,d,c;return t(this,(function(t){switch(t.label){case 0:return e=new T(n.pageComponent),this.pageComponents.some((function(t){return t.id===e.id}))?[2]:[4,this.pageDataProvider.getPageComponentPropValues(e)];case 1:return o=t.sent(),s=f.initPageComponentPropValue(o,[o.component],this.theme.settings,!0),this.initializedPropValues.push(s),(null===(d=this.page)||void 0===d?void 0:d.type)===i.CHECKOUT?[2]:(a=null===(c=this.theme)||void 0===c?void 0:c.components.find((function(t){return t.id===e.componentId})),r=this.pageComponents.find((function(e){return e.componentId===(null==a?void 0:a.id)})),(null==a?void 0:a.isCommon)&&r||(n.customIndex?this.pageComponents.splice(n.customIndex,0,e):this.pageComponents.push(e)),[2])}}))}))},this.handleDeletePageComponent=function(e){g.specification?g.specification.components=g.pageComponents.filter((function(t){return t.id!==e.pageComponentId})):g.page.components=g.pageComponents.filter((function(t){return t.id!==e.pageComponentId}))},this.handleSetSelectedComponent=function(e){g.selectedPageComponentId=e.componentId},this.handleSetHoveredComponent=function(e){g.hoveredPageComponentId=e.componentId},this.handleScrollToComponent=function(e){var t=e.componentId,n=g.componentRefs[t];n&&(g.isScrolledIntoView(n)||window.scrollTo({top:n.offsetTop,behavior:"smooth"}))},this.handleEditorReload=function(){window.location.reload()},this.updateThemeSettings=function(e){var t=e.settings;g.theme&&(g.theme.settings=new _(t))},this.router=a,r(this),this.startMessaging()}return Object.defineProperty(A.prototype,"specification",{get:function(){var e,t,n,o,s,a,r,d=this,c=this.page;return(null==c?void 0:c.type)===i.PRODUCT&&(r=null===(e=c.specifications)||void 0===e?void 0:e.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.productId)}))),(null==c?void 0:c.type)===i.CATEGORY&&(r=null===(t=c.specifications)||void 0===t?void 0:t.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.categoryId)}))),(null==c?void 0:c.type)===i.BRAND&&(r=null===(n=c.specifications)||void 0===n?void 0:n.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.brandId)}))),(null==c?void 0:c.type)===i.BLOG&&(r=null===(o=c.specifications)||void 0===o?void 0:o.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.blogId)}))),(null==c?void 0:c.type)===i.BLOG_CATEGORY&&(r=null===(s=c.specifications)||void 0===s?void 0:s.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.blogCategoryId)}))),(null==c?void 0:c.type)===i.RAFFLE_DETAIL&&(r=null===(a=c.specifications)||void 0===a?void 0:a.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.raffleId)}))),r},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"pageComponents",{get:function(){var e;return this.specification?this.specification.components:(null===(e=this.page)||void 0===e?void 0:e.components)||[]},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"selectedPageComponent",{get:function(){var e=this;return this.pageComponents.find((function(t){return t.id===e.selectedPageComponentId}))},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"selectedComponent",{get:function(){var e,t=this;return null===(e=this.theme)||void 0===e?void 0:e.components.find((function(e){var n;return e.id===(null===(n=t.selectedPageComponent)||void 0===n?void 0:n.componentId)}))},enumerable:!1,configurable:!0}),A.prototype.createLoadingListener=function(){var e=this;a((function(){return e.isLoading}),(function(){e.onLoadingChange()}))},A.prototype.getVariantIdFromParams=function(i,o){var s,a;return e(this,void 0,void 0,(function(){var e,r,d,c,p,u,l,m,h;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=new URLSearchParams("?"+o),[4,g({input:{productIdList:[i],priceListId:n.getPriceListId(),salesChannelId:n.getSalesChannelId()}})];case 1:return(r=t.sent()).isSuccess&&!(null===(a=null===(s=null==r?void 0:r.data)||void 0===s?void 0:s.data)||void 0===a?void 0:a.length)?[2]:(d=E.getVariantTypeSlug,c=v.getVariantValueSlug,p=r.data.data[0],u=p.variantTypes.map((function(e){return d(e.variantType)})),l=[],u.forEach((function(t,n){var i=p.variantTypes[n],o=e.get(t);if(o){var s=i.variantType.values.find((function(e){return c(e)===o}));s&&l.push(s)}})),(m=p.variants.find((function(e){return e.variantValues.every((function(e){return l.some((function(t){return t.id===e.id}))}))})))?[2,m.id]:[3,3]);case 2:return h=t.sent(),console.error(h),[3,3];case 3:return[2]}}))}))},A}();!function(e){e.FRAME_DID_LOAD="FRAME_DID_LOAD",e.UPDATE_FRAME_DATA="UPDATE_FRAME_DATA",e.UPDATE_THEME_JSON="UPDATE_THEME_JSON",e.UPDATE_PROP_VALUE="UPDATE_PROP_VALUE",e.UPDATE_PAGE_PARAMS="UPDATE_PAGE_PARAMS",e.UPDATE_PAGE_COMPONENT_ORDER="UPDATE_PAGE_COMPONENT_ORDER",e.ADD_COMPONENT="ADD_COMPONENT",e.DELETE_COMPONENT="DELETE_COMPONENT",e.UPDATE_COMPONENT="UPDATE_COMPONENT",e.ADD_PAGE_COMPONENT="ADD_PAGE_COMPONENT",e.DELETE_PAGE_COMPONENT="DELETE_PAGE_COMPONENT",e.COMPONENT_MOUSE_OVER="COMPONENT_MOUSE_OVER",e.COMPONENT_MOUSE_LEAVE="COMPONENT_MOUSE_LEAVE",e.COMPONENT_CLICK="COMPONENT_CLICK",e.SET_SELECTED_COMPONENT="SET_SELECTED_COMPONENT",e.SET_HOVERED_COMPONENT="SET_HOVERED_COMPONENT",e.SCROLL_TO_COMPONENT="SCROLL_TO_COMPONENT",e.UPDATE_THEME_SETTINGS="UPDATE_THEME_SETTINGS",e.EDITOR_PAGE_CHANGE="EDITOR_PAGE_CHANGE",e.EDITOR_LOADING_CHANGE="EDITOR_LOADING_CHANGE",e.EDITOR_RELOAD="EDITOR_RELOAD"}(D||(D={}));export{D as BridgeMessageType,A as default};
|
|
1
|
+
import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import{IkasStorefrontConfig as n}from"@ikas/storefront-config";import{IkasThemeJsonPageType as i,IkasBlogMetaDataTargetType as o,IkasHTMLMetaDataTargetType as a}from"@ikas/storefront-models";import"@ikas/localized-address";import{reaction as s,makeAutoObservable as r,runInAction as d}from"mobx";import{listRaffleMetaData as u,listBlogMetaData as c,listHTMLMetaData as l,setAPIClientConfig as p,listCustomerSettings as m,searchProducts as h}from"@ikas/storefront-api";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/blog-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/product-list/functions.js";import"../../models/ui/product-list/index.js";import{IkasPageDataProvider as g}from"@ikas/storefront-providers";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import{IkasPageDataInit as f}from"../../page-data-init/index.js";import{IkasVariantTypeFunctions as E,IkasVariantValueFunctions as v}from"@ikas/storefront-model-functions";import{IkasThemeJson as P}from"../../models/data/theme-json/index.js";import{IkasThemeJsonPageComponent as O}from"../../models/data/theme-json/page/component/index.js";import{IkasThemeJsonComponent as T}from"../../models/data/theme-json/component/index.js";import{IkasThemeJsonSettings as C}from"../../models/data/theme-json/settings/index.js";import{IkasBaseStore as _}from"../../store/base/index.js";var D,A=function(){function A(s){var h=this;this.theme=null,this.page=null,this.selectedPageComponentId=null,this.hoveredPageComponentId=null,this.componentRefs={},this.isLoading=!1,this.updateId="",this.locale="en",this.pageParams={},this.apiKey=null,this.pageDataProvider=null,this.initializedPropValues=[],this.startMessaging=function(){window.addEventListener("message",h.onMessage,!1),h.sendMessage(D.FRAME_DID_LOAD,"4.5.0"),h.createLoadingListener()},this.onMessage=function(n){return e(h,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:switch(e=n.data.type,i=n.data.data,e){case D.UPDATE_FRAME_DATA:return[3,1];case D.UPDATE_THEME_JSON:return[3,3];case D.UPDATE_PROP_VALUE:return[3,5];case D.UPDATE_PAGE_PARAMS:return[3,7];case D.UPDATE_PAGE_COMPONENT_ORDER:return[3,9];case D.ADD_COMPONENT:return[3,11];case D.DELETE_COMPONENT:return[3,12];case D.UPDATE_COMPONENT:return[3,13];case D.ADD_PAGE_COMPONENT:return[3,14];case D.DELETE_PAGE_COMPONENT:return[3,16];case D.SET_SELECTED_COMPONENT:return[3,17];case D.SET_HOVERED_COMPONENT:return[3,18];case D.SCROLL_TO_COMPONENT:return[3,19];case D.EDITOR_RELOAD:return[3,20];case D.UPDATE_THEME_SETTINGS:return[3,21]}return[3,22];case 1:return[4,this.handleUpdateFrameData(i)];case 2:case 4:case 6:case 8:case 10:case 15:return t.sent(),[3,23];case 3:return[4,this.handleUpdateThemeJson(i)];case 5:return[4,this.handleUpdatePropValue(i)];case 7:return[4,this.handleUpdatePageParams(i)];case 9:return[4,this.handleUpdatePageComponentOrder(i)];case 11:return this.handleAddNewComponent(i),[3,23];case 12:return this.handleDeleteComponent(i),[3,23];case 13:return this.handleUpdateComponent(i),[3,23];case 14:return[4,this.handleAddNewPageComponent(i)];case 16:return this.handleDeletePageComponent(i),[3,23];case 17:return this.handleSetSelectedComponent(i),[3,23];case 18:return this.handleSetHoveredComponent(i),[3,23];case 19:return this.handleScrollToComponent(i),[3,23];case 20:return this.handleEditorReload(),[3,23];case 21:return this.updateThemeSettings(i),[3,23];case 22:return[3,23];case 23:return[2]}}))}))},this.onClick=function(e){h.sendMessage(D.COMPONENT_CLICK,{componentId:e})},this.onMouseOver=function(e){h.sendMessage(D.COMPONENT_MOUSE_OVER,{componentId:e})},this.onMouseLeave=function(e){h.sendMessage(D.COMPONENT_MOUSE_LEAVE,{componentId:e})},this.onPageChange=function(n){return e(h,void 0,void 0,(function(){var e,s,r,p,m,h,g,f,E,v,P,O,T,C=this;return t(this,(function(t){switch(t.label){case 0:return e=n.slice(1),s=e.split("?"),e=s[0],r=s[1],this.pageParams={},n.startsWith("/account/orders/")?p=i.ORDER_DETAIL:n.startsWith("/account/orders")?p=i.ORDERS:n.startsWith("/account/addresses")?p=i.ADDRESSES:n.startsWith("/account/favorite-products")?p=i.FAVORITE_PRODUCTS:n.startsWith("/account/forgot-password")?p=i.FORGOT_PASSWORD:n.startsWith("/account/login")?p=i.LOGIN:n.startsWith("/account/raffles")?p=i.RAFFLE_ACCOUNT:n.startsWith("/account/recover-password")?p=i.RECOVER_PASSWORD:n.startsWith("/account/activate")?p=i.ACTIVATE_CUSTOMER:n.startsWith("/account/register")?p=i.REGISTER:n.startsWith("/account")?p=i.ACCOUNT:n.startsWith("/blog/")?p=i.BLOG:n.startsWith("/blog")?p=i.BLOG_INDEX:n.startsWith("/pages")?(p=i.CUSTOM,this.pageParams={slug:e.split("/")[1]}):p=n.startsWith("/raffle/")?i.RAFFLE_DETAIL:n.startsWith("/raffle")?i.RAFFLE:n.startsWith("/404")?i.NOT_FOUND:n.startsWith("/cart")?i.CART:n.startsWith("/checkout")?i.CHECKOUT:"/"===n?i.INDEX:n.startsWith("/search")?i.SEARCH:i.PRODUCT,p!==i.PRODUCT?[3,6]:[4,l({slug:{eq:e}})];case 1:return(h=t.sent()).isSuccess&&(null===(E=h.data)||void 0===E?void 0:E.length)?(g=h.data[0]).targetType!==a.PRODUCT?[3,3]:[4,this.getVariantIdFromParams(g.targetId,r)]:[3,5];case 2:return m=t.sent(),this.pageParams={productId:g.targetId,variantId:m,slug:e},[3,4];case 3:if(g.targetType===a.CATEGORY)p=i.CATEGORY,this.pageParams={categoryId:g.targetId,slug:e};else{if(g.targetType!==a.BRAND)return[2];p=i.BRAND,this.pageParams={brandId:g.targetId,slug:e}}t.label=4;case 4:return[3,6];case 5:return[2];case 6:return p!==i.BLOG?[3,8]:[4,c({slug:{eq:e}})];case 7:if(!(h=t.sent()).isSuccess||!(null===(P=null===(v=h.data)||void 0===v?void 0:v.data)||void 0===P?void 0:P.length))return[2];if((g=h.data.data[0]).targetType===o.BLOG)this.pageParams={blogId:g.targetId,slug:e};else{if(g.targetType!==o.BLOG_CATEGORY)return[2];p=i.BLOG_CATEGORY,this.pageParams={blogCategoryId:g.targetId,slug:e}}t.label=8;case 8:return p!==i.RAFFLE_DETAIL?[3,10]:[4,u({slug:{eq:e}})];case 9:if(!(h=t.sent()).isSuccess||!(null===(O=h.data)||void 0===O?void 0:O.length))return[2];g=h.data[0],this.pageParams={raffleId:g.targetId,slug:e},t.label=10;case 10:return this.isLoading=!0,[4,this.getPagePropValues(this.theme,p,this.pageParams)];case 11:return f=t.sent(),d((function(){var e,t;_.currentPageType=p,C.pageDataProvider=f,p===i.CUSTOM?C.page=null===(e=C.theme)||void 0===e?void 0:e.pages.find((function(e){return e.type===p&&e.slug===C.pageParams.slug})):C.page=null===(t=C.theme)||void 0===t?void 0:t.pages.find((function(e){return e.type===p})),requestAnimationFrame((function(){document.body.scrollTop=0,document.scrollingElement&&(document.scrollingElement.scrollTop=0)}))})),this.sendMessage(D.EDITOR_PAGE_CHANGE,{pageType:p,pageParams:this.pageParams,pageSpecificData:(null===(T=this.pageDataProvider)||void 0===T?void 0:T.pageSpecificData)||null}),this.isLoading=!1,[2]}}))}))},this.onLoadingChange=function(){h.sendMessage(D.EDITOR_LOADING_CHANGE,{isLoading:h.isLoading})},this.sendMessage=function(e,t){window.parent.postMessage({type:e,data:JSON.parse(JSON.stringify(t))},"*")},this.getPagePropValues=function(n,o,a){return e(h,void 0,void 0,(function(){var e,s,r;return t(this,(function(t){switch(t.label){case 0:return e=new g(n,a,o),(a.blogId||a.blogCategoryId)&&(e.possiblePageTypes=[i.BLOG,i.BLOG_CATEGORY]),a.raffleId&&(e.possiblePageTypes=[i.RAFFLE_DETAIL]),[4,e.getPageData()];case 1:return t.sent(),e.pageSpecificData?(f.setPageSpecificData(e.pageSpecificData,o,!0),o===i.PRODUCT&&f.pageSpecificData&&(s=f.pageSpecificData,(r=s.variants.find((function(e){return e.id===a.variantId})))&&(s.selectedVariantValues=r.variantValues))):f.pageSpecificData=void 0,this.initializedPropValues=f.initPagePropValues(e.$pageComponentPropValues,n.components,n.customData,n.settings,!1),[2,e]}}))}))},this.setComponentRef=function(e,t){h.componentRefs[t.id]=e},this.isScrolledIntoView=function(e){var t=e.getBoundingClientRect(),n=t.top,i=t.bottom;return n<window.innerHeight&&i>=0&&i<window.innerHeight&&n>0},this.handleUpdateFrameData=function(i){return e(h,void 0,void 0,(function(){var e,o,a,s,r,d,u=this;return t(this,(function(t){switch(t.label){case 0:return this.theme=new P(i.theme),this.page=null===(r=this.theme)||void 0===r?void 0:r.pages.find((function(e){return e.id===i.selectedPage.id})),this.pageParams=i.pageParams,this.apiKey=i.apiKey,this.locale=i.locale||"en",this.translations=i.translations||void 0,this.page?((e=i.storefront?i.storefront:null)&&(o=e.routings.find((function(e){return e.locale===u.locale})),n.init({storefrontId:e.id,storefrontRoutingId:null==o?void 0:o.id,storefrontThemeId:e.mainStorefrontThemeId||void 0,salesChannelId:e.salesChannelId||void 0,priceListId:(null==o?void 0:o.priceListId)||void 0,routings:e.routings,stockPreference:null===(d=this.theme)||void 0===d?void 0:d.settings.stockPreference,translations:this.translations||n.getTranslations(),isEditor:!0,apiKey:i.apiKey,apiUrl:i.apiUrl,cdnUrl:i.cdnUrl,merchantSettings:i.merchantSettings}),p(),this.setCustomerSettings()),a=Date.now()+"",this.updateId=a,this.isLoading=!0,[4,this.getPagePropValues(this.theme,this.page.type,this.pageParams||{})]):[2];case 1:return s=t.sent(),this.updateId===a&&(this.pageDataProvider=s,this.isLoading=!1),[2]}}))}))},this.setCustomerSettings=function(){return e(h,void 0,void 0,(function(){var e,i,o;return t(this,(function(t){switch(t.label){case 0:return n.getCustomerSettings()?[3,2]:[4,m({storefrontId:{eq:n.getStorefrontId()}})];case 1:(e=t.sent()).isSuccess&&(null===(o=e.data)||void 0===o?void 0:o.data.length)&&(i=e.data.data[0],n.init({customerSettings:i})),t.label=2;case 2:return[2]}}))}))},this.handleUpdateThemeJson=function(n){return e(h,void 0,void 0,(function(){return t(this,(function(e){return this.theme=new P(n.theme),[2]}))}))},this.handleUpdatePropValue=function(n){return e(h,void 0,void 0,(function(){var e,i,o,a,s,r,d,u=this;return t(this,(function(t){switch(t.label){case 0:return e=n.propName,i=n.value,(o=null===(d=null===(r=this.selectedComponent)||void 0===r?void 0:r.props)||void 0===d?void 0:d.find((function(t){return t.name===e})))&&this.selectedPageComponent?(a=this.initializedPropValues.find((function(e){return e.pageComponent.id===u.selectedPageComponentId})),this.pageDataProvider&&a?(this.selectedPageComponent.propValues[e]=i,[4,this.pageDataProvider.getPageComponentPropValue(this.selectedPageComponent,o)]):[2]):[2];case 1:return(s=t.sent())&&JSON.stringify(s).includes("href")?[4,this.pageDataProvider.setLinkSlugs()]:[3,3];case 2:t.sent(),t.label=3;case 3:return a.propValues[e]=f.initPropValue(o,s,this.theme.settings,!0),[2]}}))}))},this.handleUpdatePageParams=function(n){return e(h,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return this.pageParams=n.pageParams,this.isLoading=!0,[4,this.getPagePropValues(this.theme,this.page.type,this.pageParams||{})];case 1:return e=t.sent(),this.pageDataProvider=e,this.isLoading=!1,[2]}}))}))},this.handleUpdatePageComponentOrder=function(n){return e(h,void 0,void 0,(function(){return t(this,(function(e){return this.specification?this.specification.components=n.pageComponents.map((function(e){return new O(e)})):this.page.components=n.pageComponents.map((function(e){return new O(e)})),[2]}))}))},this.handleAddNewComponent=function(e){var t,n=new T(e.component);null===(t=h.theme)||void 0===t||t.components.push(n)},this.handleDeleteComponent=function(e){var t,n;(null===(t=h.theme)||void 0===t?void 0:t.components)&&(h.theme.components=h.theme.components.filter((function(t){return t.id!==e.componentId})));var i=h.pageComponents.filter((function(t){return t.componentId!==e.componentId}))||[];h.specification&&h.specification.components&&(h.specification.components=i),!h.specification&&(null===(n=h.page)||void 0===n?void 0:n.components)&&(h.page.components=i)},this.handleUpdateComponent=function(e){var t=h.theme.components.findIndex((function(t){return t.id===e.component.id}));-1!==t&&(h.theme.components[t]=new T(e.component))},this.handleAddNewPageComponent=function(n){return e(h,void 0,void 0,(function(){var e,o,a,s,r,d,u;return t(this,(function(t){switch(t.label){case 0:return e=new O(n.pageComponent),this.pageComponents.some((function(t){return t.id===e.id}))?[2]:[4,this.pageDataProvider.getPageComponentPropValues(e)];case 1:return o=t.sent(),a=f.initPageComponentPropValue(o,[o.component],this.theme.settings,!0),this.initializedPropValues.push(a),(null===(d=this.page)||void 0===d?void 0:d.type)===i.CHECKOUT?[2]:(s=null===(u=this.theme)||void 0===u?void 0:u.components.find((function(t){return t.id===e.componentId})),r=this.pageComponents.find((function(e){return e.componentId===(null==s?void 0:s.id)})),(null==s?void 0:s.isCommon)&&r||(n.customIndex?this.pageComponents.splice(n.customIndex,0,e):this.pageComponents.push(e)),[2])}}))}))},this.handleDeletePageComponent=function(e){h.specification?h.specification.components=h.pageComponents.filter((function(t){return t.id!==e.pageComponentId})):h.page.components=h.pageComponents.filter((function(t){return t.id!==e.pageComponentId}))},this.handleSetSelectedComponent=function(e){h.selectedPageComponentId=e.componentId},this.handleSetHoveredComponent=function(e){h.hoveredPageComponentId=e.componentId},this.handleScrollToComponent=function(e){var t=e.componentId,n=h.componentRefs[t];n&&(h.isScrolledIntoView(n)||window.scrollTo({top:n.offsetTop,behavior:"smooth"}))},this.handleEditorReload=function(){window.location.reload()},this.updateThemeSettings=function(e){var t=e.settings;h.theme&&(h.theme.settings=new C(t))},this.router=s,r(this),this.startMessaging()}return Object.defineProperty(A.prototype,"specification",{get:function(){var e,t,n,o,a,s,r,d=this,u=this.page;return(null==u?void 0:u.type)===i.PRODUCT&&(r=null===(e=u.specifications)||void 0===e?void 0:e.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.productId)}))),(null==u?void 0:u.type)===i.CATEGORY&&(r=null===(t=u.specifications)||void 0===t?void 0:t.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.categoryId)}))),(null==u?void 0:u.type)===i.BRAND&&(r=null===(n=u.specifications)||void 0===n?void 0:n.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.brandId)}))),(null==u?void 0:u.type)===i.BLOG&&(r=null===(o=u.specifications)||void 0===o?void 0:o.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.blogId)}))),(null==u?void 0:u.type)===i.BLOG_CATEGORY&&(r=null===(a=u.specifications)||void 0===a?void 0:a.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.blogCategoryId)}))),(null==u?void 0:u.type)===i.RAFFLE_DETAIL&&(r=null===(s=u.specifications)||void 0===s?void 0:s.find((function(e){var t;return e.id===(null===(t=d.pageParams)||void 0===t?void 0:t.raffleId)}))),r},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"pageComponents",{get:function(){var e;return this.specification?this.specification.components:(null===(e=this.page)||void 0===e?void 0:e.components)||[]},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"selectedPageComponent",{get:function(){var e=this;return this.pageComponents.find((function(t){return t.id===e.selectedPageComponentId}))},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"selectedComponent",{get:function(){var e,t=this;return null===(e=this.theme)||void 0===e?void 0:e.components.find((function(e){var n;return e.id===(null===(n=t.selectedPageComponent)||void 0===n?void 0:n.componentId)}))},enumerable:!1,configurable:!0}),A.prototype.createLoadingListener=function(){var e=this;s((function(){return e.isLoading}),(function(){e.onLoadingChange()}))},A.prototype.getVariantIdFromParams=function(i,o){var a,s;return e(this,void 0,void 0,(function(){var e,r,d,u,c,l,p,m,g;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=new URLSearchParams("?"+o),[4,h({input:{productIdList:[i],priceListId:n.getPriceListId(),salesChannelId:n.getSalesChannelId()}})];case 1:return(r=t.sent()).isSuccess&&!(null===(s=null===(a=null==r?void 0:r.data)||void 0===a?void 0:a.data)||void 0===s?void 0:s.length)?[2]:(d=E.getVariantTypeSlug,u=v.getVariantValueSlug,c=r.data.data[0],l=c.variantTypes.map((function(e){return d(e.variantType)})),p=[],l.forEach((function(t,n){var i=c.variantTypes[n],o=e.get(t);if(o){var a=i.variantType.values.find((function(e){return u(e)===o}));a&&p.push(a)}})),(m=c.variants.find((function(e){return e.variantValues.every((function(e){return p.some((function(t){return t.id===e.id}))}))})))?[2,m.id]:[3,3]);case 2:return g=t.sent(),console.error(g),[3,3];case 3:return[2]}}))}))},A}();!function(e){e.FRAME_DID_LOAD="FRAME_DID_LOAD",e.UPDATE_FRAME_DATA="UPDATE_FRAME_DATA",e.UPDATE_THEME_JSON="UPDATE_THEME_JSON",e.UPDATE_PROP_VALUE="UPDATE_PROP_VALUE",e.UPDATE_PAGE_PARAMS="UPDATE_PAGE_PARAMS",e.UPDATE_PAGE_COMPONENT_ORDER="UPDATE_PAGE_COMPONENT_ORDER",e.ADD_COMPONENT="ADD_COMPONENT",e.DELETE_COMPONENT="DELETE_COMPONENT",e.UPDATE_COMPONENT="UPDATE_COMPONENT",e.ADD_PAGE_COMPONENT="ADD_PAGE_COMPONENT",e.DELETE_PAGE_COMPONENT="DELETE_PAGE_COMPONENT",e.COMPONENT_MOUSE_OVER="COMPONENT_MOUSE_OVER",e.COMPONENT_MOUSE_LEAVE="COMPONENT_MOUSE_LEAVE",e.COMPONENT_CLICK="COMPONENT_CLICK",e.SET_SELECTED_COMPONENT="SET_SELECTED_COMPONENT",e.SET_HOVERED_COMPONENT="SET_HOVERED_COMPONENT",e.SCROLL_TO_COMPONENT="SCROLL_TO_COMPONENT",e.UPDATE_THEME_SETTINGS="UPDATE_THEME_SETTINGS",e.EDITOR_PAGE_CHANGE="EDITOR_PAGE_CHANGE",e.EDITOR_LOADING_CHANGE="EDITOR_LOADING_CHANGE",e.EDITOR_RELOAD="EDITOR_RELOAD"}(D||(D={}));export{D as BridgeMessageType,A as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IkasCheckout as ICheckout, IkasPaymentGateway } from "@ikas/storefront-models";
|
|
2
2
|
import { IkasLocalizedOrderAddress } from "../localized-order-address";
|
|
3
|
-
export
|
|
3
|
+
export type IkasCheckout = {
|
|
4
4
|
appliedCouponCode?: string | null;
|
|
5
5
|
selectedPaymentGateway?: IkasPaymentGateway | null;
|
|
6
6
|
masterPassPaymentGateway?: IkasPaymentGateway | null;
|
|
@@ -17,6 +17,7 @@ export declare function getFieldSettings(address: IkasLocalizedCustomerAddress):
|
|
|
17
17
|
state: AddressFormField;
|
|
18
18
|
city: AddressFormField;
|
|
19
19
|
district: AddressFormField;
|
|
20
|
+
region: AddressFormField;
|
|
20
21
|
phone: AddressFormField;
|
|
21
22
|
company: AddressFormField;
|
|
22
23
|
taxOffice: AddressFormField;
|
|
@@ -37,6 +38,7 @@ export declare function validateIkasLocalizedCustomerAddress(address: IkasLocali
|
|
|
37
38
|
state: ErrorType;
|
|
38
39
|
city: ErrorType;
|
|
39
40
|
district: ErrorType;
|
|
41
|
+
region: ErrorType;
|
|
40
42
|
phone: ErrorType;
|
|
41
43
|
company: ErrorType;
|
|
42
44
|
taxOffice: ErrorType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LocalizedAddressModel } from "@ikas/localized-address";
|
|
2
2
|
import { IkasCheckoutSettings, IkasCustomerAddress } from "@ikas/storefront-models";
|
|
3
|
-
export
|
|
3
|
+
export type IkasLocalizedCustomerAddress = {
|
|
4
4
|
countrySettings: LocalizedAddressModel | null;
|
|
5
5
|
checkoutSettings: IkasCheckoutSettings | null;
|
|
6
6
|
} & IkasCustomerAddress;
|
|
@@ -17,6 +17,7 @@ export declare function getFieldSettings(address: IkasLocalizedOrderAddress): {
|
|
|
17
17
|
state: import("@ikas/localized-address").AddressFormField;
|
|
18
18
|
city: import("@ikas/localized-address").AddressFormField;
|
|
19
19
|
district: import("@ikas/localized-address").AddressFormField;
|
|
20
|
+
region: import("@ikas/localized-address").AddressFormField;
|
|
20
21
|
phone: import("@ikas/localized-address").AddressFormField;
|
|
21
22
|
company: import("@ikas/localized-address").AddressFormField;
|
|
22
23
|
taxOffice: import("@ikas/localized-address").AddressFormField;
|
|
@@ -36,6 +37,7 @@ export declare function validateIkasLocalizedOrderAddress(address: IkasLocalized
|
|
|
36
37
|
state: import("@ikas/localized-address").ErrorType;
|
|
37
38
|
city: import("@ikas/localized-address").ErrorType;
|
|
38
39
|
district: import("@ikas/localized-address").ErrorType;
|
|
40
|
+
region: import("@ikas/localized-address").ErrorType;
|
|
39
41
|
phone: import("@ikas/localized-address").ErrorType;
|
|
40
42
|
company: import("@ikas/localized-address").ErrorType;
|
|
41
43
|
taxOffice: import("@ikas/localized-address").ErrorType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LocalizedAddressModel } from "@ikas/localized-address";
|
|
2
2
|
import { IkasCheckoutSettings, IkasOrderAddress } from "@ikas/storefront-models";
|
|
3
|
-
export
|
|
3
|
+
export type IkasLocalizedOrderAddress = {
|
|
4
4
|
countrySettings: LocalizedAddressModel | null;
|
|
5
5
|
checkoutSettings: IkasCheckoutSettings | null;
|
|
6
6
|
} & IkasOrderAddress;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IkasBlogCategoryListPropValue } from "@ikas/storefront-providers";
|
|
2
2
|
import { IkasBlogCategory } from "../../data";
|
|
3
|
-
export
|
|
3
|
+
export type IkasBlogCategoryList = {
|
|
4
4
|
data: IkasBlogCategory[];
|
|
5
5
|
type: IkasBlogCategoryListType;
|
|
6
6
|
limit: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IkasBrand } from "../../../models/data";
|
|
2
2
|
import { IkasBrandListPropValue } from "@ikas/storefront-providers";
|
|
3
|
-
export
|
|
3
|
+
export type IkasBrandList = {
|
|
4
4
|
data: IkasBrand[];
|
|
5
5
|
type: IkasBrandListType;
|
|
6
6
|
sort: IkasBrandListSortType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IkasCategory } from "../../../models/data";
|
|
2
2
|
import { IkasCategoryListPropValue } from "@ikas/storefront-providers";
|
|
3
|
-
export
|
|
3
|
+
export type IkasCategoryList = {
|
|
4
4
|
data: IkasCategory[];
|
|
5
5
|
type: IkasCategoryListType;
|
|
6
6
|
sort: IkasCategoryListSortType;
|
|
@@ -5,7 +5,7 @@ import { IkasCategoryList } from "../category-list";
|
|
|
5
5
|
import { IkasCustomerReviewList } from "../customer-review-list";
|
|
6
6
|
import { IkasCustomerReviewSummaryList } from "../customer-review-summary-list";
|
|
7
7
|
import { IkasRaffleList } from "../raffle-list";
|
|
8
|
-
|
|
8
|
+
type ListType = IkasBlogCategoryList | IkasBlogList | IkasCategoryList | IkasBrandList | IkasCustomerReviewList | IkasCustomerReviewSummaryList | IkasRaffleList;
|
|
9
9
|
export declare function getPageCount(list: ListType): number;
|
|
10
10
|
export declare function isStatic(list: ListType): boolean;
|
|
11
11
|
export declare function hasPrev(list: ListType): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IkasBrand, IkasProduct, IkasProductFilter, IkasFilterCategory, IkasThemeJsonPageType, IkasCategory } from "../../../models/data";
|
|
2
2
|
import { IkasProductListPropValue, IkasRelatedProductProps, IkasViewedTogetherProductProps } from "@ikas/storefront-providers";
|
|
3
|
-
export
|
|
3
|
+
export type IkasProductList = {
|
|
4
4
|
data: IkasProduct[];
|
|
5
5
|
type: IkasProductListType;
|
|
6
6
|
pageType: IkasThemeJsonPageType;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { PhoneRule, RequiredRule } from "../rules";
|
|
2
2
|
import { IkasCustomer } from "../../../data";
|
|
3
|
-
|
|
3
|
+
type AccountInfoFormPropsValidatorMessage<T> = {
|
|
4
4
|
requiredRule: ((model: T) => string) | string;
|
|
5
5
|
phoneRule?: ((model: T) => string) | string;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
type AccountInfoFormProps<T> = {
|
|
8
8
|
message: AccountInfoFormPropsValidatorMessage<T>;
|
|
9
9
|
customer: IkasCustomer;
|
|
10
10
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { PhoneRule, RequiredRule } from "../rules";
|
|
2
2
|
import { IkasCity, IkasCountry, IkasCustomerAddress, IkasDistrict, IkasState } from "../../../data";
|
|
3
|
-
|
|
3
|
+
type AddressFormPropsValidatorMessage<T> = {
|
|
4
4
|
requiredRule: ((model: T) => string) | string;
|
|
5
5
|
phoneRule?: ((model: T) => string) | string;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
type AddressFormProps<T> = {
|
|
8
8
|
message: AddressFormPropsValidatorMessage<T>;
|
|
9
9
|
address?: IkasCustomerAddress;
|
|
10
10
|
};
|