@searchcraft/javascript-sdk 0.10.6 → 0.11.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/components/defineCustomElements.js +4 -0
- package/dist/components/index.d.ts +541 -221
- package/dist/components/index.js +1655 -8
- package/dist/components/index.js.map +1 -1
- package/dist/components/{p-b194d081.js → p-0c495408.js} +30 -20
- package/dist/components/p-0c495408.js.map +1 -0
- package/dist/components/{p-9f4c50ed.js → p-1d5c5536.js} +18 -8
- package/dist/components/p-1d5c5536.js.map +1 -0
- package/dist/components/{p-f2976b33.js → p-3286bbb3.js} +22 -10
- package/dist/components/p-3286bbb3.js.map +1 -0
- package/dist/components/{p-75134ca7.js → p-3e41546c.js} +17 -8
- package/dist/components/p-3e41546c.js.map +1 -0
- package/dist/components/{p-6e5ed641.js → p-87435aac.js} +98 -42
- 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-aba24c85.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-a7d611cd.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-2735dceb.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 +5340 -4085
- package/dist/hydrate/index.mjs +5340 -4085
- 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 +31 -4
- 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 +264 -8
- 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-2735dceb.js.map +0 -1
- package/dist/components/p-6e5ed641.js.map +0 -1
- package/dist/components/p-75134ca7.js.map +0 -1
- package/dist/components/p-810a7850.js.map +0 -1
- package/dist/components/p-9f4c50ed.js.map +0 -1
- package/dist/components/p-a7d611cd.js.map +0 -1
- package/dist/components/p-aba24c85.js.map +0 -1
- package/dist/components/p-b194d081.js.map +0 -1
- package/dist/components/p-b54873ff.js +0 -1928
- package/dist/components/p-b54873ff.js.map +0 -1
- package/dist/components/p-f2976b33.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,8 +15,15 @@ export namespace Components {
|
|
|
15
15
|
*/
|
|
16
16
|
interface SearchcraftAd {
|
|
17
17
|
"adClientResponseItem"?: AdClientResponseItem;
|
|
18
|
-
"
|
|
19
|
-
|
|
18
|
+
"adSource": 'Custom' | 'Nativo' | 'adMarketplace';
|
|
19
|
+
/**
|
|
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
|
+
*/
|
|
22
|
+
"renderPosition": 'interstitial' | 'top' | 'bottom';
|
|
23
|
+
/**
|
|
24
|
+
* The id of the Searchcraft instance that this component should use.
|
|
25
|
+
*/
|
|
26
|
+
"searchcraftId"?: string;
|
|
20
27
|
}
|
|
21
28
|
/**
|
|
22
29
|
* This web component represents a button.
|
|
@@ -82,6 +89,10 @@ export namespace Components {
|
|
|
82
89
|
* The name of the field where facets are applied.
|
|
83
90
|
*/
|
|
84
91
|
"fieldName": string;
|
|
92
|
+
/**
|
|
93
|
+
* The id of the Searchcraft instance that this component should use.
|
|
94
|
+
*/
|
|
95
|
+
"searchcraftId"?: string;
|
|
85
96
|
}
|
|
86
97
|
/**
|
|
87
98
|
* This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.
|
|
@@ -114,6 +125,10 @@ export namespace Components {
|
|
|
114
125
|
* The items to filter.
|
|
115
126
|
*/
|
|
116
127
|
"items": FilterItem[];
|
|
128
|
+
/**
|
|
129
|
+
* The id of the Searchcraft instance that this component should use.
|
|
130
|
+
*/
|
|
131
|
+
"searchcraftId"?: string;
|
|
117
132
|
}
|
|
118
133
|
/**
|
|
119
134
|
* This web component provides a user-friendly interface for querying an indexed dataset, enabling users to easily search large collections of data.
|
|
@@ -147,7 +162,6 @@ export namespace Components {
|
|
|
147
162
|
* Where to place the search button.
|
|
148
163
|
*/
|
|
149
164
|
"buttonPlacement"?: 'left' | 'right' | 'none';
|
|
150
|
-
"core"?: SearchcraftCore;
|
|
151
165
|
/**
|
|
152
166
|
* The label rendered above the input.
|
|
153
167
|
*/
|
|
@@ -160,6 +174,10 @@ export namespace Components {
|
|
|
160
174
|
* The input element's placeholder value.
|
|
161
175
|
*/
|
|
162
176
|
"placeholderValue"?: string;
|
|
177
|
+
/**
|
|
178
|
+
* The id of the Searchcraft instance that this component should use.
|
|
179
|
+
*/
|
|
180
|
+
"searchcraftId"?: string;
|
|
163
181
|
}
|
|
164
182
|
/**
|
|
165
183
|
* This web component serves as the input label for the searchcraft-input-form component.
|
|
@@ -174,6 +192,12 @@ export namespace Components {
|
|
|
174
192
|
"inputLabelClassName"?: string | undefined;
|
|
175
193
|
"label": string;
|
|
176
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
|
+
}
|
|
177
201
|
/**
|
|
178
202
|
* This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
|
|
179
203
|
* @react-import ```jsx
|
|
@@ -193,6 +217,10 @@ export namespace Components {
|
|
|
193
217
|
* ```
|
|
194
218
|
*/
|
|
195
219
|
interface SearchcraftPagination {
|
|
220
|
+
/**
|
|
221
|
+
* The id of the Searchcraft instance that this component should use.
|
|
222
|
+
*/
|
|
223
|
+
"searchcraftId"?: string;
|
|
196
224
|
}
|
|
197
225
|
/**
|
|
198
226
|
* Renders a button which, when clicked, turns on popover visibility.
|
|
@@ -235,6 +263,10 @@ export namespace Components {
|
|
|
235
263
|
* ```
|
|
236
264
|
*/
|
|
237
265
|
interface SearchcraftPopoverButton {
|
|
266
|
+
/**
|
|
267
|
+
* The id of the Searchcraft instance that this component should use.
|
|
268
|
+
*/
|
|
269
|
+
"searchcraftId"?: string;
|
|
238
270
|
/**
|
|
239
271
|
* A callback function responsible for rendering the button contents.
|
|
240
272
|
*/
|
|
@@ -248,6 +280,10 @@ export namespace Components {
|
|
|
248
280
|
* Renders the footer for the searchcraft-popover-form.
|
|
249
281
|
*/
|
|
250
282
|
interface SearchcraftPopoverFooter {
|
|
283
|
+
/**
|
|
284
|
+
* The id of the Searchcraft instance that this component should use.
|
|
285
|
+
*/
|
|
286
|
+
"searchcraftId"?: string;
|
|
251
287
|
}
|
|
252
288
|
/**
|
|
253
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.
|
|
@@ -286,6 +322,10 @@ export namespace Components {
|
|
|
286
322
|
* Formats the content rendered for each result.
|
|
287
323
|
*/
|
|
288
324
|
"popoverResultMappings"?: PopoverResultMappings;
|
|
325
|
+
/**
|
|
326
|
+
* The id of the Searchcraft instance that this component should use.
|
|
327
|
+
*/
|
|
328
|
+
"searchcraftId"?: string;
|
|
289
329
|
/**
|
|
290
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.
|
|
291
331
|
*/
|
|
@@ -301,6 +341,10 @@ export namespace Components {
|
|
|
301
341
|
"documentPosition": number;
|
|
302
342
|
"item": SearchClientResponseItem | undefined;
|
|
303
343
|
"popoverResultMappings": PopoverResultMappings | undefined;
|
|
344
|
+
/**
|
|
345
|
+
* The id of the Searchcraft instance that this component should use.
|
|
346
|
+
*/
|
|
347
|
+
"searchcraftId"?: string;
|
|
304
348
|
}
|
|
305
349
|
/**
|
|
306
350
|
* This web component is designed to display a list of results within a popover interface.
|
|
@@ -321,6 +365,10 @@ export namespace Components {
|
|
|
321
365
|
"searchClientResponseItems": SearchClientResponseItem[] | undefined;
|
|
322
366
|
"searchResultsPage": number;
|
|
323
367
|
"searchResultsPerPage": number;
|
|
368
|
+
/**
|
|
369
|
+
* The id of the Searchcraft instance that this component should use.
|
|
370
|
+
*/
|
|
371
|
+
"searchcraftId"?: string;
|
|
324
372
|
}
|
|
325
373
|
/**
|
|
326
374
|
* This web component is designed to display the number of results returned from a search query.
|
|
@@ -357,6 +405,10 @@ export namespace Components {
|
|
|
357
405
|
* ```
|
|
358
406
|
*/
|
|
359
407
|
interface SearchcraftResultsInfo {
|
|
408
|
+
/**
|
|
409
|
+
* The id of the Searchcraft instance that this component should use.
|
|
410
|
+
*/
|
|
411
|
+
"searchcraftId"?: string;
|
|
360
412
|
/**
|
|
361
413
|
* A callback function responsible for rendering the results info.
|
|
362
414
|
*/
|
|
@@ -375,6 +427,10 @@ export namespace Components {
|
|
|
375
427
|
*/
|
|
376
428
|
"index": number;
|
|
377
429
|
"item"?: SearchClientResponseItem;
|
|
430
|
+
/**
|
|
431
|
+
* The id of the Searchcraft instance that this component should use.
|
|
432
|
+
*/
|
|
433
|
+
"searchcraftId"?: string;
|
|
378
434
|
/**
|
|
379
435
|
* A callback function responsible for rendering a result.
|
|
380
436
|
*/
|
|
@@ -426,6 +482,10 @@ export namespace Components {
|
|
|
426
482
|
* A query that will appears when the component initializes or the search term is ''..
|
|
427
483
|
*/
|
|
428
484
|
"initialQuery"?: string;
|
|
485
|
+
/**
|
|
486
|
+
* The id of the Searchcraft instance that this component should use.
|
|
487
|
+
*/
|
|
488
|
+
"searchcraftId"?: string;
|
|
429
489
|
/**
|
|
430
490
|
* A callback function responsible for rendering a result. Passed to `searchcraft-search-result`.
|
|
431
491
|
*/
|
|
@@ -455,6 +515,10 @@ export namespace Components {
|
|
|
455
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.
|
|
456
516
|
*/
|
|
457
517
|
"increment": string | number;
|
|
518
|
+
/**
|
|
519
|
+
* The id of the Searchcraft instance that this component should use.
|
|
520
|
+
*/
|
|
521
|
+
"searchcraftId"?: string;
|
|
458
522
|
}
|
|
459
523
|
/**
|
|
460
524
|
* This web component is designed to allow users to select between a group of options.
|
|
@@ -522,6 +586,33 @@ export namespace Components {
|
|
|
522
586
|
*/
|
|
523
587
|
"step": number;
|
|
524
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
|
+
}
|
|
525
616
|
/**
|
|
526
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.'
|
|
527
618
|
* @react-import ```jsx
|
|
@@ -550,6 +641,10 @@ export namespace Components {
|
|
|
550
641
|
* The label.
|
|
551
642
|
*/
|
|
552
643
|
"label": string;
|
|
644
|
+
/**
|
|
645
|
+
* The id of the Searchcraft instance that this component should use.
|
|
646
|
+
*/
|
|
647
|
+
"searchcraftId"?: string;
|
|
553
648
|
/**
|
|
554
649
|
* The secondary label displayed below the main label.
|
|
555
650
|
*/
|
|
@@ -739,6 +834,15 @@ declare global {
|
|
|
739
834
|
prototype: HTMLSearchcraftInputLabelElement;
|
|
740
835
|
new (): HTMLSearchcraftInputLabelElement;
|
|
741
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
|
+
};
|
|
742
846
|
/**
|
|
743
847
|
* This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
|
|
744
848
|
* @react-import ```jsx
|
|
@@ -1039,6 +1143,33 @@ declare global {
|
|
|
1039
1143
|
prototype: HTMLSearchcraftSliderElement;
|
|
1040
1144
|
new (): HTMLSearchcraftSliderElement;
|
|
1041
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
|
+
};
|
|
1042
1173
|
/**
|
|
1043
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.'
|
|
1044
1175
|
* @react-import ```jsx
|
|
@@ -1091,6 +1222,7 @@ declare global {
|
|
|
1091
1222
|
"searchcraft-filter-panel": HTMLSearchcraftFilterPanelElement;
|
|
1092
1223
|
"searchcraft-input-form": HTMLSearchcraftInputFormElement;
|
|
1093
1224
|
"searchcraft-input-label": HTMLSearchcraftInputLabelElement;
|
|
1225
|
+
"searchcraft-loading": HTMLSearchcraftLoadingElement;
|
|
1094
1226
|
"searchcraft-pagination": HTMLSearchcraftPaginationElement;
|
|
1095
1227
|
"searchcraft-popover-button": HTMLSearchcraftPopoverButtonElement;
|
|
1096
1228
|
"searchcraft-popover-footer": HTMLSearchcraftPopoverFooterElement;
|
|
@@ -1103,6 +1235,7 @@ declare global {
|
|
|
1103
1235
|
"searchcraft-search-results-per-page": HTMLSearchcraftSearchResultsPerPageElement;
|
|
1104
1236
|
"searchcraft-select": HTMLSearchcraftSelectElement;
|
|
1105
1237
|
"searchcraft-slider": HTMLSearchcraftSliderElement;
|
|
1238
|
+
"searchcraft-summary-box": HTMLSearchcraftSummaryBoxElement;
|
|
1106
1239
|
"searchcraft-theme": HTMLSearchcraftThemeElement;
|
|
1107
1240
|
"searchcraft-toggle-button": HTMLSearchcraftToggleButtonElement;
|
|
1108
1241
|
}
|
|
@@ -1113,8 +1246,15 @@ declare namespace LocalJSX {
|
|
|
1113
1246
|
*/
|
|
1114
1247
|
interface SearchcraftAd {
|
|
1115
1248
|
"adClientResponseItem"?: AdClientResponseItem;
|
|
1116
|
-
"
|
|
1117
|
-
|
|
1249
|
+
"adSource"?: 'Custom' | 'Nativo' | 'adMarketplace';
|
|
1250
|
+
/**
|
|
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.
|
|
1252
|
+
*/
|
|
1253
|
+
"renderPosition"?: 'interstitial' | 'top' | 'bottom';
|
|
1254
|
+
/**
|
|
1255
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1256
|
+
*/
|
|
1257
|
+
"searchcraftId"?: string;
|
|
1118
1258
|
}
|
|
1119
1259
|
/**
|
|
1120
1260
|
* This web component represents a button.
|
|
@@ -1188,6 +1328,10 @@ declare namespace LocalJSX {
|
|
|
1188
1328
|
* Emitted when the facets are updated.
|
|
1189
1329
|
*/
|
|
1190
1330
|
"onFacetSelectionUpdated"?: (event: SearchcraftFacetListCustomEvent<{ paths: string[] }>) => void;
|
|
1331
|
+
/**
|
|
1332
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1333
|
+
*/
|
|
1334
|
+
"searchcraftId"?: string;
|
|
1191
1335
|
}
|
|
1192
1336
|
/**
|
|
1193
1337
|
* This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.
|
|
@@ -1220,6 +1364,10 @@ declare namespace LocalJSX {
|
|
|
1220
1364
|
* The items to filter.
|
|
1221
1365
|
*/
|
|
1222
1366
|
"items"?: FilterItem[];
|
|
1367
|
+
/**
|
|
1368
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1369
|
+
*/
|
|
1370
|
+
"searchcraftId"?: string;
|
|
1223
1371
|
}
|
|
1224
1372
|
/**
|
|
1225
1373
|
* This web component provides a user-friendly interface for querying an indexed dataset, enabling users to easily search large collections of data.
|
|
@@ -1253,7 +1401,6 @@ declare namespace LocalJSX {
|
|
|
1253
1401
|
* Where to place the search button.
|
|
1254
1402
|
*/
|
|
1255
1403
|
"buttonPlacement"?: 'left' | 'right' | 'none';
|
|
1256
|
-
"core"?: SearchcraftCore;
|
|
1257
1404
|
/**
|
|
1258
1405
|
* The label rendered above the input.
|
|
1259
1406
|
*/
|
|
@@ -1278,6 +1425,10 @@ declare namespace LocalJSX {
|
|
|
1278
1425
|
* The input element's placeholder value.
|
|
1279
1426
|
*/
|
|
1280
1427
|
"placeholderValue"?: string;
|
|
1428
|
+
/**
|
|
1429
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1430
|
+
*/
|
|
1431
|
+
"searchcraftId"?: string;
|
|
1281
1432
|
}
|
|
1282
1433
|
/**
|
|
1283
1434
|
* This web component serves as the input label for the searchcraft-input-form component.
|
|
@@ -1292,6 +1443,12 @@ declare namespace LocalJSX {
|
|
|
1292
1443
|
"inputLabelClassName"?: string | undefined;
|
|
1293
1444
|
"label"?: string;
|
|
1294
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
|
+
}
|
|
1295
1452
|
/**
|
|
1296
1453
|
* This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
|
|
1297
1454
|
* @react-import ```jsx
|
|
@@ -1311,6 +1468,10 @@ declare namespace LocalJSX {
|
|
|
1311
1468
|
* ```
|
|
1312
1469
|
*/
|
|
1313
1470
|
interface SearchcraftPagination {
|
|
1471
|
+
/**
|
|
1472
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1473
|
+
*/
|
|
1474
|
+
"searchcraftId"?: string;
|
|
1314
1475
|
}
|
|
1315
1476
|
/**
|
|
1316
1477
|
* Renders a button which, when clicked, turns on popover visibility.
|
|
@@ -1353,6 +1514,10 @@ declare namespace LocalJSX {
|
|
|
1353
1514
|
* ```
|
|
1354
1515
|
*/
|
|
1355
1516
|
interface SearchcraftPopoverButton {
|
|
1517
|
+
/**
|
|
1518
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1519
|
+
*/
|
|
1520
|
+
"searchcraftId"?: string;
|
|
1356
1521
|
/**
|
|
1357
1522
|
* A callback function responsible for rendering the button contents.
|
|
1358
1523
|
*/
|
|
@@ -1366,6 +1531,10 @@ declare namespace LocalJSX {
|
|
|
1366
1531
|
* Renders the footer for the searchcraft-popover-form.
|
|
1367
1532
|
*/
|
|
1368
1533
|
interface SearchcraftPopoverFooter {
|
|
1534
|
+
/**
|
|
1535
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1536
|
+
*/
|
|
1537
|
+
"searchcraftId"?: string;
|
|
1369
1538
|
}
|
|
1370
1539
|
/**
|
|
1371
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.
|
|
@@ -1404,6 +1573,10 @@ declare namespace LocalJSX {
|
|
|
1404
1573
|
* Formats the content rendered for each result.
|
|
1405
1574
|
*/
|
|
1406
1575
|
"popoverResultMappings"?: PopoverResultMappings;
|
|
1576
|
+
/**
|
|
1577
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1578
|
+
*/
|
|
1579
|
+
"searchcraftId"?: string;
|
|
1407
1580
|
/**
|
|
1408
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.
|
|
1409
1582
|
*/
|
|
@@ -1419,6 +1592,10 @@ declare namespace LocalJSX {
|
|
|
1419
1592
|
"documentPosition"?: number;
|
|
1420
1593
|
"item"?: SearchClientResponseItem | undefined;
|
|
1421
1594
|
"popoverResultMappings"?: PopoverResultMappings | undefined;
|
|
1595
|
+
/**
|
|
1596
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1597
|
+
*/
|
|
1598
|
+
"searchcraftId"?: string;
|
|
1422
1599
|
}
|
|
1423
1600
|
/**
|
|
1424
1601
|
* This web component is designed to display a list of results within a popover interface.
|
|
@@ -1439,6 +1616,10 @@ declare namespace LocalJSX {
|
|
|
1439
1616
|
"searchClientResponseItems"?: SearchClientResponseItem[] | undefined;
|
|
1440
1617
|
"searchResultsPage": number;
|
|
1441
1618
|
"searchResultsPerPage": number;
|
|
1619
|
+
/**
|
|
1620
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1621
|
+
*/
|
|
1622
|
+
"searchcraftId"?: string;
|
|
1442
1623
|
}
|
|
1443
1624
|
/**
|
|
1444
1625
|
* This web component is designed to display the number of results returned from a search query.
|
|
@@ -1475,6 +1656,10 @@ declare namespace LocalJSX {
|
|
|
1475
1656
|
* ```
|
|
1476
1657
|
*/
|
|
1477
1658
|
interface SearchcraftResultsInfo {
|
|
1659
|
+
/**
|
|
1660
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1661
|
+
*/
|
|
1662
|
+
"searchcraftId"?: string;
|
|
1478
1663
|
/**
|
|
1479
1664
|
* A callback function responsible for rendering the results info.
|
|
1480
1665
|
*/
|
|
@@ -1493,6 +1678,10 @@ declare namespace LocalJSX {
|
|
|
1493
1678
|
*/
|
|
1494
1679
|
"index": number;
|
|
1495
1680
|
"item"?: SearchClientResponseItem;
|
|
1681
|
+
/**
|
|
1682
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1683
|
+
*/
|
|
1684
|
+
"searchcraftId"?: string;
|
|
1496
1685
|
/**
|
|
1497
1686
|
* A callback function responsible for rendering a result.
|
|
1498
1687
|
*/
|
|
@@ -1544,6 +1733,10 @@ declare namespace LocalJSX {
|
|
|
1544
1733
|
* A query that will appears when the component initializes or the search term is ''..
|
|
1545
1734
|
*/
|
|
1546
1735
|
"initialQuery"?: string;
|
|
1736
|
+
/**
|
|
1737
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1738
|
+
*/
|
|
1739
|
+
"searchcraftId"?: string;
|
|
1547
1740
|
/**
|
|
1548
1741
|
* A callback function responsible for rendering a result. Passed to `searchcraft-search-result`.
|
|
1549
1742
|
*/
|
|
@@ -1573,6 +1766,10 @@ declare namespace LocalJSX {
|
|
|
1573
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.
|
|
1574
1767
|
*/
|
|
1575
1768
|
"increment"?: string | number;
|
|
1769
|
+
/**
|
|
1770
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1771
|
+
*/
|
|
1772
|
+
"searchcraftId"?: string;
|
|
1576
1773
|
}
|
|
1577
1774
|
/**
|
|
1578
1775
|
* This web component is designed to allow users to select between a group of options.
|
|
@@ -1648,6 +1845,33 @@ declare namespace LocalJSX {
|
|
|
1648
1845
|
*/
|
|
1649
1846
|
"step"?: number;
|
|
1650
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
|
+
}
|
|
1651
1875
|
/**
|
|
1652
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.'
|
|
1653
1877
|
* @react-import ```jsx
|
|
@@ -1680,6 +1904,10 @@ declare namespace LocalJSX {
|
|
|
1680
1904
|
* When the toggle element is changed.
|
|
1681
1905
|
*/
|
|
1682
1906
|
"onToggleUpdated"?: (event: SearchcraftToggleButtonCustomEvent<boolean>) => void;
|
|
1907
|
+
/**
|
|
1908
|
+
* The id of the Searchcraft instance that this component should use.
|
|
1909
|
+
*/
|
|
1910
|
+
"searchcraftId"?: string;
|
|
1683
1911
|
/**
|
|
1684
1912
|
* The secondary label displayed below the main label.
|
|
1685
1913
|
*/
|
|
@@ -1693,6 +1921,7 @@ declare namespace LocalJSX {
|
|
|
1693
1921
|
"searchcraft-filter-panel": SearchcraftFilterPanel;
|
|
1694
1922
|
"searchcraft-input-form": SearchcraftInputForm;
|
|
1695
1923
|
"searchcraft-input-label": SearchcraftInputLabel;
|
|
1924
|
+
"searchcraft-loading": SearchcraftLoading;
|
|
1696
1925
|
"searchcraft-pagination": SearchcraftPagination;
|
|
1697
1926
|
"searchcraft-popover-button": SearchcraftPopoverButton;
|
|
1698
1927
|
"searchcraft-popover-footer": SearchcraftPopoverFooter;
|
|
@@ -1705,6 +1934,7 @@ declare namespace LocalJSX {
|
|
|
1705
1934
|
"searchcraft-search-results-per-page": SearchcraftSearchResultsPerPage;
|
|
1706
1935
|
"searchcraft-select": SearchcraftSelect;
|
|
1707
1936
|
"searchcraft-slider": SearchcraftSlider;
|
|
1937
|
+
"searchcraft-summary-box": SearchcraftSummaryBox;
|
|
1708
1938
|
"searchcraft-theme": SearchcraftTheme;
|
|
1709
1939
|
"searchcraft-toggle-button": SearchcraftToggleButton;
|
|
1710
1940
|
}
|
|
@@ -1801,6 +2031,10 @@ declare module "@stencil/core" {
|
|
|
1801
2031
|
* ```
|
|
1802
2032
|
*/
|
|
1803
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>;
|
|
1804
2038
|
/**
|
|
1805
2039
|
* This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
|
|
1806
2040
|
* @react-import ```jsx
|
|
@@ -2019,6 +2253,28 @@ declare module "@stencil/core" {
|
|
|
2019
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.
|
|
2020
2254
|
*/
|
|
2021
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>;
|
|
2022
2278
|
/**
|
|
2023
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.'
|
|
2024
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
|