@docsearch/react 3.6.2 → 3.6.3
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 +1 -1
- package/dist/esm/index.d.ts +22 -22
- package/dist/esm/index.js +1 -1
- package/dist/umd/index.js +2 -2
- package/dist/umd/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AutocompleteState, AutocompleteOptions } from '@algolia/autocomplete-core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { SearchClient } from 'algoliasearch';
|
|
3
|
+
import { SearchQuery, LiteClient } from 'algoliasearch/lite';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
type ContentType = 'content' | 'lvl0' | 'lvl1' | 'lvl2' | 'lvl3' | 'lvl4' | 'lvl5' | 'lvl6';
|
|
7
7
|
interface DocSearchHitAttributeHighlightResult {
|
|
8
8
|
value: string;
|
|
9
9
|
matchLevel: 'full' | 'none' | 'partial';
|
|
@@ -78,13 +78,13 @@ declare type DocSearchHit = {
|
|
|
78
78
|
__autocomplete_id?: number;
|
|
79
79
|
};
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
type InternalDocSearchHit = DocSearchHit & {
|
|
82
82
|
__docsearch_parent: InternalDocSearchHit | null;
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
type StoredDocSearchHit = Omit<DocSearchHit, '_highlightResult' | '_snippetResult'>;
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
type DocSearchTranslations = Partial<{
|
|
88
88
|
button: ButtonTranslations;
|
|
89
89
|
modal: ModalTranslations;
|
|
90
90
|
}>;
|
|
@@ -93,7 +93,7 @@ interface DocSearchProps {
|
|
|
93
93
|
apiKey: string;
|
|
94
94
|
indexName: string;
|
|
95
95
|
placeholder?: string;
|
|
96
|
-
searchParameters?:
|
|
96
|
+
searchParameters?: SearchQuery;
|
|
97
97
|
maxResultsPerGroup?: number;
|
|
98
98
|
transformItems?: (items: DocSearchHit[]) => DocSearchHit[];
|
|
99
99
|
hitComponent?: (props: {
|
|
@@ -103,7 +103,7 @@ interface DocSearchProps {
|
|
|
103
103
|
resultsFooterComponent?: (props: {
|
|
104
104
|
state: AutocompleteState<InternalDocSearchHit>;
|
|
105
105
|
}) => JSX.Element | null;
|
|
106
|
-
transformSearchClient?: (searchClient:
|
|
106
|
+
transformSearchClient?: <T extends LiteClient | SearchClient>(searchClient: T) => T;
|
|
107
107
|
disableUserPersonalization?: boolean;
|
|
108
108
|
initialQuery?: string;
|
|
109
109
|
navigator?: AutocompleteOptions<InternalDocSearchHit>['navigator'];
|
|
@@ -113,18 +113,18 @@ interface DocSearchProps {
|
|
|
113
113
|
}) => string;
|
|
114
114
|
insights?: AutocompleteOptions<InternalDocSearchHit>['insights'];
|
|
115
115
|
}
|
|
116
|
-
declare function DocSearch(props: DocSearchProps): JSX.Element;
|
|
116
|
+
declare function DocSearch(props: DocSearchProps): React.JSX.Element;
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
type ButtonTranslations = Partial<{
|
|
119
119
|
buttonText: string;
|
|
120
120
|
buttonAriaLabel: string;
|
|
121
121
|
}>;
|
|
122
|
-
|
|
122
|
+
type DocSearchButtonProps = React.ComponentProps<'button'> & {
|
|
123
123
|
translations?: ButtonTranslations;
|
|
124
124
|
};
|
|
125
|
-
declare const DocSearchButton: React.ForwardRefExoticComponent<
|
|
125
|
+
declare const DocSearchButton: React.ForwardRefExoticComponent<Omit<DocSearchButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
type FooterTranslations = Partial<{
|
|
128
128
|
selectText: string;
|
|
129
129
|
selectKeyAriaLabel: string;
|
|
130
130
|
navigateText: string;
|
|
@@ -135,19 +135,19 @@ declare type FooterTranslations = Partial<{
|
|
|
135
135
|
searchByText: string;
|
|
136
136
|
}>;
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
type ErrorScreenTranslations = Partial<{
|
|
139
139
|
titleText: string;
|
|
140
140
|
helpText: string;
|
|
141
141
|
}>;
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
type NoResultsScreenTranslations = Partial<{
|
|
144
144
|
noResultsText: string;
|
|
145
145
|
suggestedQueryText: string;
|
|
146
146
|
reportMissingResultsText: string;
|
|
147
147
|
reportMissingResultsLinkText: string;
|
|
148
148
|
}>;
|
|
149
149
|
|
|
150
|
-
|
|
150
|
+
type StartScreenTranslations = Partial<{
|
|
151
151
|
recentSearchesTitle: string;
|
|
152
152
|
noRecentSearchesText: string;
|
|
153
153
|
saveRecentSearchButtonTitle: string;
|
|
@@ -156,13 +156,13 @@ declare type StartScreenTranslations = Partial<{
|
|
|
156
156
|
removeFavoriteSearchButtonTitle: string;
|
|
157
157
|
}>;
|
|
158
158
|
|
|
159
|
-
|
|
159
|
+
type ScreenStateTranslations = Partial<{
|
|
160
160
|
errorScreen: ErrorScreenTranslations;
|
|
161
161
|
startScreen: StartScreenTranslations;
|
|
162
162
|
noResultsScreen: NoResultsScreenTranslations;
|
|
163
163
|
}>;
|
|
164
164
|
|
|
165
|
-
|
|
165
|
+
type SearchBoxTranslations = Partial<{
|
|
166
166
|
resetButtonTitle: string;
|
|
167
167
|
resetButtonAriaLabel: string;
|
|
168
168
|
cancelButtonText: string;
|
|
@@ -170,16 +170,16 @@ declare type SearchBoxTranslations = Partial<{
|
|
|
170
170
|
searchInputLabel: string;
|
|
171
171
|
}>;
|
|
172
172
|
|
|
173
|
-
|
|
173
|
+
type ModalTranslations = Partial<{
|
|
174
174
|
searchBox: SearchBoxTranslations;
|
|
175
175
|
footer: FooterTranslations;
|
|
176
176
|
}> & ScreenStateTranslations;
|
|
177
|
-
|
|
177
|
+
type DocSearchModalProps = DocSearchProps & {
|
|
178
178
|
initialScrollY: number;
|
|
179
179
|
onClose?: () => void;
|
|
180
180
|
translations?: ModalTranslations;
|
|
181
181
|
};
|
|
182
|
-
declare function DocSearchModal({ appId, apiKey, indexName, placeholder, searchParameters, maxResultsPerGroup, onClose, transformItems, hitComponent, resultsFooterComponent, navigator, initialScrollY, transformSearchClient, disableUserPersonalization, initialQuery: initialQueryFromProp, translations, getMissingResultsUrl, insights, }: DocSearchModalProps): JSX.Element;
|
|
182
|
+
declare function DocSearchModal({ appId, apiKey, indexName, placeholder, searchParameters, maxResultsPerGroup, onClose, transformItems, hitComponent, resultsFooterComponent, navigator, initialScrollY, transformSearchClient, disableUserPersonalization, initialQuery: initialQueryFromProp, translations, getMissingResultsUrl, insights, }: DocSearchModalProps): React.JSX.Element;
|
|
183
183
|
|
|
184
184
|
interface UseDocSearchKeyboardEventsProps {
|
|
185
185
|
isOpen: boolean;
|
|
@@ -190,6 +190,6 @@ interface UseDocSearchKeyboardEventsProps {
|
|
|
190
190
|
}
|
|
191
191
|
declare function useDocSearchKeyboardEvents({ isOpen, onOpen, onClose, onInput, searchButtonRef, }: UseDocSearchKeyboardEventsProps): void;
|
|
192
192
|
|
|
193
|
-
declare const version = "3.6.
|
|
193
|
+
declare const version = "3.6.3";
|
|
194
194
|
|
|
195
195
|
export { type ButtonTranslations, DocSearch, DocSearchButton, type DocSearchButtonProps, DocSearchModal, type DocSearchModalProps, type DocSearchProps, type DocSearchTranslations, type ModalTranslations, type UseDocSearchKeyboardEventsProps, useDocSearchKeyboardEvents, version };
|