@magicx-eng/ai-autocomplete-vanilla 0.67.1 → 0.69.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
@@ -47,7 +47,7 @@ To get a key, create your product at https://ai-autocomplete.com/edit/logic (it
47
47
  - **Product strip:** a row of product cards under the options, from your catalog or from your own search.
48
48
  - **Option overrides:** supply a parameter's options yourself, as a fixed list, a computed one, or results from your own endpoint.
49
49
  - **Catalog report:** each response says which of the query's constraints the catalog applied, which it dropped, and how many items are left.
50
- - **Motion:** the picked option presses in, new details shimmer, and a loading skeleton keeps the layout while a request is in flight.
50
+ - **Motion:** the picked option presses in, new details shimmer, and the options fade out while a request is in flight.
51
51
  - **Input handling:** keyboard navigation, the ARIA combobox 1.2 pattern, and IME-safe typing.
52
52
  - **Auth:** a public key, or short-lived access tokens with automatic refresh and one retry on a 401.
53
53
  - **Styling:** light and dark themes, CSS variables, stable `data-aia-*` selector hooks, and shadow DOM support.
@@ -111,7 +111,7 @@ const ac = new AIAutocomplete(container, {
111
111
  prependPlaceholder: true, // false = show the starting state's lead-in text as a hint only; a picked option is not written after it
112
112
  showNonTappableOptions: true, // false = hide non-tappable options from the dropdown
113
113
  locationSearch: true, // false = a location field takes typed text only, no lookups
114
- showSkipButton: true, // false = hide the pill bar's "skip" button (after the label)
114
+ showSkipButton: true, // false = hide the pill bar's "skip" button (trailing edge)
115
115
  showOptionIcons: true, // false = render option rows as text only (no icons)
116
116
  showChipIcons: true, // false = render completed chips as text only (no icons)
117
117
  showChipImages: true, // false = never draw an option's picture on its completed chip
@@ -346,11 +346,11 @@ unsub();
346
346
 
347
347
  > **Datepicker in a custom UI.** For a date parameter, `state.activeFormatType` is `"date"` and `state.filteredOptions` holds that month's day cells. Each cell's `text` is the date it commits (`"March 23"`, or `"Tuesday"` inside the next week), so rendering them as a plain list already works — `selectOption(cell)` behaves exactly as it does for an option. To draw an actual calendar, read `state.dateView` for the month on show, `cellDay(cell)` for the number to paint, and call `showPreviousMonth()` / `showNextMonth()` to page. Cells that pad the start and end of the month have `is_tappable: false`. For a **range** parameter `activeFormatType` is `"date-range"` and the same `selectOption(cell)` is called twice: the first records the start (`state.dateRangeStart` holds it, and nothing is committed yet), the second commits the span. `dateCellMarks` and `visibleDateRange` are exported to paint the two ends and the band between them the way the built-in calendars do. A `"date"` question can also ask the end of a range whose start is already known. Then `state.dateFloor` holds that start: mark it, dim the days before it (`isDimmedDay` and `dateFloorFor` are exported for this), and note that picking one of them does nothing.
348
348
 
349
- > **Option icons.** An option may carry an icon: `icon_svg` is inline SVG markup and `icon` its name. The built-in dropdown draws the SVG before the option's text, in the text color, and hides it while the row shows its loading skeleton. When rendering options yourself, pass `icon_svg` through the exported `sanitizeOptionIconSvg` before inserting it — it reduces the markup to plain vector drawing and returns `null` for anything else — and use `optionLabel(option)` for the text — it is the option's `text` alone; `icon` is the icon's name and is never shown as text, even when `icon_svg` is missing or fails to draw. A picked option's `icon` / `icon_svg` are copied onto its completed parameter, and the chip in the input draws the glyph before its text. Both surfaces can be switched off: `showOptionIcons: false` renders option rows as text only and `showChipIcons: false` renders chips as text only; either way the icon element is omitted rather than hidden.
349
+ > **Option icons.** An option may carry an icon: `icon_svg` is inline SVG markup and `icon` its name. The built-in dropdown draws the SVG before the option's text, in the text color. When rendering options yourself, pass `icon_svg` through the exported `sanitizeOptionIconSvg` before inserting it — it reduces the markup to plain vector drawing and returns `null` for anything else — and use `optionLabel(option)` for the text — it is the option's `text` alone; `icon` is the icon's name and is never shown as text, even when `icon_svg` is missing or fails to draw. A picked option's `icon` / `icon_svg` are copied onto its completed parameter, and the chip in the input draws the glyph before its text. Both surfaces can be switched off: `showOptionIcons: false` renders option rows as text only and `showChipIcons: false` renders chips as text only; either way the icon element is omitted rather than hidden.
350
350
 
351
- > **Option pictures and counts.** An option may also carry `image_url` — a picture of the best-matching catalog item offering it — and `item_count`, how many items offer it (each is present only when the server includes it; when it includes counts, the options also arrive ordered by them, most items first; a starting state carries pictures but no counts). The built-in dropdown draws the picture as a square thumbnail before the option's text (in place of its `icon_svg`, so a row never leads with two visuals) and the count as a muted label at the row's trailing edge (`"12 items"`); a skeleton row keeps the tile's placeholder fill and hides the count. Icons and pictures are all-or-nothing per list: if any tappable option would draw neither, no row draws one, so a list never mixes rows with and without a leading visual (non-tappable rows don't count). A custom dropdown can apply the same rule with the exported `optionsShowLeadingVisuals(options, showIcons, showImages)`. The unit word after the number is a token: set `--aia-option-count-unit: "sneakers"` to name what is being counted, `--aia-option-count-unit-one: "sneaker"` for a count of 1 (it falls back to the plural token), or `--aia-option-count-unit: ""` for the number alone. When rendering options yourself, pass `image_url` through the exported `optionImageSrc` before using it as an `<img src>` — it returns the URL only when it is `http(s)` and `null` otherwise — and `formatOptionCount(option.item_count)` gives the number the built-in rows print (`null` when there is no count); `optionCountLabel(count, unit?)` appends a unit for a dropdown that prints the word itself (`"item"` / `"items"` by default; one word, a `{ one, other }` pair, or `""` for none). Both surfaces can be switched off: `showOptionImages: false` renders rows without pictures (an option's icon then draws instead) and `showOptionCounts: false` hides the counts. A picked option's `image_url` is copied onto its completed parameter too, and the chip in the input draws it as a small rounded tile before its text, in place of the icon; `showChipImages: false` renders chips without pictures (the icon then draws instead). The tile is sized by `--aia-option-image-size` (28px), rounded by `--aia-option-image-radius` (8.4px), spaced by `--aia-option-image-gap` (8.4px) and filled by `--aia-option-image-bg` (default: `--aia-skeleton-bg`) as a placeholder until its picture loads (and on skeleton rows, or if the picture fails); a loaded picture is scaled to fit rather than cropped and sits on the dropdown's background, and one narrower than the tile is rounded on its own corners by `--aia-option-picture-radius` (4.2px); in a grid with pictures, an icon row draws its glyph at `--aia-option-tile-icon-size` (1.5em) so it holds the picture column; the count reads `--aia-option-count-font-size` (8.4px), `--aia-option-count-color` and `--aia-option-count-opacity` (0.6); the chip's tile reads `--aia-chip-image-size` (1.25em of the chip's font), `--aia-chip-image-radius` (4px) and `--aia-chip-image-bg` (default: `--aia-skeleton-bg`), the placeholder fill shown until the picture loads; a loaded picture narrower than the tile narrows it to the picture's own width, so the radius rounds the picture.
351
+ > **Option pictures and counts.** An option may also carry `image_url` — a picture of the best-matching catalog item offering it — and `item_count`, how many items offer it (each is present only when the server includes it; when it includes counts, the options also arrive ordered by them, most items first; a starting state carries pictures but no counts). The built-in dropdown draws the picture as a square thumbnail before the option's text (in place of its `icon_svg`, so a row never leads with two visuals) and the count as a muted label at the row's trailing edge (`"12 items"`). Icons and pictures are all-or-nothing per list: if any tappable option would draw neither, no row draws one, so a list never mixes rows with and without a leading visual (non-tappable rows don't count). A custom dropdown can apply the same rule with the exported `optionsShowLeadingVisuals(options, showIcons, showImages)`. The unit word after the number is a token: set `--aia-option-count-unit: "sneakers"` to name what is being counted, `--aia-option-count-unit-one: "sneaker"` for a count of 1 (it falls back to the plural token), or `--aia-option-count-unit: ""` for the number alone. When rendering options yourself, pass `image_url` through the exported `optionImageSrc` before using it as an `<img src>` — it returns the URL only when it is `http(s)` and `null` otherwise — and `formatOptionCount(option.item_count)` gives the number the built-in rows print (`null` when there is no count); `optionCountLabel(count, unit?)` appends a unit for a dropdown that prints the word itself (`"item"` / `"items"` by default; one word, a `{ one, other }` pair, or `""` for none). Both surfaces can be switched off: `showOptionImages: false` renders rows without pictures (an option's icon then draws instead) and `showOptionCounts: false` hides the counts. A picked option's `image_url` is copied onto its completed parameter too, and the chip in the input draws it as a small rounded tile before its text, in place of the icon; `showChipImages: false` renders chips without pictures (the icon then draws instead). The tile is sized by `--aia-option-image-size` (28px), rounded by `--aia-option-image-radius` (8.4px), spaced by `--aia-option-image-gap` (8.4px) and filled by `--aia-option-image-bg` (default: `--aia-skeleton-bg`) as a placeholder until its picture loads (or if the picture fails); a loaded picture is scaled to fit rather than cropped and sits on the dropdown's background, and one narrower than the tile is rounded on its own corners by `--aia-option-picture-radius` (4.2px); in a grid with pictures, an icon row draws its glyph at `--aia-option-tile-icon-size` (1.5em) so it holds the picture column; the count reads `--aia-option-count-font-size` (8.4px), `--aia-option-count-color` and `--aia-option-count-opacity` (0.6); the chip's tile reads `--aia-chip-image-size` (1.25em of the chip's font), `--aia-chip-image-radius` (4px) and `--aia-chip-image-bg` (default: `--aia-skeleton-bg`), the placeholder fill shown until the picture loads; a loaded picture narrower than the tile narrows it to the picture's own width, so the radius rounds the picture.
352
352
 
353
- > **Parameter names under options.** An option that completes the word being typed (the server's `traditional_autocomplete` suggestion) can read the same as an option of another parameter, so the built-in dropdown draws the name of the parameter it answers under its text, muted and smaller (`Flavor`, `Subcategory`); the SDK sets it as `parameterLabel` from the option's `parameter`, and a skeleton row hides it. It reads `--aia-option-parameter-font-size` (8.4px), `--aia-option-parameter-color` and `--aia-option-parameter-opacity` (0.6).
353
+ > **Parameter names under options.** An option that completes the word being typed (the server's `traditional_autocomplete` suggestion) can read the same as an option of another parameter, so the built-in dropdown draws the name of the parameter it answers under its text, muted and smaller (`Flavor`, `Subcategory`); the SDK sets it as `parameterLabel` from the option's `parameter`. It reads `--aia-option-parameter-font-size` (8.4px), `--aia-option-parameter-color` and `--aia-option-parameter-opacity` (0.6).
354
354
 
355
355
  ### State shape (`CoreState`)
356
356
 
@@ -370,11 +370,11 @@ unsub();
370
370
  | `activeDropdownIndex` | `number` | Highlighted option index (-1 = none) |
371
371
  | `isDropdownOpen` | `boolean` | Whether the dropdown should be visible |
372
372
  | `newParamId` | `string \| null` | ID of the most recently added param (for shimmer animation) |
373
- | `isLoading` | `boolean` | Fetch in progress. The Tier 1 / Tier 2 renderers gate the loading skeleton additionally on `!inSelectionAnimation` and `!editingParam`. |
373
+ | `isLoading` | `boolean` | Fetch in progress. The Tier 1 / Tier 2 renderers gate the loading state additionally on `!inSelectionAnimation` and `!editingParam`. |
374
374
  | `optionQuery` | `string` | The phrase the active parameter's options are filtered by — what the user has typed for it, trimmed — or the replacement typed so far during a re-edit. This is what an [option override](#option-overrides) is asked with. |
375
- | `isSearchingOptions` | `boolean` | True while an [option override](#option-overrides) for the parameter on screen has been asked and hasn't answered. Render the same skeleton you render for `isLoading`; the built-in dropdowns do. |
376
- | `inSelectionAnimation` | `boolean` | True for the 500 ms after a user-initiated option tap so the press animation can finish before the dropdown switches to the loading skeleton. |
377
- | `editingParam` | `CompletedParamState \| null` | When non-null, the user is re-editing a bold completed param; cached options remain visible and the loading skeleton is suppressed. |
375
+ | `isSearchingOptions` | `boolean` | True while an [option override](#option-overrides) for the parameter on screen has been asked and hasn't answered. Render the same loading state you render for `isLoading`; the built-in dropdowns do. |
376
+ | `inSelectionAnimation` | `boolean` | True for the 170 ms after a user-initiated option tap so the press animation can finish before the dropdown switches to the loading state. |
377
+ | `editingParam` | `CompletedParamState \| null` | When non-null, the user is re-editing a bold completed param; cached options remain visible and the loading state is suppressed. |
378
378
  | `products` | `Product[]` | What the product strip shows: the items the latest response reported as matching the query, or the results of a custom `products` search. See [Product strip](#product-strip) — Tier 3 consumers render their own cards and call `selectProduct(product)` to emit `onProductSelect`. |
379
379
  | `customFields` | `CustomFieldsReport \| null` | The catalog report the latest response carried — applied and dropped filters, and the matching items' count and list — or `null` when it carried none. See [The catalog report](#the-catalog-report-customfields). |
380
380
  | `isReady` | `boolean` | Server indicates query is complete |
@@ -629,7 +629,8 @@ For styling beyond the CSS variables, target these stable `data-aia-*` attribute
629
629
  | `[data-aia-pill]` | Each unfilled-suggestion pill |
630
630
  | `[data-aia-pillbar]` | Pill bar container inside the dropdown |
631
631
  | `[data-aia-pill-scroll]` | Scrollable pill region inside the bar — carries the horizontal scroll and right-edge fade mask |
632
- | `[data-aia-skip]` | The pill bar's "skip" button: after the label behind a thin rule, or alone at the end of a skip-only row. Tune via `--aia-skip-font-size` / `--aia-skip-color` / `--aia-skip-color-hover` / `--aia-skip-hover-bg` |
632
+ | `[data-aia-skip]` | The pill bar's "skip" button: at the header's trailing edge, or alone at the end of a skip-only row. Tune via `--aia-skip-font-size` / `--aia-skip-color` / `--aia-skip-color-hover` / `--aia-skip-hover-bg` |
633
+ | `[data-aia-hint-el]` | The empty box's hint: the lead-in and the first starting options, one at a time. Tune via `--aia-hint-color` / `--aia-hint-font-weight` / `--aia-hint-icon-opacity` |
633
634
  | `[data-aia-option]` | Each suggestion option |
634
635
  | `[data-aia-scroll-arrow]` | The "more below" arrow on the dropdown — carries `data-aia-visible` while shown |
635
636
  | `[data-aia-dropdown]` | The dropdown root (listbox). Carries `data-aia-has-products` while the product strip has cards, and `data-aia-fit` while it is fitted to a short screen (see [Short screens](#short-screens)). |
@@ -716,7 +717,7 @@ new AIAutocomplete(el, {
716
717
  { text: "Checking", is_tappable: true, kind: null },
717
718
  ],
718
719
  // A list that lives behind a request — return a promise. The dropdown
719
- // shows its loading skeleton until it settles.
720
+ // shows its loading state until it settles.
720
721
  location: async (query, signal) => {
721
722
  const res = await fetch(`/api/locations?q=${encodeURIComponent(query)}`, { signal });
722
723
  const places = await res.json();
package/REFERENCE.md CHANGED
@@ -460,6 +460,10 @@ locations is the server's call: it marks them `type: { kind: "location" }`.
460
460
  - **Without options**, the dropdown shows a search field instead. Typing in it
461
461
  searches places through the MagicX server, which proxies a location provider,
462
462
  and lists what it finds; any city, address or landmark can be picked.
463
+ What the user types in the main input is searched there too, cut to its
464
+ place-name end ("going to paris" searches "paris"; "to san fran" searches
465
+ "san fran"). Typing in the field itself takes over until it loses focus, and
466
+ an input that holds no place name never clears the field.
463
467
 
464
468
  Nothing is required to switch it on. The field searches
465
469
  `…/locations/autocomplete`, next to your `/suggest` endpoint
@@ -556,14 +560,15 @@ The full input also accepts `--aia-input-radius` and `--aia-written-text-font-we
556
560
  | `--aia-footer-gap` | `12px` | `12px` | Breathing room above the dropdown footer (badge / keyboard hints), additive to the dropdown's 8px section gap. |
557
561
  | `--aia-footer-chip-bg` | `--aia-surface` at 65% | `--aia-surface` at 65% | Fill behind the footer's keyboard hint and AI-Autocomplete badge. The option list scrolls under the footer, so this keeps both legible over the row passing behind them. `transparent` on the glass surface. |
558
562
  | `--aia-dropdown-bg` | — | — | Optional bg color the dropdown's "glass" rim shadow tints toward. Set this to the page background behind the dropdown so the bottom-corner glow blends seamlessly. |
559
- | `--aia-scrollbar-thumb` | `rgba(0, 0, 0, 0.3)` | `rgba(0, 0, 0, 0.3)` | No longer used: the option list hides its scrollbar in every browser. Kept so existing overrides don't break. |
563
+ | `--aia-scrollbar-track` | `rgba(15, 23, 42, 0.05)` | `rgba(255, 255, 255, 0.08)` | The floating options box's thin scrollbar track, shown while a long list overflows. |
564
+ | `--aia-scrollbar-thumb` | `rgba(15, 23, 42, 0.22)` | `rgba(255, 255, 255, 0.28)` | That scrollbar's thumb. |
560
565
  | `--aia-streak-rgb` | `99, 102, 241` | `255, 255, 255` | Comma-separated RGB triplet tinting the datepicker's pressed cell, and its selected cell when `--aia-date-selected-bg` is unset. The today ring uses `--aia-date-today-ring`, not this. |
561
566
  | `--aia-product-card-width` | `81.2px` | `81.2px` | Width of a product card in the strip. The media tile is square, so this also sets its height. |
562
567
  | `--aia-product-gap` | `5.6px` | `5.6px` | Gap between product cards. |
563
568
  | `--aia-product-bg` | `transparent` | `transparent` | Product card background. |
564
569
  | `--aia-product-bg-active` | `--aia-option-bg` | `--aia-option-bg` | Product card background on hover. |
565
570
  | `--aia-product-media-bg` | `--aia-skeleton-bg` | `--aia-skeleton-bg` | Placeholder fill of the product tile: shown until the photo loads, and behind both fallback tiles (placeholder pictogram or title initial) used when an image URL is missing, blank or fails to load. Once a photo loads the tile is transparent. |
566
- | `--aia-scroll-arrow-color` | `--aia-option-color` | `--aia-option-color` | Chevron color of the arrow (`--aia-scroll-arrow-color-hover` on hover). |
571
+ | `--aia-scroll-arrow-color` | `--aia-option-color` | `--aia-option-color` | Chevron color of the arrow (`--aia-scroll-arrow-color-hover` on hover). `optionsStyle: "classic"` only: the floating box draws a thin scrollbar instead (`--aia-scrollbar-*`). |
567
572
  | `--aia-placeholder-fade` | `120ms` | `120ms` | Fade-out of the outgoing placeholder phrase when the starting-state placeholder changes (the incoming one types itself in). |
568
573
  | `--aia-product-image-radius` | `5.6px` | `5.6px` | Corner radius of a product photo narrower than its square tile (a tall one), which is scaled to fit rather than cropped. A photo that fills the tile takes the tile's own 5.6px corners. |
569
574
  | `--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. |
@@ -596,7 +601,8 @@ The full input also accepts `--aia-input-radius` and `--aia-written-text-font-we
596
601
  | `--aia-confirm-color` | `#ffffff` | `#000000` | The checkbox's checkmark (and, in dark mode, the Done buttons' text). |
597
602
  | `--aia-done-bg` / `--aia-done-bg-hover` / `--aia-done-color` | `#e4e8f0` / `#d8dde8` / `#2a3150` | `--aia-confirm-*` | The Done buttons (multi-select and time wheel). |
598
603
  | `--aia-multi-done-bg` / `--aia-multi-done-bg-hover` / `--aia-multi-done-color` | `--aia-done-*` | `--aia-done-*` | Override the multi-select Done button alone. |
599
- | `--aia-multi-done-width` | as wide as the widest option | same | Width of the multi-select Done button; set `100%` for full width. |
604
+ | `--aia-multi-done-width` | `100%` (classic: as wide as the widest option) | same | Width of the multi-select Done button. |
605
+ | `--aia-panel-min-width` | `160px` | same | Narrowest the floating options box gets when it hugs its options (desktop). |
600
606
  | `--aia-multi-done-min-width` | `120px` | `120px` | Narrowest the multi-select Done button gets. |
601
607
  | `--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
608
  | `--aia-see-all-bg` / `--aia-see-all-bg-hover` / `--aia-see-all-color` | `#111111` / `#333333` / `#ffffff` | `--aia-confirm-*` | The "See all results" button (`seeAllResults`). |
@@ -606,4 +612,4 @@ The full input also accepts `--aia-input-radius` and `--aia-written-text-font-we
606
612
  | `--aia-location-field-radius` | `10px` | `10px` | Corner radius of the location search field. |
607
613
  | `--aia-location-font-size` | `15px` | `15px` | The location field's text and the place names. |
608
614
  | `--aia-location-row-bg-highlighted` | `--aia-streak-rgb` at 8% (indigo) | `--aia-streak-rgb` at 8% (white) | The highlighted (or hovered) place. |
609
- | `--aia-skeleton-bg` | `rgba(189, 189, 189, 0.083)` | `#1a1b1d` | Fill color for the loading skeleton bars and the masked text in cached pills/options, and of the option and chip image tiles while their picture loads (unless `--aia-option-image-bg` / `--aia-chip-image-bg` are set). |
615
+ | `--aia-skeleton-bg` | `rgba(189, 189, 189, 0.083)` | `#1a1b1d` | Fill color of the option and chip image tiles while their picture loads (unless `--aia-option-image-bg` / `--aia-chip-image-bg` are set). |
package/dist/index.d.mts CHANGED
@@ -1236,11 +1236,12 @@ interface CoreDerivedState {
1236
1236
  */
1237
1237
  dropdownLoading: boolean;
1238
1238
  /**
1239
- * True for the short fade-out after the answer's request settles, while the
1240
- * skeleton is still drawn from `skeletonOptions` and the dropdown carries
1241
- * `data-aia-skeleton-exiting`. Derived, so it switches on in the same state
1242
- * update that ends the loading — a renderer never sees a frame between the
1243
- * two.
1239
+ * True after the answer's request settles, until the loading fade-out has
1240
+ * run, while the faded rows are still drawn from `skeletonOptions` and the
1241
+ * dropdown carries `data-aia-skeleton-exiting`. Derived, so it switches on
1242
+ * in the same state update that ends the loading — a renderer never sees a
1243
+ * frame between the two. The SDK's own stylesheets no longer read the
1244
+ * attribute; it stays as a styling hook.
1244
1245
  */
1245
1246
  skeletonExiting: boolean;
1246
1247
  /**
@@ -1373,12 +1374,12 @@ interface CoreOptions {
1373
1374
  /**
1374
1375
  * When true (default), the dropdown's pill bar ends in a small "skip" button
1375
1376
  * that dismisses the active pill — same action as pressing → at the end of
1376
- * the input. It sits right after the parameter label, behind a thin rule
1377
- * ("Gender | skip"). Set to false to hide it. When pills render elsewhere
1377
+ * the input. It sits at the header row's trailing edge, across from the
1378
+ * parameter label. Set to false to hide it. When pills render elsewhere
1378
1379
  * (`pillPlacement: "inline"` / `"hidden"`) the bar renders as a skip-only
1379
- * row holding just the button, alone at the bar's trailing edge with no
1380
- * rule; it hides during re-edit, on the loading skeleton, and while the
1381
- * input is empty either way.
1380
+ * row holding just the button, alone at the bar's trailing edge; it hides
1381
+ * during re-edit, on the loading skeleton, and while the input is empty
1382
+ * either way.
1382
1383
  */
1383
1384
  showSkipButton?: boolean;
1384
1385
  /** Render mode. Default: "full". */
@@ -1602,6 +1603,8 @@ declare class AIAutocomplete {
1602
1603
  private pendingSearchStarted;
1603
1604
  /** The text at the last user keystroke, while its last word is still open. */
1604
1605
  private openWordText;
1606
+ /** The input text the location field last mirrored while on screen. */
1607
+ private locationMirrorText;
1605
1608
  /** Identified params held back until the word they end ends. */
1606
1609
  private heldIdentified;
1607
1610
  /** Values waiting for confirmation. Only a submit of the same text admits them. */
@@ -1931,18 +1934,42 @@ declare class AIAutocomplete {
1931
1934
  private subscribeViewportBreakpoint;
1932
1935
  /** Batched render subscriber — coalesces multiple store.set calls into one DOM update. */
1933
1936
  private subscribeBatchedRender;
1937
+ /**
1938
+ * Mirrors the input into the location field whenever the field is on screen
1939
+ * with text it has not mirrored yet: each keystroke, and the question
1940
+ * arriving after the text was typed. Keyed off state rather than the
1941
+ * keystroke: the caret lands after the text, so a keystroke can read the
1942
+ * panel closed for one update before it opens again. Reopening the panel on
1943
+ * unchanged text mirrors nothing, so a search typed in the field survives.
1944
+ */
1945
+ private subscribeLocationMirror;
1934
1946
  /** Auto-clear newParamId after shimmer animation. */
1935
1947
  /**
1936
1948
  * Tracks the answer's request for the skeleton mirror. When the request
1937
1949
  * starts, `skeletonRequested` records it (the skeleton is already showing,
1938
1950
  * so the extra write changes nothing on screen). When it settles, the
1939
1951
  * derived `skeletonExiting` is already true in that same state — this only
1940
- * schedules the release after SKELETON_FADE_MS, or releases at once when the
1941
- * response beat the press window and no skeleton was ever drawn.
1952
+ * schedules the release once the fade that began when loading showed has
1953
+ * run its SKELETON_FADE_MS, or releases at once when the response beat the
1954
+ * press window and no skeleton was ever drawn.
1942
1955
  */
1943
1956
  private subscribeSkeletonMirror;
1944
1957
  private subscribeNewParamTimer;
1945
1958
  private handleChange;
1959
+ /**
1960
+ * While a location question is open, what the user types in the input is
1961
+ * searched in the location field: only the place-name end of it ("going to
1962
+ * paris" → "paris"). Typing in the field itself takes over until it loses focus.
1963
+ *
1964
+ * Runs from `subscribeLocationMirror` (each text change while the field is
1965
+ * on screen, and once when it comes on screen), so a place typed
1966
+ * before the server asked for it ("going to paris", then the destination
1967
+ * question) is searched right away.
1968
+ *
1969
+ * The phrase is `livePhraseOf` (the text after the last chip), not
1970
+ * `optionQuery`, which reads "" mid-word once a /suggest response lands.
1971
+ */
1972
+ private mirrorTypedIntoLocationSearch;
1946
1973
  /** True while commitOnWordEnd is on and the user still types the last word. */
1947
1974
  private isWordOpen;
1948
1975
  private admitIdentified;
@@ -2664,6 +2691,15 @@ declare function optionLabel(option: {
2664
2691
  icon_svg?: string;
2665
2692
  }): string;
2666
2693
 
2694
+ /** Drops the hug so the grid measures and lays out at the panel's full width. */
2695
+ declare function releasePanelHug(dropdown: HTMLElement): void;
2696
+ /**
2697
+ * The React and Angular entry: reads from the rendered panel what vanilla's
2698
+ * renderDropdown passes from its state. Call it after every render; their
2699
+ * grids call `releasePanelHug` before they measure.
2700
+ */
2701
+ declare function syncPanelHug(dropdown: HTMLElement): void;
2702
+
2667
2703
  /**
2668
2704
  * Open-panel motion, copied from the playground's Real-time One tab
2669
2705
  * (`src/genui/morph.ts` + `AutoHeight`, 2026-11):
@@ -2756,6 +2792,45 @@ declare const PLACEHOLDER_SWAP_GAP_MS = 50;
2756
2792
  /** Set on the input while the outgoing phrase fades; the stylesheets fade `::before` on it. */
2757
2793
  declare const PLACEHOLDER_LEAVING_ATTR = "data-aia-placeholder-leaving";
2758
2794
 
2795
+ /**
2796
+ * The empty box's hint (Brad 2026-11-18): the placeholder's lead-in ("Find")
2797
+ * followed by the first three starting options, one at a time ("Find a table"
2798
+ * → "Find a date spot" → "Find trending restaurants"). The option's noun
2799
+ * carries its icon. The change is a word swap: words both lines share stay
2800
+ * where they are (sliding if they must move); only the words that change
2801
+ * dissolve, blur(2px) + fade, 280 ms out and 320 ms in.
2802
+ *
2803
+ * The hint is a non-editable sibling laid over the input, never a child of
2804
+ * the contentEditable, so the editable's DOM and the core's notion of the
2805
+ * placeholder (Tab-to-accept, prefix-typing suppression) are unchanged. While
2806
+ * it shows, `data-aia-hint` on the input hides the `::before` placeholder.
2807
+ */
2808
+ interface StartingHintOption {
2809
+ text: string;
2810
+ icon_svg?: string;
2811
+ }
2812
+ /** How long each option holds before the next swaps in. */
2813
+ declare const HINT_HOLD_MS = 2600;
2814
+ declare const HINT_ATTR = "data-aia-hint";
2815
+ /** Marks the hint element itself, so stylesheets (React's CSS modules
2816
+ * included) can reach it without a class name. */
2817
+ declare const HINT_EL_ATTR = "data-aia-hint-el";
2818
+ /** Test / teardown hook: remove the hint and its timer for this input. */
2819
+ declare function cancelStartingHint(input: HTMLElement): void;
2820
+ /**
2821
+ * The hint's options from the actionable suggestions: the first question's
2822
+ * tappable options (a traditional-autocomplete answer is not a question).
2823
+ */
2824
+ declare function startingHintOptions(suggestions: readonly {
2825
+ parameter: string;
2826
+ type?: {
2827
+ kind?: string;
2828
+ };
2829
+ options?: readonly (StartingHintOption & {
2830
+ is_tappable?: boolean;
2831
+ })[];
2832
+ }[]): StartingHintOption[];
2833
+
2759
2834
  interface RenderEditableArgs {
2760
2835
  input: HTMLElement;
2761
2836
  segments: Segment[];
@@ -2774,6 +2849,12 @@ interface RenderEditableArgs {
2774
2849
  showChipIcons?: boolean;
2775
2850
  /** Whether completed chips draw the picture of the option that answered them, in place of the icon. Default: true. */
2776
2851
  showChipImages?: boolean;
2852
+ /**
2853
+ * The starting question's options. While the box is empty and there are at
2854
+ * least two, the placeholder's lead word cycles through the first three of
2855
+ * them (see startingHint.ts). Omitted or empty: the plain placeholder.
2856
+ */
2857
+ hintOptions?: readonly StartingHintOption[];
2777
2858
  }
2778
2859
  /**
2779
2860
  * Renders text segments into the contentEditable input. Completed params are
@@ -3272,4 +3353,4 @@ declare const SMART_SUGGESTION_SPARKLE_SVG: string;
3272
3353
  /** True when some pill is a question the shopper can decline. */
3273
3354
  declare function hasSkippablePill(suggestions: Suggestion[]): boolean;
3274
3355
 
3275
- export { AIAutocomplete, type APIConfig, type APIKeyConfig, ATTRIBUTION_URL, type AccessTokenConfig, type AccessTokenResult, type AppearanceMode, type AutocompleteRequest, type AutocompleteResponse, type AutocompleteResult, type CompletedParam, type CompletedParamState, type CoreOptions, type CoreState, type CurrencyOptions, type CustomFieldsReport, DATE_RANGE_META_END, DATE_RANGE_META_START, DEFAULT_OPTION_COUNT_UNIT, type DateMonthView, type DateRange, type DateSelection, EDITOR_GROW_MS, type ExpressedFilter, type FilterOp, type FormatType, type IdentifiedParam, type IdentifiedParamState, type InputItem, LOCATION_META_KEY, LOCATION_MIN_QUERY, type LocationPlace, type LocationStatus, type LocationView, type LooseDateOptions, MULTI_DONE_FIT_VAR, MULTI_SELECT_TOGGLE_MIN_PX, MULTI_SELECT_TOGGLE_SLOP_PX, type MatchedItem, type MatchedItems, ModeController, OPTIONS_GRID_MOBILE_QUERY, OPTION_ENTER_DELAY_VAR, OPTION_ENTER_FADE_MS, OPTION_ENTER_RISE_MS, OPTION_ENTER_RISE_PX, OPTION_ENTER_STAGGER_MS, OPTION_IMAGE_WIDTH, type OptionOverride, type OptionOverrides, type OptionsGridLayout, type OptionsGridPlan, PANEL_ENTER_DELAY_MS, PANEL_ENTER_MS, PANEL_GHOST_CLASS, PANEL_GLIDE_MS, PANEL_LEAVE_MS, PLACEHOLDER_FADE_OUT_MS, PLACEHOLDER_LEAVING_ATTR, PLACEHOLDER_SWAP_GAP_MS, PLACEHOLDER_TYPE_MS, PLACEHOLDER_WORD_PAUSE_MS, PRODUCT_IMAGE_WIDTH, PRODUCT_PATH_PREFIX, PRODUCT_ROW_PX_PER_LINE, type PhraseMatch, type Product, type ProductImageFallback, type ProductRowMetrics, type ProductRowWheel, type ProductsConfig, type ProductsLayout, RANGE_SEPARATOR, type RecentlySuggested, type RenderMode, SCHEMA_VERSION, SCROLL_ARROW_ATTR, SCROLL_ARROW_BOTTOM_VAR, SCROLL_ARROW_CLASS, SCROLL_ARROW_FADE_MS, SCROLL_ARROW_LABEL, SCROLL_ARROW_SCROLL_IDLE_MS, SCROLL_ARROW_VISIBLE_ATTR, SKIPPED_PARAM_TEXT, SMART_SUGGESTION_SPARKLE_SVG, type ScrollArrowArgs, type ScrollArrowController, type Segment, type SelectOptionOptions, type SkippedParamState, type Store, type SubmitResultExtras, type Suggestion, type SuggestionOption, type SuggestionType, TIME_META_KEY, TIME_STEP_MINUTES, TIME_WHEEL_COLUMNS, TIME_WHEEL_ROW_HEIGHT, type TaskKind, type TextPart, type TimeParts, type TimePeriod, type TimeView, type TimeWheelColumn, type TimeWheelRow, type UIStrings, VIEWPORT_FIT_ATTR, VIEWPORT_FIT_HEIGHT_VAR, type ViewportFitArgs, type ViewportFitController, WEEKDAY_LABELS, addMonths, attachProductRowWheel, attachScrollArrow, attachViewportFit, buildAttributionUrl, buildDateOptions, buildLocationOption, buildQuery, buildSubmitResult, buildTimeOption, cellDay, cellIso, chipIdFromTap, computeOptionsGridLayout, containScroll, createStore, cursorIsAtEnd, dateCellMarks, dateFloorFor, dateSelectionFor, destroyPanelMorph, extractPlainText, findMultiSelectDone, fitMultiSelectDone, formatAbsoluteDate, formatDate, formatDateRange, formatOptionCount, formatPlace, formatTime, getCursorOffset, getFooterHint, hasSkippablePill, highlightParts, identifiedParamLabel, inPanelGhost, isCalendarFormat, isDimmedDay, isMultiSelectToggleTap, isOptionsGridMobileViewport, isPickerFormat, isSmartSuggestion, isTraditionalAutocompleteSuggestion, isoDate, isoTime, keepCaretOnChip, labelTraditionalAutocomplete, locationEndpointFor, matchTypedPhrase, measureOptionsGrid, monthLabel, needsOptionsGridMeasurement, notePanelMorphHeight, optionCountLabel, optionEnterDelayMs, optionHasImage, optionImageSources, optionImageSrc, optionLabel, optionsEntranceDurationMs, optionsGridTemplateColumns, optionsShowLeadingVisuals, panelMorphGlide, panelMorphKey, panelMorphTargetHeight, parseDate, parseLooseDate, parseLooseDateRange, parseTime, plainTextLength, planOptionsGrid, previousGraphemeBoundary, productFromMatchedItem, productImageSources, productImageSrc, productInitial, productPhotoFill, productRowWheelTarget, productsFromCustomFields, queryLive, renderEditableContent, resolveFormatType, resolveIdentifiedDate, sameOptionRows, sanitizeOptionIconSvg, scrollCaretIntoView, selectedIsoFromText, selectedRangeFor, setCursorOffset, settlePanelMorph, shopifyImageSrc, timeWheelIndex, timeWheelIndexFromScroll, timeWheelRows, toWireIdentifiedParams, typedFragment, uiStringsFor, visibleDateRange, watchEditorHeight, withSkippedParams, withTimeWheelIndex, withoutTraditionalAutocomplete };
3356
+ export { AIAutocomplete, type APIConfig, type APIKeyConfig, ATTRIBUTION_URL, type AccessTokenConfig, type AccessTokenResult, type AppearanceMode, type AutocompleteRequest, type AutocompleteResponse, type AutocompleteResult, type CompletedParam, type CompletedParamState, type CoreOptions, type CoreState, type CurrencyOptions, type CustomFieldsReport, DATE_RANGE_META_END, DATE_RANGE_META_START, DEFAULT_OPTION_COUNT_UNIT, type DateMonthView, type DateRange, type DateSelection, EDITOR_GROW_MS, type ExpressedFilter, type FilterOp, type FormatType, HINT_ATTR, HINT_EL_ATTR, HINT_HOLD_MS, type IdentifiedParam, type IdentifiedParamState, type InputItem, LOCATION_META_KEY, LOCATION_MIN_QUERY, type LocationPlace, type LocationStatus, type LocationView, type LooseDateOptions, MULTI_DONE_FIT_VAR, MULTI_SELECT_TOGGLE_MIN_PX, MULTI_SELECT_TOGGLE_SLOP_PX, type MatchedItem, type MatchedItems, ModeController, OPTIONS_GRID_MOBILE_QUERY, OPTION_ENTER_DELAY_VAR, OPTION_ENTER_FADE_MS, OPTION_ENTER_RISE_MS, OPTION_ENTER_RISE_PX, OPTION_ENTER_STAGGER_MS, OPTION_IMAGE_WIDTH, type OptionOverride, type OptionOverrides, type OptionsGridLayout, type OptionsGridPlan, PANEL_ENTER_DELAY_MS, PANEL_ENTER_MS, PANEL_GHOST_CLASS, PANEL_GLIDE_MS, PANEL_LEAVE_MS, PLACEHOLDER_FADE_OUT_MS, PLACEHOLDER_LEAVING_ATTR, PLACEHOLDER_SWAP_GAP_MS, PLACEHOLDER_TYPE_MS, PLACEHOLDER_WORD_PAUSE_MS, PRODUCT_IMAGE_WIDTH, PRODUCT_PATH_PREFIX, PRODUCT_ROW_PX_PER_LINE, type PhraseMatch, type Product, type ProductImageFallback, type ProductRowMetrics, type ProductRowWheel, type ProductsConfig, type ProductsLayout, RANGE_SEPARATOR, type RecentlySuggested, type RenderMode, SCHEMA_VERSION, SCROLL_ARROW_ATTR, SCROLL_ARROW_BOTTOM_VAR, SCROLL_ARROW_CLASS, SCROLL_ARROW_FADE_MS, SCROLL_ARROW_LABEL, SCROLL_ARROW_SCROLL_IDLE_MS, SCROLL_ARROW_VISIBLE_ATTR, SKIPPED_PARAM_TEXT, SMART_SUGGESTION_SPARKLE_SVG, type ScrollArrowArgs, type ScrollArrowController, type Segment, type SelectOptionOptions, type SkippedParamState, type StartingHintOption, type Store, type SubmitResultExtras, type Suggestion, type SuggestionOption, type SuggestionType, TIME_META_KEY, TIME_STEP_MINUTES, TIME_WHEEL_COLUMNS, TIME_WHEEL_ROW_HEIGHT, type TaskKind, type TextPart, type TimeParts, type TimePeriod, type TimeView, type TimeWheelColumn, type TimeWheelRow, type UIStrings, VIEWPORT_FIT_ATTR, VIEWPORT_FIT_HEIGHT_VAR, type ViewportFitArgs, type ViewportFitController, WEEKDAY_LABELS, addMonths, attachProductRowWheel, attachScrollArrow, attachViewportFit, buildAttributionUrl, buildDateOptions, buildLocationOption, buildQuery, buildSubmitResult, buildTimeOption, cancelStartingHint, cellDay, cellIso, chipIdFromTap, computeOptionsGridLayout, containScroll, createStore, cursorIsAtEnd, dateCellMarks, dateFloorFor, dateSelectionFor, destroyPanelMorph, extractPlainText, findMultiSelectDone, fitMultiSelectDone, formatAbsoluteDate, formatDate, formatDateRange, formatOptionCount, formatPlace, formatTime, getCursorOffset, getFooterHint, hasSkippablePill, highlightParts, identifiedParamLabel, inPanelGhost, isCalendarFormat, isDimmedDay, isMultiSelectToggleTap, isOptionsGridMobileViewport, isPickerFormat, isSmartSuggestion, isTraditionalAutocompleteSuggestion, isoDate, isoTime, keepCaretOnChip, labelTraditionalAutocomplete, locationEndpointFor, matchTypedPhrase, measureOptionsGrid, monthLabel, needsOptionsGridMeasurement, notePanelMorphHeight, optionCountLabel, optionEnterDelayMs, optionHasImage, optionImageSources, optionImageSrc, optionLabel, optionsEntranceDurationMs, optionsGridTemplateColumns, optionsShowLeadingVisuals, panelMorphGlide, panelMorphKey, panelMorphTargetHeight, parseDate, parseLooseDate, parseLooseDateRange, parseTime, plainTextLength, planOptionsGrid, previousGraphemeBoundary, productFromMatchedItem, productImageSources, productImageSrc, productInitial, productPhotoFill, productRowWheelTarget, productsFromCustomFields, queryLive, releasePanelHug, renderEditableContent, resolveFormatType, resolveIdentifiedDate, sameOptionRows, sanitizeOptionIconSvg, scrollCaretIntoView, selectedIsoFromText, selectedRangeFor, setCursorOffset, settlePanelMorph, shopifyImageSrc, startingHintOptions, syncPanelHug, timeWheelIndex, timeWheelIndexFromScroll, timeWheelRows, toWireIdentifiedParams, typedFragment, uiStringsFor, visibleDateRange, watchEditorHeight, withSkippedParams, withTimeWheelIndex, withoutTraditionalAutocomplete };
package/dist/index.d.ts CHANGED
@@ -1236,11 +1236,12 @@ interface CoreDerivedState {
1236
1236
  */
1237
1237
  dropdownLoading: boolean;
1238
1238
  /**
1239
- * True for the short fade-out after the answer's request settles, while the
1240
- * skeleton is still drawn from `skeletonOptions` and the dropdown carries
1241
- * `data-aia-skeleton-exiting`. Derived, so it switches on in the same state
1242
- * update that ends the loading — a renderer never sees a frame between the
1243
- * two.
1239
+ * True after the answer's request settles, until the loading fade-out has
1240
+ * run, while the faded rows are still drawn from `skeletonOptions` and the
1241
+ * dropdown carries `data-aia-skeleton-exiting`. Derived, so it switches on
1242
+ * in the same state update that ends the loading — a renderer never sees a
1243
+ * frame between the two. The SDK's own stylesheets no longer read the
1244
+ * attribute; it stays as a styling hook.
1244
1245
  */
1245
1246
  skeletonExiting: boolean;
1246
1247
  /**
@@ -1373,12 +1374,12 @@ interface CoreOptions {
1373
1374
  /**
1374
1375
  * When true (default), the dropdown's pill bar ends in a small "skip" button
1375
1376
  * that dismisses the active pill — same action as pressing → at the end of
1376
- * the input. It sits right after the parameter label, behind a thin rule
1377
- * ("Gender | skip"). Set to false to hide it. When pills render elsewhere
1377
+ * the input. It sits at the header row's trailing edge, across from the
1378
+ * parameter label. Set to false to hide it. When pills render elsewhere
1378
1379
  * (`pillPlacement: "inline"` / `"hidden"`) the bar renders as a skip-only
1379
- * row holding just the button, alone at the bar's trailing edge with no
1380
- * rule; it hides during re-edit, on the loading skeleton, and while the
1381
- * input is empty either way.
1380
+ * row holding just the button, alone at the bar's trailing edge; it hides
1381
+ * during re-edit, on the loading skeleton, and while the input is empty
1382
+ * either way.
1382
1383
  */
1383
1384
  showSkipButton?: boolean;
1384
1385
  /** Render mode. Default: "full". */
@@ -1602,6 +1603,8 @@ declare class AIAutocomplete {
1602
1603
  private pendingSearchStarted;
1603
1604
  /** The text at the last user keystroke, while its last word is still open. */
1604
1605
  private openWordText;
1606
+ /** The input text the location field last mirrored while on screen. */
1607
+ private locationMirrorText;
1605
1608
  /** Identified params held back until the word they end ends. */
1606
1609
  private heldIdentified;
1607
1610
  /** Values waiting for confirmation. Only a submit of the same text admits them. */
@@ -1931,18 +1934,42 @@ declare class AIAutocomplete {
1931
1934
  private subscribeViewportBreakpoint;
1932
1935
  /** Batched render subscriber — coalesces multiple store.set calls into one DOM update. */
1933
1936
  private subscribeBatchedRender;
1937
+ /**
1938
+ * Mirrors the input into the location field whenever the field is on screen
1939
+ * with text it has not mirrored yet: each keystroke, and the question
1940
+ * arriving after the text was typed. Keyed off state rather than the
1941
+ * keystroke: the caret lands after the text, so a keystroke can read the
1942
+ * panel closed for one update before it opens again. Reopening the panel on
1943
+ * unchanged text mirrors nothing, so a search typed in the field survives.
1944
+ */
1945
+ private subscribeLocationMirror;
1934
1946
  /** Auto-clear newParamId after shimmer animation. */
1935
1947
  /**
1936
1948
  * Tracks the answer's request for the skeleton mirror. When the request
1937
1949
  * starts, `skeletonRequested` records it (the skeleton is already showing,
1938
1950
  * so the extra write changes nothing on screen). When it settles, the
1939
1951
  * derived `skeletonExiting` is already true in that same state — this only
1940
- * schedules the release after SKELETON_FADE_MS, or releases at once when the
1941
- * response beat the press window and no skeleton was ever drawn.
1952
+ * schedules the release once the fade that began when loading showed has
1953
+ * run its SKELETON_FADE_MS, or releases at once when the response beat the
1954
+ * press window and no skeleton was ever drawn.
1942
1955
  */
1943
1956
  private subscribeSkeletonMirror;
1944
1957
  private subscribeNewParamTimer;
1945
1958
  private handleChange;
1959
+ /**
1960
+ * While a location question is open, what the user types in the input is
1961
+ * searched in the location field: only the place-name end of it ("going to
1962
+ * paris" → "paris"). Typing in the field itself takes over until it loses focus.
1963
+ *
1964
+ * Runs from `subscribeLocationMirror` (each text change while the field is
1965
+ * on screen, and once when it comes on screen), so a place typed
1966
+ * before the server asked for it ("going to paris", then the destination
1967
+ * question) is searched right away.
1968
+ *
1969
+ * The phrase is `livePhraseOf` (the text after the last chip), not
1970
+ * `optionQuery`, which reads "" mid-word once a /suggest response lands.
1971
+ */
1972
+ private mirrorTypedIntoLocationSearch;
1946
1973
  /** True while commitOnWordEnd is on and the user still types the last word. */
1947
1974
  private isWordOpen;
1948
1975
  private admitIdentified;
@@ -2664,6 +2691,15 @@ declare function optionLabel(option: {
2664
2691
  icon_svg?: string;
2665
2692
  }): string;
2666
2693
 
2694
+ /** Drops the hug so the grid measures and lays out at the panel's full width. */
2695
+ declare function releasePanelHug(dropdown: HTMLElement): void;
2696
+ /**
2697
+ * The React and Angular entry: reads from the rendered panel what vanilla's
2698
+ * renderDropdown passes from its state. Call it after every render; their
2699
+ * grids call `releasePanelHug` before they measure.
2700
+ */
2701
+ declare function syncPanelHug(dropdown: HTMLElement): void;
2702
+
2667
2703
  /**
2668
2704
  * Open-panel motion, copied from the playground's Real-time One tab
2669
2705
  * (`src/genui/morph.ts` + `AutoHeight`, 2026-11):
@@ -2756,6 +2792,45 @@ declare const PLACEHOLDER_SWAP_GAP_MS = 50;
2756
2792
  /** Set on the input while the outgoing phrase fades; the stylesheets fade `::before` on it. */
2757
2793
  declare const PLACEHOLDER_LEAVING_ATTR = "data-aia-placeholder-leaving";
2758
2794
 
2795
+ /**
2796
+ * The empty box's hint (Brad 2026-11-18): the placeholder's lead-in ("Find")
2797
+ * followed by the first three starting options, one at a time ("Find a table"
2798
+ * → "Find a date spot" → "Find trending restaurants"). The option's noun
2799
+ * carries its icon. The change is a word swap: words both lines share stay
2800
+ * where they are (sliding if they must move); only the words that change
2801
+ * dissolve, blur(2px) + fade, 280 ms out and 320 ms in.
2802
+ *
2803
+ * The hint is a non-editable sibling laid over the input, never a child of
2804
+ * the contentEditable, so the editable's DOM and the core's notion of the
2805
+ * placeholder (Tab-to-accept, prefix-typing suppression) are unchanged. While
2806
+ * it shows, `data-aia-hint` on the input hides the `::before` placeholder.
2807
+ */
2808
+ interface StartingHintOption {
2809
+ text: string;
2810
+ icon_svg?: string;
2811
+ }
2812
+ /** How long each option holds before the next swaps in. */
2813
+ declare const HINT_HOLD_MS = 2600;
2814
+ declare const HINT_ATTR = "data-aia-hint";
2815
+ /** Marks the hint element itself, so stylesheets (React's CSS modules
2816
+ * included) can reach it without a class name. */
2817
+ declare const HINT_EL_ATTR = "data-aia-hint-el";
2818
+ /** Test / teardown hook: remove the hint and its timer for this input. */
2819
+ declare function cancelStartingHint(input: HTMLElement): void;
2820
+ /**
2821
+ * The hint's options from the actionable suggestions: the first question's
2822
+ * tappable options (a traditional-autocomplete answer is not a question).
2823
+ */
2824
+ declare function startingHintOptions(suggestions: readonly {
2825
+ parameter: string;
2826
+ type?: {
2827
+ kind?: string;
2828
+ };
2829
+ options?: readonly (StartingHintOption & {
2830
+ is_tappable?: boolean;
2831
+ })[];
2832
+ }[]): StartingHintOption[];
2833
+
2759
2834
  interface RenderEditableArgs {
2760
2835
  input: HTMLElement;
2761
2836
  segments: Segment[];
@@ -2774,6 +2849,12 @@ interface RenderEditableArgs {
2774
2849
  showChipIcons?: boolean;
2775
2850
  /** Whether completed chips draw the picture of the option that answered them, in place of the icon. Default: true. */
2776
2851
  showChipImages?: boolean;
2852
+ /**
2853
+ * The starting question's options. While the box is empty and there are at
2854
+ * least two, the placeholder's lead word cycles through the first three of
2855
+ * them (see startingHint.ts). Omitted or empty: the plain placeholder.
2856
+ */
2857
+ hintOptions?: readonly StartingHintOption[];
2777
2858
  }
2778
2859
  /**
2779
2860
  * Renders text segments into the contentEditable input. Completed params are
@@ -3272,4 +3353,4 @@ declare const SMART_SUGGESTION_SPARKLE_SVG: string;
3272
3353
  /** True when some pill is a question the shopper can decline. */
3273
3354
  declare function hasSkippablePill(suggestions: Suggestion[]): boolean;
3274
3355
 
3275
- export { AIAutocomplete, type APIConfig, type APIKeyConfig, ATTRIBUTION_URL, type AccessTokenConfig, type AccessTokenResult, type AppearanceMode, type AutocompleteRequest, type AutocompleteResponse, type AutocompleteResult, type CompletedParam, type CompletedParamState, type CoreOptions, type CoreState, type CurrencyOptions, type CustomFieldsReport, DATE_RANGE_META_END, DATE_RANGE_META_START, DEFAULT_OPTION_COUNT_UNIT, type DateMonthView, type DateRange, type DateSelection, EDITOR_GROW_MS, type ExpressedFilter, type FilterOp, type FormatType, type IdentifiedParam, type IdentifiedParamState, type InputItem, LOCATION_META_KEY, LOCATION_MIN_QUERY, type LocationPlace, type LocationStatus, type LocationView, type LooseDateOptions, MULTI_DONE_FIT_VAR, MULTI_SELECT_TOGGLE_MIN_PX, MULTI_SELECT_TOGGLE_SLOP_PX, type MatchedItem, type MatchedItems, ModeController, OPTIONS_GRID_MOBILE_QUERY, OPTION_ENTER_DELAY_VAR, OPTION_ENTER_FADE_MS, OPTION_ENTER_RISE_MS, OPTION_ENTER_RISE_PX, OPTION_ENTER_STAGGER_MS, OPTION_IMAGE_WIDTH, type OptionOverride, type OptionOverrides, type OptionsGridLayout, type OptionsGridPlan, PANEL_ENTER_DELAY_MS, PANEL_ENTER_MS, PANEL_GHOST_CLASS, PANEL_GLIDE_MS, PANEL_LEAVE_MS, PLACEHOLDER_FADE_OUT_MS, PLACEHOLDER_LEAVING_ATTR, PLACEHOLDER_SWAP_GAP_MS, PLACEHOLDER_TYPE_MS, PLACEHOLDER_WORD_PAUSE_MS, PRODUCT_IMAGE_WIDTH, PRODUCT_PATH_PREFIX, PRODUCT_ROW_PX_PER_LINE, type PhraseMatch, type Product, type ProductImageFallback, type ProductRowMetrics, type ProductRowWheel, type ProductsConfig, type ProductsLayout, RANGE_SEPARATOR, type RecentlySuggested, type RenderMode, SCHEMA_VERSION, SCROLL_ARROW_ATTR, SCROLL_ARROW_BOTTOM_VAR, SCROLL_ARROW_CLASS, SCROLL_ARROW_FADE_MS, SCROLL_ARROW_LABEL, SCROLL_ARROW_SCROLL_IDLE_MS, SCROLL_ARROW_VISIBLE_ATTR, SKIPPED_PARAM_TEXT, SMART_SUGGESTION_SPARKLE_SVG, type ScrollArrowArgs, type ScrollArrowController, type Segment, type SelectOptionOptions, type SkippedParamState, type Store, type SubmitResultExtras, type Suggestion, type SuggestionOption, type SuggestionType, TIME_META_KEY, TIME_STEP_MINUTES, TIME_WHEEL_COLUMNS, TIME_WHEEL_ROW_HEIGHT, type TaskKind, type TextPart, type TimeParts, type TimePeriod, type TimeView, type TimeWheelColumn, type TimeWheelRow, type UIStrings, VIEWPORT_FIT_ATTR, VIEWPORT_FIT_HEIGHT_VAR, type ViewportFitArgs, type ViewportFitController, WEEKDAY_LABELS, addMonths, attachProductRowWheel, attachScrollArrow, attachViewportFit, buildAttributionUrl, buildDateOptions, buildLocationOption, buildQuery, buildSubmitResult, buildTimeOption, cellDay, cellIso, chipIdFromTap, computeOptionsGridLayout, containScroll, createStore, cursorIsAtEnd, dateCellMarks, dateFloorFor, dateSelectionFor, destroyPanelMorph, extractPlainText, findMultiSelectDone, fitMultiSelectDone, formatAbsoluteDate, formatDate, formatDateRange, formatOptionCount, formatPlace, formatTime, getCursorOffset, getFooterHint, hasSkippablePill, highlightParts, identifiedParamLabel, inPanelGhost, isCalendarFormat, isDimmedDay, isMultiSelectToggleTap, isOptionsGridMobileViewport, isPickerFormat, isSmartSuggestion, isTraditionalAutocompleteSuggestion, isoDate, isoTime, keepCaretOnChip, labelTraditionalAutocomplete, locationEndpointFor, matchTypedPhrase, measureOptionsGrid, monthLabel, needsOptionsGridMeasurement, notePanelMorphHeight, optionCountLabel, optionEnterDelayMs, optionHasImage, optionImageSources, optionImageSrc, optionLabel, optionsEntranceDurationMs, optionsGridTemplateColumns, optionsShowLeadingVisuals, panelMorphGlide, panelMorphKey, panelMorphTargetHeight, parseDate, parseLooseDate, parseLooseDateRange, parseTime, plainTextLength, planOptionsGrid, previousGraphemeBoundary, productFromMatchedItem, productImageSources, productImageSrc, productInitial, productPhotoFill, productRowWheelTarget, productsFromCustomFields, queryLive, renderEditableContent, resolveFormatType, resolveIdentifiedDate, sameOptionRows, sanitizeOptionIconSvg, scrollCaretIntoView, selectedIsoFromText, selectedRangeFor, setCursorOffset, settlePanelMorph, shopifyImageSrc, timeWheelIndex, timeWheelIndexFromScroll, timeWheelRows, toWireIdentifiedParams, typedFragment, uiStringsFor, visibleDateRange, watchEditorHeight, withSkippedParams, withTimeWheelIndex, withoutTraditionalAutocomplete };
3356
+ export { AIAutocomplete, type APIConfig, type APIKeyConfig, ATTRIBUTION_URL, type AccessTokenConfig, type AccessTokenResult, type AppearanceMode, type AutocompleteRequest, type AutocompleteResponse, type AutocompleteResult, type CompletedParam, type CompletedParamState, type CoreOptions, type CoreState, type CurrencyOptions, type CustomFieldsReport, DATE_RANGE_META_END, DATE_RANGE_META_START, DEFAULT_OPTION_COUNT_UNIT, type DateMonthView, type DateRange, type DateSelection, EDITOR_GROW_MS, type ExpressedFilter, type FilterOp, type FormatType, HINT_ATTR, HINT_EL_ATTR, HINT_HOLD_MS, type IdentifiedParam, type IdentifiedParamState, type InputItem, LOCATION_META_KEY, LOCATION_MIN_QUERY, type LocationPlace, type LocationStatus, type LocationView, type LooseDateOptions, MULTI_DONE_FIT_VAR, MULTI_SELECT_TOGGLE_MIN_PX, MULTI_SELECT_TOGGLE_SLOP_PX, type MatchedItem, type MatchedItems, ModeController, OPTIONS_GRID_MOBILE_QUERY, OPTION_ENTER_DELAY_VAR, OPTION_ENTER_FADE_MS, OPTION_ENTER_RISE_MS, OPTION_ENTER_RISE_PX, OPTION_ENTER_STAGGER_MS, OPTION_IMAGE_WIDTH, type OptionOverride, type OptionOverrides, type OptionsGridLayout, type OptionsGridPlan, PANEL_ENTER_DELAY_MS, PANEL_ENTER_MS, PANEL_GHOST_CLASS, PANEL_GLIDE_MS, PANEL_LEAVE_MS, PLACEHOLDER_FADE_OUT_MS, PLACEHOLDER_LEAVING_ATTR, PLACEHOLDER_SWAP_GAP_MS, PLACEHOLDER_TYPE_MS, PLACEHOLDER_WORD_PAUSE_MS, PRODUCT_IMAGE_WIDTH, PRODUCT_PATH_PREFIX, PRODUCT_ROW_PX_PER_LINE, type PhraseMatch, type Product, type ProductImageFallback, type ProductRowMetrics, type ProductRowWheel, type ProductsConfig, type ProductsLayout, RANGE_SEPARATOR, type RecentlySuggested, type RenderMode, SCHEMA_VERSION, SCROLL_ARROW_ATTR, SCROLL_ARROW_BOTTOM_VAR, SCROLL_ARROW_CLASS, SCROLL_ARROW_FADE_MS, SCROLL_ARROW_LABEL, SCROLL_ARROW_SCROLL_IDLE_MS, SCROLL_ARROW_VISIBLE_ATTR, SKIPPED_PARAM_TEXT, SMART_SUGGESTION_SPARKLE_SVG, type ScrollArrowArgs, type ScrollArrowController, type Segment, type SelectOptionOptions, type SkippedParamState, type StartingHintOption, type Store, type SubmitResultExtras, type Suggestion, type SuggestionOption, type SuggestionType, TIME_META_KEY, TIME_STEP_MINUTES, TIME_WHEEL_COLUMNS, TIME_WHEEL_ROW_HEIGHT, type TaskKind, type TextPart, type TimeParts, type TimePeriod, type TimeView, type TimeWheelColumn, type TimeWheelRow, type UIStrings, VIEWPORT_FIT_ATTR, VIEWPORT_FIT_HEIGHT_VAR, type ViewportFitArgs, type ViewportFitController, WEEKDAY_LABELS, addMonths, attachProductRowWheel, attachScrollArrow, attachViewportFit, buildAttributionUrl, buildDateOptions, buildLocationOption, buildQuery, buildSubmitResult, buildTimeOption, cancelStartingHint, cellDay, cellIso, chipIdFromTap, computeOptionsGridLayout, containScroll, createStore, cursorIsAtEnd, dateCellMarks, dateFloorFor, dateSelectionFor, destroyPanelMorph, extractPlainText, findMultiSelectDone, fitMultiSelectDone, formatAbsoluteDate, formatDate, formatDateRange, formatOptionCount, formatPlace, formatTime, getCursorOffset, getFooterHint, hasSkippablePill, highlightParts, identifiedParamLabel, inPanelGhost, isCalendarFormat, isDimmedDay, isMultiSelectToggleTap, isOptionsGridMobileViewport, isPickerFormat, isSmartSuggestion, isTraditionalAutocompleteSuggestion, isoDate, isoTime, keepCaretOnChip, labelTraditionalAutocomplete, locationEndpointFor, matchTypedPhrase, measureOptionsGrid, monthLabel, needsOptionsGridMeasurement, notePanelMorphHeight, optionCountLabel, optionEnterDelayMs, optionHasImage, optionImageSources, optionImageSrc, optionLabel, optionsEntranceDurationMs, optionsGridTemplateColumns, optionsShowLeadingVisuals, panelMorphGlide, panelMorphKey, panelMorphTargetHeight, parseDate, parseLooseDate, parseLooseDateRange, parseTime, plainTextLength, planOptionsGrid, previousGraphemeBoundary, productFromMatchedItem, productImageSources, productImageSrc, productInitial, productPhotoFill, productRowWheelTarget, productsFromCustomFields, queryLive, releasePanelHug, renderEditableContent, resolveFormatType, resolveIdentifiedDate, sameOptionRows, sanitizeOptionIconSvg, scrollCaretIntoView, selectedIsoFromText, selectedRangeFor, setCursorOffset, settlePanelMorph, shopifyImageSrc, startingHintOptions, syncPanelHug, timeWheelIndex, timeWheelIndexFromScroll, timeWheelRows, toWireIdentifiedParams, typedFragment, uiStringsFor, visibleDateRange, watchEditorHeight, withSkippedParams, withTimeWheelIndex, withoutTraditionalAutocomplete };