@magicx-eng/ai-autocomplete-angular 0.5.5 → 0.5.7

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.
@@ -13,6 +13,8 @@ interface DropdownVm {
13
13
  showsOptions: boolean;
14
14
  showsFallbackSkeleton: boolean;
15
15
  isVisible: boolean;
16
+ /** Identity of the suggestion the options belong to — drives the grid's scroll reset. */
17
+ groupKey: string;
16
18
  footerKey: string;
17
19
  footerHint: string;
18
20
  optionsPosition: "above" | "below";
@@ -55,6 +57,11 @@ export declare class AIAutocompleteDropdownComponent implements OnInit, OnChange
55
57
  get rootClass(): string;
56
58
  /** Fallback skeleton-bar widths used when loading with zero cached options. */
57
59
  readonly fallbackSkeletonBarWidths: number[];
60
+ /**
61
+ * Attribution/branding link URL for the footer, with a `utm_source` derived
62
+ * from the embedding page's hostname (see {@link buildAttributionUrl}).
63
+ */
64
+ readonly brandHref: string;
58
65
  /**
59
66
  * View-model derived from the controller's `dropdown$`. Adds three booleans
60
67
  * (`showsPills`, `showsOptions`, `showsFallbackSkeleton`, `isVisible`) that
@@ -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,EAEnB,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,EAAE,gBAAgB,EAAE,CAAC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IAC5E,OAAO,CAAC,MAAM;IA4Cd,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;yCApLpB,+BAA+B;2CAA/B,+BAA+B;CAwL3C"}
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,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,yFAAyF;IACzF,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,OAAO,GAAG,OAAO,CAAC;CACpC;A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yCA5LpB,+BAA+B;2CAA/B,+BAA+B;CAgM3C"}
@@ -1,19 +1,15 @@
1
- import { type AfterViewInit, type ElementRef, type OnDestroy } from "@angular/core";
1
+ import { type ElementRef, type OnChanges, type SimpleChanges } from "@angular/core";
2
2
  import * as i0 from "@angular/core";
3
3
  /**
4
4
  * Intrinsic grid layout primitive — auto-fits as many columns as fit between
5
5
  * `min` and `max` wide, wrapping to new rows when there's no more horizontal
6
6
  * room. Mirrors the React `<Grid>` component / vanilla `.aia-grid` primitive.
7
7
  *
8
- * Optionally scrolls (`scroll`, capped height) with a bottom fade overlay
9
- * (`fade`) that appears while there's hidden overflow below. The fade is driven
10
- * by a ResizeObserver + scroll listener + MutationObserver (for projected
11
- * content changes) — all run outside Angular's zone so high-frequency layout
12
- * events don't trip change detection (mirrors the former SuggestionGrid).
8
+ * Optionally scrolls (`scroll`, capped height).
13
9
  *
14
10
  * @internal
15
11
  */
16
- export declare class GridComponent implements AfterViewInit, OnDestroy {
12
+ export declare class GridComponent implements OnChanges {
17
13
  /** Minimum cell width. CSS length, e.g. "16rem". Columns auto-fit at runtime. */
18
14
  min: string;
19
15
  /** Maximum cell width. CSS length. Defaults (via CSS) to `1fr` (stretch). */
@@ -24,20 +20,16 @@ export declare class GridComponent implements AfterViewInit, OnDestroy {
24
20
  scroll: boolean;
25
21
  /** Max height when `scroll`. CSS length. Defaults (via CSS) to 120px. */
26
22
  maxHeight?: string;
27
- /** Show a bottom fade overlay while the grid has hidden overflow below. */
28
- fade: boolean;
23
+ /** Scroll back to the top whenever this key changes (`scroll` only). */
24
+ scrollResetKey?: string;
29
25
  gridRef?: ElementRef<HTMLDivElement>;
30
- hasBottomOverflow: boolean;
31
- private readonly zone;
32
- private readonly cdr;
33
- private resizeObserver?;
34
- private mutationObserver?;
35
- private scrollListener?;
36
- ngAfterViewInit(): void;
37
- ngOnDestroy(): void;
38
- private bindOverflowTracking;
39
- private measureOverflow;
26
+ /**
27
+ * A new `scrollResetKey` means a different content group is being shown (e.g.
28
+ * the next suggestion's options after a selection) — start it from the top
29
+ * instead of inheriting the previous group's scroll offset.
30
+ */
31
+ ngOnChanges(changes: SimpleChanges): void;
40
32
  static ɵfac: i0.ɵɵFactoryDeclaration<GridComponent, never>;
41
- static ɵcmp: i0.ɵɵComponentDeclaration<GridComponent, "aia-grid", never, { "min": "min"; "max": "max"; "gap": "gap"; "scroll": "scroll"; "maxHeight": "maxHeight"; "fade": "fade"; }, {}, never, ["*"], true, never>;
33
+ static ɵcmp: i0.ɵɵComponentDeclaration<GridComponent, "aia-grid", never, { "min": "min"; "max": "max"; "gap": "gap"; "scroll": "scroll"; "maxHeight": "maxHeight"; "scrollResetKey": "scrollResetKey"; }, {}, never, ["*"], true, never>;
42
34
  }
43
35
  //# sourceMappingURL=grid.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"grid.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/internal/layout/grid.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAIlB,KAAK,UAAU,EAIf,KAAK,SAAS,EAGf,MAAM,eAAe,CAAC;;AAEvB;;;;;;;;;;;;GAYG;AACH,qBAQa,aAAc,YAAW,aAAa,EAAE,SAAS;IAC5D,iFAAiF;IACxE,GAAG,SAAW;IACvB,6EAA6E;IACpE,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,yBAAyB;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,mEAAmE;IAC1D,MAAM,UAAS;IACxB,yEAAyE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,2EAA2E;IAClE,IAAI,UAAS;IAEgB,OAAO,CAAC,EAAE,UAAU,CAAC,cAAc,CAAC,CAAC;IAE3E,iBAAiB,UAAS;IAE1B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAkB;IACvC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAA6B;IACjD,OAAO,CAAC,cAAc,CAAC,CAAiB;IACxC,OAAO,CAAC,gBAAgB,CAAC,CAAmB;IAC5C,OAAO,CAAC,cAAc,CAAC,CAAa;IAEpC,eAAe,IAAI,IAAI;IAMvB,WAAW,IAAI,IAAI;IAQnB,OAAO,CAAC,oBAAoB;IAuB5B,OAAO,CAAC,eAAe;yCA7DZ,aAAa;2CAAb,aAAa;CAwEzB"}
1
+ {"version":3,"file":"grid.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/internal/layout/grid.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,UAAU,EAEf,KAAK,SAAS,EACd,KAAK,aAAa,EAGnB,MAAM,eAAe,CAAC;;AAEvB;;;;;;;;GAQG;AACH,qBAQa,aAAc,YAAW,SAAS;IAC7C,iFAAiF;IACxE,GAAG,SAAW;IACvB,6EAA6E;IACpE,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,yBAAyB;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,mEAAmE;IAC1D,MAAM,UAAS;IACxB,yEAAyE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,wEAAwE;IAC/D,cAAc,CAAC,EAAE,MAAM,CAAC;IAEK,OAAO,CAAC,EAAE,UAAU,CAAC,cAAc,CAAC,CAAC;IAE3E;;;;OAIG;IACH,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;yCArB9B,aAAa;2CAAb,aAAa;CA2BzB"}
@@ -5,7 +5,7 @@ import * as i0 from "@angular/core";
5
5
  * Internal grid of suggestion options. Mirrors
6
6
  * `packages/react/src/components/SuggestionGrid.tsx` — a thin wrapper over the
7
7
  * `Grid` layout primitive (which owns the auto-fit columns and the
8
- * capped-height scroll + bottom-fade). It only wires each option to its
8
+ * capped-height scroll). It only wires each option to its
9
9
  * select/highlight handlers and listbox-scoped id.
10
10
  *
11
11
  * @internal
@@ -15,10 +15,16 @@ export declare class SuggestionGridComponent {
15
15
  activeIndex: number;
16
16
  listboxId: string;
17
17
  loading: boolean;
18
+ /**
19
+ * Identity of the suggestion these options belong to. When it changes the
20
+ * grid scrolls back to the top, so the next parameter's options are read
21
+ * from the first one instead of from the previous list's scroll offset.
22
+ */
23
+ groupKey: string;
18
24
  readonly select: EventEmitter<SuggestionOption>;
19
25
  readonly highlight: EventEmitter<number>;
20
26
  trackByOptionText: (_: number, opt: SuggestionOption) => string;
21
27
  static ɵfac: i0.ɵɵFactoryDeclaration<SuggestionGridComponent, never>;
22
- static ɵcmp: i0.ɵɵComponentDeclaration<SuggestionGridComponent, "aia-suggestion-grid", never, { "options": "options"; "activeIndex": "activeIndex"; "listboxId": "listboxId"; "loading": "loading"; }, { "select": "select"; "highlight": "highlight"; }, never, never, true, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<SuggestionGridComponent, "aia-suggestion-grid", never, { "options": "options"; "activeIndex": "activeIndex"; "listboxId": "listboxId"; "loading": "loading"; "groupKey": "groupKey"; }, { "select": "select"; "highlight": "highlight"; }, never, never, true, never>;
23
29
  }
24
30
  //# sourceMappingURL=suggestion-grid.component.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"suggestion-grid.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/internal/suggestion-grid/suggestion-grid.component.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,YAAY,EAIb,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;;AAI5E;;;;;;;;GAQG;AACH,qBAQa,uBAAuB;IACzB,OAAO,EAAE,gBAAgB,EAAE,CAAM;IACjC,WAAW,SAAM;IACjB,SAAS,SAAM;IACf,OAAO,UAAS;IAEf,QAAQ,CAAC,MAAM,iCAAwC;IACvD,QAAQ,CAAC,SAAS,uBAA8B;IAE1D,iBAAiB,MAAO,MAAM,OAAO,gBAAgB,KAAG,MAAM,CAAa;yCAThE,uBAAuB;2CAAvB,uBAAuB;CAUnC"}
1
+ {"version":3,"file":"suggestion-grid.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/internal/suggestion-grid/suggestion-grid.component.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,YAAY,EAIb,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;;AAI5E;;;;;;;;GAQG;AACH,qBAQa,uBAAuB;IACzB,OAAO,EAAE,gBAAgB,EAAE,CAAM;IACjC,WAAW,SAAM;IACjB,SAAS,SAAM;IACf,OAAO,UAAS;IACzB;;;;OAIG;IACM,QAAQ,SAAM;IAEb,QAAQ,CAAC,MAAM,iCAAwC;IACvD,QAAQ,CAAC,SAAS,uBAA8B;IAE1D,iBAAiB,MAAO,MAAM,OAAO,gBAAgB,KAAG,MAAM,CAAa;yCAfhE,uBAAuB;2CAAvB,uBAAuB;CAgBnC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magicx-eng/ai-autocomplete-angular",
3
- "version": "0.5.5",
3
+ "version": "0.5.7",
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.5.5"
24
+ "@magicx-eng/ai-autocomplete-vanilla": "0.5.7"
25
25
  },
26
26
  "keywords": [
27
27
  "angular",