@docsearch/react 4.7.0 → 5.0.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/README.md +0 -2
- package/dist/esm/AskAiScreenState-CRHicWbN.d.ts +106 -0
- package/dist/esm/DocSearch-HJsNvtZr.d.ts +295 -0
- package/dist/esm/DocSearchAskAiModal-B7vpLudE.d.ts +48 -0
- package/dist/esm/DocSearchAskAiModal-KaA6fBV4.js +954 -0
- package/dist/esm/DocSearchAskAiModal-KaA6fBV4.js.map +1 -0
- package/dist/esm/DocSearchButton-CZM_jACU.d.ts +18 -0
- package/dist/esm/DocSearchButton-CaxxOzQU.js +71 -0
- package/dist/esm/DocSearchButton-CaxxOzQU.js.map +1 -0
- package/dist/esm/DocSearchModal-CpvDjo1O.js +250 -0
- package/dist/esm/DocSearchModal-CpvDjo1O.js.map +1 -0
- package/dist/esm/DocSearchTheme-DvL4mf0D.d.ts +5 -0
- package/dist/esm/askaiModal.d.ts +2 -0
- package/dist/esm/askaiModal.js +3 -0
- package/dist/esm/button.d.ts +2 -0
- package/dist/esm/button.js +3 -0
- package/dist/esm/docsearchAi.d.ts +220 -0
- package/dist/esm/docsearchAi.js +34 -0
- package/dist/esm/docsearchAi.js.map +1 -0
- package/dist/esm/index-Bqqv4HmN.d.ts +233 -0
- package/dist/esm/index.d.ts +9 -657
- package/dist/esm/index.js +35 -3
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/keyboard-BkSdCzTU.js +9 -0
- package/dist/esm/keyboard-BkSdCzTU.js.map +1 -0
- package/dist/esm/keyboardShortcuts-C-lx6Xt7.js +25 -0
- package/dist/esm/keyboardShortcuts-C-lx6Xt7.js.map +1 -0
- package/dist/esm/modal.d.ts +2 -0
- package/dist/esm/modal.js +3 -0
- package/dist/esm/normalizeDocSearchIndexes-DAzlMybx.js +1240 -0
- package/dist/esm/normalizeDocSearchIndexes-DAzlMybx.js.map +1 -0
- package/dist/esm/objectSpread2-BNmiQYyW.js +67 -0
- package/dist/esm/objectWithoutProperties-phqYxDS0.js +53 -0
- package/dist/esm/objectWithoutProperties-phqYxDS0.js.map +1 -0
- package/dist/esm/sidepanel.d.ts +395 -0
- package/dist/esm/sidepanel.js +773 -0
- package/dist/esm/sidepanel.js.map +1 -0
- package/dist/esm/useDocSearchKeyboardEvents-u23fFhR9.d.ts +43 -0
- package/dist/esm/useDocSearchKeyboardEvents.d.ts +2 -41
- package/dist/esm/useDocSearchKeyboardEvents.js +43 -1
- package/dist/esm/useDocSearchKeyboardEvents.js.map +1 -0
- package/dist/esm/useSearchClient-mIHVB6ga.js +433 -0
- package/dist/esm/useSearchClient-mIHVB6ga.js.map +1 -0
- package/dist/esm/useSuggestedQuestions-CG2H3qm4.js +1116 -0
- package/dist/esm/useSuggestedQuestions-CG2H3qm4.js.map +1 -0
- package/dist/esm/useTheme.d.ts +7 -6
- package/dist/esm/useTheme.js +21 -1
- package/dist/esm/useTheme.js.map +1 -0
- package/dist/esm/version.d.ts +4 -2
- package/dist/esm/version.js +6 -1
- package/dist/esm/version.js.map +1 -0
- package/dist/umd/index.js +175 -5
- package/dist/umd/index.js.map +1 -1
- package/package.json +31 -34
- package/style/askai.js +1 -0
- package/button.js +0 -1
- package/dist/esm/DocSearchButton.d.ts +0 -18
- package/dist/esm/DocSearchButton.js +0 -1
- package/dist/esm/DocSearchModal.d.ts +0 -446
- package/dist/esm/DocSearchModal.js +0 -3
- package/dist/esm/Sidepanel.d.ts +0 -371
- package/dist/esm/Sidepanel.js +0 -3
- package/dist/umd/DocSearchModal.js +0 -5
- package/dist/umd/DocSearchModal.js.map +0 -1
- package/dist/umd/DocsearchButton.js +0 -3
- package/dist/umd/DocsearchButton.js.map +0 -1
- package/dist/umd/Sidepanel.js +0 -5
- package/dist/umd/Sidepanel.js.map +0 -1
- package/dist/umd/useDocSearchKeyboardEvents.js +0 -3
- package/dist/umd/useDocSearchKeyboardEvents.js.map +0 -1
- package/dist/umd/useTheme.js +0 -3
- package/dist/umd/useTheme.js.map +0 -1
- package/dist/umd/version.js +0 -3
- package/dist/umd/version.js.map +0 -1
- package/modal.js +0 -1
- package/sidepanel.js +0 -1
- package/useDocSearchKeyboardEvents.js +0 -1
- package/useTheme.js +0 -1
- package/version.js +0 -1
package/README.md
CHANGED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import "./index-Bqqv4HmN.js";
|
|
2
|
+
import { f as ResultsScreenTranslations, h as StoredSearchesSectionsTranslations, m as ErrorScreenTranslations, p as NoResultsScreenTranslations } from "./DocSearch-HJsNvtZr.js";
|
|
3
|
+
import React, { JSX } from "react";
|
|
4
|
+
import { AutocompleteState, BaseItem } from "@algolia/autocomplete-core";
|
|
5
|
+
import "@ai-sdk/react";
|
|
6
|
+
//#region src/components/ToolCall.d.ts
|
|
7
|
+
type ToolCallTranslations = {
|
|
8
|
+
/** Text shown while assistant is preparing tool call. */
|
|
9
|
+
preToolCallText: string;
|
|
10
|
+
/** Text shown while assistant is performing search tool call. */
|
|
11
|
+
searchingText: string;
|
|
12
|
+
/** Text shown while assistant is finished performing tool call. */
|
|
13
|
+
toolCallResultText: string;
|
|
14
|
+
/** Text shown when the agent saved related information to memory. */
|
|
15
|
+
savedMemoryToolResultText: string;
|
|
16
|
+
/** Text shown when the agent used the memory tool to enhance results. */
|
|
17
|
+
memoryToolResultText: string;
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/AskAiScreen.d.ts
|
|
21
|
+
type AskAiScreenTranslations = Partial<Omit<ToolCallTranslations, 'searchingText' | 'toolCallResultText'> & {
|
|
22
|
+
disclaimerText: string;
|
|
23
|
+
relatedSourcesText: string;
|
|
24
|
+
thinkingText: string;
|
|
25
|
+
copyButtonText: string;
|
|
26
|
+
copyButtonCopiedText: string;
|
|
27
|
+
copyButtonTitle: string;
|
|
28
|
+
likeButtonTitle: string;
|
|
29
|
+
dislikeButtonTitle: string;
|
|
30
|
+
thanksForFeedbackText: string;
|
|
31
|
+
feedbackPanelTitle: string;
|
|
32
|
+
feedbackDetailsPlaceholder: string;
|
|
33
|
+
feedbackDisclaimerText: string;
|
|
34
|
+
feedbackSubmitButtonText: string;
|
|
35
|
+
feedbackCloseButtonTitle: string;
|
|
36
|
+
feedbackTagIncorrect: string;
|
|
37
|
+
feedbackTagNotWhatIAsked: string;
|
|
38
|
+
feedbackTagSlowOrBuggy: string;
|
|
39
|
+
feedbackTagStyleOrTone: string;
|
|
40
|
+
feedbackTagSafetyOrLegal: string;
|
|
41
|
+
feedbackTagOther: string;
|
|
42
|
+
/**
|
|
43
|
+
* Text shown while assistant is performing search tool call. Maps to
|
|
44
|
+
* `ToolCallTranslations.searchingText`.
|
|
45
|
+
*/
|
|
46
|
+
duringToolCallText: string;
|
|
47
|
+
/**
|
|
48
|
+
* Text shown while assistant is finished performing tool call. Maps to
|
|
49
|
+
* `ToolCallTranslations.toolCallResultText`.
|
|
50
|
+
*/
|
|
51
|
+
afterToolCallText: string;
|
|
52
|
+
/**
|
|
53
|
+
* Build the full jsx element for the aggregated search block. If provided,
|
|
54
|
+
* completely overrides the default english renderer.
|
|
55
|
+
*/
|
|
56
|
+
aggregatedToolCallNode?: (queries: string[], onSearchQueryClick: (query: string) => void) => React.ReactNode;
|
|
57
|
+
/**
|
|
58
|
+
* Generate the list connective parts only (backwards compatibility).
|
|
59
|
+
* Receives full list of queries and should return translation parts for
|
|
60
|
+
* before/after/separators. Example: (qs) => ({ before: 'searched for ',
|
|
61
|
+
* separator: ', ', lastSeparator: ' and ', after: '' }).
|
|
62
|
+
*/
|
|
63
|
+
aggregatedToolCallText?: (queries: string[]) => {
|
|
64
|
+
before?: string;
|
|
65
|
+
separator?: string;
|
|
66
|
+
lastSeparator?: string;
|
|
67
|
+
after?: string;
|
|
68
|
+
};
|
|
69
|
+
/** Message that's shown when user has stopped the streaming of a message. */
|
|
70
|
+
stoppedStreamingText: string;
|
|
71
|
+
/** Error title shown if there is an error while chatting. */
|
|
72
|
+
errorTitleText: string;
|
|
73
|
+
/** Message shown when thread depth limit is exceeded (AI-217 error). */
|
|
74
|
+
threadDepthExceededMessage: string;
|
|
75
|
+
/** Button text for starting a new conversation after thread depth error. */
|
|
76
|
+
startNewConversationButtonText: string;
|
|
77
|
+
suggestedPromptsTitleText: string;
|
|
78
|
+
}>;
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/components/ui/RecentConversationsResults.d.ts
|
|
81
|
+
type RecentConversationsResultsTranslations = Partial<{
|
|
82
|
+
recentConversationsTitle: string;
|
|
83
|
+
removeRecentConversationButtonTitle: string;
|
|
84
|
+
}>;
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region src/components/AskAiStartScreen.d.ts
|
|
87
|
+
type AskAiStartScreenTranslations = RecentConversationsResultsTranslations & StoredSearchesSectionsTranslations;
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/NewConversationScreen.d.ts
|
|
90
|
+
type NewConversationTranslations = Partial<{
|
|
91
|
+
newConversationTitle: string;
|
|
92
|
+
newConversationDescription: string;
|
|
93
|
+
}>;
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region src/AskAiScreenState.d.ts
|
|
96
|
+
type AskAiScreenStateTranslations = Partial<{
|
|
97
|
+
errorScreen: ErrorScreenTranslations;
|
|
98
|
+
startScreen: AskAiStartScreenTranslations;
|
|
99
|
+
noResultsScreen: NoResultsScreenTranslations;
|
|
100
|
+
resultsScreen: ResultsScreenTranslations;
|
|
101
|
+
askAiScreen: AskAiScreenTranslations;
|
|
102
|
+
newConversation: NewConversationTranslations;
|
|
103
|
+
}>;
|
|
104
|
+
//#endregion
|
|
105
|
+
export { NewConversationTranslations as n, ToolCallTranslations as r, AskAiScreenStateTranslations as t };
|
|
106
|
+
//# sourceMappingURL=AskAiScreenState-CRHicWbN.d.ts.map
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { a as StoredDocSearchHit, d as DocSearchHit } from "./index-Bqqv4HmN.js";
|
|
2
|
+
import { t as DocSearchTheme$1 } from "./DocSearchTheme-DvL4mf0D.js";
|
|
3
|
+
import { t as ButtonTranslations } from "./DocSearchButton-CZM_jACU.js";
|
|
4
|
+
import { DocSearchModalShortcuts, DocSearchRef, DocSearchRef as DocSearchRef$1 } from "@docsearch/core";
|
|
5
|
+
import React, { JSX } from "react";
|
|
6
|
+
import { AutocompleteOptions, AutocompleteState, BaseItem } from "@algolia/autocomplete-core";
|
|
7
|
+
import { LiteClient, SearchParamsObject } from "algoliasearch/lite";
|
|
8
|
+
//#region src/types/InternalDocSearchHit.d.ts
|
|
9
|
+
type InternalDocSearchHit = DocSearchHit & {
|
|
10
|
+
__docsearch_parent: InternalDocSearchHit | null;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/components/FacetBar.d.ts
|
|
14
|
+
type FacetBarTranslations = Partial<{
|
|
15
|
+
/**
|
|
16
|
+
* Label displayed as the default (all) facet option.
|
|
17
|
+
*
|
|
18
|
+
* @default 'All'
|
|
19
|
+
*/
|
|
20
|
+
defaultValueLabel: string;
|
|
21
|
+
/**
|
|
22
|
+
* Facet menu trigger aria label when a facet is selected.
|
|
23
|
+
*
|
|
24
|
+
* @default 'selected'
|
|
25
|
+
*/
|
|
26
|
+
facetMenuTriggerAriaLabel: string;
|
|
27
|
+
/**
|
|
28
|
+
* Label displayed for clearing all facets action.
|
|
29
|
+
*
|
|
30
|
+
* @default 'Clear all'
|
|
31
|
+
*/
|
|
32
|
+
clearAllLabel: string;
|
|
33
|
+
/**
|
|
34
|
+
* Aria label for the list of possible facets.
|
|
35
|
+
*
|
|
36
|
+
* @default 'Search filters'
|
|
37
|
+
*/
|
|
38
|
+
facetsAriaLabel: string;
|
|
39
|
+
/**
|
|
40
|
+
* Aria label for the list of selected facets.
|
|
41
|
+
*
|
|
42
|
+
* @default 'Selected search filters'
|
|
43
|
+
*/
|
|
44
|
+
selectedFacetsAriaLabel: string;
|
|
45
|
+
/**
|
|
46
|
+
* Aria label indicating to clear a selected facet.
|
|
47
|
+
*
|
|
48
|
+
* @default 'Clear filter:'
|
|
49
|
+
*/
|
|
50
|
+
clearFacetAriaLabel: string;
|
|
51
|
+
}>;
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/components/KeywordSearchBox.d.ts
|
|
54
|
+
type KeywordSearchBoxTranslations = Partial<{
|
|
55
|
+
clearButtonTitle: string;
|
|
56
|
+
clearButtonAriaLabel: string;
|
|
57
|
+
closeButtonText: string;
|
|
58
|
+
closeButtonAriaLabel: string;
|
|
59
|
+
placeholderText: string;
|
|
60
|
+
enterKeyHint: string;
|
|
61
|
+
searchInputLabel: string;
|
|
62
|
+
}>;
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region src/Footer.d.ts
|
|
65
|
+
type FooterTranslations = Partial<{
|
|
66
|
+
selectText: string;
|
|
67
|
+
submitQuestionText: string;
|
|
68
|
+
selectKeyAriaLabel: string;
|
|
69
|
+
navigateText: string;
|
|
70
|
+
navigateUpKeyAriaLabel: string;
|
|
71
|
+
navigateDownKeyAriaLabel: string;
|
|
72
|
+
closeText: string;
|
|
73
|
+
backToSearchText: string;
|
|
74
|
+
closeKeyAriaLabel: string;
|
|
75
|
+
poweredByText: string;
|
|
76
|
+
}>;
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/components/ui/StoredSearchesSections.d.ts
|
|
79
|
+
type StoredSearchesSectionsTranslations = Partial<{
|
|
80
|
+
recentSearchesTitle: string;
|
|
81
|
+
noRecentSearchesText: string;
|
|
82
|
+
saveRecentSearchButtonTitle: string;
|
|
83
|
+
removeRecentSearchButtonTitle: string;
|
|
84
|
+
favoriteSearchesTitle: string;
|
|
85
|
+
removeFavoriteSearchButtonTitle: string;
|
|
86
|
+
}>;
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/components/KeywordStartScreen.d.ts
|
|
89
|
+
type KeywordStartScreenTranslations = StoredSearchesSectionsTranslations;
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/ErrorScreen.d.ts
|
|
92
|
+
type ErrorScreenTranslations = Partial<{
|
|
93
|
+
titleText: string;
|
|
94
|
+
helpText: string;
|
|
95
|
+
}>;
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region src/NoResultsScreen.d.ts
|
|
98
|
+
type NoResultsScreenTranslations = Partial<{
|
|
99
|
+
noResultsText: string;
|
|
100
|
+
suggestedQueryText: string;
|
|
101
|
+
reportMissingResultsText: string;
|
|
102
|
+
reportMissingResultsLinkText: string;
|
|
103
|
+
}>;
|
|
104
|
+
//#endregion
|
|
105
|
+
//#region src/components/HitResultBadge.d.ts
|
|
106
|
+
type HitResultBadgeTranslations = Partial<{
|
|
107
|
+
/**
|
|
108
|
+
* Label text used for screen readers to announce the result badge. Should
|
|
109
|
+
* reflect the key of `resultBadgeKey`.
|
|
110
|
+
*
|
|
111
|
+
* @default 'Category'
|
|
112
|
+
*/
|
|
113
|
+
resultBadgeLabelText: string;
|
|
114
|
+
}>;
|
|
115
|
+
//#endregion
|
|
116
|
+
//#region src/Results.d.ts
|
|
117
|
+
type ResultsTranslations = HitResultBadgeTranslations & Partial<{
|
|
118
|
+
askAiPlaceholder: string;
|
|
119
|
+
noResultsAskAiPlaceholder: string;
|
|
120
|
+
recentConversationTimestampFallback: string;
|
|
121
|
+
askAiResultsTitle: string;
|
|
122
|
+
}>;
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/ResultsScreen.d.ts
|
|
125
|
+
type ResultsScreenTranslations = Partial<{
|
|
126
|
+
askAiPlaceholder: string;
|
|
127
|
+
noResultsAskAiPlaceholder: string;
|
|
128
|
+
resultsSectionTitle: string;
|
|
129
|
+
askAiResultsTitle: string;
|
|
130
|
+
}> & ResultsTranslations;
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region src/ScreenState.d.ts
|
|
133
|
+
type ScreenStateTranslations = Partial<{
|
|
134
|
+
errorScreen: ErrorScreenTranslations;
|
|
135
|
+
startScreen: KeywordStartScreenTranslations;
|
|
136
|
+
noResultsScreen: NoResultsScreenTranslations;
|
|
137
|
+
resultsScreen: ResultsScreenTranslations;
|
|
138
|
+
}>;
|
|
139
|
+
//#endregion
|
|
140
|
+
//#region src/DocSearchModal.d.ts
|
|
141
|
+
type ModalTranslations = Partial<{
|
|
142
|
+
searchBox: KeywordSearchBoxTranslations;
|
|
143
|
+
footer: FooterTranslations;
|
|
144
|
+
facets: FacetBarTranslations;
|
|
145
|
+
}> & ScreenStateTranslations;
|
|
146
|
+
type DocSearchModalProps = DocSearchProps & {
|
|
147
|
+
initialScrollY: number;
|
|
148
|
+
onClose?: () => void;
|
|
149
|
+
translations?: ModalTranslations;
|
|
150
|
+
};
|
|
151
|
+
declare function DocSearchModal({ appId, apiKey, maxResultsPerGroup, theme, onClose, transformItems, hitComponent, resultsFooterComponent, navigator, initialScrollY, transformSearchClient, disableUserPersonalization, initialQuery: initialQueryFromProp, translations, getMissingResultsUrl, insights, recentSearchesLimit, recentSearchesWithFavoritesLimit, indices, indexName, searchParameters, facets, ...props }: DocSearchModalProps): JSX.Element;
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region src/DocSearch.d.ts
|
|
154
|
+
type DocSearchTranslations = Partial<{
|
|
155
|
+
button: ButtonTranslations;
|
|
156
|
+
modal: ModalTranslations;
|
|
157
|
+
}>;
|
|
158
|
+
type DocSearchTransformClient = {
|
|
159
|
+
search: LiteClient['search'];
|
|
160
|
+
addAlgoliaAgent: LiteClient['addAlgoliaAgent'];
|
|
161
|
+
transporter: Pick<LiteClient['transporter'], 'algoliaAgent'>;
|
|
162
|
+
};
|
|
163
|
+
interface DocSearchIndex {
|
|
164
|
+
name: string;
|
|
165
|
+
searchParameters?: SearchParamsObject;
|
|
166
|
+
}
|
|
167
|
+
interface DocSearchFacet {
|
|
168
|
+
key: string;
|
|
169
|
+
label?: string;
|
|
170
|
+
}
|
|
171
|
+
interface DocSearchProps {
|
|
172
|
+
/** Algolia application id used by the search client. */
|
|
173
|
+
appId: string;
|
|
174
|
+
/** Public api key with search permissions for the index. */
|
|
175
|
+
apiKey: string;
|
|
176
|
+
/**
|
|
177
|
+
* Name of the algolia index to query.
|
|
178
|
+
*
|
|
179
|
+
* @deprecated `indexName` will be removed in a future version. Please use
|
|
180
|
+
* `indices` property going forward.
|
|
181
|
+
*/
|
|
182
|
+
indexName?: string;
|
|
183
|
+
/**
|
|
184
|
+
* List of indices and _optional_ searchParameters to be used for search.
|
|
185
|
+
*
|
|
186
|
+
* @see {@link https://docsearch.algolia.com/docs/api#indices}
|
|
187
|
+
*/
|
|
188
|
+
indices?: Array<DocSearchIndex | string>;
|
|
189
|
+
/**
|
|
190
|
+
* Facets to display as keyword-search filter controls. Values are read
|
|
191
|
+
* dynamically from the configured Algolia indices.
|
|
192
|
+
*
|
|
193
|
+
* @default [ ]
|
|
194
|
+
*/
|
|
195
|
+
facets?: DocSearchFacet[];
|
|
196
|
+
/** Theme overrides applied to the modal and related components. */
|
|
197
|
+
theme?: DocSearchTheme$1;
|
|
198
|
+
/** Placeholder text for the search input. */
|
|
199
|
+
placeholder?: string;
|
|
200
|
+
/**
|
|
201
|
+
* Additional algolia search parameters to merge into each query.
|
|
202
|
+
*
|
|
203
|
+
* @deprecated `searchParameters` will be removed in a future version. Please
|
|
204
|
+
* use `indices` property going forward.
|
|
205
|
+
*/
|
|
206
|
+
searchParameters?: SearchParamsObject;
|
|
207
|
+
/** Maximum number of hits to display per source/group. */
|
|
208
|
+
maxResultsPerGroup?: number;
|
|
209
|
+
/** Hook to post-process hits before rendering. */
|
|
210
|
+
transformItems?: (items: DocSearchHit[]) => DocSearchHit[];
|
|
211
|
+
/**
|
|
212
|
+
* Custom component to render an individual hit. Supports template patterns:
|
|
213
|
+
*
|
|
214
|
+
* - HTML strings with html helper: (props, { html }) => html`<div>...</div>`
|
|
215
|
+
* - JSX templates: (props) => <div>...</div>
|
|
216
|
+
* - Function-based templates: (props) => string | JSX.Element | Function.
|
|
217
|
+
*/
|
|
218
|
+
hitComponent?: (props: {
|
|
219
|
+
hit: InternalDocSearchHit | StoredDocSearchHit;
|
|
220
|
+
children: React.ReactNode;
|
|
221
|
+
}, helpers?: {
|
|
222
|
+
html: (template: TemplateStringsArray, ...values: any[]) => any;
|
|
223
|
+
}) => JSX.Element;
|
|
224
|
+
/**
|
|
225
|
+
* Custom component rendered at the bottom of the results panel. Supports
|
|
226
|
+
* template patterns:
|
|
227
|
+
*
|
|
228
|
+
* - HTML strings with html helper: (props, { html }) => html`<div>...</div>`
|
|
229
|
+
* - JSX templates: (props) => <div>...</div>
|
|
230
|
+
* - Function-based templates: (props) => string | JSX.Element | Function.
|
|
231
|
+
*/
|
|
232
|
+
resultsFooterComponent?: (props: {
|
|
233
|
+
state: AutocompleteState<InternalDocSearchHit>;
|
|
234
|
+
}, helpers?: {
|
|
235
|
+
html: (template: TemplateStringsArray, ...values: any[]) => any;
|
|
236
|
+
}) => JSX.Element | null;
|
|
237
|
+
/** Hook to wrap or modify the algolia search client. */
|
|
238
|
+
transformSearchClient?: (searchClient: DocSearchTransformClient) => DocSearchTransformClient;
|
|
239
|
+
/** Disable storage and usage of recent and favorite searches. */
|
|
240
|
+
disableUserPersonalization?: boolean;
|
|
241
|
+
/** Query string to prefill when opening the modal. */
|
|
242
|
+
initialQuery?: string;
|
|
243
|
+
/** Custom navigator for controlling link navigation. */
|
|
244
|
+
navigator?: AutocompleteOptions<InternalDocSearchHit>['navigator'];
|
|
245
|
+
/** Localized strings for the button and modal ui. */
|
|
246
|
+
translations?: DocSearchTranslations;
|
|
247
|
+
/** Builds a url to report missing results for a given query. */
|
|
248
|
+
getMissingResultsUrl?: ({ query }: {
|
|
249
|
+
query: string;
|
|
250
|
+
}) => string;
|
|
251
|
+
/** Insights client integration options to send analytics events. */
|
|
252
|
+
insights?: AutocompleteOptions<InternalDocSearchHit>['insights'];
|
|
253
|
+
/**
|
|
254
|
+
* The container element where the modal should be portaled to. Defaults to
|
|
255
|
+
* document.body.
|
|
256
|
+
*/
|
|
257
|
+
portalContainer?: DocumentFragment | Element;
|
|
258
|
+
/**
|
|
259
|
+
* Limit of how many recent searches should be saved/displayed..
|
|
260
|
+
*
|
|
261
|
+
* @default 7
|
|
262
|
+
*/
|
|
263
|
+
recentSearchesLimit?: number;
|
|
264
|
+
/**
|
|
265
|
+
* Limit of how many recent searches should be saved/displayed when there are
|
|
266
|
+
* favorited searches..
|
|
267
|
+
*
|
|
268
|
+
* @default 4
|
|
269
|
+
*/
|
|
270
|
+
recentSearchesWithFavoritesLimit?: number;
|
|
271
|
+
/**
|
|
272
|
+
* Configuration for keyboard shortcuts. Allows enabling/disabling specific
|
|
273
|
+
* shortcuts.
|
|
274
|
+
*
|
|
275
|
+
* @default `{ 'Ctrl/Cmd+K': true, '/': true }`
|
|
276
|
+
*/
|
|
277
|
+
keyboardShortcuts?: DocSearchModalShortcuts;
|
|
278
|
+
/**
|
|
279
|
+
* The key used to render a custom badge for each hit. Key must match a
|
|
280
|
+
* property returned in `searchParameters.attributesToRetrieve`.
|
|
281
|
+
*
|
|
282
|
+
* @example
|
|
283
|
+
* 'version';
|
|
284
|
+
* 'hierarchy.lvl1';
|
|
285
|
+
* 'tags[2]';
|
|
286
|
+
*
|
|
287
|
+
* @default undefined
|
|
288
|
+
*/
|
|
289
|
+
resultBadgeKey?: string;
|
|
290
|
+
}
|
|
291
|
+
declare const DocSearch$1: React.ForwardRefExoticComponent<DocSearchProps & React.RefAttributes<DocSearchRef>>;
|
|
292
|
+
declare function DocSearchInner(props: DocSearchProps): JSX.Element;
|
|
293
|
+
//#endregion
|
|
294
|
+
export { FacetBarTranslations as _, DocSearchProps as a, DocSearchTranslations as c, ModalTranslations as d, ResultsScreenTranslations as f, FooterTranslations as g, StoredSearchesSectionsTranslations as h, DocSearchInner as i, DocSearchModal as l, ErrorScreenTranslations as m, DocSearchFacet as n, DocSearchRef$1 as o, NoResultsScreenTranslations as p, DocSearchIndex as r, DocSearchTransformClient as s, DocSearch$1 as t, DocSearchModalProps as u, InternalDocSearchHit as v };
|
|
295
|
+
//# sourceMappingURL=DocSearch-HJsNvtZr.d.ts.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import "./index-Bqqv4HmN.js";
|
|
2
|
+
import { _ as FacetBarTranslations, g as FooterTranslations } from "./DocSearch-HJsNvtZr.js";
|
|
3
|
+
import { DocSearchAIProps } from "./docsearchAi.js";
|
|
4
|
+
import { n as NewConversationTranslations, t as AskAiScreenStateTranslations } from "./AskAiScreenState-CRHicWbN.js";
|
|
5
|
+
import { OnAskAiToggle } from "@docsearch/core";
|
|
6
|
+
import React, { JSX } from "react";
|
|
7
|
+
import { AutocompleteState } from "@algolia/autocomplete-core";
|
|
8
|
+
import "@ai-sdk/react";
|
|
9
|
+
//#region src/components/AskAiSearchBox.d.ts
|
|
10
|
+
type AskAiSearchBoxTranslations = Partial<{
|
|
11
|
+
clearButtonTitle: string;
|
|
12
|
+
clearButtonAriaLabel: string;
|
|
13
|
+
closeButtonText: string;
|
|
14
|
+
closeButtonAriaLabel: string;
|
|
15
|
+
placeholderText: string;
|
|
16
|
+
placeholderTextAskAi: string;
|
|
17
|
+
placeholderTextAskAiStreaming: string;
|
|
18
|
+
enterKeyHint: string;
|
|
19
|
+
enterKeyHintAskAi: string;
|
|
20
|
+
searchInputLabel: string;
|
|
21
|
+
backToKeywordSearchButtonText: string;
|
|
22
|
+
backToKeywordSearchButtonAriaLabel: string;
|
|
23
|
+
newConversationPlaceholder: string;
|
|
24
|
+
conversationHistoryTitle: string;
|
|
25
|
+
startNewConversationText: string;
|
|
26
|
+
viewConversationHistoryText: string;
|
|
27
|
+
threadDepthErrorPlaceholder: string;
|
|
28
|
+
}>;
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/DocSearchAskAiModal.d.ts
|
|
31
|
+
type DocSearchAskAiModalTranslations = AskAiScreenStateTranslations & Partial<{
|
|
32
|
+
searchBox: AskAiSearchBoxTranslations;
|
|
33
|
+
newConversation: NewConversationTranslations;
|
|
34
|
+
footer: FooterTranslations;
|
|
35
|
+
facets: FacetBarTranslations;
|
|
36
|
+
}>;
|
|
37
|
+
type DocSearchAskAiModalProps = DocSearchAIProps & {
|
|
38
|
+
initialScrollY: number;
|
|
39
|
+
onAskAiToggle: OnAskAiToggle;
|
|
40
|
+
onClose?: () => void;
|
|
41
|
+
isAskAiActive?: boolean;
|
|
42
|
+
translations?: DocSearchAskAiModalTranslations;
|
|
43
|
+
isHybridModeSupported?: boolean;
|
|
44
|
+
};
|
|
45
|
+
declare function DocSearchAskAiModal({ appId, apiKey, askAi, maxResultsPerGroup, theme, onClose, transformItems, hitComponent, resultsFooterComponent, navigator, initialScrollY, transformSearchClient, disableUserPersonalization, initialQuery: initialQueryFromProp, translations, getMissingResultsUrl, insights, onAskAiToggle, interceptAskAiEvent, isAskAiActive, recentSearchesLimit, recentSearchesWithFavoritesLimit, indices, indexName, searchParameters, facets, isHybridModeSupported, ...props }: DocSearchAskAiModalProps): JSX.Element;
|
|
46
|
+
//#endregion
|
|
47
|
+
export { DocSearchAskAiModalProps as n, DocSearchAskAiModalTranslations as r, DocSearchAskAiModal as t };
|
|
48
|
+
//# sourceMappingURL=DocSearchAskAiModal-B7vpLudE.d.ts.map
|