@magicx-eng/ai-autocomplete-vanilla 0.49.3 → 0.49.5

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/dist/index.d.mts CHANGED
@@ -165,6 +165,12 @@ interface AutocompleteResponse {
165
165
  * server rather than waiting on the local filter. Absent means off.
166
166
  */
167
167
  traditional_autocomplete?: boolean;
168
+ /**
169
+ * Set when an `impression` should be sent only while the dropdown is
170
+ * visible: when it opens, and for each response that changes what it
171
+ * shows. Absent means one for every response that changes it.
172
+ */
173
+ visible_impression?: boolean;
168
174
  /** The request's `schema_version`, echoed back. */
169
175
  schema_version?: string;
170
176
  };
@@ -1211,6 +1217,9 @@ declare class AIAutocomplete {
1211
1217
  private heldIdentified;
1212
1218
  /** What the last `impression` showed, so an identical response doesn't resend it. */
1213
1219
  private lastImpressionKey;
1220
+ /** The server's `visible_impression`: send an impression only while the dropdown is visible. */
1221
+ private visibleImpression;
1222
+ private destroyed;
1214
1223
  private readonly emitSubmit;
1215
1224
  private readonly emitError;
1216
1225
  constructor(container: HTMLElement, opts?: CoreOptions);
@@ -1432,9 +1441,18 @@ declare class AIAutocomplete {
1432
1441
  private startSelectionAnimationTimer;
1433
1442
  private resolveVisitorId;
1434
1443
  private resolveSource;
1444
+ /**
1445
+ * With `visible_impression`, the dropdown opening is itself an impression of
1446
+ * what it shows, and closing it lets the next showing count again. The send
1447
+ * waits a microtask: a response that opens the dropdown sets its request id
1448
+ * only after its store write, and its own impression goes out first (the
1449
+ * deferred one then matches it and is dropped).
1450
+ */
1451
+ private subscribeVisibleImpression;
1435
1452
  /**
1436
1453
  * Records what a response put on screen: pills and their options in display
1437
- * order, and the product cards. Positions are 1-based array order.
1454
+ * order, and the product cards. Positions are 1-based array order. With
1455
+ * `visible_impression`, only while the dropdown is visible.
1438
1456
  */
1439
1457
  private fireImpression;
1440
1458
  private fireTelemetry;
package/dist/index.d.ts CHANGED
@@ -165,6 +165,12 @@ interface AutocompleteResponse {
165
165
  * server rather than waiting on the local filter. Absent means off.
166
166
  */
167
167
  traditional_autocomplete?: boolean;
168
+ /**
169
+ * Set when an `impression` should be sent only while the dropdown is
170
+ * visible: when it opens, and for each response that changes what it
171
+ * shows. Absent means one for every response that changes it.
172
+ */
173
+ visible_impression?: boolean;
168
174
  /** The request's `schema_version`, echoed back. */
169
175
  schema_version?: string;
170
176
  };
@@ -1211,6 +1217,9 @@ declare class AIAutocomplete {
1211
1217
  private heldIdentified;
1212
1218
  /** What the last `impression` showed, so an identical response doesn't resend it. */
1213
1219
  private lastImpressionKey;
1220
+ /** The server's `visible_impression`: send an impression only while the dropdown is visible. */
1221
+ private visibleImpression;
1222
+ private destroyed;
1214
1223
  private readonly emitSubmit;
1215
1224
  private readonly emitError;
1216
1225
  constructor(container: HTMLElement, opts?: CoreOptions);
@@ -1432,9 +1441,18 @@ declare class AIAutocomplete {
1432
1441
  private startSelectionAnimationTimer;
1433
1442
  private resolveVisitorId;
1434
1443
  private resolveSource;
1444
+ /**
1445
+ * With `visible_impression`, the dropdown opening is itself an impression of
1446
+ * what it shows, and closing it lets the next showing count again. The send
1447
+ * waits a microtask: a response that opens the dropdown sets its request id
1448
+ * only after its store write, and its own impression goes out first (the
1449
+ * deferred one then matches it and is dropped).
1450
+ */
1451
+ private subscribeVisibleImpression;
1435
1452
  /**
1436
1453
  * Records what a response put on screen: pills and their options in display
1437
- * order, and the product cards. Positions are 1-based array order.
1454
+ * order, and the product cards. Positions are 1-based array order. With
1455
+ * `visible_impression`, only while the dropdown is visible.
1438
1456
  */
1439
1457
  private fireImpression;
1440
1458
  private fireTelemetry;