@magicx-eng/ai-autocomplete-angular 0.5.8 → 0.7.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.
@@ -1,6 +1,6 @@
1
1
  import { type AfterViewInit, type ElementRef, EventEmitter, type OnChanges, type OnDestroy, type OnInit, type SimpleChanges, type TemplateRef } from "@angular/core";
2
2
  import { type ControlValueAccessor } from "@angular/forms";
3
- import { type APIConfig, type AppearanceMode, type AutocompleteResult, type CompletedParamState, type OptionOverrides } from "@magicx-eng/ai-autocomplete-vanilla";
3
+ import { type APIConfig, type AppearanceMode, type AutocompleteResult, type CompletedParamState, type OptionOverrides, type Product, type ProductsConfig } from "@magicx-eng/ai-autocomplete-vanilla";
4
4
  import { AIAutocompleteController } from "../controller/ai-autocomplete.controller";
5
5
  import * as i0 from "@angular/core";
6
6
  /**
@@ -31,6 +31,18 @@ export declare class AIAutocompleteComponent implements OnInit, AfterViewInit, O
31
31
  value?: string;
32
32
  /** Controlled-mode completed params. */
33
33
  completedParams?: CompletedParamState[];
34
+ /**
35
+ * Opt-in product strip. When set, the dropdown renders a horizontal row of
36
+ * product cards below the options grid, fed by your own search endpoint on
37
+ * the SDK's existing fetch cadence. Omit it and nothing about the dropdown
38
+ * changes — no request, no markup, no layout shift.
39
+ *
40
+ * Bind a stable reference (a component field, not an inline object literal):
41
+ * a new object on each change-detection pass reads as a swapped integration
42
+ * and clears the current cards — the same rule that already applies to
43
+ * `apiConfig` and `optionOverrides`.
44
+ */
45
+ products?: ProductsConfig;
34
46
  /**
35
47
  * Custom submit button. Pass a `<ng-template>` to replace the default arrow
36
48
  * button. Pass `null` to render no button. Default (`undefined`) renders
@@ -44,6 +56,12 @@ export declare class AIAutocompleteComponent implements OnInit, AfterViewInit, O
44
56
  readonly completedParamsChange: EventEmitter<CompletedParamState[]>;
45
57
  readonly focused: EventEmitter<void>;
46
58
  readonly blurred: EventEmitter<void>;
59
+ /**
60
+ * Emitted when the user activates a product card. The SDK does not
61
+ * navigate — you decide what a selection means. Modifier / middle clicks are
62
+ * left to the browser (cmd-click still opens a tab) and don't emit.
63
+ */
64
+ readonly productSelect: EventEmitter<Product>;
47
65
  containerRef: ElementRef<HTMLDivElement>;
48
66
  editorRef?: ElementRef<HTMLDivElement>;
49
67
  pillContainerRef?: ElementRef<HTMLSpanElement>;
@@ -116,6 +134,6 @@ export declare class AIAutocompleteComponent implements OnInit, AfterViewInit, O
116
134
  private handleSubmitFromUserAction;
117
135
  private measurePillWrap;
118
136
  static ɵfac: i0.ɵɵFactoryDeclaration<AIAutocompleteComponent, never>;
119
- static ɵcmp: i0.ɵɵComponentDeclaration<AIAutocompleteComponent, "ai-autocomplete", never, { "apiConfig": "apiConfig"; "optionOverrides": "optionOverrides"; "maskCompletedText": "maskCompletedText"; "columns": "columns"; "pillPlacement": "pillPlacement"; "mode": "mode"; "optionsPosition": "optionsPosition"; "animations": "animations"; "dropdownTrigger": "dropdownTrigger"; "closeDropdownOnBlur": "closeDropdownOnBlur"; "showNonTappableOptions": "showNonTappableOptions"; "autoFocus": "autoFocus"; "value": "value"; "completedParams": "completedParams"; "submitButton": "submitButton"; }, { "submitted": "submitted"; "errored": "errored"; "valueChange": "valueChange"; "completedParamsChange": "completedParamsChange"; "focused": "focused"; "blurred": "blurred"; }, never, never, true, never>;
137
+ static ɵcmp: i0.ɵɵComponentDeclaration<AIAutocompleteComponent, "ai-autocomplete", never, { "apiConfig": "apiConfig"; "optionOverrides": "optionOverrides"; "maskCompletedText": "maskCompletedText"; "columns": "columns"; "pillPlacement": "pillPlacement"; "mode": "mode"; "optionsPosition": "optionsPosition"; "animations": "animations"; "dropdownTrigger": "dropdownTrigger"; "closeDropdownOnBlur": "closeDropdownOnBlur"; "showNonTappableOptions": "showNonTappableOptions"; "autoFocus": "autoFocus"; "value": "value"; "completedParams": "completedParams"; "products": "products"; "submitButton": "submitButton"; }, { "submitted": "submitted"; "errored": "errored"; "valueChange": "valueChange"; "completedParamsChange": "completedParamsChange"; "focused": "focused"; "blurred": "blurred"; "productSelect": "productSelect"; }, never, never, true, never>;
120
138
  }
121
139
  //# sourceMappingURL=ai-autocomplete.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ai-autocomplete.component.d.ts","sourceRoot":"","sources":["../../../src/lib/ai-autocomplete/ai-autocomplete.component.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAIlB,KAAK,UAAU,EACf,YAAY,EAKZ,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,MAAM,EAGX,KAAK,aAAa,EAClB,KAAK,WAAW,EAGjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,oBAAoB,EAAqB,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EACL,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,kBAAkB,EAEvB,KAAK,mBAAmB,EAGxB,KAAK,eAAe,EAErB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;;AAKpF;;;;;;;GAOG;AACH,qBAuBa,uBACX,YAAW,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,oBAAoB;IAInE,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,iBAAiB,UAAS;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,wDAAwD;IAC/C,aAAa,EAAE,QAAQ,GAAG,UAAU,GAAG,QAAQ,CAAc;IACtE,wEAAwE;IAC/D,IAAI,EAAE,cAAc,CAAU;IAC9B,eAAe,EAAE,OAAO,GAAG,OAAO,CAAW;IAC7C,UAAU,UAAQ;IAClB,eAAe,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC/C,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAC1C,gDAAgD;IACvC,SA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,QAAQ,CAIvD;IAED,iEAAiE;IACjE,IAAI,oBAAoB,IAAI,WAAW,CAAC,OAAO,CAAC,GAAG,IAAI,CAEtD;IAED,IAAI,eAAe,IAAI,OAAO,CAE7B;IAED,IAAI,iBAAiB,IAAI,OAAO,CAE/B;IAED;;;OAGG;IACH,SAAS,CAAC,KAAK,EAAE;QAAE,QAAQ,EAAE;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;QAAC,eAAe,EAAE;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,GAAG,OAAO;IAIhG,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAOvC,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAK5C,iBAAiB,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAK1C,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAMjC,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAatC,gBAAgB,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI;IAInD,iBAAiB,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,IAAI;IAIvC,gBAAgB,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI;IAS1C;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,0BAA0B;IAalC,OAAO,CAAC,eAAe;yCA5WZ,uBAAuB;2CAAvB,uBAAuB;CA+XnC"}
@@ -1,5 +1,5 @@
1
1
  import { type OnChanges, type OnDestroy, type OnInit, type SimpleChanges } from "@angular/core";
2
- import { type AppearanceMode, type Suggestion, type SuggestionOption } from "@magicx-eng/ai-autocomplete-vanilla";
2
+ import { type AppearanceMode, type Product, type Suggestion, type SuggestionOption } from "@magicx-eng/ai-autocomplete-vanilla";
3
3
  import { type Observable } from "rxjs";
4
4
  import type { AIAutocompleteController } from "../controller/ai-autocomplete.controller";
5
5
  import * as i0 from "@angular/core";
@@ -13,6 +13,8 @@ interface DropdownVm {
13
13
  showsOptions: boolean;
14
14
  showsFallbackSkeleton: boolean;
15
15
  isVisible: boolean;
16
+ /** Product cards for the strip. Empty unless `products` is configured. */
17
+ products: Product[];
16
18
  /** Identity of the suggestion the options belong to — drives the grid's scroll reset. */
17
19
  groupKey: string;
18
20
  footerKey: string;
@@ -92,6 +94,12 @@ export declare class AIAutocompleteDropdownComponent implements OnInit, OnChange
92
94
  onPillClick(index: number): void;
93
95
  onSelect(option: SuggestionOption): void;
94
96
  onHighlight(index: number): void;
97
+ onProductSelect(product: Product): void;
98
+ /**
99
+ * A card taking focus blurs the editor, which would otherwise close the
100
+ * panel out from under the card the user just tabbed to.
101
+ */
102
+ onProductFocusChange(focused: boolean): void;
95
103
  preventBlur(event: Event): void;
96
104
  static ɵfac: i0.ɵɵFactoryDeclaration<AIAutocompleteDropdownComponent, never>;
97
105
  static ɵcmp: i0.ɵɵComponentDeclaration<AIAutocompleteDropdownComponent, "ai-autocomplete-dropdown", never, { "controller": "controller"; "showPills": "showPills"; "className": "className"; "mode": "mode"; }, {}, never, never, true, never>;
@@ -1 +1 @@
1
- {"version":3,"file":"ai-autocomplete-dropdown.component.d.ts","sourceRoot":"","sources":["../../../src/lib/ai-autocomplete-dropdown/ai-autocomplete-dropdown.component.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,aAAa,EAEnB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,cAAc,EAGnB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACtB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAkC,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAEvE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;;AAMzF,UAAU,UAAU;IAClB,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,OAAO,EAA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AI;IAkBzC,WAAW,IAAI,IAAI;IAInB;;;;OAIG;IACH,OAAO,CAAC,SAAS;IAwBjB,OAAO,CAAC,oBAAoB;IAQ5B,4EAA4E;IAC5E,OAAO,CAAC,MAAM;IA8Cd,YAAY,MAAO,MAAM,KAAK,MAAM,KAAG,MAAM,CAAM;IAEnD,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIhC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI;IAIxC,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIhC,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;yCA5LpB,+BAA+B;2CAA/B,+BAA+B;CAgM3C"}
1
+ {"version":3,"file":"ai-autocomplete-dropdown.component.d.ts","sourceRoot":"","sources":["../../../src/lib/ai-autocomplete-dropdown/ai-autocomplete-dropdown.component.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,aAAa,EAEnB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,cAAc,EAGnB,KAAK,OAAO,EACZ,KAAK,UAAU,EACf,KAAK,gBAAgB,EACtB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAkC,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAEvE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;;AAOzF,UAAU,UAAU;IAClB,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,SAAS,EAAE,OAAO,CAAC;IACnB,0EAA0E;IAC1E,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AC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIhC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI;IAIxC,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIhC,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAIvC;;;OAGG;IACH,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAI5C,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;yCA5MpB,+BAA+B;2CAA/B,+BAA+B;CAgN3C"}
@@ -1,4 +1,4 @@
1
- import { type CompletedParamState, type Segment, type Suggestion, type SuggestionOption } from "@magicx-eng/ai-autocomplete-vanilla";
1
+ import { type CompletedParamState, type Product, type Segment, type SkippedParamState, type Suggestion, type SuggestionOption } from "@magicx-eng/ai-autocomplete-vanilla";
2
2
  import { type Observable } from "rxjs";
3
3
  import type { AIAutocompleteControllerOptions, AIAutocompleteControllerState, AIAutocompleteControllerUpdate, AIAutocompleteDropdownState } from "../shared/types";
4
4
  /**
@@ -24,6 +24,13 @@ export declare class AIAutocompleteController {
24
24
  readonly text$: Observable<string>;
25
25
  /** Completed (bold) params currently in the editor. */
26
26
  readonly completedParams$: Observable<CompletedParamState[]>;
27
+ /**
28
+ * Suggestions the user dismissed with the skip key (→). Nothing renders
29
+ * them; they exist so a hand-rolled submit can pass them to
30
+ * `buildSubmitResult` and carry the same `text: "skipped"` entries the
31
+ * SDK's own requests do.
32
+ */
33
+ readonly skippedParams$: Observable<SkippedParamState[]>;
27
34
  /** Actionable suggestion pills (first one is the active pill). */
28
35
  readonly suggestionPills$: Observable<Suggestion[]>;
29
36
  /** Text + completed-param segments for rendering the editor body. */
@@ -32,6 +39,12 @@ export declare class AIAutocompleteController {
32
39
  readonly newParamId$: Observable<string | null>;
33
40
  /** All suggestions from the server (including non-actionable ones). */
34
41
  readonly suggestions$: Observable<Suggestion[]>;
42
+ /**
43
+ * Results of the latest product search. Always empty unless `products` is
44
+ * configured on the controller — the strip is opt-in and costs nothing when
45
+ * it isn't wired up.
46
+ */
47
+ readonly products$: Observable<Product[]>;
35
48
  /** Currently highlighted dropdown option index. -1 = none. */
36
49
  readonly activeIndex$: Observable<number>;
37
50
  /**
@@ -92,6 +105,16 @@ export declare class AIAutocompleteController {
92
105
  reset(): void;
93
106
  /** Pick a dropdown option (or replace the re-edited param if in re-edit mode). */
94
107
  selectOption(option: SuggestionOption): void;
108
+ /**
109
+ * Announce a product selection — fires the `onProductSelect` callback the
110
+ * controller was constructed with. `<ai-autocomplete-dropdown>` calls this
111
+ * for you; consumers rendering their own strip call it themselves.
112
+ *
113
+ * Emitting is the whole behaviour: the SDK deliberately does not navigate to
114
+ * `product.url`, because only the integration knows whether a selection
115
+ * means "open the PDP", "add to cart", or "fill the input".
116
+ */
117
+ selectProduct(product: Product): void;
95
118
  /** Promote the pill at `index` to active (front of the list). */
96
119
  setActivePill(index: number): void;
97
120
  /** Drop the last completed param's "completed" status. Text stays as plain text. */
@@ -1 +1 @@
1
- {"version":3,"file":"ai-autocomplete.controller.d.ts","sourceRoot":"","sources":["../../../src/lib/controller/ai-autocomplete.controller.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EAGxB,KAAK,OAAO,EACZ,KAAK,UAAU,EACf,KAAK,gBAAgB,EACtB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAuC,KAAK,UAAU,EAAe,MAAM,MAAM,CAAC;AACzF,OAAO,KAAK,EACV,+BAA+B,EAC/B,6BAA6B,EAC7B,8BAA8B,EAC9B,2BAA2B,EAC5B,MAAM,iBAAiB,CAAC;AAGzB;;;;;;;;;;;;GAYG;AACH,qBAAa,wBAAwB;IACnC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAqB;IAC1C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA6B;IAIvD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAmD;IACpF,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA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C,OAAO,EAAE,MAAM,GAAG,IAAI;IAKxC,yDAAyD;IACzD,YAAY,IAAI,IAAI;IAKpB,iEAAiE;IACjE,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAKlD,6DAA6D;IAC7D,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAK5C,yEAAyE;IACzE,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAKjD,oEAAoE;IACpE,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAO3C;;;;;;OAMG;IACH,MAAM,CAAC,IAAI,EAAE,8BAA8B,GAAG,IAAI;IAQlD;;;;OAIG;IACH,OAAO,IAAI,IAAI;CAOhB"}
@@ -0,0 +1,56 @@
1
+ import { EventEmitter } from "@angular/core";
2
+ import type { Product } from "@magicx-eng/ai-autocomplete-vanilla";
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Internal product strip rendered below the dropdown's options grid. Mirrors
6
+ * `packages/react/src/components/ProductStrip.tsx` and the vanilla core's
7
+ * `renderProductStrip`, so all three packages emit the same structure and
8
+ * theme identically.
9
+ *
10
+ * Two layout notes carried over from the vanilla implementation:
11
+ *
12
+ * - The dropdown paints a background but never sets `color`, so anything here
13
+ * relying on `color: inherit` would pick up the *host page's* text colour —
14
+ * black text on a dark panel. Every text node resolves its colour through
15
+ * the same `--aia-option-*` chain the options use.
16
+ * - The options grid carries a negative bottom margin so the footer rides up
17
+ * over its reserved band, and whatever follows the grid inherits that pull.
18
+ * The dropdown root is marked `data-aia-has-products` and the appearance
19
+ * layer zeroes the band at its source rather than the strip cancelling it
20
+ * from here.
21
+ *
22
+ * @internal
23
+ */
24
+ export declare class ProductStripComponent {
25
+ products: Product[];
26
+ /** Scopes the section label's id to the owning listbox. */
27
+ listboxId: string;
28
+ /**
29
+ * False while the panel is fading out. The closed dropdown keeps rendering
30
+ * its last content for the fade, and focusable cards inside it would still
31
+ * answer Tab.
32
+ */
33
+ focusable: boolean;
34
+ readonly select: EventEmitter<Product>;
35
+ /**
36
+ * Focus moved into / out of the strip. The panel closes on blur by default
37
+ * and the editor blurs the moment a card takes focus, so the dropdown
38
+ * reports focus as still-inside rather than shutting out from under the card
39
+ * the user just tabbed to.
40
+ */
41
+ readonly focusChange: EventEmitter<boolean>;
42
+ get labelId(): string;
43
+ cardId(index: number): string;
44
+ /**
45
+ * Identity *and* content: a same-id result whose fields changed must
46
+ * re-render rather than reuse the previous card's bindings.
47
+ */
48
+ trackByProduct: (_: number, product: Product) => string;
49
+ onClick(event: MouseEvent, product: Product): void;
50
+ onKeyDown(event: KeyboardEvent, product: Product): void;
51
+ onCardFocus(): void;
52
+ onCardBlur(event: FocusEvent): void;
53
+ static ɵfac: i0.ɵɵFactoryDeclaration<ProductStripComponent, never>;
54
+ static ɵcmp: i0.ɵɵComponentDeclaration<ProductStripComponent, "aia-product-strip", never, { "products": "products"; "listboxId": "listboxId"; "focusable": "focusable"; }, { "select": "select"; "focusChange": "focusChange"; }, never, never, true, never>;
55
+ }
56
+ //# sourceMappingURL=product-strip.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product-strip.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/internal/product-strip/product-strip.component.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,YAAY,EAIb,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;;AAEnE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBASa,qBAAqB;IACvB,QAAQ,EAAE,OAAO,EAAE,CAAM;IAClC,2DAA2D;IAClD,SAAS,SAAM;IACxB;;;;OAIG;IACM,SAAS,UAAQ;IAEhB,QAAQ,CAAC,MAAM,wBAA+B;IACxD;;;;;OAKG;IACO,QAAQ,CAAC,WAAW,wBAA+B;IAE7D,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAI7B;;;OAGG;IACH,cAAc,MAAO,MAAM,WAAW,OAAO,KAAG,MAAM,CAQxC;IAEd,OAAO,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;IAWlD,SAAS,CAAC,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;IAMvD,WAAW,IAAI,IAAI;IAInB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;yCA/DxB,qBAAqB;2CAArB,qBAAqB;CAoEjC"}
@@ -1,4 +1,4 @@
1
- import type { APIConfig, AutocompleteResult, CompletedParamState, OptionOverrides, Segment, Suggestion } from "@magicx-eng/ai-autocomplete-vanilla";
1
+ import type { APIConfig, AutocompleteResult, CompletedParamState, OptionOverrides, Product, ProductsConfig, Segment, SkippedParamState, Suggestion } from "@magicx-eng/ai-autocomplete-vanilla";
2
2
  /**
3
3
  * Construction-time options for {@link AIAutocompleteController}.
4
4
  *
@@ -53,6 +53,19 @@ export interface AIAutocompleteControllerOptions {
53
53
  onFocus?: () => void;
54
54
  /** Called when the input loses focus. */
55
55
  onBlur?: () => void;
56
+ /**
57
+ * Opt-in product strip. When set, the dropdown renders a horizontal row of
58
+ * product cards below the options grid, fed by the integration's own search
59
+ * endpoint on the SDK's existing fetch cadence. Omit it and nothing about
60
+ * the dropdown changes — no request, no markup, no layout shift.
61
+ */
62
+ products?: ProductsConfig;
63
+ /**
64
+ * Called when the user activates a product card. The SDK does not navigate —
65
+ * the integration decides what a selection means. Modifier / middle clicks
66
+ * are left to the browser (cmd-click still opens a tab) and don't fire this.
67
+ */
68
+ onProductSelect?: (product: Product) => void;
56
69
  /** Initial controlled text value. */
57
70
  value?: string;
58
71
  /** Initial controlled completed params. */
@@ -73,7 +86,7 @@ export interface AIAutocompleteControllerOptions {
73
86
  *
74
87
  * @public
75
88
  */
76
- export type AIAutocompleteControllerUpdate = Partial<Omit<AIAutocompleteControllerOptions, "onSubmit" | "onError" | "onChange" | "onParamsChange" | "onFocus" | "onBlur" | "setCursor">>;
89
+ export type AIAutocompleteControllerUpdate = Partial<Omit<AIAutocompleteControllerOptions, "onSubmit" | "onError" | "onChange" | "onParamsChange" | "onFocus" | "onBlur" | "onProductSelect" | "setCursor">>;
77
90
  /**
78
91
  * Snapshot of the controller's reactive state. Each field is also exposed as
79
92
  * a stand-alone observable on the controller (e.g. `controller.text$`).
@@ -88,10 +101,22 @@ export type AIAutocompleteControllerUpdate = Partial<Omit<AIAutocompleteControll
88
101
  export interface AIAutocompleteControllerState {
89
102
  text: string;
90
103
  completedParams: CompletedParamState[];
104
+ /**
105
+ * Suggestions the user dismissed with the skip key (→). Nothing renders
106
+ * them — pass them to `buildSubmitResult` so a hand-rolled submit carries
107
+ * the same `text: "skipped"` entries the SDK's own requests do.
108
+ */
109
+ skippedParams: SkippedParamState[];
91
110
  suggestionPills: Suggestion[];
92
111
  segments: Segment[];
93
112
  newParamId: string | null;
94
113
  suggestions: Suggestion[];
114
+ /**
115
+ * Results of the latest product search. Always empty unless `products` is
116
+ * configured. Already folded into the dropdown snapshot — read it here only
117
+ * when rendering your own strip.
118
+ */
119
+ products: Product[];
95
120
  activeIndex: number;
96
121
  isLoading: boolean;
97
122
  isReady: boolean;
@@ -125,6 +150,8 @@ export interface AIAutocompleteDropdownState {
125
150
  isLoading: boolean;
126
151
  /** Whether the input has no typed text — the sole state that surfaces "tab to select" in the footer hint. */
127
152
  isInputEmpty: boolean;
153
+ /** Product cards to render below the options grid. Empty (the default) renders no strip. */
154
+ products: Product[];
128
155
  /**
129
156
  * Where the dropdown opens relative to the input — mirrors the controller's
130
157
  * `optionsPosition` option. `<ai-autocomplete-dropdown>` reads it from here, so
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/shared/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,OAAO,E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,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,2BAA2B;IAC1C,kEAAkE;IAClE,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,MAAM,EAAE,OAAO,CAAC;IAChB,wFAAwF;IACxF,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,oFAAoF;IACpF,oBAAoB,EAAE,OAAO,CAAC;IAC9B,iEAAiE;IACjE,SAAS,EAAE,OAAO,CAAC;IACnB,6GAA6G;IAC7G,YAAY,EAAE,OAAO,CAAC;IACtB,4FAA4F;IAC5F,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB;;;;OAIG;IACH,eAAe,EAAE,OAAO,GAAG,OAAO,CAAC;CACpC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magicx-eng/ai-autocomplete-angular",
3
- "version": "0.5.8",
3
+ "version": "0.7.0",
4
4
  "description": "AI Autocomplete Angular SDK — guided autocomplete with pill-based input and dropdown suggestions",
5
5
  "module": "fesm2015/magicx-eng-ai-autocomplete-angular.mjs",
6
6
  "es2020": "fesm2020/magicx-eng-ai-autocomplete-angular.mjs",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "tslib": "^2.3.0",
24
- "@magicx-eng/ai-autocomplete-vanilla": "0.6.0"
24
+ "@magicx-eng/ai-autocomplete-vanilla": "0.8.0"
25
25
  },
26
26
  "keywords": [
27
27
  "angular",
package/public-api.d.ts CHANGED
@@ -5,7 +5,8 @@
5
5
  * planned export list. Only symbols re-exported here are considered part of
6
6
  * the package's public contract (TDB §19.2).
7
7
  */
8
- export type { AccessTokenConfig, AccessTokenResult, APIConfig, APIKeyConfig, AppearanceMode, AutocompleteResult, CompletedParam, CompletedParamState, OptionOverrides, Segment, Suggestion, SuggestionOption, TaskKind, } from "@magicx-eng/ai-autocomplete-vanilla";
8
+ export type { AccessTokenConfig, AccessTokenResult, APIConfig, APIKeyConfig, AppearanceMode, AutocompleteResult, CompletedParam, CompletedParamState, OptionOverrides, Product, ProductsConfig, Segment, SkippedParamState, Suggestion, SuggestionOption, TaskKind, } from "@magicx-eng/ai-autocomplete-vanilla";
9
+ export { buildSubmitResult, withSkippedParams } from "@magicx-eng/ai-autocomplete-vanilla";
9
10
  export { AIAutocompleteComponent } from "./lib/ai-autocomplete";
10
11
  export { AIAutocompleteModule } from "./lib/ai-autocomplete.module";
11
12
  export { AIAutocompleteDropdownComponent } from "./lib/ai-autocomplete-dropdown";
@@ -1 +1 @@
1
- {"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,OAAO,EACP,UAAU,EACV,gBAAgB,EAChB,QAAQ,GACT,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AAEjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAE3D,YAAY,EACV,+BAA+B,EAC/B,6BAA6B,EAC7B,8BAA8B,EAC9B,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EACV,iBAAiB,EACjB,iBAA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