@magicx-eng/ai-autocomplete-vanilla 0.74.3 → 0.74.4

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
@@ -354,7 +354,7 @@ unsub();
354
354
 
355
355
  > **Removing a chip.** With `showChipRemove: true`, every chip in the input ends in a small, faint "×"; one tap or click on it removes that chip, the same result as Backspace at the chip's trailing edge (`removeParam(id)` does the same from code). Chips the server identified in typed text get one too. The × reads `--aia-chip-remove-opacity` (0.32) and `--aia-chip-remove-opacity-hover` (0.7).
356
356
 
357
- > **Parameter names under options.** An option that completes the word being typed (the server's `traditional_autocomplete` suggestion) can read the same as an option of another parameter, so the built-in dropdown draws the name of the parameter it answers under its text, muted and smaller (`Flavor`, `Subcategory`); the SDK sets it as `parameterLabel` from the option's `parameter`. It reads `--aia-option-parameter-font-size` (12px), `--aia-option-parameter-color` and `--aia-option-parameter-opacity` (0.6).
357
+ > **Parameter names under options.** An option that completes the word being typed (the server's `traditional_autocomplete` suggestion) can read the same as an option of another parameter, so the built-in dropdown draws the name of the parameter it answers under its text, muted and smaller (`Flavor`, `Subcategory`); the SDK sets it as `parameterLabel` from the option's `parameter_label` when the server sends one (the name the merchant gave the parameter, such as `Brand` for `vendor`), else from its `parameter`. It reads `--aia-option-parameter-font-size` (12px), `--aia-option-parameter-color` and `--aia-option-parameter-opacity` (0.6).
358
358
 
359
359
  ### State shape (`CoreState`)
360
360
 
package/dist/index.d.mts CHANGED
@@ -65,6 +65,12 @@ interface SuggestionOption {
65
65
  * suggestion's.
66
66
  */
67
67
  parameter?: string;
68
+ /**
69
+ * The name the merchant gave `parameter` ("Brand" for `vendor`), sent only
70
+ * when the merchant labelled it. Display only: the SDK captions the option
71
+ * with it and always answers and reports `parameter`.
72
+ */
73
+ parameter_label?: string;
68
74
  /**
69
75
  * Set by the SDK, never the server, on the options that complete the word
70
76
  * being typed: the text typed since the last answer, whose match is drawn in bold.
@@ -72,8 +78,9 @@ interface SuggestionOption {
72
78
  matchedText?: string;
73
79
  /**
74
80
  * Set by the SDK, never the server, on the options that complete the word
75
- * being typed: the name of the parameter the option is a value of ("Flavor"
76
- * for `flavor`), which the built-in rows draw under the option's text. It
81
+ * being typed: the name of the parameter the option is a value of (the
82
+ * server's `parameter_label` when it sends one, else "Flavor" for `flavor`),
83
+ * which the built-in rows draw under the option's text. It
77
84
  * tells apart options that read alike but answer different parameters.
78
85
  */
79
86
  parameterLabel?: string;
package/dist/index.d.ts CHANGED
@@ -65,6 +65,12 @@ interface SuggestionOption {
65
65
  * suggestion's.
66
66
  */
67
67
  parameter?: string;
68
+ /**
69
+ * The name the merchant gave `parameter` ("Brand" for `vendor`), sent only
70
+ * when the merchant labelled it. Display only: the SDK captions the option
71
+ * with it and always answers and reports `parameter`.
72
+ */
73
+ parameter_label?: string;
68
74
  /**
69
75
  * Set by the SDK, never the server, on the options that complete the word
70
76
  * being typed: the text typed since the last answer, whose match is drawn in bold.
@@ -72,8 +78,9 @@ interface SuggestionOption {
72
78
  matchedText?: string;
73
79
  /**
74
80
  * Set by the SDK, never the server, on the options that complete the word
75
- * being typed: the name of the parameter the option is a value of ("Flavor"
76
- * for `flavor`), which the built-in rows draw under the option's text. It
81
+ * being typed: the name of the parameter the option is a value of (the
82
+ * server's `parameter_label` when it sends one, else "Flavor" for `flavor`),
83
+ * which the built-in rows draw under the option's text. It
77
84
  * tells apart options that read alike but answer different parameters.
78
85
  */
79
86
  parameterLabel?: string;