@magicx-eng/ai-autocomplete-angular 0.56.2 → 0.57.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 +2 -2
- package/REFERENCE.md +6 -2
- package/esm2020/lib/ai-autocomplete/ai-autocomplete.component.mjs +9 -4
- package/esm2020/lib/ai-autocomplete-dropdown/ai-autocomplete-dropdown.component.mjs +3 -3
- package/esm2020/lib/controller/ai-autocomplete.controller.mjs +3 -8
- package/esm2020/lib/internal/suggestion-grid/suggestion-grid.component.mjs +4 -3
- package/esm2020/lib/internal/suggestion-item/suggestion-item.component.mjs +23 -3
- package/esm2020/lib/shared/types.mjs +1 -1
- package/fesm2015/magicx-eng-ai-autocomplete-angular.mjs +38 -16
- package/fesm2015/magicx-eng-ai-autocomplete-angular.mjs.map +1 -1
- package/fesm2020/magicx-eng-ai-autocomplete-angular.mjs +37 -16
- package/fesm2020/magicx-eng-ai-autocomplete-angular.mjs.map +1 -1
- package/lib/ai-autocomplete/ai-autocomplete.component.d.ts +6 -1
- package/lib/ai-autocomplete/ai-autocomplete.component.d.ts.map +1 -1
- package/lib/controller/ai-autocomplete.controller.d.ts.map +1 -1
- package/lib/internal/suggestion-grid/suggestion-grid.component.d.ts +2 -1
- package/lib/internal/suggestion-grid/suggestion-grid.component.d.ts.map +1 -1
- package/lib/internal/suggestion-item/suggestion-item.component.d.ts +8 -0
- package/lib/internal/suggestion-item/suggestion-item.component.d.ts.map +1 -1
- package/lib/shared/types.d.ts +5 -0
- package/lib/shared/types.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -503,7 +503,7 @@ ac.destroy();
|
|
|
503
503
|
|
|
504
504
|
#### Constructor options
|
|
505
505
|
|
|
506
|
-
Accepts the same shape as `<ai-autocomplete>`'s inputs (`apiConfig`, `additionalContext`, `language`, `productId`, `visitorId`, `optionOverrides`, `columns`, `dropdownTrigger`, `optionsPosition`, `closeDropdownOnBlur`, `showNonTappableOptions`, `locationSearch`, `showProducts`, `products`), plus event callbacks (`onSubmit`, `onResult`, `onError`, `onChange`, `onParamsChange`, `onFocus`, `onBlur`, `onProductSelect`), the add-to-cart handler (`onProductAddToCart`, which `update()` can also set, swap or remove) and controlled-mode initial values (`value`, `completedParams`). `onResult` fires after every successful round-trip; see [Reading the query as it's built](#reading-the-query-as-its-built).
|
|
506
|
+
Accepts the same shape as `<ai-autocomplete>`'s inputs (`apiConfig`, `additionalContext`, `language`, `productId`, `visitorId`, `optionOverrides`, `columns`, `dropdownTrigger`, `optionsPosition`, `closeDropdownOnBlur`, `showNonTappableOptions`, `allOption`, `locationSearch`, `showProducts`, `products`), plus event callbacks (`onSubmit`, `onResult`, `onError`, `onChange`, `onParamsChange`, `onFocus`, `onBlur`, `onProductSelect`), the add-to-cart handler (`onProductAddToCart`, which `update()` can also set, swap or remove) and controlled-mode initial values (`value`, `completedParams`). `onResult` fires after every successful round-trip; see [Reading the query as it's built](#reading-the-query-as-its-built).
|
|
507
507
|
|
|
508
508
|
#### State observables
|
|
509
509
|
|
|
@@ -655,7 +655,7 @@ Pressing <kbd>→</kbd> at the end of the input dismisses the active pill. The d
|
|
|
655
655
|
|
|
656
656
|
Tier 2 consumers who build their own submit payload get the raw skips from the controller (`skippedParams$`, or `getState().skippedParams`) and can fold them in the same way with the exported `buildSubmitResult(text, completedParams, skippedParams, { identifiedParams, isReady })` — the last argument carries `identifiedParams$` / `isReady$` (or their `getState()` fields) so a hand-rolled submit reports the same `identified_params` and `is_ready` the SDK's own results do. Call `controller.prepareSubmit()` first, then pass `controller.getState().identifiedParams` and `controller.getState().isReady`: a typed value with no pill yet joins `identifiedParams` only in that call.
|
|
657
657
|
|
|
658
|
-
> **Reading `skippedParams$` directly:** the array
|
|
658
|
+
> **Reading `skippedParams$` directly:** the array lasts until `reset()` or a cleared search. The "drop a skip whose parameter got filled" rule is applied when the payload is built, not by pruning the array — so if the user skips `goal` and later fills one, the raw array still holds the `goal` entry. That's deliberate: the filter self-heals if they then delete that param's text, where pruning would discard the signal for good. `buildSubmitResult` applies the rule for you; to apply it elsewhere (say, a "you skipped X" badge), use the exported `withSkippedParams(completedParams, skippedParams)`.
|
|
659
659
|
|
|
660
660
|
---
|
|
661
661
|
|
package/REFERENCE.md
CHANGED
|
@@ -293,7 +293,7 @@ fully under your control. (Angular additionally runs its own `href`
|
|
|
293
293
|
sanitiser, so unrecognised schemes like `myapp://…` are rewritten to
|
|
294
294
|
`unsafe:…` in that package only.)
|
|
295
295
|
|
|
296
|
-
**Accessibility.** The strip is a `role="group"` labelled "
|
|
296
|
+
**Accessibility.** The strip is a `role="group"` labelled "Items" (in English; other languages keep their own words); each card
|
|
297
297
|
is a `role="option"` in the tab order, activated with Enter or Space, with a
|
|
298
298
|
visible focus ring. Tabbing into the strip does not close the panel. The row
|
|
299
299
|
scrolls horizontally by trackpad, wheel, touch and keyboard; the page never
|
|
@@ -573,7 +573,7 @@ The full input also accepts `--aia-input-radius` and `--aia-written-text-font-we
|
|
|
573
573
|
| `--aia-product-compare-at-opacity` | `0.6` | `0.6` | How far the struck price is dimmed. |
|
|
574
574
|
| `--aia-product-vendor-color` | `--aia-option-color` | `--aia-option-color` | Product vendor line. |
|
|
575
575
|
| `--aia-product-focus-ring` | `--aia-option-color-selected` | `--aia-option-color-selected` | Focus ring drawn on a keyboard-focused card. |
|
|
576
|
-
| `--aia-products-label-color` | `--aia-option-color` | `--aia-option-color` | "
|
|
576
|
+
| `--aia-products-label-color` | `--aia-option-color` | `--aia-option-color` | "Items" section label. |
|
|
577
577
|
| `--aia-product-title-font-size` | `8.4px` | `8.4px` | Product title font size. |
|
|
578
578
|
| `--aia-product-price-font-size` | `7.7px` | `7.7px` | Product price font size. |
|
|
579
579
|
| `--aia-product-vendor-font-size` | `7px` | `7px` | Product vendor font size. |
|
|
@@ -626,3 +626,7 @@ constructor(@Inject(PLATFORM_ID) private platformId: object) {
|
|
|
626
626
|
}
|
|
627
627
|
}
|
|
628
628
|
```
|
|
629
|
+
|
|
630
|
+
## All option
|
|
631
|
+
|
|
632
|
+
`[allOption]="true"` (default `false`) leads a plain question of two or more options with an **All** row, labelled in the UI language. Picking it skips the question, the same as the skip button, so every option stays. Its tile shows up to four of the options' pictures together, or the last option's icon when they have none. It is never added on the starting state, the Smart Suggestion, a price question (its own "any price" declines the bound), pickers or multi-select questions, nor while the shopper types to filter the list. With nothing highlighted, Tab picks the first answer, not All.
|