@ikas/bp-storefront 1.4.0-beta.23 → 1.4.0-beta.230
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/analytics/openai/addToCart.d.ts +2 -0
- package/dist/analytics/openai/addToCart.js +1 -0
- package/dist/analytics/openai/completeRegistration.d.ts +1 -0
- package/dist/analytics/openai/completeRegistration.js +1 -0
- package/dist/analytics/openai/contactForm.d.ts +1 -0
- package/dist/analytics/openai/contactForm.js +1 -0
- package/dist/analytics/openai/initAdvancedMatching.d.ts +12 -0
- package/dist/analytics/openai/initAdvancedMatching.js +1 -0
- package/dist/analytics/openai/pageView.d.ts +1 -0
- package/dist/analytics/openai/pageView.js +1 -0
- package/dist/analytics/openai/productView.d.ts +2 -0
- package/dist/analytics/openai/productView.js +1 -0
- package/dist/analytics/openai/utils.d.ts +26 -0
- package/dist/analytics/openai/utils.js +1 -0
- package/dist/analytics/utils.d.ts +1 -0
- package/dist/analytics/utils.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/api/customer/index.d.ts +12 -2
- package/dist/functions/api/customer/index.js +1 -1
- package/dist/functions/api/loyalty/index.d.ts +2 -1
- package/dist/functions/api/loyalty/index.js +1 -1
- package/dist/functions/api/product/index.js +1 -1
- package/dist/functions/models/attribute-detail/index.d.ts +3 -0
- package/dist/functions/models/attribute-list/index.d.ts +3 -0
- package/dist/functions/models/image/index.d.ts +71 -21
- package/dist/functions/models/image/index.js +1 -1
- package/dist/functions/models/index.d.ts +1 -0
- package/dist/functions/models/order/index.d.ts +139 -4
- package/dist/functions/models/order/index.js +1 -1
- package/dist/functions/models/product/attribute-value/index.d.ts +5 -0
- package/dist/functions/models/product/index.d.ts +22 -0
- package/dist/functions/models/product/index.js +1 -1
- package/dist/functions/models/product/variant/index.d.ts +96 -6
- package/dist/functions/models/product/variant/index.js +1 -1
- package/dist/functions/models/product-list/index.d.ts +21 -0
- package/dist/functions/models/product-list/index.js +1 -1
- package/dist/functions/models/validator/address/index.d.ts +70 -2
- 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 +75 -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 +349 -29
- package/dist/functions/stores/customer/index.js +1 -1
- package/dist/i18n/ikas-texts.d.ts +425 -0
- package/dist/i18n/index.d.ts +19 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +1 -1
- package/dist/packages/storefront-api/src/__api/mutations/removeGiftCardFromCart.js +1 -0
- package/dist/packages/storefront-api/src/__api/mutations/unlinkExternalAccount.js +1 -0
- package/dist/packages/storefront-api/src/__api/queries/getExternalAccountLink.js +1 -0
- package/dist/packages/storefront-api/src/__api/queries/getLoyaltyProgram.js +1 -0
- package/dist/packages/storefront-api/src/__api/queries/getMilesSmilesDetails.js +1 -0
- package/dist/packages/storefront-api/src/__api/queries/getRefundableLines.js +1 -0
- package/dist/packages/storefront-api/src/__api/queries/listOrderTransactionsWithPrices.js +1 -0
- package/dist/packages/storefront-api-client/src/utils/api.js +1 -1
- package/dist/packages/storefront-config/src/index.js +1 -1
- package/dist/packages/storefront-config/src/theme-globals.js +1 -0
- 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/mutations/unlinkExternalAccount.d.ts +6 -0
- package/dist/storefront-api/src/__api/queries/getExternalAccountLink.d.ts +6 -0
- package/dist/storefront-api/src/__api/queries/getLoyaltyProgram.d.ts +3 -0
- package/dist/storefront-api/src/__api/queries/getMilesSmilesDetails.d.ts +3 -0
- package/dist/storefront-api/src/__api/queries/getRefundableLines.d.ts +6 -0
- package/dist/storefront-api/src/__api/queries/listOrderTransactionsWithPrices.d.ts +6 -0
- package/dist/storefront-api/src/__api/types/index.d.ts +101 -6
- package/dist/storefront-api-client/src/utils/api.d.ts +7 -0
- package/dist/storefront-config/src/index.d.ts +32 -0
- package/dist/storefront-config/src/theme-globals.d.ts +349 -0
- package/dist/storefront-models/src/index.d.ts +8 -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/color.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/link.d.ts +10 -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/loyalty-program/customer-info/index.d.ts +2 -0
- package/dist/storefront-models/src/models/loyalty-program/earning-method/index.d.ts +1 -0
- package/dist/storefront-models/src/models/loyalty-program/index.d.ts +1 -0
- package/dist/storefront-models/src/models/loyalty-program/point-history/index.d.ts +1 -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 +10 -0
- package/dist/storefront-models/src/models/order/line-item/index.d.ts +6 -1
- package/dist/storefront-models/src/models/order/package/index.d.ts +1 -1
- package/dist/storefront-models/src/models/order/refund/reason/index.d.ts +6 -0
- package/dist/storefront-models/src/models/order/refund/reason/translation/index.d.ts +4 -0
- package/dist/storefront-models/src/models/order/refund/refundable-line/index.d.ts +8 -0
- package/dist/storefront-models/src/models/order/refund/refundable-lines/index.d.ts +8 -0
- package/dist/storefront-models/src/models/order/refund/settings/translation/index.d.ts +4 -0
- package/dist/storefront-models/src/models/payment-gateway/index.d.ts +3 -1
- package/dist/storefront-models/src/models/product/attribute/index.d.ts +6 -1
- package/dist/storefront-models/src/models/product/campaign/data/index.d.ts +2 -0
- package/dist/storefront-models/src/models/product/campaign/filter/index.d.ts +1 -1
- package/dist/storefront-models/src/models/product/campaign/product-tiered-discount/index.d.ts +13 -0
- package/dist/storefront-models/src/models/product/image/index.d.ts +5 -0
- package/dist/storefront-models/src/models/product/variant/index.d.ts +17 -0
- package/dist/storefront-models/src/models/storefront/index.d.ts +1 -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/theme/settings/index.d.ts +51 -0
- package/dist/theme/settings/index.js +1 -0
- package/dist/utils/component-renderer.js +1 -1
- package/dist/utils/currency.d.ts +36 -3
- package/dist/utils/helper.d.ts +1 -0
- package/dist/utils/helper.js +1 -1
- package/dist/utils/pay-with-ikas.d.ts +552 -0
- package/dist/utils/pay-with-ikas.js +1 -0
- package/dist/utils/svg.d.ts +15 -0
- package/dist/utils/svg.js +1 -0
- package/package.json +2 -2
|
@@ -10,4 +10,9 @@ export type IkasProductAttribute = {
|
|
|
10
10
|
tableTemplate: IkasProductAttributeTableTemplate | null;
|
|
11
11
|
translations?: IkasProductAttributeTranslation[] | null;
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Mirror of the API's `ProductAttributeTypeEnum` (see storefront-api `__api/types`). The API value is
|
|
15
|
+
* force-cast into this union when products are mapped (`functions/api/product`), so a value missing
|
|
16
|
+
* here still arrives at runtime — it just stops being visible to the compiler. Keep both lists in sync.
|
|
17
|
+
*/
|
|
18
|
+
export type IkasProductAttributeType = "CHOICE" | "MULTIPLE_CHOICE" | "COLOR_THUMBNAIL_MULTIPLE_CHOICE" | "TEXT" | "BOOLEAN" | "NUMERIC" | "DATE" | "DATETIME" | "HTML" | "TABLE" | "IMAGE" | "PRODUCT";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IkasProductBuyXThenGetY } from "../product-buyx-then-gety";
|
|
2
2
|
import { IkasProductCampaignDateRangeField } from "../product-campaign-date-range-field";
|
|
3
3
|
import { IkasProductFixedDiscount } from "../product-fixed-discount";
|
|
4
|
+
import { IkasProductTieredDiscount } from "../product-tiered-discount";
|
|
4
5
|
export type IkasProductCampaignData = {
|
|
5
6
|
applicableCustomerGroupIds: string[] | null;
|
|
6
7
|
applicableCustomerIds: string[] | null;
|
|
@@ -21,6 +22,7 @@ export type IkasProductCampaignData = {
|
|
|
21
22
|
usageCount: number;
|
|
22
23
|
usageLimit: number | null;
|
|
23
24
|
usageLimitPerCustomer: number | null;
|
|
25
|
+
tieredDiscount: IkasProductTieredDiscount | null;
|
|
24
26
|
};
|
|
25
27
|
export type IkasCampaignApplicablePrice = "DISCOUNT_PRICE" | "SELL_PRICE";
|
|
26
28
|
export type IkasCampaignCreatedFor = "ABANDONED_CHECKOUT" | "CART" | "CUSTOMER_REVIEW";
|
|
@@ -2,4 +2,4 @@ export type IkasProductCampaignFilter = {
|
|
|
2
2
|
idList: string[];
|
|
3
3
|
type: IkasCampaignFilterType;
|
|
4
4
|
};
|
|
5
|
-
export type IkasCampaignFilterType = "CATEGORY" | "PRODUCT" | "PRODUCT_BRAND" | "PRODUCT_TAG" | "VARIANT";
|
|
5
|
+
export type IkasCampaignFilterType = "CATEGORY" | "PRODUCT" | "PRODUCT_BRAND" | "PRODUCT_TAG" | "VARIANT" | "PRODUCT_AND_VARIANT";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IkasProductCampaignFilter } from "../filter";
|
|
2
|
+
import { IkasCampaignMinMaxRangeField } from "../product-fixed-discount";
|
|
3
|
+
export type IkasProductTieredDiscountRule = {
|
|
4
|
+
amount: number | null;
|
|
5
|
+
lineItemQuantityRange: IkasCampaignMinMaxRangeField | null;
|
|
6
|
+
priceRange: IkasCampaignMinMaxRangeField | null;
|
|
7
|
+
};
|
|
8
|
+
export type IkasProductTieredDiscount = {
|
|
9
|
+
filters: IkasProductCampaignFilter[] | null;
|
|
10
|
+
isApplyByCartAmount: boolean | null;
|
|
11
|
+
rules: IkasProductTieredDiscountRule[];
|
|
12
|
+
shouldMatchAllConditions: boolean | null;
|
|
13
|
+
};
|
|
@@ -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;
|
|
@@ -29,3 +29,20 @@ export type IkasAppliedCampaignAmount = {
|
|
|
29
29
|
formattedPrice: string | null;
|
|
30
30
|
discountPercentage: string | null;
|
|
31
31
|
};
|
|
32
|
+
export type IkasTieredDiscountProduct = {
|
|
33
|
+
amount: number | null;
|
|
34
|
+
lineItemQuantityRange: {
|
|
35
|
+
min: number;
|
|
36
|
+
max: number;
|
|
37
|
+
};
|
|
38
|
+
type: IkasCampaignType;
|
|
39
|
+
sellPrice: number;
|
|
40
|
+
finalPrice: number;
|
|
41
|
+
sellPriceWithQuantity: number;
|
|
42
|
+
finalPriceWithQuantity: number;
|
|
43
|
+
formattedSellPrice: string;
|
|
44
|
+
formattedSellPriceWithQuantity: string;
|
|
45
|
+
formattedFinalPrice: string;
|
|
46
|
+
formattedFinalPriceWithQuantity: string;
|
|
47
|
+
salesChannelIds: string[] | null;
|
|
48
|
+
};
|
|
@@ -20,6 +20,7 @@ export type IkasStorefront = {
|
|
|
20
20
|
analytics4Id: string | null;
|
|
21
21
|
universalAnalyticsId: string | null;
|
|
22
22
|
tiktokPixelId: string | null;
|
|
23
|
+
openAiPixelId?: string | null;
|
|
23
24
|
token: string | null;
|
|
24
25
|
type: IkasStorefrontType;
|
|
25
26
|
metaTemplates: IkasStorefontMetaTemplates[] | 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};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { RuntimeBreakpointToken, RuntimeDesignToken, RuntimeKeyframeToken, RuntimeThemeColorSchemes, RuntimeTypographyToken, ThemeSetting } from "../../storefront-config/src";
|
|
2
|
+
/**
|
|
3
|
+
* Register the live global-variable object (`_g_`) so `getThemeSetting`/`getThemeSettings`
|
|
4
|
+
* return actual runtime values (constants, computed getters, and in-editor edits) instead
|
|
5
|
+
* of the serialized design-time defaults. Called by generated code, not by component authors.
|
|
6
|
+
*/
|
|
7
|
+
export declare function registerThemeSettingValues(values: Record<string, any> | null): void;
|
|
8
|
+
/** All global variables (Theme Settings) defined for the theme. */
|
|
9
|
+
export declare function getThemeSettings(): ThemeSetting[];
|
|
10
|
+
/**
|
|
11
|
+
* A single global variable by its stable key (`variableName`, e.g. `_6Q0KV7VGGM`).
|
|
12
|
+
* Discover keys via {@link getThemeSettings} (each item carries a human `displayName`).
|
|
13
|
+
* The returned `value` is the live blueprint value when available, else the default.
|
|
14
|
+
* Its shape is discriminated by `type` (see {@link ThemeSetting.value}); note an
|
|
15
|
+
* IMAGE setting's value is an image REFERENCE (no `.url`) — resolve with
|
|
16
|
+
* `getDefaultSrc`/`getSrc`. An ENUM setting's `value` is one of its enum's option VALUES
|
|
17
|
+
* (or null) and the setting also carries `enumTypeId` and `options` (`{ label: value }`);
|
|
18
|
+
* in a code component prefer the typed `themeValue("_key")` from `./global-types`, which
|
|
19
|
+
* narrows the value to the enum's union.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getThemeSetting(name: string): ThemeSetting | undefined;
|
|
22
|
+
/** Convenience: the resolved value of a global variable, or `undefined` if not found. */
|
|
23
|
+
export declare function getThemeSettingValue(name: string): any;
|
|
24
|
+
/** Theme color tokens. Each carries a resolved value and a `var(--id)` CSS reference. */
|
|
25
|
+
export declare function getThemeColors(): RuntimeDesignToken[];
|
|
26
|
+
/** Theme typography tokens (text styles). Apply `className` or read `resolved` CSS values. */
|
|
27
|
+
export declare function getThemeTypography(): RuntimeTypographyToken[];
|
|
28
|
+
/** Theme responsive breakpoints (`{ id, width }`). */
|
|
29
|
+
export declare function getThemeBreakpoints(): RuntimeBreakpointToken[];
|
|
30
|
+
/** Theme keyframe/transition animations. Use `ref` as the CSS animation name. */
|
|
31
|
+
export declare function getThemeKeyframes(): RuntimeKeyframeToken[];
|
|
32
|
+
/**
|
|
33
|
+
* Theme color schemes (palettes). Returns two PARALLEL lists with different jobs:
|
|
34
|
+
* - `schemes`: the color SLOTS as `{ id }` only — no colors and no display label live here at
|
|
35
|
+
* runtime. A slot's human name is authoring-only (read it via the CLI/MCP `list-theme-globals`
|
|
36
|
+
* or the editor); at runtime identify a slot solely by its `id`.
|
|
37
|
+
* - `values`: the actual palettes. A palette's colors live in its `colorsByScheme`
|
|
38
|
+
* map, keyed by slot id → `{ resolved, cssVar }`.
|
|
39
|
+
*
|
|
40
|
+
* To render swatches, iterate `values[].colorsByScheme` (the source of truth for
|
|
41
|
+
* colors), NOT the top-level `schemes` array — `schemes` carries slot ids only, so
|
|
42
|
+
* iterating it renders empty:
|
|
43
|
+
*
|
|
44
|
+
* const { values } = getThemeColorSchemes();
|
|
45
|
+
* values.forEach(palette =>
|
|
46
|
+
* Object.entries(palette.colorsByScheme).forEach(([slotId, { resolved, cssVar }]) => {
|
|
47
|
+
* // slotId → stable slot key, cssVar → live var() ref (prefer this), resolved → hex snapshot
|
|
48
|
+
* })
|
|
49
|
+
* );
|
|
50
|
+
*/
|
|
51
|
+
export declare function getThemeColorSchemes(): RuntimeThemeColorSchemes;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__assign as o}from'./../../ext/tslib/tslib.es6.mjs.js';import{IkasStorefrontConfig as l}from"../../packages/storefront-config/src/index.js";var n=null;function e(o){n=o}function i(l){return n&&l.name in n?o(o({},l),{value:n[l.name]}):l}function r(){var o,n;return Object.values(null!==(n=null===(o=l.themeGlobals)||void 0===o?void 0:o.settings)&&void 0!==n?n:{}).map(i)}function t(o){var n,e,r=null===(e=null===(n=l.themeGlobals)||void 0===n?void 0:n.settings)||void 0===e?void 0:e[o];return r?i(r):void 0}function u(o){var l;return null===(l=t(o))||void 0===l?void 0:l.value}function v(){var o,n;return null!==(n=null===(o=l.themeGlobals)||void 0===o?void 0:o.colors)&&void 0!==n?n:[]}function s(){var o,n;return null!==(n=null===(o=l.themeGlobals)||void 0===o?void 0:o.typography)&&void 0!==n?n:[]}function a(){var o,n;return null!==(n=null===(o=l.themeGlobals)||void 0===o?void 0:o.breakpoints)&&void 0!==n?n:[]}function d(){var o,n;return null!==(n=null===(o=l.themeGlobals)||void 0===o?void 0:o.keyframes)&&void 0!==n?n:[]}function m(){var o,n;return null!==(n=null===(o=l.themeGlobals)||void 0===o?void 0:o.colorSchemes)&&void 0!==n?n:{schemes:[],values:[]}}export{a as getThemeBreakpoints,m as getThemeColorSchemes,v as getThemeColors,d as getThemeKeyframes,t as getThemeSetting,u as getThemeSettingValue,r as getThemeSettings,s as getThemeTypography,e as registerThemeSettingValues};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as t}from'./../ext/tslib/tslib.es6.mjs.js';import{createElement as r}from'./../ext/preact/dist/preact.mjs.js';import{useRef as n,useMemo as e,useEffect as c}from'./../ext/preact/hooks/dist/hooks.mjs.js';var o={},a="data-ikas-ccr",u=0;function i(t,r){if(!t)return function(t,r){for(var n=[],e=t;e;){var c=e.getAttribute("id");c&&n.unshift(c),e=e.parentElement}var o=n.map(function(t){return'[id="'.concat(t,'"]')}).join(" ");return o?"".concat(o,' [id="').concat(r,'"]'):'[id="'.concat(r,'"]')}(t,r);var n=t.getAttribute(a);return n||(n="r".concat(++u),t.setAttribute(a,n)),"[".concat(a,'="').concat(n,'"] > [id="').concat(r,'"]')}function s(a){var u=a.id,s=a.components,f=a.style,l=a.className,d=a.parentProps,m=void 0===d?o:d,p=a.map,v=void 0===p?o:p,h=n([]),y=n(m),j=n(v),g=n(null);y.current=m,j.current=v;var b=e(function(){return(Array.isArray(s)?s:s?[s]:[]).flat().filter(Boolean)},[s]);c(function(){if(0!==b.length){h.current.forEach(function(t){return t()}),h.current=[];for(var r=0;r<b.length;r++){var n=b[r];if(n.l){var e="".concat(u,"-").concat(r),c=i(g.current,e),o=n.l(c,t(t({},y.current),j.current),{},{id:e,key:e});"function"==typeof o&&h.current.push(o)}}return function(){h.current.forEach(function(t){return t()}),h.current=[]}}},[b,u]);var k=e(function(){return 0===b.length?"":b.map(function(r,n){var e="".concat(u,"-").concat(n);return r.r(t(t({},y.current),j.current),{},{id:e,key:e})}).join("")},[b,u]);return 0===b.length?null:r("div",{id:u,ref:g,dangerouslySetInnerHTML:{__html:k},style:t({display:"contents"},f),className:l})}export{s as IkasComponentRenderer};
|
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;
|
package/dist/utils/helper.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare function capitalize(value: string): string;
|
|
|
7
7
|
export declare function tryForEach(items: any[], callback: (item: any, index: number) => void, printErrors?: boolean): void;
|
|
8
8
|
export declare function formatDate(date: Date): string;
|
|
9
9
|
export declare function getCookieValue(cookieName: string): string | null;
|
|
10
|
+
export declare function getOpenAiAttributionMetadata(): Record<string, string>;
|
|
10
11
|
export declare function isClient(): boolean;
|
|
11
12
|
export declare function isServer(): boolean;
|
|
12
13
|
export declare function getQueryParams(): URLSearchParams | undefined;
|
package/dist/utils/helper.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__spreadArray as r}from'./../ext/tslib/tslib.es6.mjs.js';import{IkasStorefrontConfig as
|
|
1
|
+
import{__spreadArray as r,__assign as n}from'./../ext/tslib/tslib.es6.mjs.js';import{IkasStorefrontConfig as t}from"../packages/storefront-config/src/index.js";import{reaction as e}from'./../ext/mobx/dist/mobx.esm.js';var o=function(r){return/^\+?\d+$/.test(r)},a=function(r){r=(r=r.replace(/^\s+|\s+$/g,"")).toLocaleLowerCase("tr-TR");for(var n="àáäâèéëêìíïîıòóöôùúüûñçşğ·/_,:;",t=0;t<31;t++)r=r.replace(new RegExp(n.charAt(t),"g"),"aaaaeeeeiiiiioooouuuuncsg------".charAt(t));return r=r.replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")},i=function(r){return!(r.length>320)&&/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(r)};function u(r){return!!new Intl.DateTimeFormat(r,{hour:"numeric"}).format(0).match(/\s/)}function c(r,n,t){void 0===t&&(t=!1),r.forEach(function(r,e){try{n(r,e)}catch(r){t&&console.error(r)}})}function f(r){var n={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",hour12:!1},e=t.getCurrentLocale();return"undefined"!=typeof navigator?n.hour12=u(navigator.language):n.hour12=u(e),new Intl.DateTimeFormat(e,n).format(r)}function s(r){var n=document.cookie.split(";").find(function(n){return n.trim().startsWith("".concat(r,"="))});return n?n.split("=")[1]:null}function l(){var r=s("__oppref"),t=s("__obref");return n(n({},r?{oppref:r}:{}),t?{obref:t}:{})}function m(){return"undefined"!=typeof window}function p(){return!m()}function g(){if(m())return new URLSearchParams(location.search)}function h(){return!!m()&&(performance.getEntriesByType?"back_forward"===performance.getEntriesByType("navigation")[0].type:performance.navigation.type===performance.navigation.TYPE_BACK_FORWARD)}function v(r,n){void 0===n&&(n={arrayFormat:"comma"});for(var t=[],e=function(r,e){if(null==e)return"continue";Array.isArray(e)?"comma"===n.arrayFormat&&e.length>0?t.push("".concat(r,"=").concat(e.join(","))):e.forEach(function(n){return t.push("".concat(r,"=").concat(n))}):t.push("".concat(r,"=").concat(e))},o=0,a=Object.entries(r);o<a.length;o++){var i=a[o];e(i[0],i[1])}return t.length>0?"".concat(t.join("&")):""}function y(r){return null==r?r:JSON.parse(JSON.stringify(r))}function d(r,n){if(!r||!Array.isArray(r))return{};for(var t={},e=0,o=r;e<o.length;e++){var a=o[e],i=void 0;t[i=String("string"==typeof n?a[n]:"function"==typeof n?n(a):a)]||(t[i]=[]),t[i].push(a)}return t}function A(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];return n&&Array.isArray(n)?(0===t.length&&(t=[function(r){return r}]),r([],n,!0).sort(function(r,n){for(var e=0,o=t;e<o.length;e++){var a=o[e],i=void 0,u=void 0;if("string"==typeof a?(i=r[a],u=n[a]):"function"==typeof a?(i=a(r),u=a(n)):(i=r,u=n),null!=i||null!=u){if(null==i)return 1;if(null==u)return-1;if(i<u)return-1;if(i>u)return 1}}return 0})):[]}function _(r,n){var t;return function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];clearTimeout(t),t=setTimeout(function(){return r.apply(void 0,e)},n)}}function b(r,n){return e(r,n)}export{y as cloneDeep,_ as debounce,f as formatDate,s as getCookieValue,l as getOpenAiAttributionMetadata,g as getQueryParams,d as groupBy,h as isBackNavigation,m as isClient,p as isServer,b as reaction,A as sortBy,a as stringToSlug,v as stringifyQueryParams,c as tryForEach,i as validateEmail,o as validatePhoneNumber};
|