@ikas/bp-storefront 0.130.0 → 0.132.0

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.
@@ -1,12 +1,20 @@
1
1
  import { IkasProductOffer } from "../../../storefront-models/src";
2
2
  /**
3
- * Checks whether a product offer has been accepted in the current cart's campaign offers.
3
+ * Checks whether the product offer is already in the cart as an ACCEPTED campaign offer for the
4
+ * PRODUCT target page type. This is a **cart-state check** and is independent of
5
+ * `productOffer.isSelected` (the UI toggle state set by `acceptProductOffer`). Use it to disable
6
+ * the selection UI and show an "already in cart" state when the offer has been added.
7
+ *
8
+ * Example state combinations:
9
+ * - `isSelected=true`, `isAcceptedProductOffer=false` — user selected it in UI, not yet in cart
10
+ * - `isSelected=true`, `isAcceptedProductOffer=true` — selected AND in cart (disable toggle)
11
+ * - `isSelected=false`, `isAcceptedProductOffer=false` — deselected, not in cart
4
12
  *
5
13
  * @ai-category CampaignOffer
6
14
  * @ai-related acceptProductOffer, rejectProductOffer
7
15
  *
8
- * @param productOffer - The product offer to check acceptance status for.
9
- * @returns True if the offer is accepted for the PRODUCT target page type in the cart, false otherwise.
16
+ * @param productOffer - The product offer to check.
17
+ * @returns True if the offer's campaign offer is in the cart as ACCEPTED for PRODUCT target page type, false otherwise.
10
18
  *
11
19
  * @example
12
20
  * ```typescript
@@ -20,12 +28,14 @@ import { IkasProductOffer } from "../../../storefront-models/src";
20
28
  */
21
29
  export declare function isAcceptedProductOffer(productOffer: IkasProductOffer): boolean;
22
30
  /**
23
- * Accepts a product offer by setting its isSelected flag to true.
31
+ * Sets `productOffer.isSelected = true` — a **UI toggle** marking the offer as selected by the
32
+ * user. This does NOT add the offer to the cart; cart inclusion happens through the add-to-cart
33
+ * flow. See `isAcceptedProductOffer` for the independent cart-state check.
24
34
  *
25
35
  * @ai-category CampaignOffer
26
36
  * @ai-related isAcceptedProductOffer, rejectProductOffer
27
37
  *
28
- * @param productOffer - The product offer to accept.
38
+ * @param productOffer - The product offer to mark as selected in the UI.
29
39
  * @returns void
30
40
  *
31
41
  * @example
@@ -324,6 +324,10 @@ export declare function getIkasOrderFormattedOrderedAt(order: IkasOrder): string
324
324
  * import { getIkasOrderPackageStatusTranslation } from "@ikas/bp-storefront";
325
325
  * const statusLabel = getIkasOrderPackageStatusTranslation(order); // e.g. "Delivered"
326
326
  * ```
327
+ *
328
+ * NOTE: Pass the `IkasOrder` directly — NOT an `IkasDisplayedPackage` returned by
329
+ * `getIkasOrderDisplayedPackages()`. The function reads `order.orderPackageStatus` from the
330
+ * order itself.
327
331
  */
328
332
  export declare function getIkasOrderPackageStatusTranslation(order: IkasOrder): string;
329
333
  /**
@@ -142,8 +142,14 @@ export declare function getFilterKeyList(filter: IkasProductFilter): string[];
142
142
  /**
143
143
  * Returns the filter values sorted and filtered for display, respecting the configured sort type (alphabetical, product count, or custom).
144
144
  *
145
+ * NOTE on numeric filter suffixes: for `NUMBER_RANGE` / `NUMBER_RANGE_LIST` filters, decide the
146
+ * display suffix from `filter.type` — NOT by blanket-applying the store currency symbol. The
147
+ * canonical convention used by the serel theme templates is:
148
+ * - `filter.type === "DISCOUNT_RATIO"` → `"%"`
149
+ * - otherwise (including `"PRICE"`) → `getProductListCurrencySymbol(productList)`
150
+ *
145
151
  * @ai-category ProductFilter, Filtering, ProductList
146
- * @ai-related getFilterValueList, getFilterKeyList, selectFilterValue
152
+ * @ai-related getFilterValueList, getFilterKeyList, selectFilterValue, getProductListCurrencySymbol
147
153
  *
148
154
  * @param filter - The product filter whose values to retrieve and sort for display.
149
155
  * @returns A sorted array of filter values, excluding unselected values with zero result count.
@@ -525,9 +525,11 @@ export declare function getProductAvailableStockLocations(product: IkasProduct):
525
525
  export declare function getProductOptionSet(product: IkasProduct): Promise<boolean>;
526
526
  export declare function initProductOptionSet(productOptionSet: IkasProductOptionSet): void;
527
527
  /**
528
- * Initialize bundle product data for a product.
529
- * If an `editLineID` URL param is present, restores bundle selections from the cart line item;
530
- * otherwise loads bundle products for the currently selected variant.
528
+ * Initialize bundle product data for a product — the canonical entry point for product detail
529
+ * pages. Calls `getBundleProductsOfVariant` internally to fetch bundle data, then binds variant
530
+ * selections and quantities. If an `editLineID` URL param is present, restores bundle selections
531
+ * from the matching cart line item (used for cart edit flow); otherwise loads bundle products for
532
+ * the currently selected variant.
531
533
  *
532
534
  * @ai-category Product, ProductDetail
533
535
  * @ai-related getBundleProductsOfVariant, getSelectedProductVariant, isBundleProductQuantityEditable
@@ -547,8 +549,13 @@ export declare function initProductOptionSet(productOptionSet: IkasProductOption
547
549
  */
548
550
  export declare function initBundleProducts(product: IkasProduct): Promise<void>;
549
551
  /**
550
- * Fetch and attach bundle product data for a specific variant.
551
- * Loads the full product data for each bundle product and caches the results on the parent product.
552
+ * Fetch and attach bundle product data for a specific variant. Loads the full product data for
553
+ * each bundle product and caches the results on the parent product.
554
+ *
555
+ * NOTE: Fetching alone does NOT bind variant selections or quantities. On a product detail page,
556
+ * prefer `initBundleProducts(product)` — it calls this function and then initializes selections,
557
+ * quantities, and the cart-edit (`editLineID`) flow. Use `getBundleProductsOfVariant` directly
558
+ * only when you need to re-fetch for a different variant without full re-initialization.
552
559
  *
553
560
  * @ai-category Product, Variant
554
561
  * @ai-related initBundleProducts, setProductOfBundleProduct, getSelectedProductVariant
@@ -61,15 +61,19 @@ export declare class Router {
61
61
  * @ai-category Navigation
62
62
  * @ai-related navigate, goBack
63
63
  *
64
- * @param pageType - The type of page to navigate to (INDEX, CART, CHECKOUT, PRODUCT, LOGIN, etc.)
64
+ * @param pageType - The type of page to navigate to. Typed as `IkasThemePageType`.
65
65
  * @param slug - Optional slug for pages that require it (e.g., product slug, order ID)
66
66
  * @param queryParams - Optional query parameters to add to the URL
67
67
  * @param shallow - If true, only update URL without full navigation (default: false)
68
68
  * @param newTab - If true, open in a new browser tab (default: false)
69
69
  *
70
- * Page types: INDEX, ACCOUNT, ADDRESSES, FAVORITE_PRODUCTS, FORGOT_PASSWORD, LOGIN,
71
- * REGISTER, ORDERS, ORDER_DETAIL, BLOG_INDEX, BLOG, BLOG_CATEGORY, CART, CHECKOUT,
72
- * CUSTOM, RAFFLE, RAFFLE_DETAIL, SEARCH, NOT_FOUND
70
+ * Accepted page types (`IkasThemePageType`): INDEX, ACCOUNT, ADDRESSES, FAVORITE_PRODUCTS,
71
+ * FORGOT_PASSWORD, LOGIN, REGISTER, ORDERS, ORDER_DETAIL, BLOG_INDEX, BLOG, BLOG_CATEGORY,
72
+ * CART, CHECKOUT, CUSTOM, RAFFLE, RAFFLE_DETAIL, SEARCH, NOT_FOUND.
73
+ *
74
+ * TypeScript note: `pageType` is typed as `IkasThemePageType`, not `string`. If you are
75
+ * passing a value that TypeScript infers as `string` (e.g. from a lookup map keyed by tab
76
+ * name), cast with `as IkasThemePageType` or type the source map with `Record<..., IkasThemePageType>`.
73
77
  *
74
78
  * @example
75
79
  * ```typescript
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/bp-storefront",
3
- "version": "0.130.0",
3
+ "version": "0.132.0",
4
4
  "description": "A framework for the ikas blueprint storefronts.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",