@magicx-eng/ai-autocomplete-vanilla 0.46.0 → 0.48.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
@@ -953,6 +953,10 @@ When the open dropdown would run past the edge of the visible screen — most of
953
953
 
954
954
  While fitted, the dropdown root carries `data-aia-fit`, and the height it is capped at is in its `--aia-dropdown-fit-height` property. Every option shows in that one scroll, so the option list's usual limit of visible rows does not apply.
955
955
 
956
+ ### Dismissing the keyboard
957
+
958
+ On a phone or tablet, the shopper can put the keyboard away to see the whole dropdown: a tap on the page, or the keyboard's own done / hide key, closes the keyboard and leaves the dropdown open. The next tap outside the search box and dropdown closes it. Scrolling the page doesn't, and neither does tapping inside the dropdown. A tap on a link, button or other field outside it is treated as moving on, and closes the dropdown straight away as before. With a mouse, a click outside closes the dropdown at once, as it always has. While the dropdown is held open this way, `isDropdownOpen` stays `true` and `isFocused` is `false`.
959
+
956
960
  ### Selector Hooks
957
961
 
958
962
  For styling beyond the CSS variables, target these stable `data-aia-*` attributes:
package/dist/index.d.mts CHANGED
@@ -55,6 +55,11 @@ interface SuggestionOption {
55
55
  * suggestion's.
56
56
  */
57
57
  parameter?: string;
58
+ /**
59
+ * Set by the SDK, never the server, on the options that complete the word
60
+ * being typed: the text typed since the last answer, whose match is drawn in bold.
61
+ */
62
+ matchedText?: string;
58
63
  }
59
64
  /**
60
65
  * The value type of a parameter — which picker it needs. The server sends it
@@ -62,7 +67,8 @@ interface SuggestionOption {
62
67
  * from its options.
63
68
  */
64
69
  interface SuggestionType {
65
- kind: "string" | "numeric" | "date" | "date_range" | "boolean";
70
+ /** `traditional_autocomplete` marks a suggestion whose options complete the word being typed; it is never a pill. */
71
+ kind: "string" | "numeric" | "date" | "date_range" | "boolean" | "traditional_autocomplete";
66
72
  /** How a date is written, e.g. "DD/MM/YYYY". */
67
73
  date_format?: string;
68
74
  /** What joins the two dates of a range, e.g. " to ". */
@@ -109,6 +115,8 @@ interface AutocompleteRequest {
109
115
  recently_suggested?: RecentlySuggested[];
110
116
  contact_account_count?: number;
111
117
  additional_context?: Record<string, unknown>;
118
+ /** Tells the server this client can show option-value completions of the word being typed. */
119
+ accepts_traditional_autocomplete?: boolean;
112
120
  };
113
121
  meta: {
114
122
  request_id: string;
@@ -144,6 +152,12 @@ interface AutocompleteResponse {
144
152
  * exactly. Absent means off.
145
153
  */
146
154
  phrase_exact_match?: boolean;
155
+ /**
156
+ * Set when the server completes the word being typed. Typed text that
157
+ * only reaches an option mid-word ("a" in "Medium Heat") then asks the
158
+ * server rather than waiting on the local filter. Absent means off.
159
+ */
160
+ traditional_autocomplete?: boolean;
147
161
  /** The request's `schema_version`, echoed back. */
148
162
  schema_version?: string;
149
163
  };
@@ -674,6 +688,13 @@ interface CoreInputState {
674
688
  * while `opts.showProducts` is false.
675
689
  */
676
690
  products: Product[];
691
+ /**
692
+ * Whether the latest applied response said the server completes the word
693
+ * being typed (`meta.traditional_autocomplete`). While true the typed text
694
+ * filters the active question's options by word start, the way the server
695
+ * matches, so a fragment inside a word does not hold the request back.
696
+ */
697
+ traditionalAutocomplete: boolean;
677
698
  /**
678
699
  * The catalog grounding report the latest applied response carried, or null
679
700
  * when it carried none. Replaced wholesale per response, so it always
@@ -709,6 +730,13 @@ interface CoreInputState {
709
730
  skipNextFetch: boolean;
710
731
  lastRawQuery: string;
711
732
  isFocused: boolean;
733
+ /**
734
+ * The open dropdown stays up through a blur. Latched on while the panel is
735
+ * open and focused on a touch-primary device, and released by the next tap
736
+ * outside the widget, so dismissing the keyboard leaves the panel on screen.
737
+ * See controllers/holdOpenController.ts.
738
+ */
739
+ dropdownHeld: boolean;
712
740
  /**
713
741
  * Re-edit state: while non-null, the user is editing a bold completed param.
714
742
  * The snapshot stays here even after the param is removed from
@@ -1142,6 +1170,7 @@ declare class AIAutocomplete {
1142
1170
  private fetchController;
1143
1171
  private keyboardController;
1144
1172
  private pillsController;
1173
+ private holdOpen;
1145
1174
  private productsController;
1146
1175
  private optionSource;
1147
1176
  private reEdit;
@@ -2143,6 +2172,7 @@ declare const en: {
2143
2172
  soldOut: string;
2144
2173
  submit: string;
2145
2174
  scrollArrow: string;
2175
+ keepTyping: string;
2146
2176
  };
2147
2177
  type UIStrings = typeof en;
2148
2178
  declare function uiStringsFor(language?: string): UIStrings;
@@ -2439,6 +2469,34 @@ declare function productFromMatchedItem(item: MatchedItem, language?: string): P
2439
2469
  */
2440
2470
  declare function productsFromCustomFields(report: CustomFieldsReport | null | undefined, language?: string): Product[];
2441
2471
 
2472
+ interface TextPart {
2473
+ text: string;
2474
+ bold: boolean;
2475
+ }
2476
+ /** The word being typed: the text after the last whitespace. */
2477
+ declare function typedFragment(text: string): string;
2478
+ interface PhraseMatch {
2479
+ /** How many of the typed words (counted from the end) the option text covers. */
2480
+ typedWords: number;
2481
+ /** The covered span of the option text. */
2482
+ start: number;
2483
+ end: number;
2484
+ }
2485
+ /**
2486
+ * The longest run of the typed words, ending at the last one, that reads as a
2487
+ * phrase inside `optionText`: every typed word but the last equals a whole
2488
+ * option word and the last starts one. Case- and accent-insensitive; the phrase
2489
+ * may begin at any option word. Null when not even the last word starts one.
2490
+ */
2491
+ declare function matchTypedPhrase(optionText: string, typedText: string): PhraseMatch | null;
2492
+ /**
2493
+ * Splits an option's text so what the typed text matches can be drawn in bold:
2494
+ * the phrase `matchTypedPhrase` finds when it spans several words, else the
2495
+ * start of every word that begins with the last typed word. Case- and
2496
+ * accent-insensitive. The parts always join back into `text`.
2497
+ */
2498
+ declare function highlightParts(text: string, typedText: string | undefined): TextPart[];
2499
+
2442
2500
  declare class ModeController {
2443
2501
  private container;
2444
2502
  private mode;
@@ -2544,4 +2602,13 @@ interface SubmitResultExtras {
2544
2602
  */
2545
2603
  declare function buildSubmitResult(text: string, completedParams: CompletedParamState[], skippedParams?: SkippedParamState[], extras?: SubmitResultExtras): AutocompleteResult;
2546
2604
 
2547
- 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 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 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, type ScrollArrowArgs, type ScrollArrowController, type Segment, type SkippedParamState, type Store, type SubmitResultExtras, type Suggestion, type SuggestionOption, type SuggestionType, type TaskKind, type UIStrings, VIEWPORT_FIT_ATTR, VIEWPORT_FIT_HEIGHT_VAR, type ViewportFitArgs, type ViewportFitController, WEEKDAY_LABELS, addMonths, attachProductRowWheel, attachScrollArrow, attachViewportFit, buildAttributionUrl, buildDateOptions, buildQuery, buildSubmitResult, cellDay, cellIso, chipIdFromTap, computeOptionsGridLayout, containScroll, createStore, cursorIsAtEnd, dateCellMarks, dateSelectionFor, extractPlainText, formatAbsoluteDate, formatDate, formatDateRange, formatOptionCount, getCursorOffset, getFooterHint, identifiedParamLabel, isCalendarFormat, isOptionsGridMobileViewport, isoDate, keepCaretOnChip, measureOptionsGrid, monthLabel, needsOptionsGridMeasurement, optionCountLabel, optionEnterDelayMs, optionHasImage, optionImageSources, optionImageSrc, optionLabel, optionsEntranceDurationMs, optionsGridTemplateColumns, parseDate, parseLooseDate, parseLooseDateRange, plainTextLength, planOptionsGrid, previousGraphemeBoundary, productFromMatchedItem, productImageSources, productImageSrc, productInitial, productRowWheelTarget, productsFromCustomFields, renderEditableContent, resolveFormatType, resolveIdentifiedDate, sameOptionRows, sanitizeOptionIconSvg, scrollCaretIntoView, selectedIsoFromText, selectedRangeFor, setCursorOffset, shopifyImageSrc, toWireIdentifiedParams, uiStringsFor, visibleDateRange, withSkippedParams };
2605
+ /** True for the suggestion whose options complete the word being typed. */
2606
+ declare function isTraditionalAutocompleteSuggestion(suggestion: Suggestion | undefined | null): boolean;
2607
+ /** Drops the traditional autocomplete suggestion where only real pills make sense. */
2608
+ declare function withoutTraditionalAutocomplete(suggestions: Suggestion[]): Suggestion[];
2609
+ /** Gives the traditional autocomplete suggestion its header when the server left the text empty. */
2610
+ declare function labelTraditionalAutocomplete(suggestions: Suggestion[], header: string): Suggestion[];
2611
+ /** True when some pill is a question the shopper can decline. */
2612
+ declare function hasSkippablePill(suggestions: Suggestion[]): boolean;
2613
+
2614
+ 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 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, type ScrollArrowArgs, type ScrollArrowController, type Segment, type SkippedParamState, type Store, type SubmitResultExtras, type Suggestion, type SuggestionOption, type SuggestionType, type TaskKind, type TextPart, type UIStrings, VIEWPORT_FIT_ATTR, VIEWPORT_FIT_HEIGHT_VAR, type ViewportFitArgs, type ViewportFitController, WEEKDAY_LABELS, addMonths, attachProductRowWheel, attachScrollArrow, attachViewportFit, buildAttributionUrl, buildDateOptions, buildQuery, buildSubmitResult, cellDay, cellIso, chipIdFromTap, computeOptionsGridLayout, containScroll, createStore, cursorIsAtEnd, dateCellMarks, dateSelectionFor, extractPlainText, formatAbsoluteDate, formatDate, formatDateRange, formatOptionCount, getCursorOffset, getFooterHint, hasSkippablePill, highlightParts, identifiedParamLabel, isCalendarFormat, isOptionsGridMobileViewport, isTraditionalAutocompleteSuggestion, isoDate, keepCaretOnChip, labelTraditionalAutocomplete, matchTypedPhrase, measureOptionsGrid, monthLabel, needsOptionsGridMeasurement, optionCountLabel, optionEnterDelayMs, optionHasImage, optionImageSources, optionImageSrc, optionLabel, optionsEntranceDurationMs, optionsGridTemplateColumns, parseDate, parseLooseDate, parseLooseDateRange, plainTextLength, planOptionsGrid, previousGraphemeBoundary, productFromMatchedItem, productImageSources, productImageSrc, productInitial, productRowWheelTarget, productsFromCustomFields, renderEditableContent, resolveFormatType, resolveIdentifiedDate, sameOptionRows, sanitizeOptionIconSvg, scrollCaretIntoView, selectedIsoFromText, selectedRangeFor, setCursorOffset, shopifyImageSrc, toWireIdentifiedParams, typedFragment, uiStringsFor, visibleDateRange, withSkippedParams, withoutTraditionalAutocomplete };
package/dist/index.d.ts CHANGED
@@ -55,6 +55,11 @@ interface SuggestionOption {
55
55
  * suggestion's.
56
56
  */
57
57
  parameter?: string;
58
+ /**
59
+ * Set by the SDK, never the server, on the options that complete the word
60
+ * being typed: the text typed since the last answer, whose match is drawn in bold.
61
+ */
62
+ matchedText?: string;
58
63
  }
59
64
  /**
60
65
  * The value type of a parameter — which picker it needs. The server sends it
@@ -62,7 +67,8 @@ interface SuggestionOption {
62
67
  * from its options.
63
68
  */
64
69
  interface SuggestionType {
65
- kind: "string" | "numeric" | "date" | "date_range" | "boolean";
70
+ /** `traditional_autocomplete` marks a suggestion whose options complete the word being typed; it is never a pill. */
71
+ kind: "string" | "numeric" | "date" | "date_range" | "boolean" | "traditional_autocomplete";
66
72
  /** How a date is written, e.g. "DD/MM/YYYY". */
67
73
  date_format?: string;
68
74
  /** What joins the two dates of a range, e.g. " to ". */
@@ -109,6 +115,8 @@ interface AutocompleteRequest {
109
115
  recently_suggested?: RecentlySuggested[];
110
116
  contact_account_count?: number;
111
117
  additional_context?: Record<string, unknown>;
118
+ /** Tells the server this client can show option-value completions of the word being typed. */
119
+ accepts_traditional_autocomplete?: boolean;
112
120
  };
113
121
  meta: {
114
122
  request_id: string;
@@ -144,6 +152,12 @@ interface AutocompleteResponse {
144
152
  * exactly. Absent means off.
145
153
  */
146
154
  phrase_exact_match?: boolean;
155
+ /**
156
+ * Set when the server completes the word being typed. Typed text that
157
+ * only reaches an option mid-word ("a" in "Medium Heat") then asks the
158
+ * server rather than waiting on the local filter. Absent means off.
159
+ */
160
+ traditional_autocomplete?: boolean;
147
161
  /** The request's `schema_version`, echoed back. */
148
162
  schema_version?: string;
149
163
  };
@@ -674,6 +688,13 @@ interface CoreInputState {
674
688
  * while `opts.showProducts` is false.
675
689
  */
676
690
  products: Product[];
691
+ /**
692
+ * Whether the latest applied response said the server completes the word
693
+ * being typed (`meta.traditional_autocomplete`). While true the typed text
694
+ * filters the active question's options by word start, the way the server
695
+ * matches, so a fragment inside a word does not hold the request back.
696
+ */
697
+ traditionalAutocomplete: boolean;
677
698
  /**
678
699
  * The catalog grounding report the latest applied response carried, or null
679
700
  * when it carried none. Replaced wholesale per response, so it always
@@ -709,6 +730,13 @@ interface CoreInputState {
709
730
  skipNextFetch: boolean;
710
731
  lastRawQuery: string;
711
732
  isFocused: boolean;
733
+ /**
734
+ * The open dropdown stays up through a blur. Latched on while the panel is
735
+ * open and focused on a touch-primary device, and released by the next tap
736
+ * outside the widget, so dismissing the keyboard leaves the panel on screen.
737
+ * See controllers/holdOpenController.ts.
738
+ */
739
+ dropdownHeld: boolean;
712
740
  /**
713
741
  * Re-edit state: while non-null, the user is editing a bold completed param.
714
742
  * The snapshot stays here even after the param is removed from
@@ -1142,6 +1170,7 @@ declare class AIAutocomplete {
1142
1170
  private fetchController;
1143
1171
  private keyboardController;
1144
1172
  private pillsController;
1173
+ private holdOpen;
1145
1174
  private productsController;
1146
1175
  private optionSource;
1147
1176
  private reEdit;
@@ -2143,6 +2172,7 @@ declare const en: {
2143
2172
  soldOut: string;
2144
2173
  submit: string;
2145
2174
  scrollArrow: string;
2175
+ keepTyping: string;
2146
2176
  };
2147
2177
  type UIStrings = typeof en;
2148
2178
  declare function uiStringsFor(language?: string): UIStrings;
@@ -2439,6 +2469,34 @@ declare function productFromMatchedItem(item: MatchedItem, language?: string): P
2439
2469
  */
2440
2470
  declare function productsFromCustomFields(report: CustomFieldsReport | null | undefined, language?: string): Product[];
2441
2471
 
2472
+ interface TextPart {
2473
+ text: string;
2474
+ bold: boolean;
2475
+ }
2476
+ /** The word being typed: the text after the last whitespace. */
2477
+ declare function typedFragment(text: string): string;
2478
+ interface PhraseMatch {
2479
+ /** How many of the typed words (counted from the end) the option text covers. */
2480
+ typedWords: number;
2481
+ /** The covered span of the option text. */
2482
+ start: number;
2483
+ end: number;
2484
+ }
2485
+ /**
2486
+ * The longest run of the typed words, ending at the last one, that reads as a
2487
+ * phrase inside `optionText`: every typed word but the last equals a whole
2488
+ * option word and the last starts one. Case- and accent-insensitive; the phrase
2489
+ * may begin at any option word. Null when not even the last word starts one.
2490
+ */
2491
+ declare function matchTypedPhrase(optionText: string, typedText: string): PhraseMatch | null;
2492
+ /**
2493
+ * Splits an option's text so what the typed text matches can be drawn in bold:
2494
+ * the phrase `matchTypedPhrase` finds when it spans several words, else the
2495
+ * start of every word that begins with the last typed word. Case- and
2496
+ * accent-insensitive. The parts always join back into `text`.
2497
+ */
2498
+ declare function highlightParts(text: string, typedText: string | undefined): TextPart[];
2499
+
2442
2500
  declare class ModeController {
2443
2501
  private container;
2444
2502
  private mode;
@@ -2544,4 +2602,13 @@ interface SubmitResultExtras {
2544
2602
  */
2545
2603
  declare function buildSubmitResult(text: string, completedParams: CompletedParamState[], skippedParams?: SkippedParamState[], extras?: SubmitResultExtras): AutocompleteResult;
2546
2604
 
2547
- 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 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 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, type ScrollArrowArgs, type ScrollArrowController, type Segment, type SkippedParamState, type Store, type SubmitResultExtras, type Suggestion, type SuggestionOption, type SuggestionType, type TaskKind, type UIStrings, VIEWPORT_FIT_ATTR, VIEWPORT_FIT_HEIGHT_VAR, type ViewportFitArgs, type ViewportFitController, WEEKDAY_LABELS, addMonths, attachProductRowWheel, attachScrollArrow, attachViewportFit, buildAttributionUrl, buildDateOptions, buildQuery, buildSubmitResult, cellDay, cellIso, chipIdFromTap, computeOptionsGridLayout, containScroll, createStore, cursorIsAtEnd, dateCellMarks, dateSelectionFor, extractPlainText, formatAbsoluteDate, formatDate, formatDateRange, formatOptionCount, getCursorOffset, getFooterHint, identifiedParamLabel, isCalendarFormat, isOptionsGridMobileViewport, isoDate, keepCaretOnChip, measureOptionsGrid, monthLabel, needsOptionsGridMeasurement, optionCountLabel, optionEnterDelayMs, optionHasImage, optionImageSources, optionImageSrc, optionLabel, optionsEntranceDurationMs, optionsGridTemplateColumns, parseDate, parseLooseDate, parseLooseDateRange, plainTextLength, planOptionsGrid, previousGraphemeBoundary, productFromMatchedItem, productImageSources, productImageSrc, productInitial, productRowWheelTarget, productsFromCustomFields, renderEditableContent, resolveFormatType, resolveIdentifiedDate, sameOptionRows, sanitizeOptionIconSvg, scrollCaretIntoView, selectedIsoFromText, selectedRangeFor, setCursorOffset, shopifyImageSrc, toWireIdentifiedParams, uiStringsFor, visibleDateRange, withSkippedParams };
2605
+ /** True for the suggestion whose options complete the word being typed. */
2606
+ declare function isTraditionalAutocompleteSuggestion(suggestion: Suggestion | undefined | null): boolean;
2607
+ /** Drops the traditional autocomplete suggestion where only real pills make sense. */
2608
+ declare function withoutTraditionalAutocomplete(suggestions: Suggestion[]): Suggestion[];
2609
+ /** Gives the traditional autocomplete suggestion its header when the server left the text empty. */
2610
+ declare function labelTraditionalAutocomplete(suggestions: Suggestion[], header: string): Suggestion[];
2611
+ /** True when some pill is a question the shopper can decline. */
2612
+ declare function hasSkippablePill(suggestions: Suggestion[]): boolean;
2613
+
2614
+ 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 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, type ScrollArrowArgs, type ScrollArrowController, type Segment, type SkippedParamState, type Store, type SubmitResultExtras, type Suggestion, type SuggestionOption, type SuggestionType, type TaskKind, type TextPart, type UIStrings, VIEWPORT_FIT_ATTR, VIEWPORT_FIT_HEIGHT_VAR, type ViewportFitArgs, type ViewportFitController, WEEKDAY_LABELS, addMonths, attachProductRowWheel, attachScrollArrow, attachViewportFit, buildAttributionUrl, buildDateOptions, buildQuery, buildSubmitResult, cellDay, cellIso, chipIdFromTap, computeOptionsGridLayout, containScroll, createStore, cursorIsAtEnd, dateCellMarks, dateSelectionFor, extractPlainText, formatAbsoluteDate, formatDate, formatDateRange, formatOptionCount, getCursorOffset, getFooterHint, hasSkippablePill, highlightParts, identifiedParamLabel, isCalendarFormat, isOptionsGridMobileViewport, isTraditionalAutocompleteSuggestion, isoDate, keepCaretOnChip, labelTraditionalAutocomplete, matchTypedPhrase, measureOptionsGrid, monthLabel, needsOptionsGridMeasurement, optionCountLabel, optionEnterDelayMs, optionHasImage, optionImageSources, optionImageSrc, optionLabel, optionsEntranceDurationMs, optionsGridTemplateColumns, parseDate, parseLooseDate, parseLooseDateRange, plainTextLength, planOptionsGrid, previousGraphemeBoundary, productFromMatchedItem, productImageSources, productImageSrc, productInitial, productRowWheelTarget, productsFromCustomFields, renderEditableContent, resolveFormatType, resolveIdentifiedDate, sameOptionRows, sanitizeOptionIconSvg, scrollCaretIntoView, selectedIsoFromText, selectedRangeFor, setCursorOffset, shopifyImageSrc, toWireIdentifiedParams, typedFragment, uiStringsFor, visibleDateRange, withSkippedParams, withoutTraditionalAutocomplete };