@magicx-eng/ai-autocomplete-vanilla 0.74.2 → 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 +1 -1
- package/dist/index.d.mts +15 -5
- package/dist/index.d.ts +15 -5
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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 (
|
|
76
|
-
*
|
|
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;
|
|
@@ -3415,9 +3422,12 @@ declare function matchTypedPhrase(optionText: string, typedText: string): Phrase
|
|
|
3415
3422
|
/**
|
|
3416
3423
|
* Splits an option's text so what the typed text matches can be drawn in bold:
|
|
3417
3424
|
* the phrase `matchTypedPhrase` finds when it spans several words, else the
|
|
3418
|
-
* start of every word that begins with the last typed word.
|
|
3419
|
-
*
|
|
3420
|
-
*
|
|
3425
|
+
* start of every word that begins with the last typed word. When no word
|
|
3426
|
+
* begins with a Hangul last word, its first occurrence inside a word is bold
|
|
3427
|
+
* instead, since Korean compound nouns hold a word mid-word (화이 in 플랫화이트).
|
|
3428
|
+
* Latin text keeps word starts only. Case- and accent-insensitive. A last
|
|
3429
|
+
* character the typed text spells only the start of is its own part, marked
|
|
3430
|
+
* `partial`. The parts always join back into `text`.
|
|
3421
3431
|
*/
|
|
3422
3432
|
declare function highlightParts(text: string, typedText: string | undefined): TextPart[];
|
|
3423
3433
|
|
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 (
|
|
76
|
-
*
|
|
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;
|
|
@@ -3415,9 +3422,12 @@ declare function matchTypedPhrase(optionText: string, typedText: string): Phrase
|
|
|
3415
3422
|
/**
|
|
3416
3423
|
* Splits an option's text so what the typed text matches can be drawn in bold:
|
|
3417
3424
|
* the phrase `matchTypedPhrase` finds when it spans several words, else the
|
|
3418
|
-
* start of every word that begins with the last typed word.
|
|
3419
|
-
*
|
|
3420
|
-
*
|
|
3425
|
+
* start of every word that begins with the last typed word. When no word
|
|
3426
|
+
* begins with a Hangul last word, its first occurrence inside a word is bold
|
|
3427
|
+
* instead, since Korean compound nouns hold a word mid-word (화이 in 플랫화이트).
|
|
3428
|
+
* Latin text keeps word starts only. Case- and accent-insensitive. A last
|
|
3429
|
+
* character the typed text spells only the start of is its own part, marked
|
|
3430
|
+
* `partial`. The parts always join back into `text`.
|
|
3421
3431
|
*/
|
|
3422
3432
|
declare function highlightParts(text: string, typedText: string | undefined): TextPart[];
|
|
3423
3433
|
|