@searchcraft/javascript-sdk 0.10.7 → 0.11.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/components/defineCustomElements.js +4 -0
- package/dist/components/index.d.ts +530 -217
- package/dist/components/index.js +1661 -8
- package/dist/components/index.js.map +1 -1
- package/dist/components/{p-e99cd628.js → p-0c495408.js} +30 -20
- package/dist/components/p-0c495408.js.map +1 -0
- package/dist/components/{p-b4cac872.js → p-1d5c5536.js} +18 -8
- package/dist/components/p-1d5c5536.js.map +1 -0
- package/dist/components/{p-274c5cc8.js → p-3286bbb3.js} +22 -10
- package/dist/components/p-3286bbb3.js.map +1 -0
- package/dist/components/{p-ea48ccae.js → p-3e41546c.js} +17 -8
- package/dist/components/p-3e41546c.js.map +1 -0
- package/dist/components/{p-adc6236e.js → p-87435aac.js} +31 -20
- package/dist/components/p-87435aac.js.map +1 -0
- package/dist/components/p-919734fe.js +31 -0
- package/dist/components/p-919734fe.js.map +1 -0
- package/dist/components/{p-b01f8216.js → p-b13c7fbb.js} +48 -33
- package/dist/components/p-b13c7fbb.js.map +1 -0
- package/dist/components/{p-810a7850.js → p-b4b67072.js} +2 -2
- package/dist/components/p-b4b67072.js.map +1 -0
- package/dist/components/{p-acab4d41.js → p-b7e99386.js} +22 -22
- package/dist/components/p-b7e99386.js.map +1 -0
- package/dist/components/{p-4dd1995c.js → p-c9b65e8f.js} +4 -4
- package/dist/components/{p-4dd1995c.js.map → p-c9b65e8f.js.map} +1 -1
- package/dist/components/p-d54771ef.js.map +1 -1
- package/dist/components/{p-a64b4cba.js → p-e2a10337.js} +2 -2
- package/dist/components/{p-a64b4cba.js.map → p-e2a10337.js.map} +1 -1
- package/dist/components/p-e30203b1.js +62 -0
- package/dist/components/p-e30203b1.js.map +1 -0
- package/dist/components/{p-320e3895.js → p-fc8ccffa.js} +22 -11
- package/dist/components/p-fc8ccffa.js.map +1 -0
- package/dist/components/searchcraft-ad.js +1 -1
- package/dist/components/searchcraft-facet-list.js +1 -1
- package/dist/components/searchcraft-filter-panel.js +51 -23
- package/dist/components/searchcraft-filter-panel.js.map +1 -1
- package/dist/components/searchcraft-input-form.js +1 -1
- package/dist/components/searchcraft-loading.d.ts +11 -0
- package/dist/components/searchcraft-loading.js +8 -0
- package/dist/components/searchcraft-loading.js.map +1 -0
- package/dist/components/searchcraft-pagination.js +13 -3
- package/dist/components/searchcraft-pagination.js.map +1 -1
- package/dist/components/searchcraft-popover-button.js +21 -9
- package/dist/components/searchcraft-popover-button.js.map +1 -1
- package/dist/components/searchcraft-popover-footer.js +1 -1
- package/dist/components/searchcraft-popover-form.js +32 -20
- package/dist/components/searchcraft-popover-form.js.map +1 -1
- package/dist/components/searchcraft-popover-list-item.js +1 -1
- package/dist/components/searchcraft-popover-list-view.js +1 -1
- package/dist/components/searchcraft-results-info.js +15 -7
- package/dist/components/searchcraft-results-info.js.map +1 -1
- package/dist/components/searchcraft-search-result.js +1 -1
- package/dist/components/searchcraft-search-results-per-page.js +14 -4
- package/dist/components/searchcraft-search-results-per-page.js.map +1 -1
- package/dist/components/searchcraft-search-results.js +50 -69
- package/dist/components/searchcraft-search-results.js.map +1 -1
- package/dist/components/searchcraft-slider.js +1 -1
- package/dist/components/searchcraft-summary-box.d.ts +11 -0
- package/dist/components/searchcraft-summary-box.js +2287 -0
- package/dist/components/searchcraft-summary-box.js.map +1 -0
- package/dist/components/searchcraft-theme.js +2 -2
- package/dist/components/searchcraft-theme.js.map +1 -1
- package/dist/components/searchcraft-toggle-button.js +1 -1
- package/dist/hydrate/index.js +6072 -4862
- package/dist/hydrate/index.mjs +6072 -4862
- package/dist/themes/hologram.css +1 -1
- package/dist/themes/hologram.css.map +1 -1
- package/dist/types/classes/CoreInstanceRegistry.d.ts +38 -0
- package/dist/types/classes/Logger.d.ts +25 -0
- package/dist/types/classes/SearchcraftCore.d.ts +50 -0
- package/dist/types/classes/index.d.ts +3 -0
- package/dist/types/clients/MeasureClient.d.ts +27 -0
- package/dist/types/clients/SearchClient.d.ts +35 -0
- package/dist/types/clients/SummaryClient.d.ts +10 -0
- package/dist/types/clients/ad-clients/AdClient.d.ts +20 -0
- package/dist/types/clients/ad-clients/AdMarketplaceClient.d.ts +14 -0
- package/dist/types/clients/ad-clients/CustomAdClient.d.ts +6 -0
- package/dist/types/clients/ad-clients/NativoClient.d.ts +14 -0
- package/dist/types/clients/ad-clients/index.d.ts +5 -0
- package/dist/types/clients/index.d.ts +4 -0
- package/dist/types/components/searchcraft-ad/searchcraft-ad.d.ts +10 -3
- package/dist/types/components/searchcraft-facet-list/searchcraft-facet-list.d.ts +9 -2
- package/dist/types/components/searchcraft-filter-panel/searchcraft-filter-panel.d.ts +14 -3
- package/dist/types/components/searchcraft-input-form/searchcraft-input-form.d.ts +9 -6
- package/dist/types/components/searchcraft-loading/searchcraft-loading.d.ts +10 -0
- package/dist/types/components/searchcraft-pagination/searchcraft-pagination.d.ts +8 -1
- package/dist/types/components/searchcraft-popover-button/searchcraft-popover-button.d.ts +10 -2
- package/dist/types/components/searchcraft-popover-footer/searchcraft-popover-footer.d.ts +8 -1
- package/dist/types/components/searchcraft-popover-form/searchcraft-popover-form.d.ts +11 -3
- package/dist/types/components/searchcraft-popover-list-item/searchcraft-popover-list-item.d.ts +9 -1
- package/dist/types/components/searchcraft-popover-list-view/searchcraft-popover-list-view.d.ts +11 -3
- package/dist/types/components/searchcraft-results-info/searchcraft-results-info.d.ts +8 -1
- package/dist/types/components/searchcraft-search-result/searchcraft-search-result.d.ts +10 -1
- package/dist/types/components/searchcraft-search-results/searchcraft-search-results.d.ts +11 -5
- package/dist/types/components/searchcraft-search-results-per-page/searchcraft-search-results-per-page.d.ts +8 -1
- package/dist/types/components/searchcraft-summary-box/searchcraft-summary-box.d.ts +49 -0
- package/dist/types/components/searchcraft-toggle-button/searchcraft-toggle-button.d.ts +8 -1
- package/dist/types/components.d.ts +256 -6
- package/dist/types/index.d.ts +4 -5
- package/dist/types/store/SearchcraftStore.types.d.ts +14 -15
- package/dist/types/store/SearchcraftStoreFactory.d.ts +13 -0
- package/dist/types/store/index.d.ts +1 -1
- package/dist/types/types/core-types/AdClientResponses.types.d.ts +24 -0
- package/dist/types/types/core-types/Facets.types.d.ts +39 -0
- package/dist/types/types/core-types/Measure.types.d.ts +52 -0
- package/dist/types/types/core-types/SearchClient.types.d.ts +67 -0
- package/dist/types/types/core-types/SearchClientResponses.types.d.ts +7 -0
- package/dist/types/types/core-types/SearchcraftAdConfig.types.d.ts +76 -0
- package/dist/types/types/core-types/SearchcraftConfig.types.d.ts +65 -0
- package/dist/types/types/core-types/SearchcraftResponse.types.d.ts +46 -0
- package/dist/types/types/core-types/SubscriptionEvents.types.d.ts +51 -0
- package/dist/types/types/core-types/index.d.ts +10 -0
- package/dist/types/types/index.d.ts +3 -0
- package/dist/types/types/sdk-types/index.d.ts +4 -0
- package/dist/types/types/sdk-types/result-mappings.types.d.ts +58 -0
- package/dist/types/types/sdk-types/searchcraft-filter-panel.types.d.ts +44 -0
- package/dist/types/types/sdk-types/templates.types.d.ts +29 -0
- package/dist/types/utils/core-utils/index.d.ts +3 -0
- package/dist/types/utils/core-utils/sanitize.d.ts +2 -0
- package/dist/types/utils/core-utils/url.d.ts +2 -0
- package/dist/types/utils/facets.d.ts +1 -1
- package/dist/types/utils/html.d.ts +1 -1
- package/dist/types/utils/units.d.ts +1 -1
- package/package.json +5 -3
- package/dist/components/p-062d6b80.js +0 -1940
- package/dist/components/p-062d6b80.js.map +0 -1
- package/dist/components/p-274c5cc8.js.map +0 -1
- package/dist/components/p-320e3895.js.map +0 -1
- package/dist/components/p-810a7850.js.map +0 -1
- package/dist/components/p-acab4d41.js.map +0 -1
- package/dist/components/p-adc6236e.js.map +0 -1
- package/dist/components/p-b01f8216.js.map +0 -1
- package/dist/components/p-b4cac872.js.map +0 -1
- package/dist/components/p-e99cd628.js.map +0 -1
- package/dist/components/p-ea48ccae.js.map +0 -1
- package/dist/types/store/SearchcraftStore.d.ts +0 -4
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* It contains typing information for all components that exist in this project.
|
|
6
6
|
*/
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
|
-
import { AdClientResponseItem, FilterItem, PopoverButtonTemplate, PopoverResultMappings, ResultsInfoTemplate, SearchClientResponseItem,
|
|
8
|
+
import { AdClientResponseItem, FilterItem, PopoverButtonTemplate, PopoverResultMappings, ResultsInfoTemplate, SearchClientResponseItem, SearchResultTemplate, SearchResultTemplateData } from "./types/index";
|
|
9
9
|
import { SearchcraftSelectOption } from "./components/searchcraft-select/searchcraft-select";
|
|
10
|
-
export { AdClientResponseItem, FilterItem, PopoverButtonTemplate, PopoverResultMappings, ResultsInfoTemplate, SearchClientResponseItem,
|
|
10
|
+
export { AdClientResponseItem, FilterItem, PopoverButtonTemplate, PopoverResultMappings, ResultsInfoTemplate, SearchClientResponseItem, SearchResultTemplate, SearchResultTemplateData } from "./types/index";
|
|
11
11
|
export { SearchcraftSelectOption } from "./components/searchcraft-select/searchcraft-select";
|
|
12
12
|
export namespace Components {
|
|
13
13
|
/**
|
|
@@ -15,11 +15,15 @@ export namespace Components {
|
|
|
15
15
|
*/
|
|
16
16
|
interface SearchcraftAd {
|
|
17
17
|
"adClientResponseItem"?: AdClientResponseItem;
|
|
18
|
-
"adSource":
|
|
18
|
+
"adSource": 'Custom' | 'Nativo' | 'adMarketplace';
|
|
19
19
|
/**
|
|
20
20
|
* Where the ad is being rendered within the search results div. Lifecycle behavior differs for ads being rendered in different positions, so we need to be able to handle all of those cases.
|
|
21
21
|
*/
|
|
22
22
|
"renderPosition": 'interstitial' | 'top' | 'bottom';
|
|
23
|
+
/**
|
|
24
|
+
* The id of the Searchcraft instance that this component should use.
|
|
25
|
+
*/
|
|
26
|
+
"searchcraftId"?: string;
|
|
23
27
|
}
|
|
24
28
|
/**
|
|
25
29
|
* This web component represents a button.
|
|
@@ -85,6 +89,10 @@ export namespace Components {
|
|
|
85
89
|
* The name of the field where facets are applied.
|
|
86
90
|
*/
|
|
87
91
|
"fieldName": string;
|
|
92
|
+
/**
|
|
93
|
+
* The id of the Searchcraft instance that this component should use.
|
|
94
|
+
*/
|
|
95
|
+
"searchcraftId"?: string;
|
|
88
96
|
}
|
|
89
97
|
/**
|
|
90
98
|
* This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.
|
|
@@ -117,6 +125,10 @@ export namespace Components {
|
|
|
117
125
|
* The items to filter.
|
|
118
126
|
*/
|
|
119
127
|
"items": FilterItem[];
|
|
128
|
+
/**
|
|
129
|
+
* The id of the Searchcraft instance that this component should use.
|
|
130
|
+
*/
|
|
131
|
+
"searchcraftId"?: string;
|
|
120
132
|
}
|
|
121
133
|
/**
|
|
122
134
|
* This web component provides a user-friendly interface for querying an indexed dataset, enabling users to easily search large collections of data.
|
|
@@ -150,7 +162,6 @@ export namespace Components {
|
|
|
150
162
|
* Where to place the search button.
|
|
151
163
|
*/
|
|
152
164
|
"buttonPlacement"?: 'left' | 'right' | 'none';
|
|
153
|
-
"core"?: SearchcraftCore;
|
|
154
165
|
/**
|
|
155
166
|
* The label rendered above the input.
|
|
156
167
|
*/
|
|
@@ -163,6 +174,10 @@ export namespace Components {
|
|
|
163
174
|
* The input element's placeholder value.
|
|
164
175
|
*/
|
|
165
176
|
"placeholderValue"?: string;
|
|
177
|
+
/**
|
|
178
|
+
* The id of the Searchcraft instance that this component should use.
|
|
179
|
+
*/
|
|
180
|
+
"searchcraftId"?: string;
|
|
166
181
|
}
|
|
167
182
|
/**
|
|
168
183
|
* This web component serves as the input label for the searchcraft-input-form component.
|
|
@@ -177,6 +192,12 @@ export namespace Components {
|
|
|
177
192
|
"inputLabelClassName"?: string | undefined;
|
|
178
193
|
"label": string;
|
|
179
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* Renders a loading spinner/loading state for use in things like the summary box.
|
|
197
|
+
*/
|
|
198
|
+
interface SearchcraftLoading {
|
|
199
|
+
"label"?: string;
|
|
200
|
+
}
|
|
180
201
|
/**
|
|
181
202
|
* This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
|
|
182
203
|
* @react-import ```jsx
|
|
@@ -196,6 +217,10 @@ export namespace Components {
|
|
|
196
217
|
* ```
|
|
197
218
|
*/
|
|
198
219
|
interface SearchcraftPagination {
|
|
220
|
+
/**
|
|
221
|
+
* The id of the Searchcraft instance that this component should use.
|
|
222
|
+
*/
|
|
223
|
+
"searchcraftId"?: string;
|
|
199
224
|
}
|
|
200
225
|
/**
|
|
201
226
|
* Renders a button which, when clicked, turns on popover visibility.
|
|
@@ -238,6 +263,10 @@ export namespace Components {
|
|
|
238
263
|
* ```
|
|
239
264
|
*/
|
|
240
265
|
interface SearchcraftPopoverButton {
|
|
266
|
+
/**
|
|
267
|
+
* The id of the Searchcraft instance that this component should use.
|
|
268
|
+
*/
|
|
269
|
+
"searchcraftId"?: string;
|
|
241
270
|
/**
|
|
242
271
|
* A callback function responsible for rendering the button contents.
|
|
243
272
|
*/
|
|
@@ -251,6 +280,10 @@ export namespace Components {
|
|
|
251
280
|
* Renders the footer for the searchcraft-popover-form.
|
|
252
281
|
*/
|
|
253
282
|
interface SearchcraftPopoverFooter {
|
|
283
|
+
/**
|
|
284
|
+
* The id of the Searchcraft instance that this component should use.
|
|
285
|
+
*/
|
|
286
|
+
"searchcraftId"?: string;
|
|
254
287
|
}
|
|
255
288
|
/**
|
|
256
289
|
* This web component is designed to display search results in a popover container that dynamically appears when the user interacts with a search input field, or when a popover-button is pressed.
|
|
@@ -289,6 +322,10 @@ export namespace Components {
|
|
|
289
322
|
* Formats the content rendered for each result.
|
|
290
323
|
*/
|
|
291
324
|
"popoverResultMappings"?: PopoverResultMappings;
|
|
325
|
+
/**
|
|
326
|
+
* The id of the Searchcraft instance that this component should use.
|
|
327
|
+
*/
|
|
328
|
+
"searchcraftId"?: string;
|
|
292
329
|
/**
|
|
293
330
|
* The type of popover form to render. - `inline` - Renders inline with the rest of the content on the page. The search results pop over the page content. - `fullscreen` - Renders in fullscreen view. Used together with the `searchcraft-popover-button` component. - `modal` - Renders in a modal view. Used together with the `searchcraft-popover-button` component.
|
|
294
331
|
*/
|
|
@@ -304,6 +341,10 @@ export namespace Components {
|
|
|
304
341
|
"documentPosition": number;
|
|
305
342
|
"item": SearchClientResponseItem | undefined;
|
|
306
343
|
"popoverResultMappings": PopoverResultMappings | undefined;
|
|
344
|
+
/**
|
|
345
|
+
* The id of the Searchcraft instance that this component should use.
|
|
346
|
+
*/
|
|
347
|
+
"searchcraftId"?: string;
|
|
307
348
|
}
|
|
308
349
|
/**
|
|
309
350
|
* This web component is designed to display a list of results within a popover interface.
|
|
@@ -324,6 +365,10 @@ export namespace Components {
|
|
|
324
365
|
"searchClientResponseItems": SearchClientResponseItem[] | undefined;
|
|
325
366
|
"searchResultsPage": number;
|
|
326
367
|
"searchResultsPerPage": number;
|
|
368
|
+
/**
|
|
369
|
+
* The id of the Searchcraft instance that this component should use.
|
|
370
|
+
*/
|
|
371
|
+
"searchcraftId"?: string;
|
|
327
372
|
}
|
|
328
373
|
/**
|
|
329
374
|
* This web component is designed to display the number of results returned from a search query.
|
|
@@ -360,6 +405,10 @@ export namespace Components {
|
|
|
360
405
|
* ```
|
|
361
406
|
*/
|
|
362
407
|
interface SearchcraftResultsInfo {
|
|
408
|
+
/**
|
|
409
|
+
* The id of the Searchcraft instance that this component should use.
|
|
410
|
+
*/
|
|
411
|
+
"searchcraftId"?: string;
|
|
363
412
|
/**
|
|
364
413
|
* A callback function responsible for rendering the results info.
|
|
365
414
|
*/
|
|
@@ -378,6 +427,10 @@ export namespace Components {
|
|
|
378
427
|
*/
|
|
379
428
|
"index": number;
|
|
380
429
|
"item"?: SearchClientResponseItem;
|
|
430
|
+
/**
|
|
431
|
+
* The id of the Searchcraft instance that this component should use.
|
|
432
|
+
*/
|
|
433
|
+
"searchcraftId"?: string;
|
|
381
434
|
/**
|
|
382
435
|
* A callback function responsible for rendering a result.
|
|
383
436
|
*/
|
|
@@ -429,6 +482,10 @@ export namespace Components {
|
|
|
429
482
|
* A query that will appears when the component initializes or the search term is ''..
|
|
430
483
|
*/
|
|
431
484
|
"initialQuery"?: string;
|
|
485
|
+
/**
|
|
486
|
+
* The id of the Searchcraft instance that this component should use.
|
|
487
|
+
*/
|
|
488
|
+
"searchcraftId"?: string;
|
|
432
489
|
/**
|
|
433
490
|
* A callback function responsible for rendering a result. Passed to `searchcraft-search-result`.
|
|
434
491
|
*/
|
|
@@ -458,6 +515,10 @@ export namespace Components {
|
|
|
458
515
|
* The amount the options will increase (e.g. 20 = [20, 40, 60, 80, 100]). The base value is defined by the `searchResultsPerPage` option in the configuration.
|
|
459
516
|
*/
|
|
460
517
|
"increment": string | number;
|
|
518
|
+
/**
|
|
519
|
+
* The id of the Searchcraft instance that this component should use.
|
|
520
|
+
*/
|
|
521
|
+
"searchcraftId"?: string;
|
|
461
522
|
}
|
|
462
523
|
/**
|
|
463
524
|
* This web component is designed to allow users to select between a group of options.
|
|
@@ -525,6 +586,33 @@ export namespace Components {
|
|
|
525
586
|
*/
|
|
526
587
|
"step": number;
|
|
527
588
|
}
|
|
589
|
+
/**
|
|
590
|
+
* This component renders a summary box for RAG search result summaries.
|
|
591
|
+
* When the user makes a search, a network call is made to retrieve the summary content, which is then
|
|
592
|
+
* rendered in this box.
|
|
593
|
+
* NOTE: This component requires the usage of a read key that has "SUMMARY" permissions.
|
|
594
|
+
* @react-import ```jsx
|
|
595
|
+
* import { SearchcraftSummaryBox } from "@searchcraft/react-sdk";
|
|
596
|
+
* ```
|
|
597
|
+
* @vue-import ```jsx
|
|
598
|
+
* import { SearchcraftSummaryBox } from "@searchcraft/vue-sdk";
|
|
599
|
+
* ```
|
|
600
|
+
* @js-example ```html
|
|
601
|
+
* <searchcraft-summary-box />
|
|
602
|
+
* ```
|
|
603
|
+
* @react-example ```jsx
|
|
604
|
+
* <SearchcraftSummaryBox />
|
|
605
|
+
* ```
|
|
606
|
+
* @vue-example ```jsx
|
|
607
|
+
* <SearchcraftSummaryBox />
|
|
608
|
+
* ```
|
|
609
|
+
*/
|
|
610
|
+
interface SearchcraftSummaryBox {
|
|
611
|
+
/**
|
|
612
|
+
* The id of the Searchcraft instance that this component should use.
|
|
613
|
+
*/
|
|
614
|
+
"searchcraftId"?: string;
|
|
615
|
+
}
|
|
528
616
|
/**
|
|
529
617
|
* This web component adds Searchcraft's built-in css theme to your page. It does not render anything visible, its only function is to manage the css styles on the page.'
|
|
530
618
|
* @react-import ```jsx
|
|
@@ -553,6 +641,10 @@ export namespace Components {
|
|
|
553
641
|
* The label.
|
|
554
642
|
*/
|
|
555
643
|
"label": string;
|
|
644
|
+
/**
|
|
645
|
+
* The id of the Searchcraft instance that this component should use.
|
|
646
|
+
*/
|
|
647
|
+
"searchcraftId"?: string;
|
|
556
648
|
/**
|
|
557
649
|
* The secondary label displayed below the main label.
|
|
558
650
|
*/
|
|
@@ -742,6 +834,15 @@ declare global {
|
|
|
742
834
|
prototype: HTMLSearchcraftInputLabelElement;
|
|
743
835
|
new (): HTMLSearchcraftInputLabelElement;
|
|
744
836
|
};
|
|
837
|
+
/**
|
|
838
|
+
* Renders a loading spinner/loading state for use in things like the summary box.
|
|
839
|
+
*/
|
|
840
|
+
interface HTMLSearchcraftLoadingElement extends Components.SearchcraftLoading, HTMLStencilElement {
|
|
841
|
+
}
|
|
842
|
+
var HTMLSearchcraftLoadingElement: {
|
|
843
|
+
prototype: HTMLSearchcraftLoadingElement;
|
|
844
|
+
new (): HTMLSearchcraftLoadingElement;
|
|
845
|
+
};
|
|
745
846
|
/**
|
|
746
847
|
* This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
|
|
747
848
|
* @react-import ```jsx
|
|
@@ -1042,6 +1143,33 @@ declare global {
|
|
|
1042
1143
|
prototype: HTMLSearchcraftSliderElement;
|
|
1043
1144
|
new (): HTMLSearchcraftSliderElement;
|
|
1044
1145
|
};
|
|
1146
|
+
/**
|
|
1147
|
+
* This component renders a summary box for RAG search result summaries.
|
|
1148
|
+
* When the user makes a search, a network call is made to retrieve the summary content, which is then
|
|
1149
|
+
* rendered in this box.
|
|
1150
|
+
* NOTE: This component requires the usage of a read key that has "SUMMARY" permissions.
|
|
1151
|
+
* @react-import ```jsx
|
|
1152
|
+
* import { SearchcraftSummaryBox } from "@searchcraft/react-sdk";
|
|
1153
|
+
* ```
|
|
1154
|
+
* @vue-import ```jsx
|
|
1155
|
+
* import { SearchcraftSummaryBox } from "@searchcraft/vue-sdk";
|
|
1156
|
+
* ```
|
|
1157
|
+
* @js-example ```html
|
|
1158
|
+
* <searchcraft-summary-box />
|
|
1159
|
+
* ```
|
|
1160
|
+
* @react-example ```jsx
|
|
1161
|
+
* <SearchcraftSummaryBox />
|
|
1162
|
+
* ```
|
|
1163
|
+
* @vue-example ```jsx
|
|
1164
|
+
* <SearchcraftSummaryBox />
|
|
1165
|
+
* ```
|
|
1166
|
+
*/
|
|
1167
|
+
interface HTMLSearchcraftSummaryBoxElement extends Components.SearchcraftSummaryBox, HTMLStencilElement {
|
|
1168
|
+
}
|
|
1169
|
+
var HTMLSearchcraftSummaryBoxElement: {
|
|
1170
|
+
prototype: HTMLSearchcraftSummaryBoxElement;
|
|
1171
|
+
new (): HTMLSearchcraftSummaryBoxElement;
|
|
1172
|
+
};
|
|
1045
1173
|
/**
|
|
1046
1174
|
* This web component adds Searchcraft's built-in css theme to your page. It does not render anything visible, its only function is to manage the css styles on the page.'
|
|
1047
1175
|
* @react-import ```jsx
|
|
@@ -1094,6 +1222,7 @@ declare global {
|
|
|
1094
1222
|
"searchcraft-filter-panel": HTMLSearchcraftFilterPanelElement;
|
|
1095
1223
|
"searchcraft-input-form": HTMLSearchcraftInputFormElement;
|
|
1096
1224
|
"searchcraft-input-label": HTMLSearchcraftInputLabelElement;
|
|
1225
|
+
"searchcraft-loading": HTMLSearchcraftLoadingElement;
|
|
1097
1226
|
"searchcraft-pagination": HTMLSearchcraftPaginationElement;
|
|
1098
1227
|
"searchcraft-popover-button": HTMLSearchcraftPopoverButtonElement;
|
|
1099
1228
|
"searchcraft-popover-footer": HTMLSearchcraftPopoverFooterElement;
|
|
@@ -1106,6 +1235,7 @@ declare global {
|
|
|
1106
1235
|
"searchcraft-search-results-per-page": HTMLSearchcraftSearchResultsPerPageElement;
|
|
1107
1236
|
"searchcraft-select": HTMLSearchcraftSelectElement;
|
|
1108
1237
|
"searchcraft-slider": HTMLSearchcraftSliderElement;
|
|
1238
|
+
"searchcraft-summary-box": HTMLSearchcraftSummaryBoxElement;
|
|
1109
1239
|
"searchcraft-theme": HTMLSearchcraftThemeElement;
|
|
1110
1240
|
"searchcraft-toggle-button": HTMLSearchcraftToggleButtonElement;
|
|
1111
1241
|
}
|
|
@@ -1116,11 +1246,15 @@ declare namespace LocalJSX {
|
|
|
1116
1246
|
*/
|
|
1117
1247
|
interface SearchcraftAd {
|
|
1118
1248
|
"adClientResponseItem"?: AdClientResponseItem;
|
|
1119
|
-
"adSource"?:
|
|
1249
|
+
"adSource"?: 'Custom' | 'Nativo' | 'adMarketplace';
|
|
1120
1250
|
/**
|
|
1121
1251
|
* Where the ad is being rendered within the search results div. Lifecycle behavior differs for ads being rendered in different positions, so we need to be able to handle all of those cases.
|
|
1122
1252
|
*/
|
|
1123
1253
|
"renderPosition"?: 'interstitial' | 'top' | 'bottom';
|
|
1254
|
+
/**
|
|
1255
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1256
|
+
*/
|
|
1257
|
+
"searchcraftId"?: string;
|
|
1124
1258
|
}
|
|
1125
1259
|
/**
|
|
1126
1260
|
* This web component represents a button.
|
|
@@ -1194,6 +1328,10 @@ declare namespace LocalJSX {
|
|
|
1194
1328
|
* Emitted when the facets are updated.
|
|
1195
1329
|
*/
|
|
1196
1330
|
"onFacetSelectionUpdated"?: (event: SearchcraftFacetListCustomEvent<{ paths: string[] }>) => void;
|
|
1331
|
+
/**
|
|
1332
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1333
|
+
*/
|
|
1334
|
+
"searchcraftId"?: string;
|
|
1197
1335
|
}
|
|
1198
1336
|
/**
|
|
1199
1337
|
* This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.
|
|
@@ -1226,6 +1364,10 @@ declare namespace LocalJSX {
|
|
|
1226
1364
|
* The items to filter.
|
|
1227
1365
|
*/
|
|
1228
1366
|
"items"?: FilterItem[];
|
|
1367
|
+
/**
|
|
1368
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1369
|
+
*/
|
|
1370
|
+
"searchcraftId"?: string;
|
|
1229
1371
|
}
|
|
1230
1372
|
/**
|
|
1231
1373
|
* This web component provides a user-friendly interface for querying an indexed dataset, enabling users to easily search large collections of data.
|
|
@@ -1259,7 +1401,6 @@ declare namespace LocalJSX {
|
|
|
1259
1401
|
* Where to place the search button.
|
|
1260
1402
|
*/
|
|
1261
1403
|
"buttonPlacement"?: 'left' | 'right' | 'none';
|
|
1262
|
-
"core"?: SearchcraftCore;
|
|
1263
1404
|
/**
|
|
1264
1405
|
* The label rendered above the input.
|
|
1265
1406
|
*/
|
|
@@ -1284,6 +1425,10 @@ declare namespace LocalJSX {
|
|
|
1284
1425
|
* The input element's placeholder value.
|
|
1285
1426
|
*/
|
|
1286
1427
|
"placeholderValue"?: string;
|
|
1428
|
+
/**
|
|
1429
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1430
|
+
*/
|
|
1431
|
+
"searchcraftId"?: string;
|
|
1287
1432
|
}
|
|
1288
1433
|
/**
|
|
1289
1434
|
* This web component serves as the input label for the searchcraft-input-form component.
|
|
@@ -1298,6 +1443,12 @@ declare namespace LocalJSX {
|
|
|
1298
1443
|
"inputLabelClassName"?: string | undefined;
|
|
1299
1444
|
"label"?: string;
|
|
1300
1445
|
}
|
|
1446
|
+
/**
|
|
1447
|
+
* Renders a loading spinner/loading state for use in things like the summary box.
|
|
1448
|
+
*/
|
|
1449
|
+
interface SearchcraftLoading {
|
|
1450
|
+
"label"?: string;
|
|
1451
|
+
}
|
|
1301
1452
|
/**
|
|
1302
1453
|
* This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
|
|
1303
1454
|
* @react-import ```jsx
|
|
@@ -1317,6 +1468,10 @@ declare namespace LocalJSX {
|
|
|
1317
1468
|
* ```
|
|
1318
1469
|
*/
|
|
1319
1470
|
interface SearchcraftPagination {
|
|
1471
|
+
/**
|
|
1472
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1473
|
+
*/
|
|
1474
|
+
"searchcraftId"?: string;
|
|
1320
1475
|
}
|
|
1321
1476
|
/**
|
|
1322
1477
|
* Renders a button which, when clicked, turns on popover visibility.
|
|
@@ -1359,6 +1514,10 @@ declare namespace LocalJSX {
|
|
|
1359
1514
|
* ```
|
|
1360
1515
|
*/
|
|
1361
1516
|
interface SearchcraftPopoverButton {
|
|
1517
|
+
/**
|
|
1518
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1519
|
+
*/
|
|
1520
|
+
"searchcraftId"?: string;
|
|
1362
1521
|
/**
|
|
1363
1522
|
* A callback function responsible for rendering the button contents.
|
|
1364
1523
|
*/
|
|
@@ -1372,6 +1531,10 @@ declare namespace LocalJSX {
|
|
|
1372
1531
|
* Renders the footer for the searchcraft-popover-form.
|
|
1373
1532
|
*/
|
|
1374
1533
|
interface SearchcraftPopoverFooter {
|
|
1534
|
+
/**
|
|
1535
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1536
|
+
*/
|
|
1537
|
+
"searchcraftId"?: string;
|
|
1375
1538
|
}
|
|
1376
1539
|
/**
|
|
1377
1540
|
* This web component is designed to display search results in a popover container that dynamically appears when the user interacts with a search input field, or when a popover-button is pressed.
|
|
@@ -1410,6 +1573,10 @@ declare namespace LocalJSX {
|
|
|
1410
1573
|
* Formats the content rendered for each result.
|
|
1411
1574
|
*/
|
|
1412
1575
|
"popoverResultMappings"?: PopoverResultMappings;
|
|
1576
|
+
/**
|
|
1577
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1578
|
+
*/
|
|
1579
|
+
"searchcraftId"?: string;
|
|
1413
1580
|
/**
|
|
1414
1581
|
* The type of popover form to render. - `inline` - Renders inline with the rest of the content on the page. The search results pop over the page content. - `fullscreen` - Renders in fullscreen view. Used together with the `searchcraft-popover-button` component. - `modal` - Renders in a modal view. Used together with the `searchcraft-popover-button` component.
|
|
1415
1582
|
*/
|
|
@@ -1425,6 +1592,10 @@ declare namespace LocalJSX {
|
|
|
1425
1592
|
"documentPosition"?: number;
|
|
1426
1593
|
"item"?: SearchClientResponseItem | undefined;
|
|
1427
1594
|
"popoverResultMappings"?: PopoverResultMappings | undefined;
|
|
1595
|
+
/**
|
|
1596
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1597
|
+
*/
|
|
1598
|
+
"searchcraftId"?: string;
|
|
1428
1599
|
}
|
|
1429
1600
|
/**
|
|
1430
1601
|
* This web component is designed to display a list of results within a popover interface.
|
|
@@ -1445,6 +1616,10 @@ declare namespace LocalJSX {
|
|
|
1445
1616
|
"searchClientResponseItems"?: SearchClientResponseItem[] | undefined;
|
|
1446
1617
|
"searchResultsPage": number;
|
|
1447
1618
|
"searchResultsPerPage": number;
|
|
1619
|
+
/**
|
|
1620
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1621
|
+
*/
|
|
1622
|
+
"searchcraftId"?: string;
|
|
1448
1623
|
}
|
|
1449
1624
|
/**
|
|
1450
1625
|
* This web component is designed to display the number of results returned from a search query.
|
|
@@ -1481,6 +1656,10 @@ declare namespace LocalJSX {
|
|
|
1481
1656
|
* ```
|
|
1482
1657
|
*/
|
|
1483
1658
|
interface SearchcraftResultsInfo {
|
|
1659
|
+
/**
|
|
1660
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1661
|
+
*/
|
|
1662
|
+
"searchcraftId"?: string;
|
|
1484
1663
|
/**
|
|
1485
1664
|
* A callback function responsible for rendering the results info.
|
|
1486
1665
|
*/
|
|
@@ -1499,6 +1678,10 @@ declare namespace LocalJSX {
|
|
|
1499
1678
|
*/
|
|
1500
1679
|
"index": number;
|
|
1501
1680
|
"item"?: SearchClientResponseItem;
|
|
1681
|
+
/**
|
|
1682
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1683
|
+
*/
|
|
1684
|
+
"searchcraftId"?: string;
|
|
1502
1685
|
/**
|
|
1503
1686
|
* A callback function responsible for rendering a result.
|
|
1504
1687
|
*/
|
|
@@ -1550,6 +1733,10 @@ declare namespace LocalJSX {
|
|
|
1550
1733
|
* A query that will appears when the component initializes or the search term is ''..
|
|
1551
1734
|
*/
|
|
1552
1735
|
"initialQuery"?: string;
|
|
1736
|
+
/**
|
|
1737
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1738
|
+
*/
|
|
1739
|
+
"searchcraftId"?: string;
|
|
1553
1740
|
/**
|
|
1554
1741
|
* A callback function responsible for rendering a result. Passed to `searchcraft-search-result`.
|
|
1555
1742
|
*/
|
|
@@ -1579,6 +1766,10 @@ declare namespace LocalJSX {
|
|
|
1579
1766
|
* The amount the options will increase (e.g. 20 = [20, 40, 60, 80, 100]). The base value is defined by the `searchResultsPerPage` option in the configuration.
|
|
1580
1767
|
*/
|
|
1581
1768
|
"increment"?: string | number;
|
|
1769
|
+
/**
|
|
1770
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1771
|
+
*/
|
|
1772
|
+
"searchcraftId"?: string;
|
|
1582
1773
|
}
|
|
1583
1774
|
/**
|
|
1584
1775
|
* This web component is designed to allow users to select between a group of options.
|
|
@@ -1654,6 +1845,33 @@ declare namespace LocalJSX {
|
|
|
1654
1845
|
*/
|
|
1655
1846
|
"step"?: number;
|
|
1656
1847
|
}
|
|
1848
|
+
/**
|
|
1849
|
+
* This component renders a summary box for RAG search result summaries.
|
|
1850
|
+
* When the user makes a search, a network call is made to retrieve the summary content, which is then
|
|
1851
|
+
* rendered in this box.
|
|
1852
|
+
* NOTE: This component requires the usage of a read key that has "SUMMARY" permissions.
|
|
1853
|
+
* @react-import ```jsx
|
|
1854
|
+
* import { SearchcraftSummaryBox } from "@searchcraft/react-sdk";
|
|
1855
|
+
* ```
|
|
1856
|
+
* @vue-import ```jsx
|
|
1857
|
+
* import { SearchcraftSummaryBox } from "@searchcraft/vue-sdk";
|
|
1858
|
+
* ```
|
|
1859
|
+
* @js-example ```html
|
|
1860
|
+
* <searchcraft-summary-box />
|
|
1861
|
+
* ```
|
|
1862
|
+
* @react-example ```jsx
|
|
1863
|
+
* <SearchcraftSummaryBox />
|
|
1864
|
+
* ```
|
|
1865
|
+
* @vue-example ```jsx
|
|
1866
|
+
* <SearchcraftSummaryBox />
|
|
1867
|
+
* ```
|
|
1868
|
+
*/
|
|
1869
|
+
interface SearchcraftSummaryBox {
|
|
1870
|
+
/**
|
|
1871
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1872
|
+
*/
|
|
1873
|
+
"searchcraftId"?: string;
|
|
1874
|
+
}
|
|
1657
1875
|
/**
|
|
1658
1876
|
* This web component adds Searchcraft's built-in css theme to your page. It does not render anything visible, its only function is to manage the css styles on the page.'
|
|
1659
1877
|
* @react-import ```jsx
|
|
@@ -1686,6 +1904,10 @@ declare namespace LocalJSX {
|
|
|
1686
1904
|
* When the toggle element is changed.
|
|
1687
1905
|
*/
|
|
1688
1906
|
"onToggleUpdated"?: (event: SearchcraftToggleButtonCustomEvent<boolean>) => void;
|
|
1907
|
+
/**
|
|
1908
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1909
|
+
*/
|
|
1910
|
+
"searchcraftId"?: string;
|
|
1689
1911
|
/**
|
|
1690
1912
|
* The secondary label displayed below the main label.
|
|
1691
1913
|
*/
|
|
@@ -1699,6 +1921,7 @@ declare namespace LocalJSX {
|
|
|
1699
1921
|
"searchcraft-filter-panel": SearchcraftFilterPanel;
|
|
1700
1922
|
"searchcraft-input-form": SearchcraftInputForm;
|
|
1701
1923
|
"searchcraft-input-label": SearchcraftInputLabel;
|
|
1924
|
+
"searchcraft-loading": SearchcraftLoading;
|
|
1702
1925
|
"searchcraft-pagination": SearchcraftPagination;
|
|
1703
1926
|
"searchcraft-popover-button": SearchcraftPopoverButton;
|
|
1704
1927
|
"searchcraft-popover-footer": SearchcraftPopoverFooter;
|
|
@@ -1711,6 +1934,7 @@ declare namespace LocalJSX {
|
|
|
1711
1934
|
"searchcraft-search-results-per-page": SearchcraftSearchResultsPerPage;
|
|
1712
1935
|
"searchcraft-select": SearchcraftSelect;
|
|
1713
1936
|
"searchcraft-slider": SearchcraftSlider;
|
|
1937
|
+
"searchcraft-summary-box": SearchcraftSummaryBox;
|
|
1714
1938
|
"searchcraft-theme": SearchcraftTheme;
|
|
1715
1939
|
"searchcraft-toggle-button": SearchcraftToggleButton;
|
|
1716
1940
|
}
|
|
@@ -1807,6 +2031,10 @@ declare module "@stencil/core" {
|
|
|
1807
2031
|
* ```
|
|
1808
2032
|
*/
|
|
1809
2033
|
"searchcraft-input-label": LocalJSX.SearchcraftInputLabel & JSXBase.HTMLAttributes<HTMLSearchcraftInputLabelElement>;
|
|
2034
|
+
/**
|
|
2035
|
+
* Renders a loading spinner/loading state for use in things like the summary box.
|
|
2036
|
+
*/
|
|
2037
|
+
"searchcraft-loading": LocalJSX.SearchcraftLoading & JSXBase.HTMLAttributes<HTMLSearchcraftLoadingElement>;
|
|
1810
2038
|
/**
|
|
1811
2039
|
* This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
|
|
1812
2040
|
* @react-import ```jsx
|
|
@@ -2025,6 +2253,28 @@ declare module "@stencil/core" {
|
|
|
2025
2253
|
* This web component is designed to allow users to select a value from a range defined by a minimum and maximum value. The component renders a slider interface, which can be used to visually choose a value between two boundaries.
|
|
2026
2254
|
*/
|
|
2027
2255
|
"searchcraft-slider": LocalJSX.SearchcraftSlider & JSXBase.HTMLAttributes<HTMLSearchcraftSliderElement>;
|
|
2256
|
+
/**
|
|
2257
|
+
* This component renders a summary box for RAG search result summaries.
|
|
2258
|
+
* When the user makes a search, a network call is made to retrieve the summary content, which is then
|
|
2259
|
+
* rendered in this box.
|
|
2260
|
+
* NOTE: This component requires the usage of a read key that has "SUMMARY" permissions.
|
|
2261
|
+
* @react-import ```jsx
|
|
2262
|
+
* import { SearchcraftSummaryBox } from "@searchcraft/react-sdk";
|
|
2263
|
+
* ```
|
|
2264
|
+
* @vue-import ```jsx
|
|
2265
|
+
* import { SearchcraftSummaryBox } from "@searchcraft/vue-sdk";
|
|
2266
|
+
* ```
|
|
2267
|
+
* @js-example ```html
|
|
2268
|
+
* <searchcraft-summary-box />
|
|
2269
|
+
* ```
|
|
2270
|
+
* @react-example ```jsx
|
|
2271
|
+
* <SearchcraftSummaryBox />
|
|
2272
|
+
* ```
|
|
2273
|
+
* @vue-example ```jsx
|
|
2274
|
+
* <SearchcraftSummaryBox />
|
|
2275
|
+
* ```
|
|
2276
|
+
*/
|
|
2277
|
+
"searchcraft-summary-box": LocalJSX.SearchcraftSummaryBox & JSXBase.HTMLAttributes<HTMLSearchcraftSummaryBoxElement>;
|
|
2028
2278
|
/**
|
|
2029
2279
|
* This web component adds Searchcraft's built-in css theme to your page. It does not render anything visible, its only function is to manage the css styles on the page.'
|
|
2030
2280
|
* @react-import ```jsx
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { SearchcraftCore } from "./classes/index";
|
|
2
|
+
import type { SearchcraftConfig } from "./types/index";
|
|
3
3
|
/**
|
|
4
4
|
* @fileoverview entry point for your component library
|
|
5
5
|
*
|
|
@@ -13,14 +13,13 @@ import { searchcraftStore } from "./store/index";
|
|
|
13
13
|
* The consumer-facing `Searchcraft` class.
|
|
14
14
|
*/
|
|
15
15
|
export declare class Searchcraft extends SearchcraftCore {
|
|
16
|
-
constructor(config: SearchcraftConfig);
|
|
16
|
+
constructor(config: SearchcraftConfig, searchcraftId?: string | undefined);
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Exports the shared types that all SDKs need
|
|
20
20
|
*/
|
|
21
21
|
export type { SearchcraftConfig };
|
|
22
|
-
export { searchcraftStore };
|
|
23
22
|
export type { Components, JSX } from './components';
|
|
24
23
|
export { SearchcraftCore };
|
|
25
|
-
export type * from '@
|
|
24
|
+
export type * from '@types';
|
|
26
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,24 +1,19 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { StoreApi } from 'zustand';
|
|
2
|
+
import type { FacetPathsForIndexField, FacetPrime, RangeValueForIndexField, SearchClientResponseItem, AdClientResponseItem, SearchClientRequestProperties, SearchClientRequest } from "../types/index";
|
|
3
|
+
import type { SearchcraftCore } from "../classes/index";
|
|
4
|
+
import type { SummaryClient } from "../clients/SummaryClient";
|
|
2
5
|
/**
|
|
3
6
|
* Callable functions made available by the SearchcraftStore.
|
|
4
7
|
*/
|
|
5
8
|
export interface SearchcraftStateFunctions {
|
|
6
9
|
addFacetPathsForIndexField: (field: FacetPathsForIndexField) => void;
|
|
7
10
|
addRangeValueForIndexField: (field: RangeValueForIndexField) => void;
|
|
8
|
-
getSearchcraftCore: () => SearchcraftCore | undefined;
|
|
9
|
-
init: (searchcraft: SearchcraftCore | undefined, debug?: boolean) => void;
|
|
10
11
|
removeFacetPathsForIndexField: (fieldName: string) => void;
|
|
11
12
|
removeRangeValueForIndexField: (fieldName: string) => void;
|
|
12
|
-
|
|
13
|
+
resetSearchValues: () => void;
|
|
13
14
|
search: () => Promise<void>;
|
|
14
|
-
set: (state: Partial<SearchcraftState> | ((state: SearchcraftState) => Partial<SearchcraftState>)) => SearchcraftState;
|
|
15
|
-
setAdClientResponseItems: (items: AdClientResponseItem[]) => void;
|
|
16
|
-
setSearchClientResponseItemsFromResponse: (request: SearchClientRequestProperties | string, response: SearchcraftResponse, items: SearchClientResponseItem[], supplementalResponse: SearchcraftResponse | undefined) => void;
|
|
17
|
-
setInitialSearchClientResponseItemsFromResponse: (request: SearchClientRequestProperties | string, response: SearchcraftResponse, items: SearchClientResponseItem[]) => void;
|
|
18
|
-
setInitialQuery: (query: string) => void;
|
|
19
15
|
setPopoverVisibility: (isVisible: boolean) => void;
|
|
20
16
|
setSearchResultsCount: (count: number) => void;
|
|
21
|
-
setSearchClientResponseItems: (items: SearchClientResponseItem[]) => void;
|
|
22
17
|
setSearchResultsPage: (page: number) => void;
|
|
23
18
|
setSearchResultsPerPage: (perPage: number) => void;
|
|
24
19
|
setSearchTerm: (searchTerm: string) => void;
|
|
@@ -34,19 +29,19 @@ export interface SearchcraftStateFunctions {
|
|
|
34
29
|
*/
|
|
35
30
|
export interface SearchcraftStateValues {
|
|
36
31
|
adClientResponseItems: AdClientResponseItem[];
|
|
32
|
+
cachedAdClientResponseItems: AdClientResponseItem[];
|
|
37
33
|
core: SearchcraftCore | undefined;
|
|
38
34
|
hotkey: string;
|
|
39
35
|
hotkeyModifier: 'ctrl' | 'meta' | 'alt' | 'option';
|
|
40
|
-
logger: Logger | undefined;
|
|
41
36
|
facetPathsForIndexFields: Record<string, FacetPathsForIndexField>;
|
|
42
|
-
initialQuery: string;
|
|
43
|
-
initialSearchClientResponseItems: SearchClientResponseItem[];
|
|
44
37
|
isPopoverVisible: boolean;
|
|
45
38
|
isSearchInProgress: boolean;
|
|
46
39
|
rangeValueForIndexFields: Record<string, RangeValueForIndexField>;
|
|
47
40
|
searchMode: 'fuzzy' | 'exact';
|
|
48
|
-
searchClientRequest
|
|
41
|
+
searchClientRequest?: SearchClientRequest;
|
|
42
|
+
searchClientRequestProperties: SearchClientRequestProperties | string | undefined | null;
|
|
49
43
|
searchClientResponseItems: SearchClientResponseItem[];
|
|
44
|
+
cachedSearchClientResponseItems: SearchClientResponseItem[];
|
|
50
45
|
searchResponseTimeTaken: number | undefined;
|
|
51
46
|
searchResponseFacetPrime: FacetPrime | undefined | null;
|
|
52
47
|
supplementalFacetPrime: FacetPrime | undefined | null;
|
|
@@ -56,8 +51,12 @@ export interface SearchcraftStateValues {
|
|
|
56
51
|
searchTerm: string;
|
|
57
52
|
orderByField: string | undefined | null;
|
|
58
53
|
sortType: 'asc' | 'desc' | undefined | null;
|
|
59
|
-
|
|
54
|
+
summary: string;
|
|
55
|
+
hasSummaryBox: boolean;
|
|
56
|
+
isSummaryLoading: boolean;
|
|
57
|
+
summaryClient?: SummaryClient;
|
|
60
58
|
}
|
|
61
59
|
export interface SearchcraftState extends SearchcraftStateFunctions, SearchcraftStateValues {
|
|
62
60
|
}
|
|
61
|
+
export type SearchcraftStore = StoreApi<SearchcraftState>;
|
|
63
62
|
//# sourceMappingURL=SearchcraftStore.types.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type StoreApi } from 'zustand';
|
|
2
|
+
import type { SearchcraftState, SearchcraftStateValues } from './SearchcraftStore.types';
|
|
3
|
+
/**
|
|
4
|
+
* This is a factory function for creating new searchcraft stores.
|
|
5
|
+
*
|
|
6
|
+
* Searchcraft Stores contain the state information used by a SearchcraftCore instance.
|
|
7
|
+
*
|
|
8
|
+
* This factory function only needs to be called when a new SearchcraftCore is instantiated.
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
declare const createSearchcraftStore: (searchcraftId: string | undefined, initialState?: Partial<SearchcraftStateValues>) => StoreApi<SearchcraftState>;
|
|
12
|
+
export { createSearchcraftStore };
|
|
13
|
+
//# sourceMappingURL=SearchcraftStoreFactory.d.ts.map
|