@docsearch/react 4.0.0-beta.6 → 4.0.0-beta.7

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.
@@ -140,39 +140,97 @@ type DocSearchAskAi = {
140
140
  };
141
141
  };
142
142
  interface DocSearchProps {
143
+ /**
144
+ * Algolia application id used by the search client.
145
+ */
143
146
  appId: string;
147
+ /**
148
+ * Public api key with search permissions for the index.
149
+ */
144
150
  apiKey: string;
151
+ /**
152
+ * Name of the algolia index to query.
153
+ */
145
154
  indexName: string;
155
+ /**
156
+ * Configuration or assistant id to enable ask ai mode. Pass a string assistant id or a full config object.
157
+ */
146
158
  askAi?: DocSearchAskAi | string;
159
+ /**
160
+ * Theme overrides applied to the modal and related components.
161
+ */
147
162
  theme?: DocSearchTheme;
163
+ /**
164
+ * Placeholder text for the search input.
165
+ */
148
166
  placeholder?: string;
167
+ /**
168
+ * Additional algolia search parameters to merge into each query.
169
+ */
149
170
  searchParameters?: SearchParamsObject;
171
+ /**
172
+ * Maximum number of hits to display per source/group.
173
+ */
150
174
  maxResultsPerGroup?: number;
175
+ /**
176
+ * Hook to post-process hits before rendering.
177
+ */
151
178
  transformItems?: (items: DocSearchHit[]) => DocSearchHit[];
179
+ /**
180
+ * Custom component to render an individual hit.
181
+ */
152
182
  hitComponent?: (props: {
153
183
  hit: InternalDocSearchHit | StoredDocSearchHit;
154
184
  children: React.ReactNode;
155
185
  }) => JSX.Element;
186
+ /**
187
+ * Custom component rendered at the bottom of the results panel.
188
+ */
156
189
  resultsFooterComponent?: (props: {
157
190
  state: AutocompleteState<InternalDocSearchHit>;
158
191
  }) => JSX.Element | null;
192
+ /**
193
+ * Hook to wrap or modify the algolia search client.
194
+ */
159
195
  transformSearchClient?: (searchClient: DocSearchTransformClient) => DocSearchTransformClient;
196
+ /**
197
+ * Disable storage and usage of recent and favorite searches.
198
+ */
160
199
  disableUserPersonalization?: boolean;
200
+ /**
201
+ * Query string to prefill when opening the modal.
202
+ */
161
203
  initialQuery?: string;
204
+ /**
205
+ * Custom navigator for controlling link navigation.
206
+ */
162
207
  navigator?: AutocompleteOptions<InternalDocSearchHit>['navigator'];
208
+ /**
209
+ * Localized strings for the button and modal ui.
210
+ */
163
211
  translations?: DocSearchTranslations;
212
+ /**
213
+ * Builds a url to report missing results for a given query.
214
+ */
164
215
  getMissingResultsUrl?: ({ query }: {
165
216
  query: string;
166
217
  }) => string;
218
+ /**
219
+ * Insights client integration options to send analytics events.
220
+ */
167
221
  insights?: AutocompleteOptions<InternalDocSearchHit>['insights'];
168
222
  /**
169
- * Limit of how many recent searches that should be saved/displayed.
223
+ * The container element where the modal should be portaled to. Defaults to document.body.
224
+ */
225
+ portalContainer?: DocumentFragment | Element;
226
+ /**
227
+ * Limit of how many recent searches should be saved/displayed..
170
228
  *
171
229
  * @default 7
172
230
  */
173
231
  recentSearchesLimit?: number;
174
232
  /**
175
- * Limit of how many recent searches that should be saved/displayed when there are favorited searches.
233
+ * Limit of how many recent searches should be saved/displayed when there are favorited searches..
176
234
  *
177
235
  * @default 4
178
236
  */
@@ -309,6 +367,7 @@ interface UseDocSearchKeyboardEventsProps {
309
367
  }
310
368
  declare function useDocSearchKeyboardEvents({ isOpen, onOpen, onClose, onInput, isAskAiActive, onAskAiToggle, searchButtonRef, }: UseDocSearchKeyboardEventsProps): void;
311
369
 
312
- declare const version = "4.0.0-beta.6";
370
+ declare const version = "4.0.0-beta.7";
313
371
 
314
- export { type ButtonTranslations, DocSearch, type DocSearchAskAi, DocSearchButton, type DocSearchButtonProps, type DocSearchHit, DocSearchModal, type DocSearchModalProps, type DocSearchProps, type DocSearchState, type DocSearchTheme, type DocSearchTransformClient, type DocSearchTranslations, type InternalDocSearchHit, type ModalTranslations, type StoredAskAiMessage, type StoredAskAiState, type StoredDocSearchHit, type UseDocSearchKeyboardEventsProps, useDocSearchKeyboardEvents, version };
372
+ export { DocSearch, DocSearchButton, DocSearchModal, useDocSearchKeyboardEvents, version };
373
+ export type { ButtonTranslations, DocSearchAskAi, DocSearchButtonProps, DocSearchHit, DocSearchModalProps, DocSearchProps, DocSearchState, DocSearchTheme, DocSearchTransformClient, DocSearchTranslations, InternalDocSearchHit, ModalTranslations, StoredAskAiMessage, StoredAskAiState, StoredDocSearchHit, UseDocSearchKeyboardEventsProps };