@magicx-eng/ai-autocomplete-react 0.48.0 → 0.48.1
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 +4 -1
- package/dist/index.d.ts +4 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -512,7 +512,7 @@ Pressing <kbd>→</kbd> at the end of the input dismisses the active pill. The d
|
|
|
512
512
|
{ placeholder: "", parameter: "goal", text: "skipped", kind: null }
|
|
513
513
|
```
|
|
514
514
|
|
|
515
|
-
Tier 2 consumers who build their own submit payload get the raw skips from the hook as `skippedParams`, and can fold them in the same way with the exported `buildSubmitResult(text, completedParams, skippedParams, { identifiedParams, isReady })` — the last argument carries the hook's `identifiedParams` and `isReady` so a hand-rolled submit reports the same `identified_params` and `is_ready` the SDK's own results do.
|
|
515
|
+
Tier 2 consumers who build their own submit payload get the raw skips from the hook as `skippedParams`, and can fold them in the same way with the exported `buildSubmitResult(text, completedParams, skippedParams, { identifiedParams, isReady })` — the last argument carries the hook's `identifiedParams` and `isReady` so a hand-rolled submit reports the same `identified_params` and `is_ready` the SDK's own results do. Call `prepareSubmit()` first, then pass `getState().identifiedParams` and `getState().isReady` (not the hook's render-time values): a typed value with no pill yet joins `identifiedParams` only in that call.
|
|
516
516
|
|
|
517
517
|
> **Reading `skippedParams` directly:** the array is append-only until `reset()`. The "drop a skip whose parameter got filled" rule is applied when the payload is built, not by pruning the array — so if the user skips `goal` and later fills one, the raw array still holds the `goal` entry. That's deliberate: the filter self-heals if they then delete that param's text, where pruning would discard the signal for good. `buildSubmitResult` applies the rule for you; to apply it elsewhere (say, a "you skipped X" badge), use the exported `withSkippedParams(completedParams, skippedParams)`.
|
|
518
518
|
|
package/dist/index.d.mts
CHANGED
|
@@ -430,7 +430,10 @@ interface UseAIAutocompleteReturn {
|
|
|
430
430
|
* Does nothing without mapProducts or with a custom products integration.
|
|
431
431
|
*/
|
|
432
432
|
refreshProducts: () => void;
|
|
433
|
-
/**
|
|
433
|
+
/**
|
|
434
|
+
* Prepare the typed word before you build a submit result from your own button.
|
|
435
|
+
* A typed value with no pill yet joins `identifiedParams` only in this call. Read `getState()` after it.
|
|
436
|
+
*/
|
|
434
437
|
prepareSubmit: () => void;
|
|
435
438
|
/** Read the current state, including changes from prepareSubmit(). */
|
|
436
439
|
getState: () => CoreState;
|
package/dist/index.d.ts
CHANGED
|
@@ -430,7 +430,10 @@ interface UseAIAutocompleteReturn {
|
|
|
430
430
|
* Does nothing without mapProducts or with a custom products integration.
|
|
431
431
|
*/
|
|
432
432
|
refreshProducts: () => void;
|
|
433
|
-
/**
|
|
433
|
+
/**
|
|
434
|
+
* Prepare the typed word before you build a submit result from your own button.
|
|
435
|
+
* A typed value with no pill yet joins `identifiedParams` only in this call. Read `getState()` after it.
|
|
436
|
+
*/
|
|
434
437
|
prepareSubmit: () => void;
|
|
435
438
|
/** Read the current state, including changes from prepareSubmit(). */
|
|
436
439
|
getState: () => CoreState;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magicx-eng/ai-autocomplete-react",
|
|
3
|
-
"version": "0.48.
|
|
3
|
+
"version": "0.48.1",
|
|
4
4
|
"description": "AI Autocomplete for React: add real-time AI suggestions to any text box and guide users to what your product can do, across search, commerce, agents, and more. Drop-in component or dropdown + hook.",
|
|
5
5
|
"homepage": "https://ai-autocomplete.com/docs/react/getting-started",
|
|
6
6
|
"bugs": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"react-dom": ">=17.0.0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@magicx-eng/ai-autocomplete-vanilla": "0.58.
|
|
37
|
+
"@magicx-eng/ai-autocomplete-vanilla": "0.58.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@figma/code-connect": "^1.4.7",
|