@ikas/code-components-mcp 1.4.0-beta.13 → 1.4.0-beta.131

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,5 +1,5 @@
1
1
  {
2
- "generatedAt": "2026-05-20T13:40:14.987Z",
2
+ "generatedAt": "2026-07-21T11:46:32.982Z",
3
3
  "functions": [
4
4
  {
5
5
  "name": "apiListProductBrand",
@@ -2761,16 +2761,16 @@
2761
2761
  {
2762
2762
  "name": "getDefaultSrc",
2763
2763
  "signature": "function getDefaultSrc(image: IkasImage): string",
2764
- "description": "Returns the default source URL for an image at 1080px resolution.",
2764
+ "description": "Returns the default source URL for an image OR video at 1080px resolution.\n\nProduct media items (IkasProductImage) can be videos. ALWAYS check `item.isVideo`\nand render a `<video src={getDefaultSrc(item)}>` instead of an `<img>` when it is true.\nNever assume every media item is an image.",
2765
2765
  "params": [
2766
2766
  {
2767
2767
  "name": "image",
2768
2768
  "description": "- The image object to generate the default source URL for."
2769
2769
  }
2770
2770
  ],
2771
- "returns": "The CDN URL string for the image at 1080px size.",
2771
+ "returns": "The CDN URL string for the image or video at 1080px size.",
2772
2772
  "returnType": "string",
2773
- "example": "```typescript\nimport { getDefaultSrc } from \"@ikas/bp-storefront\";\n\nconst src = getDefaultSrc(image);\nconsole.log(src); // \"https://cdn.example.com/images/.../1080/image.webp\"\n```",
2773
+ "example": "```typescript\nimport { getDefaultSrc, createMediaSrcset } from \"@ikas/bp-storefront\";\n\n// Product images can be videos — ALWAYS branch on isVideo when mapping media:\n{product.images.map((item, i) =>\n item.isVideo ? (\n <video key={i} src={getDefaultSrc(item)} muted playsInline preload=\"metadata\">\n <track kind=\"captions\" />\n </video>\n ) : (\n <img key={i} src={getDefaultSrc(item)} srcSet={createMediaSrcset(item)} alt={`Product ${i + 1}`} />\n )\n)}\n```",
2774
2774
  "categories": [
2775
2775
  "Image"
2776
2776
  ],
@@ -2788,16 +2788,16 @@
2788
2788
  {
2789
2789
  "name": "getThumbnailSrc",
2790
2790
  "signature": "function getThumbnailSrc(image: IkasImage): string",
2791
- "description": "Returns the thumbnail source URL for an image at 180px resolution.",
2791
+ "description": "Returns the thumbnail source URL for an image OR video at 180px resolution.\n\nWhen mapping over product media (IkasProductImage[]), some items are videos:\ncheck `item.isVideo` and render a `<video>` thumbnail (typically with a play\noverlay) instead of an `<img>` when it is true.",
2792
2792
  "params": [
2793
2793
  {
2794
2794
  "name": "image",
2795
2795
  "description": "- The image object to generate the thumbnail source URL for."
2796
2796
  }
2797
2797
  ],
2798
- "returns": "The CDN URL string for the image at 180px size.",
2798
+ "returns": "The CDN URL string for the image or video at 180px size.",
2799
2799
  "returnType": "string",
2800
- "example": "```typescript\nimport { getThumbnailSrc } from \"@ikas/bp-storefront\";\n\nconst thumbnailSrc = getThumbnailSrc(image);\nconsole.log(thumbnailSrc); // \"https://cdn.example.com/images/.../180/image.webp\"\n```",
2800
+ "example": "```typescript\nimport { getThumbnailSrc, getDefaultSrc } from \"@ikas/bp-storefront\";\n\n// Thumbnail rail — branch on isVideo per item:\n{product.images.map((item, i) =>\n item.isVideo ? (\n <video key={i} src={getDefaultSrc(item)} muted preload=\"metadata\">\n <track kind=\"captions\" />\n </video>\n ) : (\n <img key={i} src={getThumbnailSrc(item)} sizes=\"112px\" alt={`Thumb ${i + 1}`} />\n )\n)}\n```",
2801
2801
  "categories": [
2802
2802
  "Image"
2803
2803
  ],
@@ -2815,7 +2815,7 @@
2815
2815
  {
2816
2816
  "name": "getSrc",
2817
2817
  "signature": "function getSrc(image: IkasImage, size: number): string",
2818
- "description": "Generates the full CDN source URL for an image or video at the specified size, handling both legacy path-based and merchant-scoped ID formats.",
2818
+ "description": "Generates the full CDN source URL for an image or video at the specified size, handling both legacy path-based and merchant-scoped ID formats.\n\nNOTE: For videos (`image.isVideo === true`) the `size` argument is IGNORED — the original .mp4 is always returned.\nSo `getSrc(item, 240)` and `getDefaultSrc(item)` produce the identical URL for a video. PREFER `getDefaultSrc(item)`\nfor video `src` (no size param) — do NOT pass an arbitrary size like `getSrc(item, 240)`, it is misleading.",
2819
2819
  "params": [
2820
2820
  {
2821
2821
  "name": "image",
@@ -2823,12 +2823,12 @@
2823
2823
  },
2824
2824
  {
2825
2825
  "name": "size",
2826
- "description": "- The desired image width in pixels for the generated URL."
2826
+ "description": "- The desired image width in pixels. Ignored for videos."
2827
2827
  }
2828
2828
  ],
2829
2829
  "returns": "The full CDN URL string for the image or video.",
2830
2830
  "returnType": "string",
2831
- "example": "```typescript\nimport { getSrc } from \"@ikas/bp-storefront\";\n\nconst src = getSrc(image, 640);\nconsole.log(src); // \"https://cdn.example.com/images/.../640/image.webp\"\n```",
2831
+ "example": "```typescript\nimport { getSrc, getDefaultSrc } from \"@ikas/bp-storefront\";\n\nconst src = getSrc(image, 640);\nconsole.log(src); // \"https://cdn.example.com/images/.../640/image.webp\"\n\n// For a video, use getDefaultSrc (size is ignored anyway):\n<video src={getDefaultSrc(item)} muted playsInline preload=\"metadata\" />\n```",
2832
2832
  "categories": [
2833
2833
  "Image"
2834
2834
  ],
@@ -2846,7 +2846,7 @@
2846
2846
  {
2847
2847
  "name": "createMediaSrcset",
2848
2848
  "signature": "function createMediaSrcset(image?: IkasImage | null): string",
2849
- "description": "Generates a complete responsive `srcset` string for an image across all standard sizes (180–3840px).",
2849
+ "description": "Generates a complete responsive `srcset` string for an image across all standard sizes (180–3840px).\n\nsrcset applies to `<img>` only — video media (`item.isVideo === true`) has no srcset\nand must be rendered with `<video src={getDefaultSrc(item)}>`. When mapping product\nimages, branch on `item.isVideo` first, then only use createMediaSrcset on the image branch.",
2850
2850
  "params": [
2851
2851
  {
2852
2852
  "name": "image",
@@ -2855,7 +2855,7 @@
2855
2855
  ],
2856
2856
  "returns": "A srcset string like `\"url 180w, url 360w, ...\"`, or an empty string if no image is provided.",
2857
2857
  "returnType": "string",
2858
- "example": "```typescript\nimport { createMediaSrcset, getDefaultSrc } from \"@ikas/bp-storefront\";\n\n<img\n src={getDefaultSrc(image)}\n srcSet={createMediaSrcset(image)}\n sizes=\"(max-width: 768px) 100vw, 50vw\"\n alt=\"Product\"\n/>\n```",
2858
+ "example": "```typescript\nimport { createMediaSrcset, getDefaultSrc } from \"@ikas/bp-storefront\";\n\n// Product images can be videos — ALWAYS branch on isVideo when mapping media:\n{product.images.map((item, i) =>\n item.isVideo ? (\n <video key={i} src={getDefaultSrc(item)} muted playsInline preload=\"metadata\">\n <track kind=\"captions\" />\n </video>\n ) : (\n <img\n key={i}\n src={getDefaultSrc(item)}\n srcSet={createMediaSrcset(item)}\n sizes=\"(max-width: 768px) 100vw, 50vw\"\n alt={`Product ${i + 1}`}\n />\n )\n)}\n```",
2859
2859
  "categories": [
2860
2860
  "Image"
2861
2861
  ],
@@ -7310,16 +7310,16 @@
7310
7310
  "name": "getProductVariantMainImage",
7311
7311
  "displayName": "getMainImage",
7312
7312
  "signature": "function getProductVariantMainImage(variant: IkasProductVariant): IkasProductImage | undefined",
7313
- "description": "Get the main/primary image for a product variant.",
7313
+ "description": "Get the main/primary media item for a product variant.\n\nThe returned IkasProductImage may be a video (`isVideo === true`) — branch on it\nand render `<video>` instead of `<img>`.",
7314
7314
  "params": [
7315
7315
  {
7316
7316
  "name": "variant",
7317
7317
  "description": "- The product variant"
7318
7318
  }
7319
7319
  ],
7320
- "returns": "The first IkasProductImage of the variant, or undefined if no images. Access `.image` to get the IkasImage for CDN helpers.",
7320
+ "returns": "The first IkasProductImage of the variant, or undefined if no images. Check `.isVideo` to decide between `<video>` and `<img>`, and access `.image` to get the IkasImage for CDN helpers.",
7321
7321
  "returnType": "IkasProductImage | undefined",
7322
- "example": "```typescript\nimport { getProductVariantMainImage, getSelectedProductVariant, getDefaultSrc } from \"@ikas/bp-storefront\";\nimport { IkasProduct } from \"@ikas/bp-storefront\";\n\nfunction ProductImage({ product }: { product: IkasProduct }) {\n const variant = getSelectedProductVariant(product);\n const productImage = getProductVariantMainImage(variant);\n const image = productImage?.image;\n\n if (!image) {\n return <div className=\"no-image\">No image available</div>;\n }\n\n return <img src={getDefaultSrc(image)} alt={product.name} />;\n}\n```",
7322
+ "example": "```typescript\nimport { getProductVariantMainImage, getSelectedProductVariant, getDefaultSrc, createMediaSrcset } from \"@ikas/bp-storefront\";\nimport { IkasProduct } from \"@ikas/bp-storefront\";\n\nfunction ProductImage({ product }: { product: IkasProduct }) {\n const variant = getSelectedProductVariant(product);\n const productImage = getProductVariantMainImage(variant);\n const image = productImage?.image;\n\n if (!image) {\n return <div className=\"no-image\">No image available</div>;\n }\n\n // Media can be a video — branch on isVideo:\n return productImage.isVideo ? (\n <video src={getDefaultSrc(image)} muted playsInline loop>\n <track kind=\"captions\" />\n </video>\n ) : (\n <img src={getDefaultSrc(image)} srcSet={createMediaSrcset(image)} alt={product.name} />\n );\n}\n```",
7323
7323
  "categories": [
7324
7324
  "ProductDetail",
7325
7325
  "ProductList"
@@ -7597,14 +7597,14 @@
7597
7597
  "name": "getProductVariantAppliedCampaignAmount",
7598
7598
  "displayName": "getAppliedCampaignAmount",
7599
7599
  "signature": "function getProductVariantAppliedCampaignAmount(variant: IkasProductVariant): IkasAppliedCampaignAmount | null",
7600
- "description": "Get the applied campaign discount amount details for a product variant, including type and formatted value.",
7600
+ "description": "Get the applied campaign discount amount details for a product variant, including type and formatted value.\n\nHow the discount value is interpreted depends on `campaign.type`:\n- `\"FIXED_AMOUNT\"` → the value is an absolute money amount, returned in `formattedPrice` (e.g. \"$10.00\"); `discountPercentage` stays null.\n- `\"RATIO\"` → the value is a percentage, returned in `discountPercentage` (e.g. \"10\" for 10% off); `formattedPrice` stays null.\n\nBoth fixed and tiered campaigns are supported. For a tiered-discount campaign\n(`campaign.fixedDiscount` is null and the discount lives in `campaign.tieredDiscount.rules`),\nthe first tier's amount (`campaign.tieredDiscount.rules[0].amount`) is used, matching the storefront runtime.",
7601
7601
  "params": [
7602
7602
  {
7603
7603
  "name": "variant",
7604
7604
  "description": "- The product variant to check for applied campaigns"
7605
7605
  }
7606
7606
  ],
7607
- "returns": "An object with campaign type, formatted price, and discount percentage, or null if no campaign is applied",
7607
+ "returns": "An object `{ type, formattedPrice, discountPercentage }` — `formattedPrice` is set for FIXED_AMOUNT campaigns, `discountPercentage` for RATIO campaigns (fixed and tiered alike); the other field stays null. Returns null if no campaign is applied.",
7608
7608
  "returnType": "IkasAppliedCampaignAmount | null",
7609
7609
  "example": "```typescript\nimport { getProductVariantAppliedCampaignAmount, getSelectedProductVariant } from \"@ikas/bp-storefront\";\nimport { IkasProduct } from \"@ikas/bp-storefront\";\n\nfunction CampaignInfo({ product }: { product: IkasProduct }) {\n const variant = getSelectedProductVariant(product);\n const campaignAmount = getProductVariantAppliedCampaignAmount(variant);\n\n if (!campaignAmount) return null;\n\n return (\n <div>\n {campaignAmount.type === \"RATIO\"\n ? `${campaignAmount.discountPercentage}% off`\n : `${campaignAmount.formattedPrice} off`}\n </div>\n );\n}\n```",
7610
7610
  "categories": [
@@ -7999,6 +7999,36 @@
7999
7999
  "IkasProductVariant"
8000
8000
  ]
8001
8001
  },
8002
+ {
8003
+ "name": "getProductVariantTieredDiscountProducts",
8004
+ "displayName": "getTieredDiscountProducts",
8005
+ "signature": "function getProductVariantTieredDiscountProducts(variant: IkasProductVariant): IkasTieredDiscountProduct[]",
8006
+ "description": "Get the tiered-discount breakdown for a product variant, one entry per discount tier.\n\nA tiered discount defines multiple quantity tiers (`campaign.tieredDiscount.rules`), each with its own\namount and quantity range. This resolves every tier against the variant's price and returns the\nper-tier sell/final prices (both raw numbers and formatted strings), matching the storefront runtime.\n\nThe discount `amount` is interpreted by `campaign.type`: `\"RATIO\"` treats it as a percentage,\n`\"FIXED_AMOUNT\"` as an absolute money amount subtracted from the tier total.\n\n`lineItemQuantityRange.min`/`max` are normalized numbers where `0` means \"unbounded\". In particular\n`max === 0` marks an open-ended top tier (e.g. \"6+\" with no upper limit) — render it as \"min+\" rather\nthan \"min–max\", and never treat `max` as a real quantity when it is `0`.\n\nReturns an empty array when the variant has no tiered-discount campaign, when a\n`PRODUCT_AND_VARIANT` filter excludes this variant, or when no tier defines a quantity range.",
8007
+ "params": [
8008
+ {
8009
+ "name": "variant",
8010
+ "description": "- The product variant to resolve tiered discounts for"
8011
+ }
8012
+ ],
8013
+ "returns": "An array of tier objects (`amount`, `lineItemQuantityRange`, `type`, sell/final prices with their formatted variants, `salesChannelIds`), or an empty array if no tiered discount applies",
8014
+ "returnType": "IkasTieredDiscountProduct[]",
8015
+ "example": "```typescript\nimport { getProductVariantTieredDiscountProducts, getSelectedProductVariant } from \"@ikas/bp-storefront\";\nimport { IkasProduct } from \"@ikas/bp-storefront\";\n\nfunction TieredDiscountTable({ product }: { product: IkasProduct }) {\n const variant = getSelectedProductVariant(product);\n const tiers = getProductVariantTieredDiscountProducts(variant);\n\n if (!tiers.length) return null;\n\n return (\n <ul>\n {tiers.map((tier, i) => (\n <li key={i}>\n Buy {tier.lineItemQuantityRange.min}+ → {tier.formattedFinalPriceWithQuantity}{\" \"}\n <s>{tier.formattedSellPriceWithQuantity}</s>\n </li>\n ))}\n </ul>\n );\n}\n```",
8016
+ "categories": [
8017
+ "Pricing",
8018
+ "ProductVariant"
8019
+ ],
8020
+ "related": [
8021
+ "getProductVariantAppliedCampaignAmount",
8022
+ "getProductVariantCampaignOffersDiscountPercentage",
8023
+ "getProductVariantFinalPrice"
8024
+ ],
8025
+ "isAsync": false,
8026
+ "isClass": false,
8027
+ "parameterTypes": [
8028
+ "IkasProductVariant",
8029
+ "IkasTieredDiscountProduct"
8030
+ ]
8031
+ },
8002
8032
  {
8003
8033
  "name": "getProductVariantIsBackInStockEnabled",
8004
8034
  "displayName": "isBackInStockEnabled",
@@ -9556,7 +9586,7 @@
9556
9586
  "name": "initAddressForm",
9557
9587
  "displayName": "init",
9558
9588
  "signature": "async function initAddressForm(addressForm: AddressForm, address?: IkasCustomerAddress): Promise<void>",
9559
- "description": "Initializes an address form with default or existing address values, loads location data, and configures field settings.",
9589
+ "description": "Initializes an address form with default or existing address values, loads location data, and configures field settings.\n\nAlso resolves `addressForm.addressFormat` for the selected country. That is an\n`AddressFormItem[][]` describing which fields the country uses and how they group into rows\n(outer array = rows, inner array = fields sharing a row), and it is the only correct source\nfor laying out an address form -- a hardcoded field list will be wrong for most countries.\nIt is empty until this promise resolves, and `setAddressFormCountry` re-resolves it, so\nrender from it rather than copying it into local state.",
9560
9590
  "params": [
9561
9591
  {
9562
9592
  "name": "addressForm",
@@ -9569,7 +9599,7 @@
9569
9599
  ],
9570
9600
  "returns": "A promise that resolves once the form is fully initialized, including country/state/city lists, field settings, checkout settings, and shipping zones.",
9571
9601
  "returnType": "Promise<void>",
9572
- "example": "```typescript\nimport { initAddressForm } from \"@ikas/bp-storefront\";\n\n// Initialize an empty address form\nawait initAddressForm(addressForm);\n\n// Initialize with an existing customer address for editing\nawait initAddressForm(addressForm, existingAddress);\n```",
9602
+ "example": "```tsx\nimport { useEffect, useState } from \"preact/hooks\";\nimport {\n type AddressForm,\n type AddressFormItem,\n initAddressForm,\n setAddressFormFirstName,\n setAddressFormLastName,\n setAddressFormIdentityNumber,\n setAddressFormAddressLine1,\n setAddressFormAddressLine2,\n setAddressFormPostalCode,\n setAddressFormPhone,\n} from \"@ikas/bp-storefront\";\n\n// Initialize an empty address form\nawait initAddressForm(addressForm);\n\n// Initialize with an existing customer address for editing\nawait initAddressForm(addressForm, existingAddress);\n\n// addressFormat is empty until init resolves, so gate the render on it.\nconst [isLoading, setIsLoading] = useState(true);\nuseEffect(() => {\n initAddressForm(addressForm, address).then(() => setIsLoading(false));\n}, []);\n\n// Every addressFormat key has a matching setter, each taking (addressForm, value).\n// The location keys (country, state, city, district, region) are omitted here: they\n// render as selects fed by addressForm.countryOptions / stateOptions / cityOptions /\n// districtOptions / regionOptions, and must fall back to a text input when the field\n// isFreeText or has no options.\nconst SETTERS: Partial<Record<AddressFormItem, (form: AddressForm, value: string) => void>> = {\n firstName: setAddressFormFirstName,\n lastName: setAddressFormLastName,\n identityNumber: setAddressFormIdentityNumber,\n addressLine1: setAddressFormAddressLine1,\n addressLine2: setAddressFormAddressLine2,\n postalCode: setAddressFormPostalCode,\n phone: setAddressFormPhone,\n};\n\n// Render the country's own layout: outer array = rows, inner array = fields in that row.\n(addressForm.addressFormat ?? []).map((row) => {\n // A field the country does not use is absent from the form object entirely.\n const keys = row.filter((key) => addressForm[key] != null);\n if (!keys.length) return null;\n\n return (\n <div className=\"address-row\" key={keys.join(\"-\")}>\n {keys.map((key) => {\n // Each entry is an IkasFormItem: value, label, placeholder, hasError, message.\n const field = addressForm[key];\n if (!field) return null; // already guaranteed by the filter above; narrows the type\n return (\n <label key={key}>\n {field.label}\n <input\n value={field.value ?? \"\"}\n placeholder={field.placeholder}\n onInput={(e) => SETTERS[key]?.(addressForm, e.currentTarget.value)}\n />\n {field.hasError && <small>{field.message}</small>}\n </label>\n );\n })}\n </div>\n );\n})\n```",
9573
9603
  "categories": [
9574
9604
  "Address",
9575
9605
  "Form",
@@ -12499,6 +12529,34 @@
12499
12529
  "isAsync": false,
12500
12530
  "isClass": false
12501
12531
  },
12532
+ {
12533
+ "name": "setLocalization",
12534
+ "signature": "function setLocalization(baseStore: BaseStore, localeOption: IkasLocaleOption): void",
12535
+ "description": "Switches the storefront to the routing associated with `localeOption` and redirects the browser\nto the equivalent URL under that routing.\n\nReads the routing directly from `localeOption.routing`, then performs a full-page redirect via\n`window.location.replace`. For CATEGORY/BRAND/PRODUCT pages, the localized slug from the page's\nmetadata translations is used when available; otherwise the visitor stays on the current path\n(with the current routing prefix swapped for the new one). Query string and hash are preserved.",
12536
+ "params": [
12537
+ {
12538
+ "name": "baseStore",
12539
+ "description": "- The base store instance (used to read the current page type for slug\nresolution on detail pages)."
12540
+ },
12541
+ {
12542
+ "name": "localeOption",
12543
+ "description": "- The locale option the visitor selected. Render `baseStore.localeOptions`\nas a list (e.g. a country/region picker) and pass the chosen entry directly to this function."
12544
+ }
12545
+ ],
12546
+ "returns": "void.",
12547
+ "returnType": "void",
12548
+ "example": "```tsx\nimport { setLocalization, baseStore } from \"@ikas/bp-storefront\";\n\nfunction LocalizationSwitcher() {\n return (\n <ul>\n {baseStore.localeOptions.map(option => (\n <li key={option.id}>\n <button onClick={() => setLocalization(baseStore, option)}>\n {option.countryName}\n </button>\n </li>\n ))}\n </ul>\n );\n}\n```",
12549
+ "categories": [
12550
+ "BaseStore",
12551
+ "Store"
12552
+ ],
12553
+ "related": [],
12554
+ "isAsync": false,
12555
+ "isClass": false,
12556
+ "parameterTypes": [
12557
+ "IkasLocaleOption"
12558
+ ]
12559
+ },
12502
12560
  {
12503
12561
  "name": "setLanguage",
12504
12562
  "signature": "function setLanguage(baseStore: BaseStore, language: IkasLanguageOption): void",
@@ -14834,7 +14892,7 @@
14834
14892
  {
14835
14893
  "name": "getEmptyAddressForm",
14836
14894
  "signature": "function getEmptyAddressForm(customerStore: IkasCustomerStore): AddressForm",
14837
- "description": "Create and return a new, empty address form with validation, wrapped in MobX observability.",
14895
+ "description": "Create and return a new, empty address form with validation, wrapped in MobX observability.\n\nUse this to create an address; use `getIkasCustomerAddressForm(address)` to edit an existing\none. It starts `initAddressForm` internally but does not await it, so await `initAddressForm`\nyourself when you need to know that the country layout (`addressFormat`) and the country/state/\ncity lists are ready to render.",
14838
14896
  "params": [
14839
14897
  {
14840
14898
  "name": "customerStore",
@@ -14843,14 +14901,16 @@
14843
14901
  ],
14844
14902
  "returns": "A new observable address form object with validated fields",
14845
14903
  "returnType": "AddressForm",
14846
- "example": "```typescript\nimport { customerStore, getEmptyAddressForm, saveCustomer } from \"@ikas/bp-storefront\";\n\nfunction AddAddressPage() {\n const form = getEmptyAddressForm(customerStore);\n\n const handleSave = async () => {\n const customer = { ...customerStore.customer! };\n customer.addresses = [...(customer.addresses || []), formToAddress(form)];\n await saveCustomer(customerStore, customer);\n };\n\n return (\n <form>\n <input\n value={form.addressLine1.value}\n onChange={e => form.addressLine1.value = e.target.value}\n />\n <button onClick={handleSave}>Save Address</button>\n </form>\n );\n}\n```",
14904
+ "example": "```tsx\nimport {\n customerStore,\n getEmptyAddressForm,\n initAddressForm,\n setAddressFormAddressLine1,\n submitAddressForm,\n} from \"@ikas/bp-storefront\";\n\n// Create the form once, then await init before rendering the country-driven layout.\nconst [form] = useState(() => getEmptyAddressForm(customerStore));\nconst [isLoading, setIsLoading] = useState(true);\nuseEffect(() => {\n initAddressForm(form).then(() => setIsLoading(false));\n}, []);\n\n// Always go through the setters. Assigning `form.addressLine1.value` directly skips\n// re-validation and the dependent-field resets the location setters perform.\nsetAddressFormAddressLine1(form, \"123 Main Street\");\n\n// submitAddressForm validates and saves the address onto the customer itself --\n// do not hand-build a customer object and call saveCustomer for this.\nconst ok = await submitAddressForm(form);\n```",
14847
14905
  "categories": [
14848
14906
  "Customer",
14849
14907
  "Address"
14850
14908
  ],
14851
14909
  "related": [
14852
- "deleteCustomerAddress",
14853
- "saveCustomer"
14910
+ "initAddressForm",
14911
+ "submitAddressForm",
14912
+ "getIkasCustomerAddressForm",
14913
+ "deleteCustomerAddress"
14854
14914
  ],
14855
14915
  "isAsync": false,
14856
14916
  "isClass": false,
@@ -15088,6 +15148,105 @@
15088
15148
  "isClass": true,
15089
15149
  "className": "Router"
15090
15150
  },
15151
+ {
15152
+ "name": "registerThemeSettingValues",
15153
+ "signature": "function registerThemeSettingValues(values: Record<string, any> | null): void",
15154
+ "description": "Register the live global-variable object (`_g_`) so `getThemeSetting`/`getThemeSettings`\nreturn actual runtime values (constants, computed getters, and in-editor edits) instead\nof the serialized design-time defaults. Called by generated code, not by component authors.",
15155
+ "params": [],
15156
+ "returnType": "void",
15157
+ "categories": [],
15158
+ "related": [],
15159
+ "isAsync": false,
15160
+ "isClass": false
15161
+ },
15162
+ {
15163
+ "name": "getThemeSettings",
15164
+ "signature": "function getThemeSettings(): ThemeSetting[]",
15165
+ "description": "All global variables (Theme Settings) defined for the theme.",
15166
+ "params": [],
15167
+ "returnType": "ThemeSetting[]",
15168
+ "categories": [],
15169
+ "related": [],
15170
+ "isAsync": false,
15171
+ "isClass": false
15172
+ },
15173
+ {
15174
+ "name": "getThemeSetting",
15175
+ "signature": "function getThemeSetting(name: string): ThemeSetting | undefined",
15176
+ "description": "A single global variable by its stable key (`variableName`, e.g. `_6Q0KV7VGGM`).\nDiscover keys via (each item carries a human `displayName`).\nThe returned `value` is the live blueprint value when available, else the default.\nIts shape is discriminated by `type` (see ); note an\nIMAGE setting's value is an image REFERENCE (no `.url`) — resolve with\n`getDefaultSrc`/`getSrc`.",
15177
+ "params": [],
15178
+ "returnType": "ThemeSetting | undefined",
15179
+ "categories": [],
15180
+ "related": [],
15181
+ "isAsync": false,
15182
+ "isClass": false
15183
+ },
15184
+ {
15185
+ "name": "getThemeSettingValue",
15186
+ "signature": "function getThemeSettingValue(name: string): any",
15187
+ "description": "Convenience: the resolved value of a global variable, or `undefined` if not found.",
15188
+ "params": [],
15189
+ "returnType": "any",
15190
+ "categories": [],
15191
+ "related": [],
15192
+ "isAsync": false,
15193
+ "isClass": false
15194
+ },
15195
+ {
15196
+ "name": "getThemeColors",
15197
+ "signature": "function getThemeColors(): RuntimeDesignToken[]",
15198
+ "description": "Theme color tokens. Each carries a resolved value and a `var(--id)` CSS reference.",
15199
+ "params": [],
15200
+ "returnType": "RuntimeDesignToken[]",
15201
+ "categories": [],
15202
+ "related": [],
15203
+ "isAsync": false,
15204
+ "isClass": false
15205
+ },
15206
+ {
15207
+ "name": "getThemeTypography",
15208
+ "signature": "function getThemeTypography(): RuntimeTypographyToken[]",
15209
+ "description": "Theme typography tokens (text styles). Apply `className` or read `resolved` CSS values.",
15210
+ "params": [],
15211
+ "returnType": "RuntimeTypographyToken[]",
15212
+ "categories": [],
15213
+ "related": [],
15214
+ "isAsync": false,
15215
+ "isClass": false
15216
+ },
15217
+ {
15218
+ "name": "getThemeBreakpoints",
15219
+ "signature": "function getThemeBreakpoints(): RuntimeBreakpointToken[]",
15220
+ "description": "Theme responsive breakpoints (`{ id, width }`).",
15221
+ "params": [],
15222
+ "returnType": "RuntimeBreakpointToken[]",
15223
+ "categories": [],
15224
+ "related": [],
15225
+ "isAsync": false,
15226
+ "isClass": false
15227
+ },
15228
+ {
15229
+ "name": "getThemeKeyframes",
15230
+ "signature": "function getThemeKeyframes(): RuntimeKeyframeToken[]",
15231
+ "description": "Theme keyframe/transition animations. Use `ref` as the CSS animation name.",
15232
+ "params": [],
15233
+ "returnType": "RuntimeKeyframeToken[]",
15234
+ "categories": [],
15235
+ "related": [],
15236
+ "isAsync": false,
15237
+ "isClass": false
15238
+ },
15239
+ {
15240
+ "name": "getThemeColorSchemes",
15241
+ "signature": "function getThemeColorSchemes(): RuntimeThemeColorSchemes",
15242
+ "description": "Theme color schemes (palettes). Returns two PARALLEL lists with different jobs:\n- `schemes`: the color SLOTS as `{ id }` only — no colors and no display label live here at\n runtime. A slot's human name is authoring-only (read it via the CLI/MCP `list-theme-globals`\n or the editor); at runtime identify a slot solely by its `id`.\n- `values`: the actual palettes. A palette's colors live in its `colorsByScheme`\n map, keyed by slot id → `{ resolved, cssVar }`.\n\nTo render swatches, iterate `values[].colorsByScheme` (the source of truth for\ncolors), NOT the top-level `schemes` array — `schemes` carries slot ids only, so\niterating it renders empty:\n\n const { values } = getThemeColorSchemes();\n values.forEach(palette =>\n Object.entries(palette.colorsByScheme).forEach(([slotId, { resolved, cssVar }]) => {\n // slotId → stable slot key, cssVar → live var() ref (prefer this), resolved → hex snapshot\n })\n );",
15243
+ "params": [],
15244
+ "returnType": "RuntimeThemeColorSchemes",
15245
+ "categories": [],
15246
+ "related": [],
15247
+ "isAsync": false,
15248
+ "isClass": false
15249
+ },
15091
15250
  {
15092
15251
  "name": "isBrowser",
15093
15252
  "signature": "function isBrowser(yes?: () => void, no?: () => void): void",
@@ -15101,10 +15260,10 @@
15101
15260
  },
15102
15261
  {
15103
15262
  "name": "IkasComponentRenderer",
15104
- "signature": "function IkasComponentRenderer({\n id: baseId,\n components,\n style,\n className,\n parentProps = EMPTY_OBJ,\n map = EMPTY_OBJ,\n}: IkasComponentRendererProps): VNode<ClassAttributes<HTMLElement> & { id: string; dangerouslySetInnerHTML: { __html: string; }; style: { cssText?: string | null | undefined; length?: string | number | null | undefined; ... 496 more ...; zoom?: string | ... 2 more ... | undefined; }; className: string | undefined; }> | null",
15263
+ "signature": "function IkasComponentRenderer({\n id: baseId,\n components,\n style,\n className,\n parentProps = EMPTY_OBJ,\n map = EMPTY_OBJ,\n}: IkasComponentRendererProps): VNode<ClassAttributes<HTMLDivElement> & { id: string; ref: MutableRef<HTMLDivElement | null>; dangerouslySetInnerHTML: { ...; }; style: { ...; }; className: string | undefined; }> | null",
15105
15264
  "description": "",
15106
15265
  "params": [],
15107
- "returnType": "VNode<ClassAttributes<HTMLElement> & { id: string; dangerouslySetInnerHTML: { __html: string; }; style: { cssText?: string | null | undefined; length?: string | number | null | undefined; ... 496 more ...; zoom?: string | ... 2 more ... | undefined; }; className: string | undefined; }> | null",
15266
+ "returnType": "VNode<ClassAttributes<HTMLDivElement> & { id: string; ref: MutableRef<HTMLDivElement | null>; dangerouslySetInnerHTML: { ...; }; style: { ...; }; className: string | undefined; }> | null",
15108
15267
  "categories": [],
15109
15268
  "related": [],
15110
15269
  "isAsync": false,
@@ -15168,6 +15327,55 @@
15168
15327
  "related": [],
15169
15328
  "isAsync": false,
15170
15329
  "isClass": false
15330
+ },
15331
+ {
15332
+ "name": "PayWithIkas",
15333
+ "signature": "function PayWithIkas({ product, quantity = 1, className, style }: PayWithIkasProps): VNode<ClassAttributes<HTMLIFrameElement> & { ref: MutableRef<HTMLIFrameElement | null>; title: string; ... 4 more ...; style: { ...; }; }> | null",
15334
+ "description": "\"Pay with ikas\" (Hızlı Öde) fast-checkout button for the product detail page.\nDrop-in Preact component that renders the pay-with-ikas checkout iframe and\nwires up its whole message protocol, so a theme gets the one-click \"Hızlı Öde\"\nflow without owning any of the plumbing. Use it next to the add-to-cart button\non the product detail page.\n\nThe pay-with-ikas URL is read from `IkasStorefrontConfig.getPayWithIkasUrl()`;\nwhen the merchant has not enabled Pay with ikas the component renders nothing.\nThe add-to-cart-enabled state is tracked reactively via mobx `autorun`, so the\niframe stays in sync as the product's availability changes (e.g. variant\nselection). Clicking \"Hızlı Öde\" creates a temporary cart via\n`createPayWithIkasSession` and redirects to the returned pay URL.",
15335
+ "params": [
15336
+ {
15337
+ "name": "product",
15338
+ "description": "- The product to fast-checkout via Pay with ikas"
15339
+ },
15340
+ {
15341
+ "name": "quantity",
15342
+ "description": "- Quantity to purchase (defaults to 1)"
15343
+ },
15344
+ {
15345
+ "name": "className",
15346
+ "description": "- Optional CSS class applied to the iframe"
15347
+ },
15348
+ {
15349
+ "name": "style",
15350
+ "description": "- Optional inline styles applied to the iframe"
15351
+ }
15352
+ ],
15353
+ "returnType": "VNode<ClassAttributes<HTMLIFrameElement> & { ref: MutableRef<HTMLIFrameElement | null>; title: string; ... 4 more ...; style: { ...; }; }> | null",
15354
+ "example": "```tsx\nimport { PayWithIkas } from \"@ikas/bp-storefront\";\n\n// On the product detail page, alongside the add-to-cart button:\n<PayWithIkas product={product} quantity={quantity} />\n```",
15355
+ "categories": [
15356
+ "ProductDetail",
15357
+ "Checkout"
15358
+ ],
15359
+ "related": [
15360
+ "createPayWithIkasSession",
15361
+ "isAddToCartEnabled"
15362
+ ],
15363
+ "isAsync": false,
15364
+ "isClass": false,
15365
+ "parameterTypes": [
15366
+ "IkasProps"
15367
+ ]
15368
+ },
15369
+ {
15370
+ "name": "normalizeSvg",
15371
+ "signature": "function normalizeSvg(svg: string, options: NormalizeSvgOptions): string",
15372
+ "description": "Isomorphic, DOM-free normalization of a raw SVG markup string for render.\nSafe to call in SSR, browser, and node — pure string transforms only.",
15373
+ "params": [],
15374
+ "returnType": "string",
15375
+ "categories": [],
15376
+ "related": [],
15377
+ "isAsync": false,
15378
+ "isClass": false
15171
15379
  }
15172
15380
  ],
15173
15381
  "codeExamples": []