mobx-view-model-devtools 0.0.41 → 0.0.43

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/index.d.ts CHANGED
@@ -6,7 +6,7 @@ import { VirtualizerHandle } from 'virtua';
6
6
  import { Ref } from 'yummies/mobx';
7
7
  import { AnyObject, Maybe, Defined } from 'yummies/types';
8
8
  import { KeyboardHandler as KeyboardHandler$1, KeyboardHandlerAction } from 'mobx-swiss-knife';
9
- import { ComponentType, ChangeEventHandler, ChangeEvent, KeyboardEvent } from 'react';
9
+ import { ComponentType, ChangeEventHandler, ChangeEvent, FocusEvent, KeyboardEvent } from 'react';
10
10
 
11
11
  declare class KeyboardHandler extends KeyboardHandler$1<KeyboardHandlerAction> {
12
12
  constructor(devtools: ViewModelDevtools);
@@ -97,12 +97,25 @@ interface SearchEngineConfig {
97
97
  getRootItems: () => ListItem<any>[];
98
98
  getPresentationMode: () => 'tree' | 'list';
99
99
  }
100
+ interface SearchSuggestion {
101
+ value: string;
102
+ suffix: string;
103
+ vmName: string;
104
+ }
100
105
  declare class SearchEngine {
101
106
  private config;
102
107
  searchInputRef: FocusableRef<HTMLInputElement>;
103
108
  searchText: string;
109
+ searchTextToSearch: string;
110
+ selectedSuggestionIndex: number;
111
+ isSearchInputFocused: boolean;
112
+ isSuggestionsDismissed: boolean;
104
113
  searchCacheKey: string;
105
114
  isSearching: boolean;
115
+ private searchTextToSearchTimeout;
116
+ private scrollToSearchMatchTimeout;
117
+ private static readonly searchDebounceMs;
118
+ private static readonly itemHeight;
106
119
  get formattedSearchText(): string;
107
120
  /**
108
121
  * Сегменты поиска, разбитые по точке.
@@ -110,15 +123,28 @@ declare class SearchEngine {
110
123
  */
111
124
  get segments(): string[];
112
125
  get endsWithDot(): boolean;
126
+ get isNestedSearch(): boolean;
113
127
  get isActive(): boolean;
128
+ get isSearchTextDebouncing(): boolean;
129
+ get shouldShowSuggestions(): boolean;
130
+ get suggestionItems(): SearchSuggestion[];
131
+ get selectedSuggestion(): SearchSuggestion | null;
114
132
  /**
115
- * Суффикс первого найденного свойства, которое начинается с последнего сегмента.
133
+ * Суффикс выбранного свойства, которое начинается с последнего сегмента.
116
134
  * Отображается как серая подсказка в инпуте.
117
135
  * Например: ввод "_pay" → suggestionSuffix = "load" (от "_payload")
118
136
  */
119
137
  get suggestionSuffix(): string;
138
+ applySuggestion: (suggestion: SearchSuggestion) => void;
120
139
  handleSearchInput: (e: ChangeEvent<HTMLInputElement>) => void;
140
+ handleSearchInputFocus: (_e: FocusEvent<HTMLInputElement>) => void;
141
+ handleSearchInputBlur: (_e: FocusEvent<HTMLInputElement>) => void;
121
142
  handleKeyDown: (e: KeyboardEvent<HTMLInputElement>) => void;
143
+ private clearSearchDebounce;
144
+ private scheduleSearchTextDebounce;
145
+ private scheduleScrollToFirstSearchMatch;
146
+ private scrollToFirstSearchMatch;
147
+ private scrollSimpleBarToOffset;
122
148
  /**
123
149
  * Рекурсивно собирает все VMListItem из дерева (включая вложенные).
124
150
  */
@@ -128,6 +154,16 @@ declare class SearchEngine {
128
154
  * pathSegments — все сегменты кроме последнего (путь навигации).
129
155
  */
130
156
  private getCandidatePropsAtDepth;
157
+ private getOwnerMatchedPathCandidates;
158
+ private getPropertyPathCandidates;
159
+ private getDirectPropertyChildren;
160
+ /**
161
+ * Уже введённый path-сегмент должен совпадать строго:
162
+ * `product.` заходит только в `product`, а не в `productAsyncTasks`
163
+ * или `serviceAndProductSearch`.
164
+ */
165
+ private getPathMatchingProps;
166
+ private getOwnerVMName;
131
167
  /**
132
168
  * Навигация вглубь по цепочке свойств.
133
169
  * Возвращает свойства на нужной глубине.
@@ -140,6 +176,7 @@ declare class SearchEngine {
140
176
  private getFlatListItems;
141
177
  getListItems(rootItems: ListItem<any>[]): ListItem<any>[];
142
178
  private getFilteredItemsForSearch;
179
+ private getExtraSearchItems;
143
180
  private getVMSearchItems;
144
181
  /**
145
182
  * Рекурсивно строит плоский список PropertyListItem для отображения.
@@ -154,6 +191,9 @@ declare class SearchEngine {
154
191
  isPropertyItemExpanded(item: PropertyListItem): boolean;
155
192
  isPropertyItemExpandable(item: PropertyListItem): boolean;
156
193
  isVmItemExpanded(item: VMListItem): boolean;
194
+ private isSearchTargetMatched;
195
+ private isVMSearchTargetMatched;
196
+ private isPropertySearchTargetMatched;
157
197
  /**
158
198
  * Определяет, должен ли элемент отображаться «нормально» (true)
159
199
  * или «затемнённо» (false — серым).
@@ -165,7 +205,14 @@ declare class SearchEngine {
165
205
  * элемент находится в «несовпадающей ветке» и тоже должен быть серым.
166
206
  */
167
207
  isItemFitted(item: ListItem<any>): boolean;
208
+ /**
209
+ * Для path-сегмента exact-match важнее includes.
210
+ * Если среди соседей есть `product`, то `product.` должен подсветить только
211
+ * `product`, а не `serviceAndProductSearch`.
212
+ */
213
+ private isPropertyFittedToSegment;
168
214
  resetSearch: () => void;
215
+ focusInput: () => void;
169
216
  constructor(config: SearchEngineConfig);
170
217
  }
171
218