@magicx-eng/ai-autocomplete-vanilla 0.2.1 → 0.3.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/dist/index.d.mts CHANGED
@@ -136,6 +136,12 @@ interface CoreInputState {
136
136
  * Set by selectOption / ReEditManager.selectOption, cleared by a timer.
137
137
  */
138
138
  inSelectionAnimation: boolean;
139
+ /**
140
+ * True once the user has pressed Tab to highlight a dropdown option. Drives
141
+ * the dropdown footer hint: "tab to select" before the first Tab, then
142
+ * "→ to skip" afterwards. Sticky until `reset()` clears it.
143
+ */
144
+ hasTabbedToHighlight: boolean;
139
145
  }
140
146
  /**
141
147
  * Derived fields recomputed from {@link CoreInputState} + {@link CoreOptions}.
@@ -415,6 +421,21 @@ interface BuildQueryResult {
415
421
  */
416
422
  declare function buildQuery(text: string, completedParams: CompletedParamState[]): BuildQueryResult;
417
423
 
424
+ /**
425
+ * The dropdown footer's keyboard hint has three states, in priority order:
426
+ * 1. an option is highlighted → "enter to proceed" (Enter commits it);
427
+ * 2. otherwise, the user has tabbed to highlight at some point → "→ to skip"
428
+ * (the right arrow skips the active pill);
429
+ * 3. otherwise (fresh) → "tab to select".
430
+ *
431
+ * Pure computation — no DOM access. Shared by the vanilla renderer and the
432
+ * React / Angular footer components so the wording can't drift between them.
433
+ */
434
+ declare function getFooterHint(hasTabbedToHighlight: boolean, optionHighlighted: boolean): {
435
+ key: string;
436
+ hint: string;
437
+ };
438
+
418
439
  declare class ModeController {
419
440
  private container;
420
441
  private mode;
@@ -429,4 +450,4 @@ declare class ModeController {
429
450
  private detachListener;
430
451
  }
431
452
 
432
- export { AIAutocomplete, type APIConfig, type APIKeyConfig, type AccessTokenConfig, type AccessTokenResult, type AppearanceMode, type AutocompleteRequest, type AutocompleteResponse, type AutocompleteResult, type CompletedParam, type CompletedParamState, type CoreOptions, type CoreState, type InputItem, ModeController, type OptionOverrides, type RenderMode, type Segment, type Store, type Suggestion, type SuggestionOption, type TaskKind, buildQuery, createStore, cursorIsAtEnd, extractPlainText, getCursorOffset, plainTextLength, previousGraphemeBoundary, renderEditableContent, setCursorOffset };
453
+ export { AIAutocomplete, type APIConfig, type APIKeyConfig, type AccessTokenConfig, type AccessTokenResult, type AppearanceMode, type AutocompleteRequest, type AutocompleteResponse, type AutocompleteResult, type CompletedParam, type CompletedParamState, type CoreOptions, type CoreState, type InputItem, ModeController, type OptionOverrides, type RenderMode, type Segment, type Store, type Suggestion, type SuggestionOption, type TaskKind, buildQuery, createStore, cursorIsAtEnd, extractPlainText, getCursorOffset, getFooterHint, plainTextLength, previousGraphemeBoundary, renderEditableContent, setCursorOffset };
package/dist/index.d.ts CHANGED
@@ -136,6 +136,12 @@ interface CoreInputState {
136
136
  * Set by selectOption / ReEditManager.selectOption, cleared by a timer.
137
137
  */
138
138
  inSelectionAnimation: boolean;
139
+ /**
140
+ * True once the user has pressed Tab to highlight a dropdown option. Drives
141
+ * the dropdown footer hint: "tab to select" before the first Tab, then
142
+ * "→ to skip" afterwards. Sticky until `reset()` clears it.
143
+ */
144
+ hasTabbedToHighlight: boolean;
139
145
  }
140
146
  /**
141
147
  * Derived fields recomputed from {@link CoreInputState} + {@link CoreOptions}.
@@ -415,6 +421,21 @@ interface BuildQueryResult {
415
421
  */
416
422
  declare function buildQuery(text: string, completedParams: CompletedParamState[]): BuildQueryResult;
417
423
 
424
+ /**
425
+ * The dropdown footer's keyboard hint has three states, in priority order:
426
+ * 1. an option is highlighted → "enter to proceed" (Enter commits it);
427
+ * 2. otherwise, the user has tabbed to highlight at some point → "→ to skip"
428
+ * (the right arrow skips the active pill);
429
+ * 3. otherwise (fresh) → "tab to select".
430
+ *
431
+ * Pure computation — no DOM access. Shared by the vanilla renderer and the
432
+ * React / Angular footer components so the wording can't drift between them.
433
+ */
434
+ declare function getFooterHint(hasTabbedToHighlight: boolean, optionHighlighted: boolean): {
435
+ key: string;
436
+ hint: string;
437
+ };
438
+
418
439
  declare class ModeController {
419
440
  private container;
420
441
  private mode;
@@ -429,4 +450,4 @@ declare class ModeController {
429
450
  private detachListener;
430
451
  }
431
452
 
432
- export { AIAutocomplete, type APIConfig, type APIKeyConfig, type AccessTokenConfig, type AccessTokenResult, type AppearanceMode, type AutocompleteRequest, type AutocompleteResponse, type AutocompleteResult, type CompletedParam, type CompletedParamState, type CoreOptions, type CoreState, type InputItem, ModeController, type OptionOverrides, type RenderMode, type Segment, type Store, type Suggestion, type SuggestionOption, type TaskKind, buildQuery, createStore, cursorIsAtEnd, extractPlainText, getCursorOffset, plainTextLength, previousGraphemeBoundary, renderEditableContent, setCursorOffset };
453
+ export { AIAutocomplete, type APIConfig, type APIKeyConfig, type AccessTokenConfig, type AccessTokenResult, type AppearanceMode, type AutocompleteRequest, type AutocompleteResponse, type AutocompleteResult, type CompletedParam, type CompletedParamState, type CoreOptions, type CoreState, type InputItem, ModeController, type OptionOverrides, type RenderMode, type Segment, type Store, type Suggestion, type SuggestionOption, type TaskKind, buildQuery, createStore, cursorIsAtEnd, extractPlainText, getCursorOffset, getFooterHint, plainTextLength, previousGraphemeBoundary, renderEditableContent, setCursorOffset };