@docsearch/react 4.4.0 → 4.5.0-beta.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/dist/esm/DocSearchButton.js +1 -1
- package/dist/esm/DocSearchModal.d.ts +21 -3
- package/dist/esm/DocSearchModal.js +1 -1
- package/dist/esm/Sidepanel.d.ts +96 -20
- package/dist/esm/Sidepanel.js +1 -1
- package/dist/esm/index.d.ts +54 -10
- package/dist/esm/index.js +2 -2
- package/dist/esm/useDocSearchKeyboardEvents.d.ts +12 -2
- package/dist/esm/useDocSearchKeyboardEvents.js +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/umd/DocSearchModal.js +3 -3
- package/dist/umd/DocSearchModal.js.map +1 -1
- package/dist/umd/DocsearchButton.js +2 -2
- package/dist/umd/DocsearchButton.js.map +1 -1
- package/dist/umd/Sidepanel.js +2 -2
- package/dist/umd/Sidepanel.js.map +1 -1
- package/dist/umd/index.js +3 -3
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/useDocSearchKeyboardEvents.js +2 -2
- package/dist/umd/useDocSearchKeyboardEvents.js.map +1 -1
- package/dist/umd/useTheme.js +1 -1
- package/dist/umd/version.js +2 -2
- package/dist/umd/version.js.map +1 -1
- package/package.json +10 -10
package/dist/esm/Sidepanel.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { SidepanelShortcuts, InitialAskAiMessage, DocSearchTheme } from '@docsearch/core';
|
|
1
|
+
import { SidepanelShortcuts, InitialAskAiMessage, DocSearchCallbacks, DocSearchTheme, DocSearchRef } from '@docsearch/core';
|
|
2
|
+
export { DocSearchCallbacks, DocSearchRef } from '@docsearch/core';
|
|
2
3
|
import React, { JSX } from 'react';
|
|
3
4
|
|
|
4
5
|
type AskAiSearchParameters = {
|
|
@@ -13,19 +14,7 @@ type AlgoliaLogoTranslations = Partial<{
|
|
|
13
14
|
poweredByText: string;
|
|
14
15
|
}>;
|
|
15
16
|
|
|
16
|
-
type
|
|
17
|
-
/**
|
|
18
|
-
* Text shown as an LLM disclaimer.
|
|
19
|
-
*/
|
|
20
|
-
conversationDisclaimer: string;
|
|
21
|
-
/**
|
|
22
|
-
* Text shown while assistant is reasoning.
|
|
23
|
-
*/
|
|
24
|
-
reasoningText: string;
|
|
25
|
-
/**
|
|
26
|
-
* Text show while assistant is thinking.
|
|
27
|
-
*/
|
|
28
|
-
thinkingText: string;
|
|
17
|
+
type ToolCallTranslations = {
|
|
29
18
|
/**
|
|
30
19
|
* Text shown while assistant is preparing tool call.
|
|
31
20
|
*/
|
|
@@ -38,6 +27,21 @@ type ConversationScreenTranslations = Partial<{
|
|
|
38
27
|
* Text shown while assistant is finished performing tool call.
|
|
39
28
|
*/
|
|
40
29
|
toolCallResultText: string;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
type ConversationScreenTranslations = Partial<ToolCallTranslations & {
|
|
33
|
+
/**
|
|
34
|
+
* Text shown as an LLM disclaimer.
|
|
35
|
+
*/
|
|
36
|
+
conversationDisclaimer: string;
|
|
37
|
+
/**
|
|
38
|
+
* Text shown while assistant is reasoning.
|
|
39
|
+
*/
|
|
40
|
+
reasoningText: string;
|
|
41
|
+
/**
|
|
42
|
+
* Text show while assistant is thinking.
|
|
43
|
+
*/
|
|
44
|
+
thinkingText: string;
|
|
41
45
|
/**
|
|
42
46
|
* Text shown describing related sources.
|
|
43
47
|
*/
|
|
@@ -122,6 +126,19 @@ type HeaderTranslations = Partial<{
|
|
|
122
126
|
viewConversationHistoryText: string;
|
|
123
127
|
}>;
|
|
124
128
|
|
|
129
|
+
/**
|
|
130
|
+
* Imperative handle exposed by the Sidepanel component for programmatic control.
|
|
131
|
+
*/
|
|
132
|
+
interface SidepanelRef {
|
|
133
|
+
/** Opens the sidepanel. */
|
|
134
|
+
open: () => void;
|
|
135
|
+
/** Closes the sidepanel. */
|
|
136
|
+
close: () => void;
|
|
137
|
+
/** Returns true once the component is mounted and ready. */
|
|
138
|
+
readonly isReady: boolean;
|
|
139
|
+
/** Returns true if the sidepanel is currently open. */
|
|
140
|
+
readonly isOpen: boolean;
|
|
141
|
+
}
|
|
125
142
|
type SidepanelTranslations = Partial<{
|
|
126
143
|
/**
|
|
127
144
|
* Translation texts for the Sidepanel header.
|
|
@@ -200,14 +217,14 @@ type SidepanelProps = {
|
|
|
200
217
|
* @default `{ 'Ctrl/Cmd+I': true }`
|
|
201
218
|
*/
|
|
202
219
|
keyboardShortcuts?: SidepanelShortcuts;
|
|
220
|
+
useStagingEnv?: boolean;
|
|
203
221
|
};
|
|
204
|
-
|
|
222
|
+
declare const Sidepanel: React.ForwardRefExoticComponent<Omit<DocSearchSidepanelProps, "button" | "panel"> & SidepanelProps & {
|
|
205
223
|
isOpen?: boolean;
|
|
206
224
|
onOpen: () => void;
|
|
207
225
|
onClose: () => void;
|
|
208
226
|
initialMessage?: InitialAskAiMessage;
|
|
209
|
-
}
|
|
210
|
-
declare const Sidepanel: ({ isOpen, onOpen, onClose, assistantId, apiKey, appId, indexName, variant, searchParameters, pushSelector, width, expandedWidth, suggestedQuestions: suggestedQuestionsEnabled, translations, keyboardShortcuts, side, initialMessage, }: Props$1) => JSX.Element;
|
|
227
|
+
} & React.RefAttributes<SidepanelRef>>;
|
|
211
228
|
|
|
212
229
|
type SidepanelButtonTranslations = Partial<{
|
|
213
230
|
/**
|
|
@@ -248,7 +265,7 @@ type SidepanelButtonProps = {
|
|
|
248
265
|
type Props = React.ComponentProps<'button'> & SidepanelButtonProps;
|
|
249
266
|
declare const SidepanelButton: ({ variant, keyboardShortcuts, translations, ...props }: Props) => JSX.Element;
|
|
250
267
|
|
|
251
|
-
type DocSearchSidepanelProps = {
|
|
268
|
+
type DocSearchSidepanelProps = DocSearchCallbacks & {
|
|
252
269
|
/**
|
|
253
270
|
* The assistant ID to use for the ask AI feature.
|
|
254
271
|
*/
|
|
@@ -289,8 +306,67 @@ type DocSearchSidepanelProps = {
|
|
|
289
306
|
* Props specific to the Sidepanel panel.
|
|
290
307
|
*/
|
|
291
308
|
panel?: Omit<SidepanelProps, 'keyboardShortcuts'>;
|
|
309
|
+
/**
|
|
310
|
+
* **Experimental:** Whether to use Agent Studio as the chat backend.
|
|
311
|
+
*
|
|
312
|
+
* This is an experimental feature and its API may change without notice in future releases.
|
|
313
|
+
* Use with caution in production environments.
|
|
314
|
+
*
|
|
315
|
+
* @default false
|
|
316
|
+
*/
|
|
317
|
+
agentStudio?: boolean;
|
|
292
318
|
};
|
|
293
|
-
declare
|
|
319
|
+
declare const DocSearchSidepanel: React.ForwardRefExoticComponent<DocSearchCallbacks & {
|
|
320
|
+
/**
|
|
321
|
+
* The assistant ID to use for the ask AI feature.
|
|
322
|
+
*/
|
|
323
|
+
assistantId: string;
|
|
324
|
+
/**
|
|
325
|
+
* Public api key with search permissions for the index.
|
|
326
|
+
*/
|
|
327
|
+
apiKey: string;
|
|
328
|
+
/**
|
|
329
|
+
* Algolia application id used by the search client.
|
|
330
|
+
*/
|
|
331
|
+
appId: string;
|
|
332
|
+
/**
|
|
333
|
+
* The index name to use for the ask AI feature. Your assistant will search this index for relevant documents.
|
|
334
|
+
*/
|
|
335
|
+
indexName: string;
|
|
336
|
+
/**
|
|
337
|
+
* The search parameters to use for the ask AI feature.
|
|
338
|
+
*/
|
|
339
|
+
searchParameters?: AskAiSearchParameters;
|
|
340
|
+
/**
|
|
341
|
+
* Configuration for keyboard shortcuts. Allows enabling/disabling specific shortcuts.
|
|
342
|
+
*
|
|
343
|
+
* @default `{ 'Ctrl/Cmd+I': true }`
|
|
344
|
+
*/
|
|
345
|
+
keyboardShortcuts?: SidepanelShortcuts;
|
|
346
|
+
/**
|
|
347
|
+
* Theme overrides applied to the Sidepanel button and panel.
|
|
348
|
+
*
|
|
349
|
+
* @default 'light'
|
|
350
|
+
*/
|
|
351
|
+
theme?: DocSearchTheme;
|
|
352
|
+
/**
|
|
353
|
+
* Props specific to the Sidepanel button.
|
|
354
|
+
*/
|
|
355
|
+
button?: Omit<SidepanelButtonProps, "keyboardShortcuts">;
|
|
356
|
+
/**
|
|
357
|
+
* Props specific to the Sidepanel panel.
|
|
358
|
+
*/
|
|
359
|
+
panel?: Omit<SidepanelProps, "keyboardShortcuts">;
|
|
360
|
+
/**
|
|
361
|
+
* **Experimental:** Whether to use Agent Studio as the chat backend.
|
|
362
|
+
*
|
|
363
|
+
* This is an experimental feature and its API may change without notice in future releases.
|
|
364
|
+
* Use with caution in production environments.
|
|
365
|
+
*
|
|
366
|
+
* @default false
|
|
367
|
+
*/
|
|
368
|
+
agentStudio?: boolean;
|
|
369
|
+
} & React.RefAttributes<DocSearchRef>>;
|
|
294
370
|
|
|
295
371
|
export { DocSearchSidepanel, Sidepanel, SidepanelButton };
|
|
296
|
-
export type { ButtonVariant, DocSearchSidepanelProps, SidepanelButtonProps, SidepanelButtonTranslations, SidepanelProps, SidepanelTranslations };
|
|
372
|
+
export type { ButtonVariant, DocSearchSidepanelProps, SidepanelButtonProps, SidepanelButtonTranslations, SidepanelProps, SidepanelRef, SidepanelTranslations };
|