@magicx-eng/ai-autocomplete-vanilla 0.57.1 → 0.58.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 +65 -523
- package/REFERENCE.md +599 -0
- package/dist/index.d.mts +226 -16
- package/dist/index.d.ts +226 -16
- package/dist/index.js +321 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +321 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -2
package/dist/index.d.ts
CHANGED
|
@@ -67,15 +67,23 @@ interface SuggestionOption {
|
|
|
67
67
|
* tells apart options that read alike but answer different parameters.
|
|
68
68
|
*/
|
|
69
69
|
parameterLabel?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Set by the SDK, never the server, on the one option the phrase being typed
|
|
72
|
+
* is spelling out (its text starts with that phrase). The built-in rows light
|
|
73
|
+
* it and dim the rest, so the choice reads as locked in before the word ends.
|
|
74
|
+
*/
|
|
75
|
+
liveMatch?: boolean;
|
|
70
76
|
}
|
|
71
77
|
/**
|
|
72
78
|
* The value type of a parameter — which picker it needs. The server sends it
|
|
73
|
-
* for every date, date-range or
|
|
74
|
-
* answered from its options.
|
|
79
|
+
* for every date, date-range, time or location parameter; a parameter
|
|
80
|
+
* without one is answered from its options. A `location` parameter that comes
|
|
81
|
+
* with options is answered from them too; only one without options gets the
|
|
82
|
+
* location search field.
|
|
75
83
|
*/
|
|
76
84
|
interface SuggestionType {
|
|
77
85
|
/** `traditional_autocomplete` marks a suggestion whose options complete the word being typed; it is never a pill. */
|
|
78
|
-
kind: "string" | "numeric" | "date" | "date_range" | "time" | "multi_select" | "boolean" | "traditional_autocomplete";
|
|
86
|
+
kind: "string" | "numeric" | "date" | "date_range" | "time" | "multi_select" | "location" | "boolean" | "traditional_autocomplete";
|
|
79
87
|
/** How a date is written, e.g. "DD/MM/YYYY". */
|
|
80
88
|
date_format?: string;
|
|
81
89
|
/** What joins the two dates of a range, e.g. " to ". */
|
|
@@ -398,6 +406,12 @@ type Segment = {
|
|
|
398
406
|
type AppearanceMode = "light" | "dark" | "auto";
|
|
399
407
|
interface APIConfigBase {
|
|
400
408
|
endpoint?: string;
|
|
409
|
+
/**
|
|
410
|
+
* Where the location search lives. Defaults to the `endpoint`'s sibling
|
|
411
|
+
* `…/locations/autocomplete` (`/api/suggest` → `/api/locations/autocomplete`).
|
|
412
|
+
* Set it when `endpoint` points at a proxy with its own path.
|
|
413
|
+
*/
|
|
414
|
+
locationEndpoint?: string;
|
|
401
415
|
appIdentifier?: string;
|
|
402
416
|
headers?: Record<string, string>;
|
|
403
417
|
}
|
|
@@ -685,13 +699,17 @@ declare function cellDay(option: SuggestionOption | undefined): number | null;
|
|
|
685
699
|
* renders a calendar instead. `"date-range"` renders the same calendar,
|
|
686
700
|
* answered in two taps — a start and an end — and committed as one span.
|
|
687
701
|
* `"time"` ignores the options the same way and renders the time wheel.
|
|
702
|
+
* `"location"` is a location parameter that came with no options: it renders
|
|
703
|
+
* a search field over the server's location search. A location parameter
|
|
704
|
+
* that has options stays `"options"`.
|
|
688
705
|
*/
|
|
689
|
-
type FormatType = "options" | "date" | "date-range" | "time";
|
|
706
|
+
type FormatType = "options" | "date" | "date-range" | "time" | "location";
|
|
690
707
|
/** Whether this format is answered by a calendar rather than by a list. */
|
|
691
708
|
declare function isCalendarFormat(format: FormatType): boolean;
|
|
692
709
|
/**
|
|
693
|
-
* Whether this format is answered by a picker the SDK draws (a calendar
|
|
694
|
-
* time wheel) rather than by the suggestion's options.
|
|
710
|
+
* Whether this format is answered by a picker the SDK draws (a calendar, the
|
|
711
|
+
* time wheel or the location search) rather than by the suggestion's options.
|
|
712
|
+
* The server still sends
|
|
695
713
|
* options for such a pill, so anything that reasons about options — filtering,
|
|
696
714
|
* exact-match promotion, the request gates, telemetry — has to ask this first.
|
|
697
715
|
*/
|
|
@@ -708,12 +726,76 @@ declare function isPickerFormat(format: FormatType): boolean;
|
|
|
708
726
|
*
|
|
709
727
|
* Accepts anything with a `type`, not a `Suggestion`, so re-edit can ask the
|
|
710
728
|
* same question about a completed param via its `suggestionValueType`, and an
|
|
711
|
-
* identified span via its own `type`.
|
|
729
|
+
* identified span via its own `type`. Pass `options` too: a location
|
|
730
|
+
* parameter is only searched when it has none.
|
|
712
731
|
*/
|
|
713
732
|
declare function resolveFormatType(source: {
|
|
714
733
|
type?: SuggestionType;
|
|
734
|
+
options?: SuggestionOption[];
|
|
715
735
|
} | undefined | null): FormatType;
|
|
716
736
|
|
|
737
|
+
/**
|
|
738
|
+
* Metadata key that carries the provider's place ID on an answer picked from
|
|
739
|
+
* the location search, as `{ id }`. A typed answer (Enter with no result
|
|
740
|
+
* highlighted) carries none: it names no place the provider knows.
|
|
741
|
+
*/
|
|
742
|
+
declare const LOCATION_META_KEY = "aiaPlace";
|
|
743
|
+
/** Shortest phrase the location search sends; shorter ones list nothing. */
|
|
744
|
+
declare const LOCATION_MIN_QUERY = 2;
|
|
745
|
+
/** One place the location search returned. */
|
|
746
|
+
interface LocationPlace {
|
|
747
|
+
/** The provider's place ID. */
|
|
748
|
+
id: string;
|
|
749
|
+
/** What the place is called: "Seattle", "1600 Pennsylvania Ave NW". */
|
|
750
|
+
name: string;
|
|
751
|
+
/** Where it is: "WA, USA". Absent when the provider gave none. */
|
|
752
|
+
secondary?: string;
|
|
753
|
+
}
|
|
754
|
+
/**
|
|
755
|
+
* Where the location search stands for the active location pill.
|
|
756
|
+
*
|
|
757
|
+
* - `idle` — nothing to search yet (the phrase is shorter than
|
|
758
|
+
* `LOCATION_MIN_QUERY`).
|
|
759
|
+
* - `loading` — a search for `query` is pending or in flight.
|
|
760
|
+
* - `done` — `places` answers `query` (possibly empty).
|
|
761
|
+
* - `error` — the search failed; `places` is empty and Enter still answers
|
|
762
|
+
* with the typed text.
|
|
763
|
+
* - `unavailable` — no search: the server's location search route answered
|
|
764
|
+
* 404 (it has none), or the consumer set `locationSearch: false`. The field
|
|
765
|
+
* only takes typed text.
|
|
766
|
+
*/
|
|
767
|
+
type LocationStatus = "idle" | "loading" | "done" | "error" | "unavailable";
|
|
768
|
+
/**
|
|
769
|
+
* What a location pill's search field shows. Derived; null unless
|
|
770
|
+
* `activeFormatType` is `"location"`.
|
|
771
|
+
*/
|
|
772
|
+
interface LocationView {
|
|
773
|
+
/** The text in the search field. */
|
|
774
|
+
query: string;
|
|
775
|
+
places: LocationPlace[];
|
|
776
|
+
status: LocationStatus;
|
|
777
|
+
/** Index into `places` that Enter answers with, or -1 for the typed text. */
|
|
778
|
+
highlighted: number;
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* How a picked place reads in the input: its name, then the first part of
|
|
782
|
+
* where it is, so two Portlands stay apart ("Portland, OR", "Portland, ME").
|
|
783
|
+
*/
|
|
784
|
+
declare function formatPlace(place: LocationPlace): string;
|
|
785
|
+
/**
|
|
786
|
+
* The option a location answer commits through `selectOption`: a picked place
|
|
787
|
+
* carries its ID in metadata; a typed answer is just its text.
|
|
788
|
+
*/
|
|
789
|
+
declare function buildLocationOption(answer: LocationPlace | string): SuggestionOption;
|
|
790
|
+
/**
|
|
791
|
+
* The location search endpoint for an API config: `apiConfig.locationEndpoint`
|
|
792
|
+
* when set, else the `/suggest` endpoint's sibling `/locations/autocomplete`.
|
|
793
|
+
* Null when the suggest endpoint doesn't end in `/suggest` (a consumer proxy
|
|
794
|
+
* with its own path) and no location endpoint was given — the field then only
|
|
795
|
+
* takes typed text.
|
|
796
|
+
*/
|
|
797
|
+
declare function locationEndpointFor(apiConfig?: APIConfig): string | null;
|
|
798
|
+
|
|
717
799
|
/**
|
|
718
800
|
* Time-of-day helpers for the time wheel.
|
|
719
801
|
*
|
|
@@ -831,6 +913,14 @@ interface CoreInputState {
|
|
|
831
913
|
* matches, so a fragment inside a word does not hold the request back.
|
|
832
914
|
*/
|
|
833
915
|
traditionalAutocomplete: boolean;
|
|
916
|
+
/**
|
|
917
|
+
* Whether the server's location search is reachable. True from the start:
|
|
918
|
+
* the SDK calls `…/locations/autocomplete` directly, with no signal needed
|
|
919
|
+
* from `/suggest`. Set false for the rest of this instance once that route
|
|
920
|
+
* answers 404 (a server without it), after which a location pill's search
|
|
921
|
+
* field only takes typed text.
|
|
922
|
+
*/
|
|
923
|
+
locationAutocomplete: boolean;
|
|
834
924
|
/**
|
|
835
925
|
* The catalog grounding report the latest applied response carried, or null
|
|
836
926
|
* when it carried none. Replaced wholesale per response, so it always
|
|
@@ -873,6 +963,14 @@ interface CoreInputState {
|
|
|
873
963
|
* See controllers/holdOpenController.ts.
|
|
874
964
|
*/
|
|
875
965
|
dropdownHeld: boolean;
|
|
966
|
+
/**
|
|
967
|
+
* The location pill's search field (inside the dropdown) holds focus, or is
|
|
968
|
+
* about to: set by the field on press and before it focuses itself, ahead
|
|
969
|
+
* of the main input's blur. Counts as focus for the dropdown's blur gate and
|
|
970
|
+
* for the `focus` / `blur` events, so moving into the field neither closes
|
|
971
|
+
* the panel nor tells the consumer the widget lost focus.
|
|
972
|
+
*/
|
|
973
|
+
locationFieldFocused: boolean;
|
|
876
974
|
/**
|
|
877
975
|
* Re-edit state: while non-null, the user is editing a bold completed param.
|
|
878
976
|
* The snapshot stays here even after the param is removed from
|
|
@@ -962,6 +1060,16 @@ interface CoreInputState {
|
|
|
962
1060
|
picked: string[];
|
|
963
1061
|
key: string;
|
|
964
1062
|
} | null;
|
|
1063
|
+
/**
|
|
1064
|
+
* The location search for the active location pill: what its field holds
|
|
1065
|
+
* and what the server answered. Surfaces to readers as the derived
|
|
1066
|
+
* `locationView`. `key` scopes it to the pill it was set for, exactly like
|
|
1067
|
+
* `dateViewMonth` (see `dateViewKey`): a stale key is ignored, so the next
|
|
1068
|
+
* location pill opens on an empty field.
|
|
1069
|
+
*/
|
|
1070
|
+
locationSearch: (LocationView & {
|
|
1071
|
+
key: string;
|
|
1072
|
+
}) | null;
|
|
965
1073
|
/**
|
|
966
1074
|
* Set while the user is picking a date for a span the server identified as
|
|
967
1075
|
* one — "september 5th" in "fly to vegas on september 5th".
|
|
@@ -1049,6 +1157,11 @@ interface CoreDerivedState {
|
|
|
1049
1157
|
multiSelectView: {
|
|
1050
1158
|
picked: string[];
|
|
1051
1159
|
} | null;
|
|
1160
|
+
/**
|
|
1161
|
+
* What the location search field shows. Null unless `activeFormatType` is
|
|
1162
|
+
* `"location"` (a location parameter that came with no options).
|
|
1163
|
+
*/
|
|
1164
|
+
locationView: LocationView | null;
|
|
1052
1165
|
placeholderText: string;
|
|
1053
1166
|
/**
|
|
1054
1167
|
* The phrase the active pill's options are filtered by — what the user has
|
|
@@ -1172,6 +1285,13 @@ interface CoreOptions {
|
|
|
1172
1285
|
closeDropdownOnBlur?: boolean;
|
|
1173
1286
|
/** When true (default), non-tappable options are rendered in the dropdown alongside tappable ones. Set to false to hide them entirely. */
|
|
1174
1287
|
showNonTappableOptions?: boolean;
|
|
1288
|
+
/**
|
|
1289
|
+
* When true (default), a location parameter without options searches the
|
|
1290
|
+
* server's location search (cities, addresses, landmarks) as the user types
|
|
1291
|
+
* in its field. Set to false to keep the field but take typed text only, so
|
|
1292
|
+
* nothing the user types is sent for a lookup.
|
|
1293
|
+
*/
|
|
1294
|
+
locationSearch?: boolean;
|
|
1175
1295
|
/** When true (default), an option that carries an `icon_svg` draws its icon before its text in the dropdown. Set to false to render option rows as text only. */
|
|
1176
1296
|
showOptionIcons?: boolean;
|
|
1177
1297
|
/** When true (default), a completed chip in the input draws the icon of the option that answered it. Set to false to render chips as text only. */
|
|
@@ -1329,6 +1449,33 @@ interface CoreOptions {
|
|
|
1329
1449
|
setCursor?: (offset: number) => void;
|
|
1330
1450
|
}
|
|
1331
1451
|
|
|
1452
|
+
/** How far past the checkbox's inner edge a tap still counts as "on the checkbox". */
|
|
1453
|
+
declare const MULTI_SELECT_TOGGLE_SLOP_PX = 10;
|
|
1454
|
+
/** The checkbox zone is never narrower than this, measured from the row's leading edge. */
|
|
1455
|
+
declare const MULTI_SELECT_TOGGLE_MIN_PX = 44;
|
|
1456
|
+
/** Passed with an option pick to say how a multi_select row was tapped. */
|
|
1457
|
+
interface SelectOptionOptions {
|
|
1458
|
+
/**
|
|
1459
|
+
* In a multi_select question: answer now with this option (plus any already
|
|
1460
|
+
* ticked) instead of only ticking it and waiting for Done. Ignored elsewhere.
|
|
1461
|
+
*/
|
|
1462
|
+
commit?: boolean;
|
|
1463
|
+
}
|
|
1464
|
+
/**
|
|
1465
|
+
* Whether a click on a multi_select row landed in its checkbox zone.
|
|
1466
|
+
*
|
|
1467
|
+
* A row has two halves. The leading strip, from the row's edge to just past
|
|
1468
|
+
* the checkbox, ticks or unticks the option and leaves the question open for
|
|
1469
|
+
* more ticks and Done. The rest of the row (icon, text, the space after it)
|
|
1470
|
+
* answers the question on the spot. A click with no pointer position (a key
|
|
1471
|
+
* press or assistive technology activating the row) always ticks: it has no
|
|
1472
|
+
* "where", and ticking is the choice that can be undone.
|
|
1473
|
+
*/
|
|
1474
|
+
declare function isMultiSelectToggleTap(row: Element, checkbox: Element | null, event: {
|
|
1475
|
+
clientX: number;
|
|
1476
|
+
detail?: number;
|
|
1477
|
+
}): boolean;
|
|
1478
|
+
|
|
1332
1479
|
type AIAutocompleteEvents = {
|
|
1333
1480
|
submit: [result: AutocompleteResult];
|
|
1334
1481
|
result: [result: AutocompleteResult];
|
|
@@ -1386,6 +1533,10 @@ declare class AIAutocomplete {
|
|
|
1386
1533
|
/** The server's `visible_impression`: send an impression only while the dropdown is visible. */
|
|
1387
1534
|
private visibleImpression;
|
|
1388
1535
|
private destroyed;
|
|
1536
|
+
/** The location search in flight, so a newer phrase or destroy() can cancel it. */
|
|
1537
|
+
private locationAbort;
|
|
1538
|
+
/** One provider session per location pill: every search for it, then the pick. */
|
|
1539
|
+
private locationSession;
|
|
1389
1540
|
private readonly emitSubmit;
|
|
1390
1541
|
private readonly emitError;
|
|
1391
1542
|
constructor(container: HTMLElement, opts?: CoreOptions);
|
|
@@ -1567,9 +1718,34 @@ declare class AIAutocomplete {
|
|
|
1567
1718
|
toggleMultiSelectOption(option: SuggestionOption): void;
|
|
1568
1719
|
/** Complete the selected values, or skip the question when no values are selected. */
|
|
1569
1720
|
commitMultiSelect(): void;
|
|
1721
|
+
/**
|
|
1722
|
+
* Answer with `option` right away, together with anything already ticked.
|
|
1723
|
+
* What a tap on a row's text does; a tap on its checkbox only ticks.
|
|
1724
|
+
*/
|
|
1725
|
+
private answerMultiSelectWith;
|
|
1570
1726
|
private finishMultiSelect;
|
|
1571
1727
|
/** Answer the active time pill with the time on the wheel. */
|
|
1572
1728
|
commitTime(): void;
|
|
1729
|
+
/**
|
|
1730
|
+
* Set the text of the location search field. No-op unless a location pill
|
|
1731
|
+
* (a location parameter without options) is active. A phrase of at least
|
|
1732
|
+
* `LOCATION_MIN_QUERY` characters asks the server's location search after a
|
|
1733
|
+
* short pause; each new phrase cancels the search before it. The search
|
|
1734
|
+
* route is called directly: once it answers 404 (a server without it), the
|
|
1735
|
+
* field only takes typed text for the rest of this instance.
|
|
1736
|
+
*/
|
|
1737
|
+
setLocationQuery(query: string): void;
|
|
1738
|
+
/** Move the highlight through the location results (ArrowDown / ArrowUp in the field). */
|
|
1739
|
+
moveLocationHighlight(delta: number): void;
|
|
1740
|
+
/**
|
|
1741
|
+
* Answer the active location pill: with the place at `index` (a tapped
|
|
1742
|
+
* row), else the highlighted place, else the typed text as written. No-op
|
|
1743
|
+
* when there is neither a place nor any text. The answer goes through
|
|
1744
|
+
* `selectOption` like a tapped option — see `buildLocationOption`.
|
|
1745
|
+
*/
|
|
1746
|
+
commitLocation(index?: number): void;
|
|
1747
|
+
private runLocationSearch;
|
|
1748
|
+
private cancelLocationSearch;
|
|
1573
1749
|
/**
|
|
1574
1750
|
* Skip the currently active pill (always index 0 of the actionable
|
|
1575
1751
|
* suggestions) and promote the next pill to active. Invoked by ArrowRight at
|
|
@@ -1596,6 +1772,13 @@ declare class AIAutocomplete {
|
|
|
1596
1772
|
skipActivePill(): void;
|
|
1597
1773
|
handleKeyDown(e: KeyboardEvent): void;
|
|
1598
1774
|
setFocused(focused: boolean): void;
|
|
1775
|
+
/**
|
|
1776
|
+
* Report that the location search field holds focus (or is about to take
|
|
1777
|
+
* it). The renderers call this; a custom UI that draws its own location
|
|
1778
|
+
* field calls it the same way — before moving focus into the field, so the
|
|
1779
|
+
* input's blur doesn't close the panel. See `locationFieldFocused`.
|
|
1780
|
+
*/
|
|
1781
|
+
setLocationFieldFocused(focused: boolean): void;
|
|
1599
1782
|
/**
|
|
1600
1783
|
* Subscribe to state changes. Listener receives the full (input + derived) shape.
|
|
1601
1784
|
*
|
|
@@ -1633,7 +1816,7 @@ declare class AIAutocomplete {
|
|
|
1633
1816
|
*/
|
|
1634
1817
|
refreshProducts(): void;
|
|
1635
1818
|
update(opts: CoreUpdateOptions): void;
|
|
1636
|
-
selectOption(option: SuggestionOption): void;
|
|
1819
|
+
selectOption(option: SuggestionOption, how?: SelectOptionOptions): void;
|
|
1637
1820
|
private applyOption;
|
|
1638
1821
|
private startSelectionAnimationTimer;
|
|
1639
1822
|
private resolveVisitorId;
|
|
@@ -1932,8 +2115,9 @@ declare function dateCellMarks(iso: string | null, args: {
|
|
|
1932
2115
|
* When a new set of options lands, each row fades in while rising into place,
|
|
1933
2116
|
* and the rows start one after another from the input's side outward — the
|
|
1934
2117
|
* row nearest the input first. The reference (the RB2B support box's
|
|
1935
|
-
* suggestion bubbles, 2026-08-19)
|
|
1936
|
-
*
|
|
2118
|
+
* suggestion bubbles, 2026-08-19), retimed to the text-box motion spec
|
|
2119
|
+
* (2026-11): opacity 0→1 and a 7 px rise together over 340 ms on
|
|
2120
|
+
* cubic-bezier(.2,.8,.2,1), consecutive rows 40 ms apart.
|
|
1937
2121
|
*
|
|
1938
2122
|
* The per-row motion is CSS: the option's *content* rule in each package's
|
|
1939
2123
|
* stylesheet both fades and rises it. Neither half runs on the cell — the
|
|
@@ -1949,13 +2133,13 @@ declare function dateCellMarks(iso: string | null, args: {
|
|
|
1949
2133
|
* `OPTION_ENTER_FADE_MS` must match the durations declared in those rules.
|
|
1950
2134
|
*/
|
|
1951
2135
|
/** Gap between consecutive rows starting their entrance. */
|
|
1952
|
-
declare const OPTION_ENTER_STAGGER_MS =
|
|
2136
|
+
declare const OPTION_ENTER_STAGGER_MS = 40;
|
|
1953
2137
|
/** Duration of a row's opacity fade — mirrors the stylesheets' entrance rule. */
|
|
1954
|
-
declare const OPTION_ENTER_FADE_MS =
|
|
2138
|
+
declare const OPTION_ENTER_FADE_MS = 340;
|
|
1955
2139
|
/** Duration of a row's rise into place — mirrors the stylesheets' entrance rule. */
|
|
1956
|
-
declare const OPTION_ENTER_RISE_MS =
|
|
2140
|
+
declare const OPTION_ENTER_RISE_MS = 340;
|
|
1957
2141
|
/** Distance a row rises from, in CSS px — mirrors the stylesheets' entrance rule. */
|
|
1958
|
-
declare const OPTION_ENTER_RISE_PX =
|
|
2142
|
+
declare const OPTION_ENTER_RISE_PX = 7;
|
|
1959
2143
|
/** Inline custom property each option carries with its own start delay. */
|
|
1960
2144
|
declare const OPTION_ENTER_DELAY_VAR = "--aia-option-enter-delay";
|
|
1961
2145
|
/**
|
|
@@ -2150,6 +2334,29 @@ declare function cursorIsAtEnd(root: HTMLElement): boolean;
|
|
|
2150
2334
|
*/
|
|
2151
2335
|
declare function previousGraphemeBoundary(text: string, offset: number): number;
|
|
2152
2336
|
|
|
2337
|
+
/**
|
|
2338
|
+
* Animated growth for the editor box.
|
|
2339
|
+
*
|
|
2340
|
+
* A box sized by its content jumps when a line is added, and CSS cannot
|
|
2341
|
+
* transition `height: auto`. So the editor's height is set explicitly to its
|
|
2342
|
+
* content's height on every change, and the stylesheets transition `height`
|
|
2343
|
+
* (EDITOR_GROW_MS, cubic-bezier(.2,.8,.2,1)) — a new line opens smoothly
|
|
2344
|
+
* instead of popping in. The editor still clips and scrolls past its
|
|
2345
|
+
* `max-height` cap; the measurement respects that cap.
|
|
2346
|
+
*
|
|
2347
|
+
* Reduced motion and `animations: false` zero the transition in CSS, so the
|
|
2348
|
+
* height still tracks the content, just without the slide.
|
|
2349
|
+
*/
|
|
2350
|
+
/** Duration of the editor's height transition — mirrors the stylesheets. */
|
|
2351
|
+
declare const EDITOR_GROW_MS = 340;
|
|
2352
|
+
/**
|
|
2353
|
+
* Keeps `editor`'s explicit height equal to its content's height, measuring on
|
|
2354
|
+
* every content change and again EDITOR_GROW_MS later (a chip forming around a
|
|
2355
|
+
* word widens it over that long and can push a word onto the next line).
|
|
2356
|
+
* Returns a function that stops watching and hands the height back to CSS.
|
|
2357
|
+
*/
|
|
2358
|
+
declare function watchEditorHeight(editor: HTMLElement): () => void;
|
|
2359
|
+
|
|
2153
2360
|
/**
|
|
2154
2361
|
* A mouse wheel over the product strip scrolls it sideways.
|
|
2155
2362
|
*
|
|
@@ -2408,6 +2615,9 @@ declare const en: {
|
|
|
2408
2615
|
keepTyping: string;
|
|
2409
2616
|
done: string;
|
|
2410
2617
|
timeLabel: string;
|
|
2618
|
+
locationSearch: string;
|
|
2619
|
+
locationNoResults: string;
|
|
2620
|
+
locationUseTyped: string;
|
|
2411
2621
|
};
|
|
2412
2622
|
type UIStrings = typeof en;
|
|
2413
2623
|
declare function uiStringsFor(language?: string): UIStrings;
|
|
@@ -2445,7 +2655,7 @@ declare function uiStringsFor(language?: string): UIStrings;
|
|
|
2445
2655
|
* reserved fade band when there is one (below-mode with the footer), and
|
|
2446
2656
|
* floats a small gap above the grid's edge in layouts that zero the band
|
|
2447
2657
|
* (`optionsPosition="above"`). When a product strip follows the grid it
|
|
2448
|
-
* instead centres itself on the strip's "
|
|
2658
|
+
* instead centres itself on the strip's "Best match" label row — the label
|
|
2449
2659
|
* carries `data-aia-products-label` for this — so it sits on the seam
|
|
2450
2660
|
* between the two sections rather than over the last visible option row
|
|
2451
2661
|
* (2026-09-14, from the Shopify storefront). A new
|
|
@@ -2870,4 +3080,4 @@ declare const SMART_SUGGESTION_SPARKLE_SVG: string;
|
|
|
2870
3080
|
/** True when some pill is a question the shopper can decline. */
|
|
2871
3081
|
declare function hasSkippablePill(suggestions: Suggestion[]): boolean;
|
|
2872
3082
|
|
|
2873
|
-
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, type ExpressedFilter, type FilterOp, type FormatType, type IdentifiedParam, type IdentifiedParamState, type InputItem, type LooseDateOptions, 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, 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 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, buildQuery, buildSubmitResult, buildTimeOption, cellDay, cellIso, chipIdFromTap, computeOptionsGridLayout, containScroll, createStore, cursorIsAtEnd, dateCellMarks, dateSelectionFor, extractPlainText, formatAbsoluteDate, formatDate, formatDateRange, formatOptionCount, formatTime, getCursorOffset, getFooterHint, hasSkippablePill, highlightParts, identifiedParamLabel, isCalendarFormat, isOptionsGridMobileViewport, isPickerFormat, isSmartSuggestion, isTraditionalAutocompleteSuggestion, isoDate, isoTime, keepCaretOnChip, labelTraditionalAutocomplete, matchTypedPhrase, measureOptionsGrid, monthLabel, needsOptionsGridMeasurement, optionCountLabel, optionEnterDelayMs, optionHasImage, optionImageSources, optionImageSrc, optionLabel, optionsEntranceDurationMs, optionsGridTemplateColumns, optionsShowLeadingVisuals, parseDate, parseLooseDate, parseLooseDateRange, parseTime, plainTextLength, planOptionsGrid, previousGraphemeBoundary, productFromMatchedItem, productImageSources, productImageSrc, productInitial, productPhotoFill, productRowWheelTarget, productsFromCustomFields, renderEditableContent, resolveFormatType, resolveIdentifiedDate, sameOptionRows, sanitizeOptionIconSvg, scrollCaretIntoView, selectedIsoFromText, selectedRangeFor, setCursorOffset, shopifyImageSrc, timeWheelIndex, timeWheelIndexFromScroll, timeWheelRows, toWireIdentifiedParams, typedFragment, uiStringsFor, visibleDateRange, withSkippedParams, withTimeWheelIndex, withoutTraditionalAutocomplete };
|
|
3083
|
+
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_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, 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, dateSelectionFor, extractPlainText, formatAbsoluteDate, formatDate, formatDateRange, formatOptionCount, formatPlace, formatTime, getCursorOffset, getFooterHint, hasSkippablePill, highlightParts, identifiedParamLabel, isCalendarFormat, isMultiSelectToggleTap, isOptionsGridMobileViewport, isPickerFormat, isSmartSuggestion, isTraditionalAutocompleteSuggestion, isoDate, isoTime, keepCaretOnChip, labelTraditionalAutocomplete, locationEndpointFor, matchTypedPhrase, measureOptionsGrid, monthLabel, needsOptionsGridMeasurement, optionCountLabel, optionEnterDelayMs, optionHasImage, optionImageSources, optionImageSrc, optionLabel, optionsEntranceDurationMs, optionsGridTemplateColumns, optionsShowLeadingVisuals, parseDate, parseLooseDate, parseLooseDateRange, parseTime, plainTextLength, planOptionsGrid, previousGraphemeBoundary, productFromMatchedItem, productImageSources, productImageSrc, productInitial, productPhotoFill, productRowWheelTarget, productsFromCustomFields, renderEditableContent, resolveFormatType, resolveIdentifiedDate, sameOptionRows, sanitizeOptionIconSvg, scrollCaretIntoView, selectedIsoFromText, selectedRangeFor, setCursorOffset, shopifyImageSrc, timeWheelIndex, timeWheelIndexFromScroll, timeWheelRows, toWireIdentifiedParams, typedFragment, uiStringsFor, visibleDateRange, watchEditorHeight, withSkippedParams, withTimeWheelIndex, withoutTraditionalAutocomplete };
|