@searchcraft/react-sdk 0.15.0 → 0.16.0
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/client/index.d.ts +31 -59
- package/dist/client/index.js +2581 -2220
- package/dist/client/index.js.map +1 -1
- package/dist/client/themes/hologram.css +1 -1
- package/dist/client/themes/hologram.css.map +1 -1
- package/dist/server/index.d.ts +130 -47
- package/dist/server/index.js +2563 -2293
- package/dist/server/index.js.map +1 -1
- package/package.json +6 -5
package/dist/client/index.d.ts
CHANGED
|
@@ -46,36 +46,21 @@ export declare interface SearchcraftFilterPanelProps extends Components.Searchcr
|
|
|
46
46
|
*
|
|
47
47
|
* @example
|
|
48
48
|
* ```tsx
|
|
49
|
-
* import React from 'react';
|
|
50
49
|
* import { SearchcraftInputForm } from '@searchcraft/react-sdk';
|
|
51
|
-
* import searchcraftConfig from './searchcraftConfig';
|
|
52
|
-
*
|
|
53
|
-
* const MySearchComponent = () => {
|
|
54
|
-
* const handleQuerySubmit = (event: CustomEvent<string>) => {
|
|
55
|
-
* console.log("Query submitted", event.detail);
|
|
56
|
-
* };
|
|
57
50
|
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* onInputFocus={() => console.log("Input focused")}
|
|
72
|
-
* onInputBlur={() => console.log("Input blurred")}
|
|
73
|
-
* onInputInit={() => console.log("Input initialized")}
|
|
74
|
-
* />
|
|
75
|
-
* );
|
|
76
|
-
* };
|
|
77
|
-
*
|
|
78
|
-
* export default MySearchComponent;
|
|
51
|
+
* const MySearchInput = () => (
|
|
52
|
+
* <SearchcraftInputForm
|
|
53
|
+
* autoSearch={true}
|
|
54
|
+
* buttonPlacement="right"
|
|
55
|
+
* buttonLabel="Search"
|
|
56
|
+
* inputLabel="Search articles"
|
|
57
|
+
* placeholderValue="Search here..."
|
|
58
|
+
* onInputFocus={() => console.log('Input focused')}
|
|
59
|
+
* onInputBlur={() => console.log('Input blurred')}
|
|
60
|
+
* />
|
|
61
|
+
* );
|
|
62
|
+
*
|
|
63
|
+
* export default MySearchInput;
|
|
79
64
|
* ```
|
|
80
65
|
*/
|
|
81
66
|
export declare const SearchcraftInputForm: FC<SearchcraftInputFormProps>;
|
|
@@ -148,13 +133,11 @@ export declare interface SearchcraftPopoverButtonProps extends Components.Search
|
|
|
148
133
|
* ```tsx
|
|
149
134
|
* import React from 'react';
|
|
150
135
|
* import { SearchcraftPopoverForm } from '@searchcraft/react-sdk';
|
|
151
|
-
* import searchcraftConfig from './searchcraftConfig';
|
|
152
136
|
* import popoverResultMappings from './popoverResultMappings';
|
|
153
137
|
*
|
|
154
138
|
* const MyPopoverSearch = () => {
|
|
155
139
|
* return (
|
|
156
140
|
* <SearchcraftPopoverForm
|
|
157
|
-
* config={searchcraftConfig}
|
|
158
141
|
* type="fullscreen"
|
|
159
142
|
* popoverResultMappings={popoverResultMappings}
|
|
160
143
|
* hotkey="k"
|
|
@@ -179,19 +162,15 @@ export declare interface SearchcraftPopoverFormProps extends Components.Searchcr
|
|
|
179
162
|
*
|
|
180
163
|
* @example
|
|
181
164
|
* ```tsx
|
|
182
|
-
* import React, { useEffect, useRef } from 'react';
|
|
183
165
|
* import { SearchcraftResultsInfo } from '@searchcraft/react-sdk';
|
|
184
166
|
*
|
|
185
|
-
* const MyResultsInfo = () =>
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
* return <SearchcraftResultsInfo ref={ref} />;
|
|
194
|
-
* };
|
|
167
|
+
* const MyResultsInfo = () => (
|
|
168
|
+
* <SearchcraftResultsInfo
|
|
169
|
+
* template={({ range, count, responseTime }, { html }) => html`
|
|
170
|
+
* ${range[0]}-${range[1]} of ${count} results in ${responseTime}ms
|
|
171
|
+
* `}
|
|
172
|
+
* />
|
|
173
|
+
* );
|
|
195
174
|
*
|
|
196
175
|
* export default MyResultsInfo;
|
|
197
176
|
* ```
|
|
@@ -231,26 +210,19 @@ export declare interface SearchcraftResultsSummaryProps extends Components.Searc
|
|
|
231
210
|
*
|
|
232
211
|
* @example
|
|
233
212
|
* ```tsx
|
|
234
|
-
* import React from 'react';
|
|
235
213
|
* import { SearchcraftSearchResults } from '@searchcraft/react-sdk';
|
|
236
|
-
* import searchResultMappings from './searchResultMappings';
|
|
237
|
-
*
|
|
238
|
-
* const MySearchComponent = () => {
|
|
239
|
-
* return (
|
|
240
|
-
* <SearchcraftSearchResults
|
|
241
|
-
* searchResultMappings={searchResultMappings}
|
|
242
|
-
* resultImagePlacement="left"
|
|
243
|
-
* buttonLabel="View More"
|
|
244
|
-
* buttonTarget="_blank"
|
|
245
|
-
* buttonRel="noopener"
|
|
246
|
-
* containerTarget="_self"
|
|
247
|
-
* containerRel="nofollow"
|
|
248
|
-
* onNoResults={() => console.log("No search results found")}
|
|
249
|
-
* />
|
|
250
|
-
* );
|
|
251
|
-
* };
|
|
252
214
|
*
|
|
253
|
-
*
|
|
215
|
+
* const MySearchResults = () => (
|
|
216
|
+
* <SearchcraftSearchResults
|
|
217
|
+
* template={(item, index, { html, safeUrl }) => html`
|
|
218
|
+
* <a href="${safeUrl(item.url)}">
|
|
219
|
+
* <h2>${item.title}</h2>
|
|
220
|
+
* </a>
|
|
221
|
+
* `}
|
|
222
|
+
* />
|
|
223
|
+
* );
|
|
224
|
+
*
|
|
225
|
+
* export default MySearchResults;
|
|
254
226
|
* ```
|
|
255
227
|
*/
|
|
256
228
|
export declare const SearchcraftSearchResults: FC<SearchcraftSearchResultsProps>;
|