@ikas/bp-storefront 2.8.0 → 2.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics/analytics-functions/addToCart.js +1 -1
- package/dist/analytics/analytics-functions/addToWishlist.js +1 -1
- package/dist/analytics/analytics-functions/completeRegistration.js +1 -1
- package/dist/analytics/analytics-functions/contactForm.js +1 -1
- package/dist/analytics/analytics-functions/createEmailSubscription.js +1 -1
- package/dist/analytics/analytics-functions/customerLogin.js +1 -1
- package/dist/analytics/analytics-functions/customerLogout.js +1 -1
- package/dist/analytics/analytics-functions/customerVisit.js +1 -1
- package/dist/analytics/analytics-functions/pageView.js +1 -1
- package/dist/analytics/analytics-functions/productView.js +1 -1
- package/dist/analytics/analytics-functions/removeFromCart.js +1 -1
- package/dist/analytics/analytics-functions/search.js +1 -1
- package/dist/analytics/analytics-functions/viewBrand.js +1 -1
- package/dist/analytics/analytics-functions/viewCart.js +1 -1
- package/dist/analytics/analytics-functions/viewCategory.js +1 -1
- package/dist/analytics/analytics-functions/viewListing.js +1 -1
- package/dist/analytics/analytics-functions/viewSearchResults.js +1 -1
- package/dist/analytics/analytics-functions/viewStorefrontPopup.js +1 -1
- package/dist/analytics/events.d.ts +8 -0
- package/dist/analytics/events.js +1 -1
- package/dist/analytics/ikas/analytics.js +1 -1
- package/dist/functions/api/cart/index.d.ts +2 -0
- package/dist/functions/api/cart/index.js +1 -1
- package/dist/functions/models/image/index.d.ts +13 -8
- package/dist/functions/models/index.d.ts +1 -0
- package/dist/functions/models/order/index.d.ts +21 -0
- package/dist/functions/models/order/index.js +1 -1
- package/dist/functions/models/product-list/index.js +1 -1
- package/dist/functions/models/validator/deactivate-customer/index.d.ts +54 -0
- package/dist/functions/models/validator/deactivate-customer/index.js +1 -0
- package/dist/functions/stores/base/index.d.ts +67 -0
- package/dist/functions/stores/base/index.js +1 -1
- package/dist/functions/stores/cart/index.d.ts +46 -2
- package/dist/functions/stores/cart/index.js +1 -1
- package/dist/functions/stores/customer/index.d.ts +100 -2
- package/dist/functions/stores/customer/index.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/packages/storefront-api/src/__api/mutations/removeGiftCardFromCart.js +1 -0
- package/dist/packages/storefront-api-client/src/utils/api.js +1 -1
- package/dist/packages/storefront-config/src/theme-globals.js +1 -1
- package/dist/router/index.d.ts +28 -0
- package/dist/router/index.js +1 -1
- package/dist/storefront-api/src/__api/mutations/removeGiftCardFromCart.d.ts +7 -0
- package/dist/storefront-api/src/__api/types/index.d.ts +32 -4
- package/dist/storefront-api-client/src/utils/api.d.ts +7 -0
- package/dist/storefront-config/src/theme-globals.d.ts +1 -1
- package/dist/storefront-models/src/index.d.ts +2 -0
- package/dist/storefront-models/src/models/blueprint/prop-value/attribute-list.d.ts +2 -0
- package/dist/storefront-models/src/models/blueprint/prop-value/attribute.d.ts +2 -0
- package/dist/storefront-models/src/models/blueprint/prop-value/index.d.ts +1 -0
- package/dist/storefront-models/src/models/blueprint/prop-value/variable-binding.d.ts +16 -0
- package/dist/storefront-models/src/models/image/index.d.ts +7 -0
- package/dist/storefront-models/src/models/order/gift-card-line/index.d.ts +15 -0
- package/dist/storefront-models/src/models/order/index.d.ts +2 -0
- package/dist/storefront-models/src/models/order/line-item/index.d.ts +1 -1
- package/dist/storefront-models/src/models/order/package/index.d.ts +1 -1
- package/dist/storefront-models/src/models/payment-gateway/index.d.ts +1 -1
- package/dist/storefront-models/src/models/product/image/index.d.ts +5 -0
- package/dist/storefront-models/src/models/validator/deactivate-customer/index.d.ts +4 -0
- package/dist/stores/customer/index.d.ts +2 -1
- package/dist/stores/customer/index.js +1 -1
- package/dist/utils/currency.d.ts +36 -3
- package/package.json +1 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { IBlueprintPropValueVariableBinding } from "./variable-binding";
|
|
1
2
|
export interface IBlueprintAttributePropValue {
|
|
2
3
|
productId?: string | null;
|
|
3
4
|
variantId?: string | null;
|
|
4
5
|
attributeId?: string | null;
|
|
5
6
|
usePageData?: boolean | null;
|
|
7
|
+
productVariable?: IBlueprintPropValueVariableBinding | null;
|
|
6
8
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A theme data binding stored INSIDE a prop value, so a single field of that value can follow a
|
|
3
|
+
* bound variable while the rest of the value stays statically authored (see
|
|
4
|
+
* `IBlueprintAttributePropValue.productVariable`). `key`/`variableId`/`path` mirror the editor's
|
|
5
|
+
* `IThemeVariableBinding` and `refId`/`componentId` mirror the surrounding `IThemeDynamicValueValue`
|
|
6
|
+
* context a COMPONENT_LIST child needs to resolve an ancestor's variable; duplicated here because
|
|
7
|
+
* storefront-models must not depend on editor-models. Only the editor and the code generators
|
|
8
|
+
* interpret it — the storefront runtime carries it through untouched.
|
|
9
|
+
*/
|
|
10
|
+
export interface IBlueprintPropValueVariableBinding {
|
|
11
|
+
key?: string | null;
|
|
12
|
+
variableId?: string | null;
|
|
13
|
+
path?: string[] | null;
|
|
14
|
+
refId?: string | null;
|
|
15
|
+
componentId?: string | null;
|
|
16
|
+
}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
export type IkasImage = {
|
|
2
2
|
id: string;
|
|
3
|
+
/**
|
|
4
|
+
* True when this media item is a VIDEO, not an image. Product media sets routinely mix both.
|
|
5
|
+
* getDefaultSrc/getSrc/getThumbnailSrc then return an .mp4 URL, so rendering it in an <img>
|
|
6
|
+
* produces broken media — branch on this flag and render <video src={getDefaultSrc(item)}>.
|
|
7
|
+
* Videos have no resized variant and no poster URL: the size argument is ignored, and
|
|
8
|
+
* createMediaSrcset does not apply.
|
|
9
|
+
*/
|
|
3
10
|
isVideo?: boolean | null;
|
|
4
11
|
altText?: string | null;
|
|
5
12
|
fileName?: string | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IkasTransactionType } from "../transaction";
|
|
2
|
+
export type IkasOrderGiftCardLine = {
|
|
3
|
+
id: string;
|
|
4
|
+
amount: number;
|
|
5
|
+
code: string;
|
|
6
|
+
giftCardId: string;
|
|
7
|
+
type: IkasGiftCardType | null;
|
|
8
|
+
appliedTransactions: IkasOrderGiftCardLineAppliedTransaction[];
|
|
9
|
+
};
|
|
10
|
+
export type IkasOrderGiftCardLineAppliedTransaction = {
|
|
11
|
+
id: string;
|
|
12
|
+
amount: number;
|
|
13
|
+
type: IkasTransactionType;
|
|
14
|
+
};
|
|
15
|
+
export type IkasGiftCardType = "GIFT_CARD" | "STORE_CREDIT";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IkasOrderAddress } from "./address";
|
|
2
2
|
import { IkasOrderAdjustment } from "./adjustment";
|
|
3
3
|
import { IkasOrderCustomer } from "./customer";
|
|
4
|
+
import { IkasOrderGiftCardLine } from "./gift-card-line";
|
|
4
5
|
import { IkasOrderGiftPackageLine } from "./gift-line";
|
|
5
6
|
import { IkasInvoice } from "./invoice";
|
|
6
7
|
import { IkasOrderLineItem } from "./line-item";
|
|
@@ -21,6 +22,7 @@ export type IkasOrder = {
|
|
|
21
22
|
currencySymbol: string | null;
|
|
22
23
|
customer: IkasOrderCustomer | null;
|
|
23
24
|
customerId: string | null;
|
|
25
|
+
giftCardLines: IkasOrderGiftCardLine[] | null;
|
|
24
26
|
giftPackageLines: IkasOrderGiftPackageLine[] | null;
|
|
25
27
|
giftPackageNote: string | null;
|
|
26
28
|
invoices: IkasInvoice[] | null;
|
|
@@ -27,4 +27,4 @@ export type IkasOrderLineItem = {
|
|
|
27
27
|
orderedAt: number;
|
|
28
28
|
_refundQuantity: number | null;
|
|
29
29
|
};
|
|
30
|
-
export type IkasOrderLineItemStatus = "CANCELLED" | "CANCEL_REJECTED" | "CANCEL_REQUESTED" | "DELIVERED" | "FULFILLED" | "REFUNDED" | "REFUND_REJECTED" | "REFUND_REQUESTED" | "REFUND_REQUEST_ACCEPTED" | "UNFULFILLED";
|
|
30
|
+
export type IkasOrderLineItemStatus = "CANCELLED" | "CANCEL_REJECTED" | "CANCEL_REQUESTED" | "DELIVERED" | "FULFILLED" | "PLANNED" | "REFUNDED" | "REFUND_REJECTED" | "REFUND_REQUESTED" | "REFUND_REQUEST_ACCEPTED" | "RETURN_DELIVERED" | "RETURN_IN_TRANSIT" | "RETURN_PARCEL_WAITING" | "RETURN_REJECTED" | "UNFULFILLED" | "WAITING_FOR_PACKAGING";
|
|
@@ -13,7 +13,7 @@ export type IkasOrderPackage = {
|
|
|
13
13
|
stockLocationId: string;
|
|
14
14
|
trackingInfo: IkasTrackingInfo | null;
|
|
15
15
|
};
|
|
16
|
-
export type IkasOrderPackageFullfillStatus = "
|
|
16
|
+
export type IkasOrderPackageFullfillStatus = "CANCELLED" | "CANCEL_REJECTED" | "CANCEL_REQUESTED" | "DELIVERED" | "ERROR" | "FULFILLED" | "PLANNED" | "READY_FOR_PICK_UP" | "READY_FOR_SHIPMENT" | "REFUNDED" | "REFUND_REJECTED" | "REFUND_REQUESTED" | "REFUND_REQUEST_ACCEPTED" | "RETURN_DELIVERED" | "RETURN_IN_TRANSIT" | "RETURN_PARCEL_WAITING" | "RETURN_REJECTED" | "UNABLE_TO_DELIVER" | "UNFULFILLED" | "WAITING_FOR_PACKAGING";
|
|
17
17
|
export type IkasDisplayedPackage = {
|
|
18
18
|
id: string;
|
|
19
19
|
createdAt: number;
|
|
@@ -22,7 +22,7 @@ export type IkasPaymentGateway = {
|
|
|
22
22
|
settings?: IkasPaymentGatewaySettings[] | null;
|
|
23
23
|
translations?: IkasPaymentGatewayTranslation[] | null;
|
|
24
24
|
};
|
|
25
|
-
export type IkasPaymentMethodType = "APP_PAYMENT" | "BANK_REDIRECT" | "BUY_ONLINE_PAY_AT_STORE" | "CASH" | "CASH_ON_DELIVERY" | "CREDIT_CARD" | "CREDIT_CARD_ON_DELIVERY" | "DIRECT_DEBIT" | "GIFT_CARD" | "MONEY_ORDER" | "OTHER" | "PAY_LATER" | "SLICE_IT" | "WALLET";
|
|
25
|
+
export type IkasPaymentMethodType = "APP_PAYMENT" | "BANK_REDIRECT" | "BUY_ONLINE_PAY_AT_STORE" | "CASH" | "CASH_ON_DELIVERY" | "CREDIT_CARD" | "CREDIT_CARD_ON_DELIVERY" | "DIRECT_DEBIT" | "GIFT_CARD" | "MONEY_ORDER" | "OTHER" | "PAY_LATER" | "SLICE_IT" | "STORE_CREDIT" | "WALLET";
|
|
26
26
|
export type IkasPaymentMethod = {
|
|
27
27
|
name: string;
|
|
28
28
|
logoUrl: string | null;
|
|
@@ -3,6 +3,11 @@ export type IkasProductImage = {
|
|
|
3
3
|
fileName: string | null;
|
|
4
4
|
imageId: string | null;
|
|
5
5
|
isMain: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* True when this media item is a VIDEO, not an image. Product galleries, cards, swatches and
|
|
8
|
+
* line items must branch on it: render <video src={getDefaultSrc(item.image)}> instead of an
|
|
9
|
+
* <img>, otherwise the .mp4 URL lands in an <img> and the media breaks.
|
|
10
|
+
*/
|
|
6
11
|
isVideo: boolean | null;
|
|
7
12
|
order: number;
|
|
8
13
|
image?: IkasImage | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ProductFacetCount, SearchProduct } from "../../storefront-api/src";
|
|
2
2
|
import { APIResponse } from "../../storefront-api-client/src";
|
|
3
|
-
import { AccountInfoForm, AddressForm, BackInStockNotificationForm, ContactForm, CouponCodeForm, CustomerReviewForm, ForgotPasswordForm, IkasCustomer, IkasFavoriteProduct, IkasLastViewedProduct, IkasOrderRefundSettings, IkasProduct, LoginForm, NewsletterSubscriptionForm, OrderTrackingForm, RecoverPasswordForm, RegisterForm, SmsLoginForm, VerifyPhoneNumberForm } from "../../storefront-models/src";
|
|
3
|
+
import { AccountInfoForm, AddressForm, BackInStockNotificationForm, ContactForm, CouponCodeForm, CustomerReviewForm, DeactivateCustomerForm, ForgotPasswordForm, IkasCustomer, IkasFavoriteProduct, IkasLastViewedProduct, IkasOrderRefundSettings, IkasProduct, LoginForm, NewsletterSubscriptionForm, OrderTrackingForm, RecoverPasswordForm, RegisterForm, SmsLoginForm, VerifyPhoneNumberForm } from "../../storefront-models/src";
|
|
4
4
|
export type IkasCustomerStore = {
|
|
5
5
|
customer: IkasCustomer | null;
|
|
6
6
|
_token: string | null;
|
|
@@ -19,6 +19,7 @@ export type IkasCustomerStore = {
|
|
|
19
19
|
_contactForm: ContactForm | null;
|
|
20
20
|
_couponCodeForm: CouponCodeForm | null;
|
|
21
21
|
_customerReviewForms: Record<string, CustomerReviewForm>;
|
|
22
|
+
_deactivateCustomerForm: DeactivateCustomerForm | null;
|
|
22
23
|
_forgotPasswordForm: ForgotPasswordForm | null;
|
|
23
24
|
_loginForm: LoginForm | null;
|
|
24
25
|
_smsLoginForm: SmsLoginForm | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{observable as o}from'./../../ext/mobx/dist/mobx.esm.js';var r=o({customer:null,_token:null,_tokenExpiry:null,_initialized:!1,_visitorSubscribedEmail:!1,_lastViewedProducts:[],_customerConsentGranted:!1,_refundSettings:null,_captchaToken:null,_savedLastViewedProducts:[],_savedLastViewedProductsResponse:null,_accountInfoForm:null,_addressForms:{},_backInStockForms:{},_contactForm:null,_couponCodeForm:null,_customerReviewForms:{},_forgotPasswordForm:null,_loginForm:null,_smsLoginForm:null,_verifyPhoneNumberForm:null,_newsletterSubscriptionForm:null,_orderTrackingForm:null,_recoverPasswordForm:null,_registerForm:null,_favoriteProducts:[],_isFavoriteProductsLoaded:!1});export{r as customerStore};
|
|
1
|
+
import{observable as o}from'./../../ext/mobx/dist/mobx.esm.js';var r=o({customer:null,_token:null,_tokenExpiry:null,_initialized:!1,_visitorSubscribedEmail:!1,_lastViewedProducts:[],_customerConsentGranted:!1,_refundSettings:null,_captchaToken:null,_savedLastViewedProducts:[],_savedLastViewedProductsResponse:null,_accountInfoForm:null,_addressForms:{},_backInStockForms:{},_contactForm:null,_couponCodeForm:null,_customerReviewForms:{},_deactivateCustomerForm:null,_forgotPasswordForm:null,_loginForm:null,_smsLoginForm:null,_verifyPhoneNumberForm:null,_newsletterSubscriptionForm:null,_orderTrackingForm:null,_recoverPasswordForm:null,_registerForm:null,_favoriteProducts:[],_isFavoriteProductsLoaded:!1});export{r as customerStore};
|
package/dist/utils/currency.d.ts
CHANGED
|
@@ -1,7 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Format a free-standing amount with the merchant's currency format settings. Use this for
|
|
3
|
+
* amounts that are NOT tied to a model (remaining amount to free shipping, gift wrap threshold,
|
|
4
|
+
* bulk discount limits, cart limit warnings). For model-bound prices, prefer the
|
|
5
|
+
* `get*FormattedPrice` helpers — they call this function internally.
|
|
2
6
|
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
7
|
+
* Applies the merchant's `currencyFormats` entry for the given currency code (symbol,
|
|
8
|
+
* symbolPosition, thousandSeparator, decimalSeparator, omitZeroDecimal). Behavior details:
|
|
9
|
+
* always two decimal places, and a space between the symbol and the number. `omitZeroDecimal`
|
|
10
|
+
* drops the fraction only when it is exactly `00`.
|
|
11
|
+
*
|
|
12
|
+
* Do NOT use `Intl.NumberFormat` for currency — it falls back to the browser locale and
|
|
13
|
+
* produces a format that conflicts with platform-formatted prices on the same screen.
|
|
14
|
+
*
|
|
15
|
+
* @ai-category Pricing
|
|
16
|
+
* @ai-related getProductVariantFormattedFinalPrice, getOrderLineItemFormattedFinalPrice, getIkasOrderFormattedTotalFinalPrice
|
|
17
|
+
*
|
|
18
|
+
* @param price - The amount to format
|
|
19
|
+
* @param currencyCode - Currency code used to look up the merchant format settings (e.g. "TRY", "USD")
|
|
20
|
+
* @param currencySymbol - Fallback symbol used when the merchant has no format entry for the code.
|
|
21
|
+
* Always pass the symbol from the model you took the amount from (e.g. `cart.currencySymbol`) —
|
|
22
|
+
* passing `null` can render the amount with no symbol at all.
|
|
23
|
+
* @returns The amount formatted with the merchant's currency format (e.g. "₺ 1,950.00")
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* import { cartStore, formatCurrency } from "@ikas/bp-storefront";
|
|
28
|
+
*
|
|
29
|
+
* function FreeShippingBar({ threshold }: { threshold: number }) {
|
|
30
|
+
* const cart = cartStore.cart;
|
|
31
|
+
* if (!cart) return null;
|
|
32
|
+
*
|
|
33
|
+
* const remaining = threshold - cart.totalFinalPrice;
|
|
34
|
+
* if (remaining <= 0) return <span>Free shipping unlocked!</span>;
|
|
35
|
+
*
|
|
36
|
+
* return <span>Add {formatCurrency(remaining, cart.currencyCode, cart.currencySymbol)} more for free shipping</span>;
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
6
39
|
*/
|
|
7
40
|
export declare const formatCurrency: (price: number, currencyCode: string, currencySymbol: string | null) => string;
|