@magicx-eng/ai-autocomplete-vanilla 0.37.0 → 0.38.0
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 -0
- package/dist/index.d.mts +14 -0
- package/dist/index.d.ts +14 -0
- 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
|
@@ -78,6 +78,7 @@ const ac = new AIAutocomplete(container, {
|
|
|
78
78
|
optionOverrides: { location: async (query, signal) => [...] }, // see "Option Overrides"
|
|
79
79
|
columns: 2,
|
|
80
80
|
maskCompletedText: false, // when true, omits completed params' text from API requests (PII masking)
|
|
81
|
+
commitOnWordEnd: false, // true = a word still being typed never becomes a chip until a space, Enter, or Tab ends it (exact matches and server identified params). Picking an option is unchanged.
|
|
81
82
|
additionalContext: { tier: "gold" }, // optional user context, to personalize suggestions and options
|
|
82
83
|
|
|
83
84
|
// Appearance
|
package/dist/index.d.mts
CHANGED
|
@@ -923,6 +923,8 @@ interface CoreOptions {
|
|
|
923
923
|
apiConfig?: APIConfig;
|
|
924
924
|
optionOverrides?: OptionOverrides;
|
|
925
925
|
maskCompletedText?: boolean;
|
|
926
|
+
/** When true, a word the user is still typing never becomes a chip. The word becomes a chip when it ends: a space, Enter, or Tab. Default: false. */
|
|
927
|
+
commitOnWordEnd?: boolean;
|
|
926
928
|
/**
|
|
927
929
|
* Optional user context. Include whatever you know about the user — a
|
|
928
930
|
* profile, preferences, workspace, anything — to personalize suggested
|
|
@@ -1134,6 +1136,10 @@ declare class AIAutocomplete {
|
|
|
1134
1136
|
private funnelTelemetry;
|
|
1135
1137
|
/** A `search_started` that happened before any response said whether to send it. */
|
|
1136
1138
|
private pendingSearchStarted;
|
|
1139
|
+
/** The text at the last user keystroke, while its last word is still open. */
|
|
1140
|
+
private openWordText;
|
|
1141
|
+
/** Identified params held back until the word they end ends. */
|
|
1142
|
+
private heldIdentified;
|
|
1137
1143
|
/** What the last `impression` showed, so an identical response doesn't resend it. */
|
|
1138
1144
|
private lastImpressionKey;
|
|
1139
1145
|
private readonly emitSubmit;
|
|
@@ -1380,6 +1386,14 @@ declare class AIAutocomplete {
|
|
|
1380
1386
|
private subscribeSkeletonMirror;
|
|
1381
1387
|
private subscribeNewParamTimer;
|
|
1382
1388
|
private handleChange;
|
|
1389
|
+
/** True while commitOnWordEnd is on and the user still types the last word. */
|
|
1390
|
+
private isWordOpen;
|
|
1391
|
+
private admitIdentified;
|
|
1392
|
+
/**
|
|
1393
|
+
* Ends the word the user is typing. Makes the chip for an exact match and
|
|
1394
|
+
* admits the held identified params. Returns true when it changed anything.
|
|
1395
|
+
*/
|
|
1396
|
+
private endTypedWord;
|
|
1383
1397
|
/**
|
|
1384
1398
|
* Opens the pending span on the first keystroke past covered text: there is
|
|
1385
1399
|
* unresolved trailing text beyond the covered offset (filterBase / last pill
|
package/dist/index.d.ts
CHANGED
|
@@ -923,6 +923,8 @@ interface CoreOptions {
|
|
|
923
923
|
apiConfig?: APIConfig;
|
|
924
924
|
optionOverrides?: OptionOverrides;
|
|
925
925
|
maskCompletedText?: boolean;
|
|
926
|
+
/** When true, a word the user is still typing never becomes a chip. The word becomes a chip when it ends: a space, Enter, or Tab. Default: false. */
|
|
927
|
+
commitOnWordEnd?: boolean;
|
|
926
928
|
/**
|
|
927
929
|
* Optional user context. Include whatever you know about the user — a
|
|
928
930
|
* profile, preferences, workspace, anything — to personalize suggested
|
|
@@ -1134,6 +1136,10 @@ declare class AIAutocomplete {
|
|
|
1134
1136
|
private funnelTelemetry;
|
|
1135
1137
|
/** A `search_started` that happened before any response said whether to send it. */
|
|
1136
1138
|
private pendingSearchStarted;
|
|
1139
|
+
/** The text at the last user keystroke, while its last word is still open. */
|
|
1140
|
+
private openWordText;
|
|
1141
|
+
/** Identified params held back until the word they end ends. */
|
|
1142
|
+
private heldIdentified;
|
|
1137
1143
|
/** What the last `impression` showed, so an identical response doesn't resend it. */
|
|
1138
1144
|
private lastImpressionKey;
|
|
1139
1145
|
private readonly emitSubmit;
|
|
@@ -1380,6 +1386,14 @@ declare class AIAutocomplete {
|
|
|
1380
1386
|
private subscribeSkeletonMirror;
|
|
1381
1387
|
private subscribeNewParamTimer;
|
|
1382
1388
|
private handleChange;
|
|
1389
|
+
/** True while commitOnWordEnd is on and the user still types the last word. */
|
|
1390
|
+
private isWordOpen;
|
|
1391
|
+
private admitIdentified;
|
|
1392
|
+
/**
|
|
1393
|
+
* Ends the word the user is typing. Makes the chip for an exact match and
|
|
1394
|
+
* admits the held identified params. Returns true when it changed anything.
|
|
1395
|
+
*/
|
|
1396
|
+
private endTypedWord;
|
|
1383
1397
|
/**
|
|
1384
1398
|
* Opens the pending span on the first keystroke past covered text: there is
|
|
1385
1399
|
* unresolved trailing text beyond the covered offset (filterBase / last pill
|