@magicx-eng/ai-autocomplete-react 0.66.3 → 0.67.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -329,6 +329,8 @@ The dropdown shows a row of product cards under the options whenever there are p
329
329
 
330
330
  Each response that read the catalog says which of the query's constraints it applied (`applied_filters`), which it dropped (`dropped_filters`) and how many items are left (`items.total`). Read it from `customFields` from the hook, or from `custom_fields` on `AutocompleteResult`. `null` means no catalog was read for that response. Details: [REFERENCE.md](https://unpkg.com/@magicx-eng/ai-autocomplete-react/REFERENCE.md), under "The catalog report".
331
331
 
332
+ When the search finds no item, `blocking_filters` names each condition whose removal finds items, with the count. The SDK greys out those chips and gives each a "×" that removes it, even with `showChipRemove` off. The chips are `blockingChips` from the hook; the opacity is the `--aia-blocking-chip-opacity` token (default `0.5`).
333
+
332
334
  #### Change product cards before display
333
335
 
334
336
  `mapProducts(products, items)` changes the cards before they show (to put in the shopper's own prices, say), and `refreshProducts()` maps them again when your data arrives. Details: [REFERENCE.md](https://unpkg.com/@magicx-eng/ai-autocomplete-react/REFERENCE.md), under "Change product cards before display".
package/REFERENCE.md CHANGED
@@ -638,7 +638,7 @@ calendar, the text is treated as a new query.
638
638
  - Select rows to toggle values. Typing filters the options and keeps the current picks.
639
639
  - Done joins the picks in selection order with the UI language's word for "and".
640
640
  - Each value has its own `completed_params` entry. The input shows one chip for the group.
641
- - Remove the group chip to change the answer. Group chips do not open for editing.
641
+ - Tap the group chip to change the answer: the checkbox list opens again with the chip's values ticked, and Done replaces the chip and sends one request. Done with every value unticked removes the chip. Leaving the list without Done keeps the answer as it was.
642
642
  - Done without picks skips the question. Typing a phrase with no matching options closes the question and keeps that phrase.
643
643
  - Space toggles the highlighted row when nothing is typed for the question. Enter commits the picks, or selects the highlighted row when no values are picked.
644
644
  - Headless integrations can call `toggleMultiSelectOption(option)` and `commitMultiSelect()`.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { AutocompleteResult, OptionOverrides, APIConfig, CurrencyOptions, AppearanceMode, CompletedParamState, ProductsLayout, ProductImageFallback, ProductsConfig, Product, MatchedItem, Suggestion, SuggestionOption, SelectOptionOptions, FormatType, DateMonthView, DateRange, TimeView, LocationView, SkippedParamState, IdentifiedParamState, CoreState, Segment, CustomFieldsReport } from '@magicx-eng/ai-autocomplete-vanilla';
2
- export { APIConfig, APIKeyConfig, AccessTokenConfig, AccessTokenResult, AppearanceMode, AutocompleteResult, CompletedParam, CompletedParamState, CurrencyOptions, CustomFieldsReport, DATE_RANGE_META_END, DATE_RANGE_META_START, DEFAULT_OPTION_COUNT_UNIT, DateMonthView, DateRange, ExpressedFilter, FilterOp, FocusInputOnSelect, FormatType, IdentifiedParam, IdentifiedParamState, LOCATION_META_KEY, LocationPlace, LocationView, MatchedItem, MatchedItems, OptionOverrides, PRODUCT_PATH_PREFIX, Product, ProductImageFallback, ProductsConfig, ProductsLayout, Segment, SelectOptionOptions, SkippedParamState, SubmitResultExtras, Suggestion, SuggestionOption, TIME_META_KEY, TaskKind, TimeView, WEEKDAY_LABELS, buildSubmitResult, cellDay, cellIso, dateCellMarks, focusesInputOnSelect, formatDate, formatDateRange, formatOptionCount, formatPlace, formatTime, isTouchPrimary, isoDate, monthLabel, optionCountLabel, optionHasImage, optionImageSources, optionImageSrc, optionLabel, optionsShowLeadingVisuals, parseDate, parseLooseDate, parseLooseDateRange, parseTime, productFromMatchedItem, productImageSources, productsFromCustomFields, sanitizeOptionIconSvg, selectedRangeFor, visibleDateRange, withSkippedParams } from '@magicx-eng/ai-autocomplete-vanilla';
1
+ import { AutocompleteResult, OptionOverrides, APIConfig, CurrencyOptions, AppearanceMode, CompletedParamState, ProductsLayout, ProductImageFallback, ProductsConfig, Product, MatchedItem, Suggestion, SuggestionOption, SelectOptionOptions, FormatType, DateMonthView, DateRange, TimeView, LocationView, SkippedParamState, IdentifiedParamState, CoreState, Segment, BlockingChip, CustomFieldsReport } from '@magicx-eng/ai-autocomplete-vanilla';
2
+ export { APIConfig, APIKeyConfig, AccessTokenConfig, AccessTokenResult, AppearanceMode, AutocompleteResult, BlockingChip, BlockingFilter, CompletedParam, CompletedParamState, CurrencyOptions, CustomFieldsReport, DATE_RANGE_META_END, DATE_RANGE_META_START, DEFAULT_OPTION_COUNT_UNIT, DateMonthView, DateRange, ExpressedFilter, FilterOp, FocusInputOnSelect, FormatType, IdentifiedParam, IdentifiedParamState, LOCATION_META_KEY, LocationPlace, LocationView, MatchedItem, MatchedItems, OptionOverrides, PRODUCT_PATH_PREFIX, Product, ProductImageFallback, ProductsConfig, ProductsLayout, Segment, SelectOptionOptions, SkippedParamState, SubmitResultExtras, Suggestion, SuggestionOption, TIME_META_KEY, TaskKind, TimeView, WEEKDAY_LABELS, buildSubmitResult, cellDay, cellIso, dateCellMarks, focusesInputOnSelect, formatDate, formatDateRange, formatOptionCount, formatPlace, formatTime, isTouchPrimary, isoDate, monthLabel, optionCountLabel, optionHasImage, optionImageSources, optionImageSrc, optionLabel, optionsShowLeadingVisuals, parseDate, parseLooseDate, parseLooseDateRange, parseTime, productFromMatchedItem, productImageSources, productsFromCustomFields, sanitizeOptionIconSvg, selectedRangeFor, visibleDateRange, withSkippedParams } from '@magicx-eng/ai-autocomplete-vanilla';
3
3
  import * as react from 'react';
4
4
  import { ReactNode, KeyboardEvent, ChangeEvent } from 'react';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
@@ -687,6 +687,8 @@ interface UseAIAutocompleteReturn {
687
687
  * pill has been tapped (the dropdown is open).
688
688
  */
689
689
  isActivePillSelected: boolean;
690
+ /** The chips whose removal finds items when the search found none, largest total first. */
691
+ blockingChips: BlockingChip[];
690
692
  placeholderText: string;
691
693
  listboxId: string;
692
694
  error: Error | null;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { AutocompleteResult, OptionOverrides, APIConfig, CurrencyOptions, AppearanceMode, CompletedParamState, ProductsLayout, ProductImageFallback, ProductsConfig, Product, MatchedItem, Suggestion, SuggestionOption, SelectOptionOptions, FormatType, DateMonthView, DateRange, TimeView, LocationView, SkippedParamState, IdentifiedParamState, CoreState, Segment, CustomFieldsReport } from '@magicx-eng/ai-autocomplete-vanilla';
2
- export { APIConfig, APIKeyConfig, AccessTokenConfig, AccessTokenResult, AppearanceMode, AutocompleteResult, CompletedParam, CompletedParamState, CurrencyOptions, CustomFieldsReport, DATE_RANGE_META_END, DATE_RANGE_META_START, DEFAULT_OPTION_COUNT_UNIT, DateMonthView, DateRange, ExpressedFilter, FilterOp, FocusInputOnSelect, FormatType, IdentifiedParam, IdentifiedParamState, LOCATION_META_KEY, LocationPlace, LocationView, MatchedItem, MatchedItems, OptionOverrides, PRODUCT_PATH_PREFIX, Product, ProductImageFallback, ProductsConfig, ProductsLayout, Segment, SelectOptionOptions, SkippedParamState, SubmitResultExtras, Suggestion, SuggestionOption, TIME_META_KEY, TaskKind, TimeView, WEEKDAY_LABELS, buildSubmitResult, cellDay, cellIso, dateCellMarks, focusesInputOnSelect, formatDate, formatDateRange, formatOptionCount, formatPlace, formatTime, isTouchPrimary, isoDate, monthLabel, optionCountLabel, optionHasImage, optionImageSources, optionImageSrc, optionLabel, optionsShowLeadingVisuals, parseDate, parseLooseDate, parseLooseDateRange, parseTime, productFromMatchedItem, productImageSources, productsFromCustomFields, sanitizeOptionIconSvg, selectedRangeFor, visibleDateRange, withSkippedParams } from '@magicx-eng/ai-autocomplete-vanilla';
1
+ import { AutocompleteResult, OptionOverrides, APIConfig, CurrencyOptions, AppearanceMode, CompletedParamState, ProductsLayout, ProductImageFallback, ProductsConfig, Product, MatchedItem, Suggestion, SuggestionOption, SelectOptionOptions, FormatType, DateMonthView, DateRange, TimeView, LocationView, SkippedParamState, IdentifiedParamState, CoreState, Segment, BlockingChip, CustomFieldsReport } from '@magicx-eng/ai-autocomplete-vanilla';
2
+ export { APIConfig, APIKeyConfig, AccessTokenConfig, AccessTokenResult, AppearanceMode, AutocompleteResult, BlockingChip, BlockingFilter, CompletedParam, CompletedParamState, CurrencyOptions, CustomFieldsReport, DATE_RANGE_META_END, DATE_RANGE_META_START, DEFAULT_OPTION_COUNT_UNIT, DateMonthView, DateRange, ExpressedFilter, FilterOp, FocusInputOnSelect, FormatType, IdentifiedParam, IdentifiedParamState, LOCATION_META_KEY, LocationPlace, LocationView, MatchedItem, MatchedItems, OptionOverrides, PRODUCT_PATH_PREFIX, Product, ProductImageFallback, ProductsConfig, ProductsLayout, Segment, SelectOptionOptions, SkippedParamState, SubmitResultExtras, Suggestion, SuggestionOption, TIME_META_KEY, TaskKind, TimeView, WEEKDAY_LABELS, buildSubmitResult, cellDay, cellIso, dateCellMarks, focusesInputOnSelect, formatDate, formatDateRange, formatOptionCount, formatPlace, formatTime, isTouchPrimary, isoDate, monthLabel, optionCountLabel, optionHasImage, optionImageSources, optionImageSrc, optionLabel, optionsShowLeadingVisuals, parseDate, parseLooseDate, parseLooseDateRange, parseTime, productFromMatchedItem, productImageSources, productsFromCustomFields, sanitizeOptionIconSvg, selectedRangeFor, visibleDateRange, withSkippedParams } from '@magicx-eng/ai-autocomplete-vanilla';
3
3
  import * as react from 'react';
4
4
  import { ReactNode, KeyboardEvent, ChangeEvent } from 'react';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
@@ -687,6 +687,8 @@ interface UseAIAutocompleteReturn {
687
687
  * pill has been tapped (the dropdown is open).
688
688
  */
689
689
  isActivePillSelected: boolean;
690
+ /** The chips whose removal finds items when the search found none, largest total first. */
691
+ blockingChips: BlockingChip[];
690
692
  placeholderText: string;
691
693
  listboxId: string;
692
694
  error: Error | null;