@magicx-eng/ai-autocomplete-vanilla 0.56.0 → 0.57.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/README.md CHANGED
@@ -209,7 +209,8 @@ new AIAutocomplete(container, {
209
209
 
210
210
  Each server item becomes a `Product` with `id` (the item's stable id), `title`,
211
211
  `price` (the item's lowest price, verbatim as the catalog spells it — the
212
- currency is yours to add), `vendor`, `imageUrl`, and a `url`: the item's own
212
+ currency is yours to add), `compareAtPrice` (the price before a markdown, on a
213
+ discounted item only, struck through beside the price), `vendor`, `imageUrl`, and a `url`: the item's own
213
214
  `item_url` when the uploaded catalog named one (absolute or root-relative;
214
215
  anything else is ignored), else a **relative** `/products/{handle}` — the right
215
216
  link for a Shopify widget running on the storefront itself — opened on the
@@ -428,6 +429,7 @@ type Product = {
428
429
  url?: string; // absent = a card with no link (still activatable)
429
430
  imageUrl?: string | null; // null uses the configured productImageFallback
430
431
  price?: string; // pre-formatted by you
432
+ compareAtPrice?: string; // the price before a markdown; struck through beside price
431
433
  vendor?: string;
432
434
  available?: boolean; // false shows a "Sold out" badge
433
435
  };
@@ -1014,6 +1016,8 @@ The full input also accepts `--aia-input-radius` and `--aia-written-text-font-we
1014
1016
  | `--aia-product-placeholder-image` | storefront pictogram | storefront pictogram | The pictogram used by `productImageFallback: "image"` (the default) when an image URL is missing, blank or fails to load. Defaults to a two-tone storefront inlined as a data URI. Set any `url(...)` to swap it; it is centered and contained over `--aia-product-media-bg`. Does not affect `"initial"` tiles. |
1015
1017
  | `--aia-product-title-color` | `--aia-option-color-selected` | `--aia-option-color-selected` | Product title text. Follows the option colors by default, so theming the panel moves suggestions and products together. |
1016
1018
  | `--aia-product-price-color` | `--aia-option-color-selected` | `--aia-option-color-selected` | Product price text. |
1019
+ | `--aia-product-compare-at-color` | `currentColor` | `currentColor` | The struck price before a markdown. Defaults to the price's colour. |
1020
+ | `--aia-product-compare-at-opacity` | `0.6` | `0.6` | How far the struck price is dimmed. |
1017
1021
  | `--aia-product-vendor-color` | `--aia-option-color` | `--aia-option-color` | Product vendor line. |
1018
1022
  | `--aia-product-focus-ring` | `--aia-option-color-selected` | `--aia-option-color-selected` | Focus ring drawn on a keyboard-focused card. |
1019
1023
  | `--aia-products-label-color` | `--aia-option-color` | `--aia-option-color` | "Products" section label. |
package/dist/index.d.mts CHANGED
@@ -234,6 +234,12 @@ interface MatchedItem {
234
234
  * The strip formats it with `currency` when the item has one.
235
235
  */
236
236
  price?: string;
237
+ /**
238
+ * The item's price before a markdown, as the catalog's number ("160.00").
239
+ * Present only on a discounted item, always above `price`, and always the
240
+ * same variant's as `price`. The strip strikes it through beside the price.
241
+ */
242
+ compare_at_price?: string;
237
243
  /** ISO 4217 currency code. Absent when unknown. */
238
244
  currency?: string;
239
245
  vendor?: string;
@@ -475,6 +481,13 @@ interface Product {
475
481
  * A custom integration (`opts.products`) supplies its own text.
476
482
  */
477
483
  price?: string;
484
+ /**
485
+ * The price before a markdown, as display text, struck through beside
486
+ * `price`. Shown only when `price` is set too. The built-in strip sets it
487
+ * from the server's `compare_at_price`, formatted like the price; a custom
488
+ * integration supplies its own text and decides when an item is discounted.
489
+ */
490
+ compareAtPrice?: string;
478
491
  vendor?: string;
479
492
  /**
480
493
  * `false` marks the card sold out: a "Sold out" badge over the image, and
package/dist/index.d.ts CHANGED
@@ -234,6 +234,12 @@ interface MatchedItem {
234
234
  * The strip formats it with `currency` when the item has one.
235
235
  */
236
236
  price?: string;
237
+ /**
238
+ * The item's price before a markdown, as the catalog's number ("160.00").
239
+ * Present only on a discounted item, always above `price`, and always the
240
+ * same variant's as `price`. The strip strikes it through beside the price.
241
+ */
242
+ compare_at_price?: string;
237
243
  /** ISO 4217 currency code. Absent when unknown. */
238
244
  currency?: string;
239
245
  vendor?: string;
@@ -475,6 +481,13 @@ interface Product {
475
481
  * A custom integration (`opts.products`) supplies its own text.
476
482
  */
477
483
  price?: string;
484
+ /**
485
+ * The price before a markdown, as display text, struck through beside
486
+ * `price`. Shown only when `price` is set too. The built-in strip sets it
487
+ * from the server's `compare_at_price`, formatted like the price; a custom
488
+ * integration supplies its own text and decides when an item is discounted.
489
+ */
490
+ compareAtPrice?: string;
478
491
  vendor?: string;
479
492
  /**
480
493
  * `false` marks the card sold out: a "Sold out" badge over the image, and