@magicx-eng/ai-autocomplete-vanilla 0.26.0 → 0.26.2
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 +18 -3
- package/dist/index.d.ts +18 -3
- package/dist/index.js +15 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -7,6 +7,16 @@ interface CompletedParam {
|
|
|
7
7
|
}
|
|
8
8
|
interface SuggestionOption {
|
|
9
9
|
text: string;
|
|
10
|
+
/**
|
|
11
|
+
* The option's real, matchable value — present when the option has a
|
|
12
|
+
* separate matchable value from its display `text` (e.g. a hierarchical
|
|
13
|
+
* option's `text` is its last path segment, "Probiotics", while `value` is
|
|
14
|
+
* the full path `text` was shortened from). Sent to the server on tap
|
|
15
|
+
* instead of `text` (see `toWireParam`), so grounding still matches the
|
|
16
|
+
* full, collision-safe value while the row shows a short label. Falls
|
|
17
|
+
* back to `text` when absent.
|
|
18
|
+
*/
|
|
19
|
+
value?: string;
|
|
10
20
|
/**
|
|
11
21
|
* The icon's name — an identifier such as `"apple"`, exposed on the row as
|
|
12
22
|
* `data-aia-icon` when its `icon_svg` draws. Never rendered as text: a row
|
|
@@ -65,6 +75,7 @@ interface AutocompleteRequest {
|
|
|
65
75
|
language: string;
|
|
66
76
|
client_version: string;
|
|
67
77
|
session_id: string;
|
|
78
|
+
source?: "full-sdk" | "headless-sdk";
|
|
68
79
|
};
|
|
69
80
|
}
|
|
70
81
|
interface AutocompleteResponse {
|
|
@@ -170,6 +181,8 @@ interface CustomFieldsReport {
|
|
|
170
181
|
interface CompletedParamState extends CompletedParam {
|
|
171
182
|
id: string;
|
|
172
183
|
text: string;
|
|
184
|
+
/** The originating option's `value` (see {@link SuggestionOption.value}), carried over so `toWireParam` can send it instead of the shortened `text`. */
|
|
185
|
+
value?: string;
|
|
173
186
|
/** Source suggestion's `type` — used by re-edit mode to render the dropdown pill. */
|
|
174
187
|
suggestionType: string;
|
|
175
188
|
/** Source suggestion's `text` — used by re-edit mode to render the dropdown pill. */
|
|
@@ -832,9 +845,10 @@ interface CoreOptions {
|
|
|
832
845
|
*/
|
|
833
846
|
styleRoot?: Document | ShadowRoot;
|
|
834
847
|
/**
|
|
835
|
-
* Identifies which SDK surface is in use
|
|
836
|
-
*
|
|
837
|
-
*
|
|
848
|
+
* Identifies which SDK surface is in use — sent as meta.source on both
|
|
849
|
+
* /api/suggest and telemetry events. The hook can't distinguish on its own
|
|
850
|
+
* — the Tier 1 component sets "full-sdk" when wiring it up. Default:
|
|
851
|
+
* "headless-sdk".
|
|
838
852
|
* @internal
|
|
839
853
|
*/
|
|
840
854
|
source?: "full-sdk" | "headless-sdk";
|
|
@@ -1134,6 +1148,7 @@ declare class AIAutocomplete {
|
|
|
1134
1148
|
update(opts: CoreUpdateOptions): void;
|
|
1135
1149
|
selectOption(option: SuggestionOption): void;
|
|
1136
1150
|
private startSelectionAnimationTimer;
|
|
1151
|
+
private resolveSource;
|
|
1137
1152
|
private fireTelemetry;
|
|
1138
1153
|
private setupContainer;
|
|
1139
1154
|
private buildAndRenderFull;
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,16 @@ interface CompletedParam {
|
|
|
7
7
|
}
|
|
8
8
|
interface SuggestionOption {
|
|
9
9
|
text: string;
|
|
10
|
+
/**
|
|
11
|
+
* The option's real, matchable value — present when the option has a
|
|
12
|
+
* separate matchable value from its display `text` (e.g. a hierarchical
|
|
13
|
+
* option's `text` is its last path segment, "Probiotics", while `value` is
|
|
14
|
+
* the full path `text` was shortened from). Sent to the server on tap
|
|
15
|
+
* instead of `text` (see `toWireParam`), so grounding still matches the
|
|
16
|
+
* full, collision-safe value while the row shows a short label. Falls
|
|
17
|
+
* back to `text` when absent.
|
|
18
|
+
*/
|
|
19
|
+
value?: string;
|
|
10
20
|
/**
|
|
11
21
|
* The icon's name — an identifier such as `"apple"`, exposed on the row as
|
|
12
22
|
* `data-aia-icon` when its `icon_svg` draws. Never rendered as text: a row
|
|
@@ -65,6 +75,7 @@ interface AutocompleteRequest {
|
|
|
65
75
|
language: string;
|
|
66
76
|
client_version: string;
|
|
67
77
|
session_id: string;
|
|
78
|
+
source?: "full-sdk" | "headless-sdk";
|
|
68
79
|
};
|
|
69
80
|
}
|
|
70
81
|
interface AutocompleteResponse {
|
|
@@ -170,6 +181,8 @@ interface CustomFieldsReport {
|
|
|
170
181
|
interface CompletedParamState extends CompletedParam {
|
|
171
182
|
id: string;
|
|
172
183
|
text: string;
|
|
184
|
+
/** The originating option's `value` (see {@link SuggestionOption.value}), carried over so `toWireParam` can send it instead of the shortened `text`. */
|
|
185
|
+
value?: string;
|
|
173
186
|
/** Source suggestion's `type` — used by re-edit mode to render the dropdown pill. */
|
|
174
187
|
suggestionType: string;
|
|
175
188
|
/** Source suggestion's `text` — used by re-edit mode to render the dropdown pill. */
|
|
@@ -832,9 +845,10 @@ interface CoreOptions {
|
|
|
832
845
|
*/
|
|
833
846
|
styleRoot?: Document | ShadowRoot;
|
|
834
847
|
/**
|
|
835
|
-
* Identifies which SDK surface is in use
|
|
836
|
-
*
|
|
837
|
-
*
|
|
848
|
+
* Identifies which SDK surface is in use — sent as meta.source on both
|
|
849
|
+
* /api/suggest and telemetry events. The hook can't distinguish on its own
|
|
850
|
+
* — the Tier 1 component sets "full-sdk" when wiring it up. Default:
|
|
851
|
+
* "headless-sdk".
|
|
838
852
|
* @internal
|
|
839
853
|
*/
|
|
840
854
|
source?: "full-sdk" | "headless-sdk";
|
|
@@ -1134,6 +1148,7 @@ declare class AIAutocomplete {
|
|
|
1134
1148
|
update(opts: CoreUpdateOptions): void;
|
|
1135
1149
|
selectOption(option: SuggestionOption): void;
|
|
1136
1150
|
private startSelectionAnimationTimer;
|
|
1151
|
+
private resolveSource;
|
|
1137
1152
|
private fireTelemetry;
|
|
1138
1153
|
private setupContainer;
|
|
1139
1154
|
private buildAndRenderFull;
|