@magicx-eng/ai-autocomplete-vanilla 0.65.0 → 0.67.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.
package/README.md CHANGED
@@ -104,6 +104,7 @@ const ac = new AIAutocomplete(container, {
104
104
  mode: "auto", // "light" | "dark" | "auto"
105
105
  optionsPosition: "below", // "above" | "below"
106
106
  animations: true, // press, shimmer, typed placeholder, staggered options, scroll arrow
107
+ optionsStyle: "floating", // "classic" = the old stroke, size and motion
107
108
  pillPlacement: "dropdown", // "inline" | "dropdown" | "hidden"
108
109
  dropdownTrigger: "auto", // "auto" | "manual" | "hidden"
109
110
  closeDropdownOnBlur: true, // false = keep dropdown open even when input loses focus
@@ -174,6 +175,7 @@ Product display options apply to both `renderMode: "full"` and
174
175
  |---|---|---|---|
175
176
  | `showProducts?` | `boolean` | `true` | Show product cards whenever there are products to display. |
176
177
  | `productsLayout?` | `"row" \| "list"` | `"row"` | Lay out cards as a scrolling row or a vertical list. |
178
+ | `seeAllResults?` | `boolean` | `false` | Tier 1 only. End the dropdown in a "See all results" button that submits like Enter, shown while there is typed text. |
177
179
  | `productImageFallback?` | `"image" \| "initial"` | `"image"` | Fallback for a missing or blank product image URL, or an image load error. `"image"` shows the placeholder pictogram; `"initial"` shows the title initial. A working image still takes priority. See [Product strip](#product-strip). |
178
180
 
179
181
  ### Methods
package/REFERENCE.md CHANGED
@@ -599,6 +599,8 @@ The full input also accepts `--aia-input-radius` and `--aia-written-text-font-we
599
599
  | `--aia-multi-done-width` | as wide as the widest option | same | Width of the multi-select Done button; set `100%` for full width. |
600
600
  | `--aia-multi-done-min-width` | `120px` | `120px` | Narrowest the multi-select Done button gets. |
601
601
  | `--aia-time-done-bg` / `--aia-time-done-bg-hover` / `--aia-time-done-color` | `--aia-done-*` | `--aia-done-*` | Override the time wheel's Done button alone. |
602
+ | `--aia-see-all-bg` / `--aia-see-all-bg-hover` / `--aia-see-all-color` | `#111111` / `#333333` / `#ffffff` | `--aia-confirm-*` | The "See all results" button (`seeAllResults`). |
603
+ | `--aia-see-all-height` / `--aia-see-all-radius` / `--aia-see-all-font-size` | `48px` / `999px` / `16px` | same | Its minimum height, corner radius and text size. |
602
604
  | `--aia-location-field-bg-idle` | `transparent` | `transparent` | The location search field at rest. |
603
605
  | `--aia-location-field-bg` | `--aia-streak-rgb` at 6% (indigo) | `--aia-streak-rgb` at 6% (white) | The location search field on hover or focus. |
604
606
  | `--aia-location-field-radius` | `10px` | `10px` | Corner radius of the location search field. |
package/dist/index.d.mts CHANGED
@@ -1330,6 +1330,14 @@ interface CoreOptions {
1330
1330
  mode?: AppearanceMode;
1331
1331
  optionsPosition?: "above" | "below";
1332
1332
  animations?: boolean;
1333
+ /**
1334
+ * The options box's look and motion. Default `"floating"`: no stroke, sized
1335
+ * to the text, and it dissolves in where it sits and glides between
1336
+ * questions. `"classic"` brings back the earlier stroke, size and motion:
1337
+ * it unfolds out of the input with a stroke, at full size. The new header
1338
+ * layout stays.
1339
+ */
1340
+ optionsStyle?: "floating" | "classic";
1333
1341
  /** When the dropdown appears. "auto" = shows when options available. "manual" = only on pill tap. "hidden" = never. Default: "auto". */
1334
1342
  dropdownTrigger?: "auto" | "manual" | "hidden";
1335
1343
  /** When true (default), the dropdown closes when the input loses focus. Set to false to keep it open whenever options are available, regardless of focus. */
@@ -1420,6 +1428,15 @@ interface CoreOptions {
1420
1428
  * request, since its search rides the suggest cadence.
1421
1429
  */
1422
1430
  showProducts?: boolean;
1431
+ /**
1432
+ * Tier 1 ("full") only. When true, the dropdown ends in a full-width "See
1433
+ * all results" button, shown while the field holds typed text. A click
1434
+ * submits the query exactly as Enter and the submit button do (`onSubmit`
1435
+ * runs, then `resetOnSubmit` applies), so an `onSubmit` that opens your
1436
+ * results page takes the shopper there. Style it with the
1437
+ * `--aia-see-all-*` custom properties. Default: false.
1438
+ */
1439
+ seeAllResults?: boolean;
1423
1440
  /**
1424
1441
  * How the product strip lays its cards out. `"row"` (the default) is a
1425
1442
  * horizontally scrolling shelf of cards. `"list"` stacks the same cards as
@@ -2662,7 +2679,7 @@ declare function optionLabel(option: {
2662
2679
  * runs between two open renders. All three packages call `settlePanelMorph`
2663
2680
  * after every commit of the dropdown, so the motion can't drift apart; it is a
2664
2681
  * no-op where Web Animations or layout are missing (jsdom) and under reduced
2665
- * motion or `animations: false`.
2682
+ * motion, `animations: false` or `optionsStyle: "classic"`.
2666
2683
  */
2667
2684
  declare const PANEL_GLIDE_MS = 360;
2668
2685
  declare const PANEL_LEAVE_MS = 280;
@@ -2746,7 +2763,13 @@ interface RenderEditableArgs {
2746
2763
  /** When set, the matching `<strong>` is decorated with the editing class. */
2747
2764
  editingParamId: string | null;
2748
2765
  placeholderText: string;
2749
- isFocused: boolean;
2766
+ /**
2767
+ * The store's focus flag. No longer read: the caret is restored whenever the
2768
+ * editor holds DOM focus, since this flag can lag it. Kept so callers in the
2769
+ * React and Angular packages stay compatible.
2770
+ * @deprecated Not read; DOM focus decides whether the caret is restored.
2771
+ */
2772
+ isFocused?: boolean;
2750
2773
  /** Whether completed chips draw the icon of the option that answered them. Default: true. */
2751
2774
  showChipIcons?: boolean;
2752
2775
  /** Whether completed chips draw the picture of the option that answered them, in place of the icon. Default: true. */
@@ -2779,6 +2802,7 @@ declare const en: {
2779
2802
  soldOut: string;
2780
2803
  addToCart: string;
2781
2804
  submit: string;
2805
+ seeAllResults: string;
2782
2806
  scrollArrow: string;
2783
2807
  keepTyping: string;
2784
2808
  done: string;
package/dist/index.d.ts CHANGED
@@ -1330,6 +1330,14 @@ interface CoreOptions {
1330
1330
  mode?: AppearanceMode;
1331
1331
  optionsPosition?: "above" | "below";
1332
1332
  animations?: boolean;
1333
+ /**
1334
+ * The options box's look and motion. Default `"floating"`: no stroke, sized
1335
+ * to the text, and it dissolves in where it sits and glides between
1336
+ * questions. `"classic"` brings back the earlier stroke, size and motion:
1337
+ * it unfolds out of the input with a stroke, at full size. The new header
1338
+ * layout stays.
1339
+ */
1340
+ optionsStyle?: "floating" | "classic";
1333
1341
  /** When the dropdown appears. "auto" = shows when options available. "manual" = only on pill tap. "hidden" = never. Default: "auto". */
1334
1342
  dropdownTrigger?: "auto" | "manual" | "hidden";
1335
1343
  /** When true (default), the dropdown closes when the input loses focus. Set to false to keep it open whenever options are available, regardless of focus. */
@@ -1420,6 +1428,15 @@ interface CoreOptions {
1420
1428
  * request, since its search rides the suggest cadence.
1421
1429
  */
1422
1430
  showProducts?: boolean;
1431
+ /**
1432
+ * Tier 1 ("full") only. When true, the dropdown ends in a full-width "See
1433
+ * all results" button, shown while the field holds typed text. A click
1434
+ * submits the query exactly as Enter and the submit button do (`onSubmit`
1435
+ * runs, then `resetOnSubmit` applies), so an `onSubmit` that opens your
1436
+ * results page takes the shopper there. Style it with the
1437
+ * `--aia-see-all-*` custom properties. Default: false.
1438
+ */
1439
+ seeAllResults?: boolean;
1423
1440
  /**
1424
1441
  * How the product strip lays its cards out. `"row"` (the default) is a
1425
1442
  * horizontally scrolling shelf of cards. `"list"` stacks the same cards as
@@ -2662,7 +2679,7 @@ declare function optionLabel(option: {
2662
2679
  * runs between two open renders. All three packages call `settlePanelMorph`
2663
2680
  * after every commit of the dropdown, so the motion can't drift apart; it is a
2664
2681
  * no-op where Web Animations or layout are missing (jsdom) and under reduced
2665
- * motion or `animations: false`.
2682
+ * motion, `animations: false` or `optionsStyle: "classic"`.
2666
2683
  */
2667
2684
  declare const PANEL_GLIDE_MS = 360;
2668
2685
  declare const PANEL_LEAVE_MS = 280;
@@ -2746,7 +2763,13 @@ interface RenderEditableArgs {
2746
2763
  /** When set, the matching `<strong>` is decorated with the editing class. */
2747
2764
  editingParamId: string | null;
2748
2765
  placeholderText: string;
2749
- isFocused: boolean;
2766
+ /**
2767
+ * The store's focus flag. No longer read: the caret is restored whenever the
2768
+ * editor holds DOM focus, since this flag can lag it. Kept so callers in the
2769
+ * React and Angular packages stay compatible.
2770
+ * @deprecated Not read; DOM focus decides whether the caret is restored.
2771
+ */
2772
+ isFocused?: boolean;
2750
2773
  /** Whether completed chips draw the icon of the option that answered them. Default: true. */
2751
2774
  showChipIcons?: boolean;
2752
2775
  /** Whether completed chips draw the picture of the option that answered them, in place of the icon. Default: true. */
@@ -2779,6 +2802,7 @@ declare const en: {
2779
2802
  soldOut: string;
2780
2803
  addToCart: string;
2781
2804
  submit: string;
2805
+ seeAllResults: string;
2782
2806
  scrollArrow: string;
2783
2807
  keepTyping: string;
2784
2808
  done: string;