@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.
Files changed (135) hide show
  1. package/dist/components/defineCustomElements.js +4 -0
  2. package/dist/components/index.d.ts +541 -221
  3. package/dist/components/index.js +1655 -8
  4. package/dist/components/index.js.map +1 -1
  5. package/dist/components/{p-b194d081.js → p-0c495408.js} +30 -20
  6. package/dist/components/p-0c495408.js.map +1 -0
  7. package/dist/components/{p-9f4c50ed.js → p-1d5c5536.js} +18 -8
  8. package/dist/components/p-1d5c5536.js.map +1 -0
  9. package/dist/components/{p-f2976b33.js → p-3286bbb3.js} +22 -10
  10. package/dist/components/p-3286bbb3.js.map +1 -0
  11. package/dist/components/{p-75134ca7.js → p-3e41546c.js} +17 -8
  12. package/dist/components/p-3e41546c.js.map +1 -0
  13. package/dist/components/{p-6e5ed641.js → p-87435aac.js} +98 -42
  14. package/dist/components/p-87435aac.js.map +1 -0
  15. package/dist/components/p-919734fe.js +31 -0
  16. package/dist/components/p-919734fe.js.map +1 -0
  17. package/dist/components/{p-aba24c85.js → p-b13c7fbb.js} +48 -33
  18. package/dist/components/p-b13c7fbb.js.map +1 -0
  19. package/dist/components/{p-810a7850.js → p-b4b67072.js} +2 -2
  20. package/dist/components/p-b4b67072.js.map +1 -0
  21. package/dist/components/{p-a7d611cd.js → p-b7e99386.js} +22 -22
  22. package/dist/components/p-b7e99386.js.map +1 -0
  23. package/dist/components/{p-4dd1995c.js → p-c9b65e8f.js} +4 -4
  24. package/dist/components/{p-4dd1995c.js.map → p-c9b65e8f.js.map} +1 -1
  25. package/dist/components/p-d54771ef.js.map +1 -1
  26. package/dist/components/{p-a64b4cba.js → p-e2a10337.js} +2 -2
  27. package/dist/components/{p-a64b4cba.js.map → p-e2a10337.js.map} +1 -1
  28. package/dist/components/p-e30203b1.js +62 -0
  29. package/dist/components/p-e30203b1.js.map +1 -0
  30. package/dist/components/{p-2735dceb.js → p-fc8ccffa.js} +22 -11
  31. package/dist/components/p-fc8ccffa.js.map +1 -0
  32. package/dist/components/searchcraft-ad.js +1 -1
  33. package/dist/components/searchcraft-facet-list.js +1 -1
  34. package/dist/components/searchcraft-filter-panel.js +51 -23
  35. package/dist/components/searchcraft-filter-panel.js.map +1 -1
  36. package/dist/components/searchcraft-input-form.js +1 -1
  37. package/dist/components/searchcraft-loading.d.ts +11 -0
  38. package/dist/components/searchcraft-loading.js +8 -0
  39. package/dist/components/searchcraft-loading.js.map +1 -0
  40. package/dist/components/searchcraft-pagination.js +13 -3
  41. package/dist/components/searchcraft-pagination.js.map +1 -1
  42. package/dist/components/searchcraft-popover-button.js +21 -9
  43. package/dist/components/searchcraft-popover-button.js.map +1 -1
  44. package/dist/components/searchcraft-popover-footer.js +1 -1
  45. package/dist/components/searchcraft-popover-form.js +32 -20
  46. package/dist/components/searchcraft-popover-form.js.map +1 -1
  47. package/dist/components/searchcraft-popover-list-item.js +1 -1
  48. package/dist/components/searchcraft-popover-list-view.js +1 -1
  49. package/dist/components/searchcraft-results-info.js +15 -7
  50. package/dist/components/searchcraft-results-info.js.map +1 -1
  51. package/dist/components/searchcraft-search-result.js +1 -1
  52. package/dist/components/searchcraft-search-results-per-page.js +14 -4
  53. package/dist/components/searchcraft-search-results-per-page.js.map +1 -1
  54. package/dist/components/searchcraft-search-results.js +50 -69
  55. package/dist/components/searchcraft-search-results.js.map +1 -1
  56. package/dist/components/searchcraft-slider.js +1 -1
  57. package/dist/components/searchcraft-summary-box.d.ts +11 -0
  58. package/dist/components/searchcraft-summary-box.js +2287 -0
  59. package/dist/components/searchcraft-summary-box.js.map +1 -0
  60. package/dist/components/searchcraft-theme.js +2 -2
  61. package/dist/components/searchcraft-theme.js.map +1 -1
  62. package/dist/components/searchcraft-toggle-button.js +1 -1
  63. package/dist/hydrate/index.js +5340 -4085
  64. package/dist/hydrate/index.mjs +5340 -4085
  65. package/dist/themes/hologram.css +1 -1
  66. package/dist/themes/hologram.css.map +1 -1
  67. package/dist/types/classes/CoreInstanceRegistry.d.ts +38 -0
  68. package/dist/types/classes/Logger.d.ts +25 -0
  69. package/dist/types/classes/SearchcraftCore.d.ts +50 -0
  70. package/dist/types/classes/index.d.ts +3 -0
  71. package/dist/types/clients/MeasureClient.d.ts +27 -0
  72. package/dist/types/clients/SearchClient.d.ts +35 -0
  73. package/dist/types/clients/SummaryClient.d.ts +10 -0
  74. package/dist/types/clients/ad-clients/AdClient.d.ts +20 -0
  75. package/dist/types/clients/ad-clients/AdMarketplaceClient.d.ts +14 -0
  76. package/dist/types/clients/ad-clients/CustomAdClient.d.ts +6 -0
  77. package/dist/types/clients/ad-clients/NativoClient.d.ts +14 -0
  78. package/dist/types/clients/ad-clients/index.d.ts +5 -0
  79. package/dist/types/clients/index.d.ts +4 -0
  80. package/dist/types/components/searchcraft-ad/searchcraft-ad.d.ts +31 -4
  81. package/dist/types/components/searchcraft-facet-list/searchcraft-facet-list.d.ts +9 -2
  82. package/dist/types/components/searchcraft-filter-panel/searchcraft-filter-panel.d.ts +14 -3
  83. package/dist/types/components/searchcraft-input-form/searchcraft-input-form.d.ts +9 -6
  84. package/dist/types/components/searchcraft-loading/searchcraft-loading.d.ts +10 -0
  85. package/dist/types/components/searchcraft-pagination/searchcraft-pagination.d.ts +8 -1
  86. package/dist/types/components/searchcraft-popover-button/searchcraft-popover-button.d.ts +10 -2
  87. package/dist/types/components/searchcraft-popover-footer/searchcraft-popover-footer.d.ts +8 -1
  88. package/dist/types/components/searchcraft-popover-form/searchcraft-popover-form.d.ts +11 -3
  89. package/dist/types/components/searchcraft-popover-list-item/searchcraft-popover-list-item.d.ts +9 -1
  90. package/dist/types/components/searchcraft-popover-list-view/searchcraft-popover-list-view.d.ts +11 -3
  91. package/dist/types/components/searchcraft-results-info/searchcraft-results-info.d.ts +8 -1
  92. package/dist/types/components/searchcraft-search-result/searchcraft-search-result.d.ts +10 -1
  93. package/dist/types/components/searchcraft-search-results/searchcraft-search-results.d.ts +11 -5
  94. package/dist/types/components/searchcraft-search-results-per-page/searchcraft-search-results-per-page.d.ts +8 -1
  95. package/dist/types/components/searchcraft-summary-box/searchcraft-summary-box.d.ts +49 -0
  96. package/dist/types/components/searchcraft-toggle-button/searchcraft-toggle-button.d.ts +8 -1
  97. package/dist/types/components.d.ts +264 -8
  98. package/dist/types/index.d.ts +4 -5
  99. package/dist/types/store/SearchcraftStore.types.d.ts +14 -15
  100. package/dist/types/store/SearchcraftStoreFactory.d.ts +13 -0
  101. package/dist/types/store/index.d.ts +1 -1
  102. package/dist/types/types/core-types/AdClientResponses.types.d.ts +24 -0
  103. package/dist/types/types/core-types/Facets.types.d.ts +39 -0
  104. package/dist/types/types/core-types/Measure.types.d.ts +52 -0
  105. package/dist/types/types/core-types/SearchClient.types.d.ts +67 -0
  106. package/dist/types/types/core-types/SearchClientResponses.types.d.ts +7 -0
  107. package/dist/types/types/core-types/SearchcraftAdConfig.types.d.ts +76 -0
  108. package/dist/types/types/core-types/SearchcraftConfig.types.d.ts +65 -0
  109. package/dist/types/types/core-types/SearchcraftResponse.types.d.ts +46 -0
  110. package/dist/types/types/core-types/SubscriptionEvents.types.d.ts +51 -0
  111. package/dist/types/types/core-types/index.d.ts +10 -0
  112. package/dist/types/types/index.d.ts +3 -0
  113. package/dist/types/types/sdk-types/index.d.ts +4 -0
  114. package/dist/types/types/sdk-types/result-mappings.types.d.ts +58 -0
  115. package/dist/types/types/sdk-types/searchcraft-filter-panel.types.d.ts +44 -0
  116. package/dist/types/types/sdk-types/templates.types.d.ts +29 -0
  117. package/dist/types/utils/core-utils/index.d.ts +3 -0
  118. package/dist/types/utils/core-utils/sanitize.d.ts +2 -0
  119. package/dist/types/utils/core-utils/url.d.ts +2 -0
  120. package/dist/types/utils/facets.d.ts +1 -1
  121. package/dist/types/utils/html.d.ts +1 -1
  122. package/dist/types/utils/units.d.ts +1 -1
  123. package/package.json +5 -3
  124. package/dist/components/p-2735dceb.js.map +0 -1
  125. package/dist/components/p-6e5ed641.js.map +0 -1
  126. package/dist/components/p-75134ca7.js.map +0 -1
  127. package/dist/components/p-810a7850.js.map +0 -1
  128. package/dist/components/p-9f4c50ed.js.map +0 -1
  129. package/dist/components/p-a7d611cd.js.map +0 -1
  130. package/dist/components/p-aba24c85.js.map +0 -1
  131. package/dist/components/p-b194d081.js.map +0 -1
  132. package/dist/components/p-b54873ff.js +0 -1928
  133. package/dist/components/p-b54873ff.js.map +0 -1
  134. package/dist/components/p-f2976b33.js.map +0 -1
  135. package/dist/types/store/SearchcraftStore.d.ts +0 -4
@@ -1,27 +1,119 @@
1
1
  // Generated by dts-bundle-generator v9.5.1
2
2
 
3
3
  import { HTMLStencilElement, JSXBase } from '@stencil/core/internal';
4
+ import { StoreApi } from 'zustand';
4
5
 
5
- declare enum LogLevel {
6
- DEBUG = 0,
7
- INFO = 1,
8
- WARN = 2,
9
- ERROR = 3
6
+ export interface ADMResponse {
7
+ partial_qt: string;
8
+ text_ads: ADMAd[];
9
+ product_ads: ADMAd[];
10
10
  }
11
- export interface SDKDebuggerOptions {
12
- logLevel: LogLevel;
13
- logFormatter?: (level: LogLevel, message: string) => string;
11
+ export interface AdClientResponseItem {
12
+ id: string;
13
+ }
14
+ export interface ADMClientResponseItem extends AdClientResponseItem {
15
+ admAdType: "adm-text-ad" | "adm-product-ad";
16
+ admAd?: ADMAd;
17
+ }
18
+ export interface ADMAd {
19
+ adv_id: number;
20
+ adv_name: string;
21
+ click_url?: string;
22
+ image_url?: string;
23
+ impression_url?: string;
24
+ price?: number;
25
+ price_currency?: string;
26
+ sale_price?: number;
27
+ term: string;
28
+ }
29
+ export type Facet = {
30
+ /**
31
+ * The path of the facet. The path represents where in the facet tree structure
32
+ * this facet exists. There is an arbitrary number of levels in a facet tree.
33
+ *
34
+ * @example
35
+ *
36
+ * '/sports/college' - Represents that this is the facet node exists at [root] -> [sports] -> [college] in the facet tree.
37
+ * '/weather' - Represents that this facet exists at [root] -> [weather] in the facet tree
38
+ * '/news/local' - [root] -> [news] -> [local]
39
+ */
40
+ path: string;
41
+ /**
42
+ * The count value just represents an arbitrary `count` metadata for this facet node.
43
+ */
44
+ count: number;
45
+ };
46
+ export type FacetWithChildrenArray = Facet & {
47
+ children: FacetWithChildrenArray[] | null | undefined;
48
+ };
49
+ export type FacetWithChildrenObject = Facet & {
50
+ children: Record<string, FacetWithChildrenObject>;
51
+ };
52
+ /**
53
+ * A Facet object returned in a search response.
54
+ */
55
+ export type FacetRoot = {
56
+ [key: string]: FacetWithChildrenArray[];
57
+ };
58
+ export type FacetPrime = FacetRoot[];
59
+ /**
60
+ * A structured Facet tree.
61
+ *
62
+ * A Facet tree is the root node of a "complete view" of the facet node tree.
63
+ * Nodes are structured based on the `path` of each facet
64
+ *
65
+ */
66
+ export type FacetTree = FacetWithChildrenObject;
67
+ /**
68
+ * Types of measure requests that can be sent to the /measure/event endpoint.
69
+ */
70
+ export type MeasureEventName = "sdk_initialized" | "search_requested" | "search_response_received" | "search_completed" | "document_clicked";
71
+ /**
72
+ * The type used for sending multiple measure events in a single network request.
73
+ * Uses /measure/batch request.
74
+ */
75
+ export interface BatchMeasureRequest {
76
+ items: MeasureRequest[];
14
77
  }
15
- declare class Logger {
16
- private logLevel;
17
- private logFormatter;
18
- constructor(options: SDKDebuggerOptions);
19
- private defaultFormatter;
20
- debug(message: string): void;
21
- info(message: string): void;
22
- warn(message: string): void;
23
- error(message: string): void;
24
- log(level: LogLevel, message: string): void;
78
+ /**
79
+ * The type representing a measure request.
80
+ */
81
+ export interface MeasureRequest {
82
+ event_name: MeasureEventName;
83
+ properties: MeasureRequestProperties;
84
+ user: MeasureRequestUser;
85
+ }
86
+ /**
87
+ * Properties attached to a measure request.
88
+ */
89
+ export interface MeasureRequestProperties {
90
+ searchcraft_organization_id?: string;
91
+ searchcraft_application_id?: string;
92
+ searchcraft_index_names: string[];
93
+ search_term?: string;
94
+ number_of_documents?: number;
95
+ external_document_id?: string;
96
+ document_position?: number;
97
+ session_id?: string;
98
+ }
99
+ /**
100
+ * User properties attached to a measure request.
101
+ */
102
+ export interface MeasureRequestUser {
103
+ user_id: string;
104
+ country?: string;
105
+ city?: string;
106
+ device_id?: string;
107
+ client_ip?: string;
108
+ locale?: string;
109
+ os?: string;
110
+ platform?: string;
111
+ region?: string;
112
+ sdk_name?: string;
113
+ sdk_version?: string;
114
+ user_agent?: string;
115
+ latitude?: number;
116
+ longitude?: number;
25
117
  }
26
118
  /**
27
119
  * A data type representing an index field value, along with properties
@@ -106,7 +198,7 @@ export interface DateRangeFilterItem extends FilterItem {
106
198
  type: "dateRange";
107
199
  options: {
108
200
  minDate: Date;
109
- maxDate: Date;
201
+ maxDate?: Date;
110
202
  granularity: "year" | "month" | "day" | "hour";
111
203
  };
112
204
  }
@@ -153,192 +245,142 @@ export type PopoverButtonTemplate = (data: {
153
245
  export type ADMAdTemplate = (data: ADMAd, utils: {
154
246
  html: TemplateHtml;
155
247
  }) => string;
156
- /**
157
- * The SearchcraftConfig object is used to initialize Searchcraft in your application.
158
- */
159
- export interface SearchcraftConfig {
248
+ export interface CustomAdConfig {
160
249
  /**
161
- * Host IP Address and port number configured and created using Vektron.
250
+ * The amount of debounce delay to add before calling the ad_container_rendered event
162
251
  */
163
- endpointURL: string;
252
+ adContainerRenderedDebounceDelay?: number;
164
253
  /**
165
- * Name or names of search indices configured using Vektron. Given as an array of strings.
254
+ * The number of custom ads to render at the start of the search results page.
166
255
  */
167
- index: string[];
256
+ adStartQuantity?: number;
168
257
  /**
169
- * A unique user identifier for the end user.
258
+ * The number of custom ads to render at the end of the search results page.
170
259
  */
171
- userId?: string;
260
+ adEndQuantity?: number;
172
261
  /**
173
- * The Index read key provided by Vektron.
262
+ * Renders a custom ad in between search results, at the specified interval.
174
263
  */
175
- readKey: string;
264
+ adInterstitialInterval?: number;
176
265
  /**
177
- * The amount of delay, in milliseconds, to debounce search requests. Defaults to `0`.
266
+ * Specifies the number of ads to be rendered in each interstitial in between search results.
178
267
  */
179
- searchDebounceDelay?: number;
268
+ adInterstitialQuantity?: number;
180
269
  /**
181
- * The maximum number of results to return per page.
270
+ * A callback function responsible for rendering the custom ad containers.
182
271
  */
183
- searchResultsPerPage?: number;
272
+ template: CustomAdTemplate;
273
+ }
274
+ export interface NativoAdConfig {
184
275
  /**
185
- * Name of the ad source to use.
276
+ * The placement id to use for Nativo ads.
186
277
  */
187
- adSource?: "adMarketplace" | "Nativo" | "Custom" | "None";
278
+ placementId?: number;
188
279
  /**
189
- * The maximum number of product ads to show for a single search term.
280
+ * The class name for nativo ad containers.
190
281
  */
191
- admProductAdQuantity?: number;
282
+ adClassName?: string;
192
283
  /**
193
- * The maximum number of text ads to show for a single search term.
284
+ * The number of custom ads to render at the start of the search results page.
194
285
  */
195
- admTextAdQuantity?: number;
286
+ adStartQuantity?: number;
196
287
  /**
197
- * The adm sub value.
288
+ * The number of custom ads to render at the end of the search results page.
198
289
  */
199
- admSub?: string;
290
+ adEndQuantity?: number;
200
291
  /**
201
- * The amount of debounce delay to add before calling the ad_container_rendered event
292
+ * Renders a custom ad in between search results, at the specified interval.
202
293
  */
203
- adContainerRenderedDebounceDelay?: number;
294
+ adInterstitialInterval?: number;
204
295
  /**
205
- * A callback function responsible for rendering the ADM ad containers.
296
+ * Specify how many normal search results to render before rendering the first interstitial ad grouping.
206
297
  */
207
- admAdTemplate?: ADMAdTemplate;
298
+ adInterstialStartIndex?: number;
208
299
  /**
209
- * The number of custom ads to render at the start of the search results page.
300
+ * Specifies the number of ads to be rendered in each interstitial in between search results.
210
301
  */
211
- customAdStartQuantity?: number;
302
+ adInterstitialQuantity?: number;
303
+ }
304
+ export interface ADMAdConfig {
212
305
  /**
213
- * The number of custom ads to render at the end of the search results page.
306
+ * The number of product ads to request.
214
307
  */
215
- customAdEndQuantity?: number;
308
+ productAdQuantity?: number;
216
309
  /**
217
- * Renders a custom ad in between search results, at the specified interval.
310
+ * The number of text ads to request.
218
311
  */
219
- customAdInterstitialInterval?: number;
312
+ textAdQuantity?: number;
220
313
  /**
221
- * Specifies the number of ads to be rendered in each interstitial in between search results.
314
+ * The adm sub value.
222
315
  */
223
- customAdInterstitialQuantity?: number;
316
+ sub?: string;
224
317
  /**
225
- * A callback function responsible for rendering the custom ad containers.
318
+ * A callback function responsible for rendering the ADM ad containers.
226
319
  */
227
- customAdTemplate?: CustomAdTemplate;
320
+ template?: ADMAdTemplate;
321
+ }
322
+ /**
323
+ * The SearchcraftConfig object is used to initialize the Searchcraft JavaScript SDK in your front-end application. See the [getting started page](https://docs.searchcraft.io/sdks/javascript/getting-started/) for a guide on how and where to use this configuration object.
324
+ */
325
+ export interface SearchcraftConfig {
228
326
  /**
229
- * The placement id to use for Nativo ads.
327
+ * The read key value to use when sending Searchcraft search requests. This value needs read key-specific permissions. If you are using Searchcraft Cloud, this value can be configured in Vektron.
230
328
  */
231
- nativoPlacementId?: number;
329
+ readKey: string;
232
330
  /**
233
- * The class name for nativo ad containers.
331
+ * The endpoint url of your Searchcraft cluster where your specified search index exists. If you are using Searchcraft Cloud, this value can be found within the Vektron dashboard in the Code Snippets section when configuring a search index.
234
332
  */
235
- nativoAdClassName?: string;
333
+ endpointURL: string;
236
334
  /**
237
- * The number of custom ads to render at the start of the search results page.
335
+ * Name of the Searchcraft search index to search for results within. If you are using Searchcraft Cloud, this value can be found within the Vektron dashboard in the Code Snippets section when configuring a search index.
238
336
  */
239
- nativoAdStartQuantity?: number;
337
+ indexName: string;
240
338
  /**
241
- * The number of custom ads to render at the end of the search results page.
339
+ * The initial search query to call when Searchcraft is first initialized in your front-end application. This parameter can be used when you want to populate a page with an initial set of search results based on a query.
340
+ *
341
+ * This value is a stringified Search query object. For a more in-depth reference on search queries, see the [search endpoint documentation](https://docs.searchcraft.io/api/search/).
242
342
  */
243
- nativoAdEndQuantity?: number;
343
+ initialQuery?: string;
244
344
  /**
245
- * Renders a custom ad in between search results, at the specified interval.
345
+ * The maximum number of documents to return per page of results.
246
346
  */
247
- nativoAdInterstitialInterval?: number;
347
+ searchResultsPerPage?: number;
248
348
  /**
249
- * Specify how many normal search results to render before rendering the first interstitial ad grouping.
349
+ * The URL pointing towards Searchcraft Cloud's semantic search and RAG summary processing layer. When using a `searchcraft-summary-box` component, this value must be specified.
250
350
  */
251
- nativoAdInterstialStartIndex?: number;
351
+ cortexURL?: string;
252
352
  /**
253
- * Specifies the number of ads to be rendered in each interstitial in between search results.
353
+ * Instructions provided to the LLM when creating search result summaries.
254
354
  */
255
- nativoAdInterstitialQuantity?: number;
256
- }
257
- export type SearchcraftAdSource = "adMarketplace" | "Nativo" | "Custom" | "None";
258
- /**
259
- * Used internally by consuming packages as part of the core sdk constructor.
260
- */
261
- export interface SearchcraftSDKInfo {
262
- sdkName: string;
263
- sdkVersion: string;
264
- }
265
- export interface AdClientResponseItem {
266
- id: string;
267
- adSource: SearchcraftAdSource;
268
- }
269
- export interface ADMAd {
270
- adv_id: number;
271
- adv_name: string;
272
- click_url?: string;
273
- image_url?: string;
274
- impression_url?: string;
275
- price?: number;
276
- price_currency?: string;
277
- sale_price?: number;
278
- term: string;
279
- }
280
- export type Facet = {
355
+ summaryInstructionsPrompt?: string;
281
356
  /**
282
- * The path of the facet. The path represents where in the facet tree structure
283
- * this facet exists. There is an arbitrary number of levels in a facet tree.
284
- *
285
- * @example
286
- *
287
- * '/sports/college' - Represents that this is the facet node exists at [root] -> [sports] -> [college] in the facet tree.
288
- * '/weather' - Represents that this facet exists at [root] -> [weather] in the facet tree
289
- * '/news/local' - [root] -> [news] -> [local]
357
+ * The amount of delay, in milliseconds, to debounce summary requests. Defaults to `1000`
290
358
  */
291
- path: string;
359
+ summaryDebounceDelay?: number;
292
360
  /**
293
- * The count value just represents an arbitrary `count` metadata for this facet node.
361
+ * Name of the ad source to use.
294
362
  */
295
- count: number;
296
- };
297
- export type FacetWithChildrenArray = Facet & {
298
- children: FacetWithChildrenArray[] | null | undefined;
299
- };
300
- /**
301
- * A Facet object returned in a search response.
302
- */
303
- export type FacetRoot = {
304
- [key: string]: FacetWithChildrenArray[];
305
- };
306
- export type FacetPrime = FacetRoot[];
307
- /**
308
- * Types of measure requests that can be sent to the /measure/event endpoint.
309
- */
310
- export type MeasureEventName = "sdk_initialized" | "search_requested" | "search_response_received" | "search_completed" | "document_clicked";
311
- /**
312
- * Properties attached to a measure request.
313
- */
314
- export interface MeasureRequestProperties {
315
- searchcraft_organization_id?: string;
316
- searchcraft_application_id?: string;
317
- searchcraft_index_names: string[];
318
- search_term?: string;
319
- number_of_documents?: number;
320
- external_document_id?: string;
321
- document_position?: number;
322
- session_id?: string;
363
+ searchDebounceDelay?: number;
364
+ /**
365
+ * A unique user identifier for end users of your product. This would typically correspond to a user id
366
+ * in your consuming application's database. Used for data analysis and visualizations on Vektron.
367
+ */
368
+ measureUserIdentifier?: string;
369
+ /**
370
+ * This object allows you to configure the quantity, number, template, and positioning of custom ad containers within your search results.
371
+ *
372
+ * To see more information on how to configure custom ads, see [the custom ads guide](https://docs.searchcraft.io/sdks/javascript/custom-ads/)
373
+ */
374
+ customAdConfig?: CustomAdConfig;
375
+ nativoConfig?: NativoAdConfig;
376
+ admAdConfig?: ADMAdConfig;
323
377
  }
324
378
  /**
325
- * User properties attached to a measure request.
379
+ * Used internally by consuming packages as part of the core sdk constructor.
326
380
  */
327
- export interface MeasureRequestUser {
328
- user_id: string;
329
- country?: string;
330
- city?: string;
331
- device_id?: string;
332
- client_ip?: string;
333
- locale?: string;
334
- os?: string;
335
- platform?: string;
336
- region?: string;
337
- sdk_name?: string;
338
- sdk_version?: string;
339
- user_agent?: string;
340
- latitude?: number;
341
- longitude?: number;
381
+ export interface SearchcraftSDKInfo {
382
+ sdkName: string;
383
+ sdkVersion: string;
342
384
  }
343
385
  export interface FacetPathsForIndexField {
344
386
  fieldName: string;
@@ -348,6 +390,22 @@ export interface RangeValueForIndexField {
348
390
  fieldName: string;
349
391
  value: string;
350
392
  }
393
+ export interface SearchClientQuery {
394
+ occur?: "must" | "should";
395
+ exact?: {
396
+ ctx: string;
397
+ };
398
+ fuzzy?: {
399
+ ctx: string;
400
+ };
401
+ }
402
+ export type SearchClientRequest = {
403
+ limit?: number;
404
+ offset?: number;
405
+ order_by?: string;
406
+ sort?: "asc" | "desc";
407
+ query: SearchClientQuery[];
408
+ };
351
409
  export interface SearchClientRequestProperties {
352
410
  /**
353
411
  * The search mode, which can be either 'fuzzy' or 'exact'.
@@ -453,7 +511,6 @@ export interface AdContainerRenderedSubscriptionEvent extends SubscriptionEvent
453
511
  name: "ad_container_rendered";
454
512
  data: {
455
513
  adContainerId: string;
456
- adSource: SearchcraftAdSource;
457
514
  searchTerm: string;
458
515
  };
459
516
  }
@@ -461,7 +518,6 @@ export interface AdContainerViewedSubscriptionEvent extends SubscriptionEvent {
461
518
  name: "ad_container_viewed";
462
519
  data: {
463
520
  adContainerId: string;
464
- adSource: SearchcraftAdSource;
465
521
  searchTerm: string;
466
522
  };
467
523
  }
@@ -502,13 +558,11 @@ declare class AdClient {
502
558
  onAdContainerRendered(_data: {
503
559
  adClientResponseItem?: AdClientResponseItem;
504
560
  adContainerId: string;
505
- adSource: SearchcraftAdSource;
506
561
  searchTerm: string;
507
562
  }): Promise<void>;
508
563
  onAdContainerViewed(_data: {
509
564
  adClientResponseItem?: AdClientResponseItem;
510
565
  adContainerId: string;
511
- adSource: SearchcraftAdSource;
512
566
  searchTerm: string;
513
567
  }): Promise<void>;
514
568
  }
@@ -543,18 +597,23 @@ declare class SearchClient {
543
597
  private parent;
544
598
  private searchCompletedEventTimeout;
545
599
  private abortController;
600
+ private supplementalAbortController;
546
601
  constructor(parent: SearchcraftCore, config: SearchcraftConfig, userId: string);
547
602
  /**
548
603
  * Getter for the base url used by the /search endpoint.
549
604
  */
550
605
  private get baseSearchUrl();
606
+ /**
607
+ * Immediately cancels all pending search requests.
608
+ */
609
+ abortRequests: () => void;
551
610
  /**
552
611
  * Make the request to get the search results.
553
612
  * @param {properties} properties - The properties for the search.
554
- * @param sendTelemetry - Whether or not to emit measure and subscription events for this search.
613
+ * @param isSupplemental - Whether or not this is a supplemental search request (for the purpose of getting top-level facet counts)
555
614
  * @returns
556
615
  */
557
- getSearchResponseItems: (properties: SearchClientRequestProperties | string, sendTelemetry?: boolean) => Promise<SearchcraftResponse>;
616
+ getSearchResponseItems: (properties: SearchClientRequestProperties | string, isSupplemental?: boolean) => Promise<SearchcraftResponse>;
558
617
  private handleGetSearchResponseItemsWithString;
559
618
  private handleGetSearchResponseItemsWithObject;
560
619
  /**
@@ -564,49 +623,13 @@ declare class SearchClient {
564
623
  */
565
624
  private formatParamsForRequest;
566
625
  }
567
- /**
568
- * Javascript Class providing the functionality to interact with the Searchcraft BE
569
- */
570
- export declare class SearchcraftCore {
571
- config: SearchcraftConfig;
572
- measureClient: MeasureClient | undefined;
573
- searchClient: SearchClient | undefined;
574
- adClient: AdClient | undefined;
575
- userId: string;
576
- private requestTimeout;
577
- private subscriptionEvents;
578
- constructor(config: SearchcraftConfig, sdkInfo: SearchcraftSDKInfo);
579
- private initInputForms;
580
- /**
581
- * When changes happen in the DOM, we want to link any input forms found to the instance of the core.
582
- */
583
- private startObservingMutations;
584
- private initClients;
585
- emitEvent<T extends SubscriptionEventName>(eventName: T, event: SubscriptionEventMap[T]): void;
586
- subscribe<T extends SubscriptionEventName>(eventName: T, callback: SubscriptionEventCallback<T>): UnsubscribeFunction;
587
- /**
588
- * Called when a `<searchcraft-ad>` component is rendered
589
- */
590
- handleAdContainerRendered(data: {
591
- adClientResponseItem?: AdClientResponseItem;
592
- adContainerId: string;
593
- adSource: SearchcraftAdSource;
594
- searchTerm: string;
595
- }): void;
596
- /**
597
- * Called when a `<searchcraft-ad>` is viewed
598
- */
599
- handleAdContainerViewed(data: {
600
- adClientResponseItem?: AdClientResponseItem;
601
- adContainerId: string;
602
- adSource: SearchcraftAdSource;
603
- searchTerm: string;
604
- }): void;
605
- /**
606
- * Perform various actions when the input is cleared
607
- */
608
- handleInputCleared(): void;
609
- getResponseItems: (properties: SearchClientRequestProperties | string, searchCallback: (request: SearchClientRequestProperties | string, response: SearchcraftResponse, items: SearchClientResponseItem[], supplementalResponse: SearchcraftResponse | undefined) => void, adCallback: (items: AdClientResponseItem[]) => void) => void;
626
+ declare class SummaryClient {
627
+ private set;
628
+ private get;
629
+ private abortController;
630
+ private timeout;
631
+ constructor(get: SearchcraftStore["getState"], set: SearchcraftStore["setState"]);
632
+ streamSummaryData(): void;
610
633
  }
611
634
  /**
612
635
  * Callable functions made available by the SearchcraftStore.
@@ -614,20 +637,12 @@ export declare class SearchcraftCore {
614
637
  export interface SearchcraftStateFunctions {
615
638
  addFacetPathsForIndexField: (field: FacetPathsForIndexField) => void;
616
639
  addRangeValueForIndexField: (field: RangeValueForIndexField) => void;
617
- getSearchcraftCore: () => SearchcraftCore | undefined;
618
- init: (searchcraft: SearchcraftCore | undefined, debug?: boolean) => void;
619
640
  removeFacetPathsForIndexField: (fieldName: string) => void;
620
641
  removeRangeValueForIndexField: (fieldName: string) => void;
621
- resetFacetPaths: () => void;
642
+ resetSearchValues: () => void;
622
643
  search: () => Promise<void>;
623
- set: (state: Partial<SearchcraftState> | ((state: SearchcraftState) => Partial<SearchcraftState>)) => SearchcraftState;
624
- setAdClientResponseItems: (items: AdClientResponseItem[]) => void;
625
- setSearchClientResponseItemsFromResponse: (request: SearchClientRequestProperties | string, response: SearchcraftResponse, items: SearchClientResponseItem[], supplementalResponse: SearchcraftResponse | undefined) => void;
626
- setInitialSearchClientResponseItemsFromResponse: (request: SearchClientRequestProperties | string, response: SearchcraftResponse, items: SearchClientResponseItem[]) => void;
627
- setInitialQuery: (query: string) => void;
628
644
  setPopoverVisibility: (isVisible: boolean) => void;
629
645
  setSearchResultsCount: (count: number) => void;
630
- setSearchClientResponseItems: (items: SearchClientResponseItem[]) => void;
631
646
  setSearchResultsPage: (page: number) => void;
632
647
  setSearchResultsPerPage: (perPage: number) => void;
633
648
  setSearchTerm: (searchTerm: string) => void;
@@ -643,19 +658,19 @@ export interface SearchcraftStateFunctions {
643
658
  */
644
659
  export interface SearchcraftStateValues {
645
660
  adClientResponseItems: AdClientResponseItem[];
661
+ cachedAdClientResponseItems: AdClientResponseItem[];
646
662
  core: SearchcraftCore | undefined;
647
663
  hotkey: string;
648
664
  hotkeyModifier: "ctrl" | "meta" | "alt" | "option";
649
- logger: Logger | undefined;
650
665
  facetPathsForIndexFields: Record<string, FacetPathsForIndexField>;
651
- initialQuery: string;
652
- initialSearchClientResponseItems: SearchClientResponseItem[];
653
666
  isPopoverVisible: boolean;
654
667
  isSearchInProgress: boolean;
655
668
  rangeValueForIndexFields: Record<string, RangeValueForIndexField>;
656
669
  searchMode: "fuzzy" | "exact";
657
- searchClientRequest: SearchClientRequestProperties | string | undefined | null;
670
+ searchClientRequest?: SearchClientRequest;
671
+ searchClientRequestProperties: SearchClientRequestProperties | string | undefined | null;
658
672
  searchClientResponseItems: SearchClientResponseItem[];
673
+ cachedSearchClientResponseItems: SearchClientResponseItem[];
659
674
  searchResponseTimeTaken: number | undefined;
660
675
  searchResponseFacetPrime: FacetPrime | undefined | null;
661
676
  supplementalFacetPrime: FacetPrime | undefined | null;
@@ -665,11 +680,60 @@ export interface SearchcraftStateValues {
665
680
  searchTerm: string;
666
681
  orderByField: string | undefined | null;
667
682
  sortType: "asc" | "desc" | undefined | null;
668
- afterInit: (state: SearchcraftState) => void;
683
+ summary: string;
684
+ hasSummaryBox: boolean;
685
+ isSummaryLoading: boolean;
686
+ summaryClient?: SummaryClient;
669
687
  }
670
688
  export interface SearchcraftState extends SearchcraftStateFunctions, SearchcraftStateValues {
671
689
  }
672
- export declare const searchcraftStore: import("zustand").StoreApi<SearchcraftState>;
690
+ export type SearchcraftStore = StoreApi<SearchcraftState>;
691
+ /**
692
+ * Javascript Class providing the functionality to interact with the Searchcraft BE
693
+ */
694
+ export declare class SearchcraftCore {
695
+ store: SearchcraftStore;
696
+ config: SearchcraftConfig;
697
+ measureClient: MeasureClient | undefined;
698
+ searchClient: SearchClient | undefined;
699
+ adClient: AdClient | undefined;
700
+ userId: string;
701
+ private requestTimeout;
702
+ private subscriptionEvents;
703
+ /**
704
+ * @param config The SearchcraftConfig object for this Searchcraft instance.
705
+ * @param sdkInfo The SDK info object for this searchcraft instance
706
+ * @param searchcraftId The identifier to use to reference this instance of SearchcraftCore.
707
+ */
708
+ constructor(config: SearchcraftConfig, sdkInfo: SearchcraftSDKInfo, searchcraftId: string | undefined);
709
+ private initClients;
710
+ emitEvent<T extends SubscriptionEventName>(eventName: T, event: SubscriptionEventMap[T]): void;
711
+ subscribe<T extends SubscriptionEventName>(eventName: T, callback: SubscriptionEventCallback<T>): UnsubscribeFunction;
712
+ /**
713
+ * Called when a `<searchcraft-ad>` component is rendered
714
+ */
715
+ handleAdContainerRendered(data: {
716
+ adClientResponseItem?: AdClientResponseItem;
717
+ adContainerId: string;
718
+ searchTerm: string;
719
+ }): void;
720
+ /**
721
+ * Called when a `<searchcraft-ad>` is viewed
722
+ */
723
+ handleAdContainerViewed(data: {
724
+ adClientResponseItem?: AdClientResponseItem;
725
+ adContainerId: string;
726
+ searchTerm: string;
727
+ }): void;
728
+ /**
729
+ * Perform various actions when the input is cleared
730
+ */
731
+ handleInputCleared(): void;
732
+ getResponseItems: (props: {
733
+ requestProperties: SearchClientRequestProperties | string;
734
+ shouldCacheResultsForEmptyState: boolean;
735
+ }) => void;
736
+ }
673
737
  export type SearchcraftSelectOption = {
674
738
  label: string;
675
739
  value: string | number;
@@ -681,8 +745,15 @@ export namespace Components {
681
745
  */
682
746
  interface SearchcraftAd {
683
747
  "adClientResponseItem"?: AdClientResponseItem;
684
- "adContainerId": string;
685
- "adSource": SearchcraftAdSource;
748
+ "adSource": "Custom" | "Nativo" | "adMarketplace";
749
+ /**
750
+ * 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.
751
+ */
752
+ "renderPosition": "interstitial" | "top" | "bottom";
753
+ /**
754
+ * The id of the Searchcraft instance that this component should use.
755
+ */
756
+ "searchcraftId"?: string;
686
757
  }
687
758
  /**
688
759
  * This web component represents a button.
@@ -748,6 +819,10 @@ export namespace Components {
748
819
  * The name of the field where facets are applied.
749
820
  */
750
821
  "fieldName": string;
822
+ /**
823
+ * The id of the Searchcraft instance that this component should use.
824
+ */
825
+ "searchcraftId"?: string;
751
826
  }
752
827
  /**
753
828
  * This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.
@@ -780,6 +855,10 @@ export namespace Components {
780
855
  * The items to filter.
781
856
  */
782
857
  "items": FilterItem[];
858
+ /**
859
+ * The id of the Searchcraft instance that this component should use.
860
+ */
861
+ "searchcraftId"?: string;
783
862
  }
784
863
  /**
785
864
  * This web component provides a user-friendly interface for querying an indexed dataset, enabling users to easily search large collections of data.
@@ -813,7 +892,6 @@ export namespace Components {
813
892
  * Where to place the search button.
814
893
  */
815
894
  "buttonPlacement"?: "left" | "right" | "none";
816
- "core"?: SearchcraftCore;
817
895
  /**
818
896
  * The label rendered above the input.
819
897
  */
@@ -826,6 +904,10 @@ export namespace Components {
826
904
  * The input element's placeholder value.
827
905
  */
828
906
  "placeholderValue"?: string;
907
+ /**
908
+ * The id of the Searchcraft instance that this component should use.
909
+ */
910
+ "searchcraftId"?: string;
829
911
  }
830
912
  /**
831
913
  * This web component serves as the input label for the searchcraft-input-form component.
@@ -840,6 +922,12 @@ export namespace Components {
840
922
  "inputLabelClassName"?: string | undefined;
841
923
  "label": string;
842
924
  }
925
+ /**
926
+ * Renders a loading spinner/loading state for use in things like the summary box.
927
+ */
928
+ interface SearchcraftLoading {
929
+ "label"?: string;
930
+ }
843
931
  /**
844
932
  * This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
845
933
  * @react-import ```jsx
@@ -859,6 +947,10 @@ export namespace Components {
859
947
  * ```
860
948
  */
861
949
  interface SearchcraftPagination {
950
+ /**
951
+ * The id of the Searchcraft instance that this component should use.
952
+ */
953
+ "searchcraftId"?: string;
862
954
  }
863
955
  /**
864
956
  * Renders a button which, when clicked, turns on popover visibility.
@@ -901,6 +993,10 @@ export namespace Components {
901
993
  * ```
902
994
  */
903
995
  interface SearchcraftPopoverButton {
996
+ /**
997
+ * The id of the Searchcraft instance that this component should use.
998
+ */
999
+ "searchcraftId"?: string;
904
1000
  /**
905
1001
  * A callback function responsible for rendering the button contents.
906
1002
  */
@@ -914,6 +1010,10 @@ export namespace Components {
914
1010
  * Renders the footer for the searchcraft-popover-form.
915
1011
  */
916
1012
  interface SearchcraftPopoverFooter {
1013
+ /**
1014
+ * The id of the Searchcraft instance that this component should use.
1015
+ */
1016
+ "searchcraftId"?: string;
917
1017
  }
918
1018
  /**
919
1019
  * 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.
@@ -952,6 +1052,10 @@ export namespace Components {
952
1052
  * Formats the content rendered for each result.
953
1053
  */
954
1054
  "popoverResultMappings"?: PopoverResultMappings;
1055
+ /**
1056
+ * The id of the Searchcraft instance that this component should use.
1057
+ */
1058
+ "searchcraftId"?: string;
955
1059
  /**
956
1060
  * 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.
957
1061
  */
@@ -967,6 +1071,10 @@ export namespace Components {
967
1071
  "documentPosition": number;
968
1072
  "item": SearchClientResponseItem | undefined;
969
1073
  "popoverResultMappings": PopoverResultMappings | undefined;
1074
+ /**
1075
+ * The id of the Searchcraft instance that this component should use.
1076
+ */
1077
+ "searchcraftId"?: string;
970
1078
  }
971
1079
  /**
972
1080
  * This web component is designed to display a list of results within a popover interface.
@@ -987,6 +1095,10 @@ export namespace Components {
987
1095
  "searchClientResponseItems": SearchClientResponseItem[] | undefined;
988
1096
  "searchResultsPage": number;
989
1097
  "searchResultsPerPage": number;
1098
+ /**
1099
+ * The id of the Searchcraft instance that this component should use.
1100
+ */
1101
+ "searchcraftId"?: string;
990
1102
  }
991
1103
  /**
992
1104
  * This web component is designed to display the number of results returned from a search query.
@@ -1023,6 +1135,10 @@ export namespace Components {
1023
1135
  * ```
1024
1136
  */
1025
1137
  interface SearchcraftResultsInfo {
1138
+ /**
1139
+ * The id of the Searchcraft instance that this component should use.
1140
+ */
1141
+ "searchcraftId"?: string;
1026
1142
  /**
1027
1143
  * A callback function responsible for rendering the results info.
1028
1144
  */
@@ -1041,6 +1157,10 @@ export namespace Components {
1041
1157
  */
1042
1158
  "index": number;
1043
1159
  "item"?: SearchClientResponseItem;
1160
+ /**
1161
+ * The id of the Searchcraft instance that this component should use.
1162
+ */
1163
+ "searchcraftId"?: string;
1044
1164
  /**
1045
1165
  * A callback function responsible for rendering a result.
1046
1166
  */
@@ -1092,6 +1212,10 @@ export namespace Components {
1092
1212
  * A query that will appears when the component initializes or the search term is ''..
1093
1213
  */
1094
1214
  "initialQuery"?: string;
1215
+ /**
1216
+ * The id of the Searchcraft instance that this component should use.
1217
+ */
1218
+ "searchcraftId"?: string;
1095
1219
  /**
1096
1220
  * A callback function responsible for rendering a result. Passed to `searchcraft-search-result`.
1097
1221
  */
@@ -1121,6 +1245,10 @@ export namespace Components {
1121
1245
  * 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.
1122
1246
  */
1123
1247
  "increment": string | number;
1248
+ /**
1249
+ * The id of the Searchcraft instance that this component should use.
1250
+ */
1251
+ "searchcraftId"?: string;
1124
1252
  }
1125
1253
  /**
1126
1254
  * This web component is designed to allow users to select between a group of options.
@@ -1188,6 +1316,33 @@ export namespace Components {
1188
1316
  */
1189
1317
  "step": number;
1190
1318
  }
1319
+ /**
1320
+ * This component renders a summary box for RAG search result summaries.
1321
+ * When the user makes a search, a network call is made to retrieve the summary content, which is then
1322
+ * rendered in this box.
1323
+ * NOTE: This component requires the usage of a read key that has "SUMMARY" permissions.
1324
+ * @react-import ```jsx
1325
+ * import { SearchcraftSummaryBox } from "@searchcraft/react-sdk";
1326
+ * ```
1327
+ * @vue-import ```jsx
1328
+ * import { SearchcraftSummaryBox } from "@searchcraft/vue-sdk";
1329
+ * ```
1330
+ * @js-example ```html
1331
+ * <searchcraft-summary-box />
1332
+ * ```
1333
+ * @react-example ```jsx
1334
+ * <SearchcraftSummaryBox />
1335
+ * ```
1336
+ * @vue-example ```jsx
1337
+ * <SearchcraftSummaryBox />
1338
+ * ```
1339
+ */
1340
+ interface SearchcraftSummaryBox {
1341
+ /**
1342
+ * The id of the Searchcraft instance that this component should use.
1343
+ */
1344
+ "searchcraftId"?: string;
1345
+ }
1191
1346
  /**
1192
1347
  * 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.'
1193
1348
  * @react-import ```jsx
@@ -1216,6 +1371,10 @@ export namespace Components {
1216
1371
  * The label.
1217
1372
  */
1218
1373
  "label": string;
1374
+ /**
1375
+ * The id of the Searchcraft instance that this component should use.
1376
+ */
1377
+ "searchcraftId"?: string;
1219
1378
  /**
1220
1379
  * The secondary label displayed below the main label.
1221
1380
  */
@@ -1407,6 +1566,15 @@ declare global {
1407
1566
  prototype: HTMLSearchcraftInputLabelElement;
1408
1567
  new (): HTMLSearchcraftInputLabelElement;
1409
1568
  };
1569
+ /**
1570
+ * Renders a loading spinner/loading state for use in things like the summary box.
1571
+ */
1572
+ interface HTMLSearchcraftLoadingElement extends Components.SearchcraftLoading, HTMLStencilElement {
1573
+ }
1574
+ var HTMLSearchcraftLoadingElement: {
1575
+ prototype: HTMLSearchcraftLoadingElement;
1576
+ new (): HTMLSearchcraftLoadingElement;
1577
+ };
1410
1578
  /**
1411
1579
  * This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
1412
1580
  * @react-import ```jsx
@@ -1707,6 +1875,33 @@ declare global {
1707
1875
  prototype: HTMLSearchcraftSliderElement;
1708
1876
  new (): HTMLSearchcraftSliderElement;
1709
1877
  };
1878
+ /**
1879
+ * This component renders a summary box for RAG search result summaries.
1880
+ * When the user makes a search, a network call is made to retrieve the summary content, which is then
1881
+ * rendered in this box.
1882
+ * NOTE: This component requires the usage of a read key that has "SUMMARY" permissions.
1883
+ * @react-import ```jsx
1884
+ * import { SearchcraftSummaryBox } from "@searchcraft/react-sdk";
1885
+ * ```
1886
+ * @vue-import ```jsx
1887
+ * import { SearchcraftSummaryBox } from "@searchcraft/vue-sdk";
1888
+ * ```
1889
+ * @js-example ```html
1890
+ * <searchcraft-summary-box />
1891
+ * ```
1892
+ * @react-example ```jsx
1893
+ * <SearchcraftSummaryBox />
1894
+ * ```
1895
+ * @vue-example ```jsx
1896
+ * <SearchcraftSummaryBox />
1897
+ * ```
1898
+ */
1899
+ interface HTMLSearchcraftSummaryBoxElement extends Components.SearchcraftSummaryBox, HTMLStencilElement {
1900
+ }
1901
+ var HTMLSearchcraftSummaryBoxElement: {
1902
+ prototype: HTMLSearchcraftSummaryBoxElement;
1903
+ new (): HTMLSearchcraftSummaryBoxElement;
1904
+ };
1710
1905
  /**
1711
1906
  * 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.'
1712
1907
  * @react-import ```jsx
@@ -1759,6 +1954,7 @@ declare global {
1759
1954
  "searchcraft-filter-panel": HTMLSearchcraftFilterPanelElement;
1760
1955
  "searchcraft-input-form": HTMLSearchcraftInputFormElement;
1761
1956
  "searchcraft-input-label": HTMLSearchcraftInputLabelElement;
1957
+ "searchcraft-loading": HTMLSearchcraftLoadingElement;
1762
1958
  "searchcraft-pagination": HTMLSearchcraftPaginationElement;
1763
1959
  "searchcraft-popover-button": HTMLSearchcraftPopoverButtonElement;
1764
1960
  "searchcraft-popover-footer": HTMLSearchcraftPopoverFooterElement;
@@ -1771,6 +1967,7 @@ declare global {
1771
1967
  "searchcraft-search-results-per-page": HTMLSearchcraftSearchResultsPerPageElement;
1772
1968
  "searchcraft-select": HTMLSearchcraftSelectElement;
1773
1969
  "searchcraft-slider": HTMLSearchcraftSliderElement;
1970
+ "searchcraft-summary-box": HTMLSearchcraftSummaryBoxElement;
1774
1971
  "searchcraft-theme": HTMLSearchcraftThemeElement;
1775
1972
  "searchcraft-toggle-button": HTMLSearchcraftToggleButtonElement;
1776
1973
  }
@@ -1781,8 +1978,15 @@ declare namespace LocalJSX {
1781
1978
  */
1782
1979
  interface SearchcraftAd {
1783
1980
  "adClientResponseItem"?: AdClientResponseItem;
1784
- "adContainerId"?: string;
1785
- "adSource"?: SearchcraftAdSource;
1981
+ "adSource"?: "Custom" | "Nativo" | "adMarketplace";
1982
+ /**
1983
+ * 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.
1984
+ */
1985
+ "renderPosition"?: "interstitial" | "top" | "bottom";
1986
+ /**
1987
+ * The id of the Searchcraft instance that this component should use.
1988
+ */
1989
+ "searchcraftId"?: string;
1786
1990
  }
1787
1991
  /**
1788
1992
  * This web component represents a button.
@@ -1858,6 +2062,10 @@ declare namespace LocalJSX {
1858
2062
  "onFacetSelectionUpdated"?: (event: SearchcraftFacetListCustomEvent<{
1859
2063
  paths: string[];
1860
2064
  }>) => void;
2065
+ /**
2066
+ * The id of the Searchcraft instance that this component should use.
2067
+ */
2068
+ "searchcraftId"?: string;
1861
2069
  }
1862
2070
  /**
1863
2071
  * This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.
@@ -1890,6 +2098,10 @@ declare namespace LocalJSX {
1890
2098
  * The items to filter.
1891
2099
  */
1892
2100
  "items"?: FilterItem[];
2101
+ /**
2102
+ * The id of the Searchcraft instance that this component should use.
2103
+ */
2104
+ "searchcraftId"?: string;
1893
2105
  }
1894
2106
  /**
1895
2107
  * This web component provides a user-friendly interface for querying an indexed dataset, enabling users to easily search large collections of data.
@@ -1923,7 +2135,6 @@ declare namespace LocalJSX {
1923
2135
  * Where to place the search button.
1924
2136
  */
1925
2137
  "buttonPlacement"?: "left" | "right" | "none";
1926
- "core"?: SearchcraftCore;
1927
2138
  /**
1928
2139
  * The label rendered above the input.
1929
2140
  */
@@ -1948,6 +2159,10 @@ declare namespace LocalJSX {
1948
2159
  * The input element's placeholder value.
1949
2160
  */
1950
2161
  "placeholderValue"?: string;
2162
+ /**
2163
+ * The id of the Searchcraft instance that this component should use.
2164
+ */
2165
+ "searchcraftId"?: string;
1951
2166
  }
1952
2167
  /**
1953
2168
  * This web component serves as the input label for the searchcraft-input-form component.
@@ -1962,6 +2177,12 @@ declare namespace LocalJSX {
1962
2177
  "inputLabelClassName"?: string | undefined;
1963
2178
  "label"?: string;
1964
2179
  }
2180
+ /**
2181
+ * Renders a loading spinner/loading state for use in things like the summary box.
2182
+ */
2183
+ interface SearchcraftLoading {
2184
+ "label"?: string;
2185
+ }
1965
2186
  /**
1966
2187
  * This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
1967
2188
  * @react-import ```jsx
@@ -1981,6 +2202,10 @@ declare namespace LocalJSX {
1981
2202
  * ```
1982
2203
  */
1983
2204
  interface SearchcraftPagination {
2205
+ /**
2206
+ * The id of the Searchcraft instance that this component should use.
2207
+ */
2208
+ "searchcraftId"?: string;
1984
2209
  }
1985
2210
  /**
1986
2211
  * Renders a button which, when clicked, turns on popover visibility.
@@ -2023,6 +2248,10 @@ declare namespace LocalJSX {
2023
2248
  * ```
2024
2249
  */
2025
2250
  interface SearchcraftPopoverButton {
2251
+ /**
2252
+ * The id of the Searchcraft instance that this component should use.
2253
+ */
2254
+ "searchcraftId"?: string;
2026
2255
  /**
2027
2256
  * A callback function responsible for rendering the button contents.
2028
2257
  */
@@ -2036,6 +2265,10 @@ declare namespace LocalJSX {
2036
2265
  * Renders the footer for the searchcraft-popover-form.
2037
2266
  */
2038
2267
  interface SearchcraftPopoverFooter {
2268
+ /**
2269
+ * The id of the Searchcraft instance that this component should use.
2270
+ */
2271
+ "searchcraftId"?: string;
2039
2272
  }
2040
2273
  /**
2041
2274
  * 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.
@@ -2074,6 +2307,10 @@ declare namespace LocalJSX {
2074
2307
  * Formats the content rendered for each result.
2075
2308
  */
2076
2309
  "popoverResultMappings"?: PopoverResultMappings;
2310
+ /**
2311
+ * The id of the Searchcraft instance that this component should use.
2312
+ */
2313
+ "searchcraftId"?: string;
2077
2314
  /**
2078
2315
  * 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.
2079
2316
  */
@@ -2089,6 +2326,10 @@ declare namespace LocalJSX {
2089
2326
  "documentPosition"?: number;
2090
2327
  "item"?: SearchClientResponseItem | undefined;
2091
2328
  "popoverResultMappings"?: PopoverResultMappings | undefined;
2329
+ /**
2330
+ * The id of the Searchcraft instance that this component should use.
2331
+ */
2332
+ "searchcraftId"?: string;
2092
2333
  }
2093
2334
  /**
2094
2335
  * This web component is designed to display a list of results within a popover interface.
@@ -2109,6 +2350,10 @@ declare namespace LocalJSX {
2109
2350
  "searchClientResponseItems"?: SearchClientResponseItem[] | undefined;
2110
2351
  "searchResultsPage": number;
2111
2352
  "searchResultsPerPage": number;
2353
+ /**
2354
+ * The id of the Searchcraft instance that this component should use.
2355
+ */
2356
+ "searchcraftId"?: string;
2112
2357
  }
2113
2358
  /**
2114
2359
  * This web component is designed to display the number of results returned from a search query.
@@ -2145,6 +2390,10 @@ declare namespace LocalJSX {
2145
2390
  * ```
2146
2391
  */
2147
2392
  interface SearchcraftResultsInfo {
2393
+ /**
2394
+ * The id of the Searchcraft instance that this component should use.
2395
+ */
2396
+ "searchcraftId"?: string;
2148
2397
  /**
2149
2398
  * A callback function responsible for rendering the results info.
2150
2399
  */
@@ -2163,6 +2412,10 @@ declare namespace LocalJSX {
2163
2412
  */
2164
2413
  "index": number;
2165
2414
  "item"?: SearchClientResponseItem;
2415
+ /**
2416
+ * The id of the Searchcraft instance that this component should use.
2417
+ */
2418
+ "searchcraftId"?: string;
2166
2419
  /**
2167
2420
  * A callback function responsible for rendering a result.
2168
2421
  */
@@ -2214,6 +2467,10 @@ declare namespace LocalJSX {
2214
2467
  * A query that will appears when the component initializes or the search term is ''..
2215
2468
  */
2216
2469
  "initialQuery"?: string;
2470
+ /**
2471
+ * The id of the Searchcraft instance that this component should use.
2472
+ */
2473
+ "searchcraftId"?: string;
2217
2474
  /**
2218
2475
  * A callback function responsible for rendering a result. Passed to `searchcraft-search-result`.
2219
2476
  */
@@ -2243,6 +2500,10 @@ declare namespace LocalJSX {
2243
2500
  * 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.
2244
2501
  */
2245
2502
  "increment"?: string | number;
2503
+ /**
2504
+ * The id of the Searchcraft instance that this component should use.
2505
+ */
2506
+ "searchcraftId"?: string;
2246
2507
  }
2247
2508
  /**
2248
2509
  * This web component is designed to allow users to select between a group of options.
@@ -2318,6 +2579,33 @@ declare namespace LocalJSX {
2318
2579
  */
2319
2580
  "step"?: number;
2320
2581
  }
2582
+ /**
2583
+ * This component renders a summary box for RAG search result summaries.
2584
+ * When the user makes a search, a network call is made to retrieve the summary content, which is then
2585
+ * rendered in this box.
2586
+ * NOTE: This component requires the usage of a read key that has "SUMMARY" permissions.
2587
+ * @react-import ```jsx
2588
+ * import { SearchcraftSummaryBox } from "@searchcraft/react-sdk";
2589
+ * ```
2590
+ * @vue-import ```jsx
2591
+ * import { SearchcraftSummaryBox } from "@searchcraft/vue-sdk";
2592
+ * ```
2593
+ * @js-example ```html
2594
+ * <searchcraft-summary-box />
2595
+ * ```
2596
+ * @react-example ```jsx
2597
+ * <SearchcraftSummaryBox />
2598
+ * ```
2599
+ * @vue-example ```jsx
2600
+ * <SearchcraftSummaryBox />
2601
+ * ```
2602
+ */
2603
+ interface SearchcraftSummaryBox {
2604
+ /**
2605
+ * The id of the Searchcraft instance that this component should use.
2606
+ */
2607
+ "searchcraftId"?: string;
2608
+ }
2321
2609
  /**
2322
2610
  * 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.'
2323
2611
  * @react-import ```jsx
@@ -2350,6 +2638,10 @@ declare namespace LocalJSX {
2350
2638
  * When the toggle element is changed.
2351
2639
  */
2352
2640
  "onToggleUpdated"?: (event: SearchcraftToggleButtonCustomEvent<boolean>) => void;
2641
+ /**
2642
+ * The id of the Searchcraft instance that this component should use.
2643
+ */
2644
+ "searchcraftId"?: string;
2353
2645
  /**
2354
2646
  * The secondary label displayed below the main label.
2355
2647
  */
@@ -2363,6 +2655,7 @@ declare namespace LocalJSX {
2363
2655
  "searchcraft-filter-panel": SearchcraftFilterPanel;
2364
2656
  "searchcraft-input-form": SearchcraftInputForm;
2365
2657
  "searchcraft-input-label": SearchcraftInputLabel;
2658
+ "searchcraft-loading": SearchcraftLoading;
2366
2659
  "searchcraft-pagination": SearchcraftPagination;
2367
2660
  "searchcraft-popover-button": SearchcraftPopoverButton;
2368
2661
  "searchcraft-popover-footer": SearchcraftPopoverFooter;
@@ -2375,6 +2668,7 @@ declare namespace LocalJSX {
2375
2668
  "searchcraft-search-results-per-page": SearchcraftSearchResultsPerPage;
2376
2669
  "searchcraft-select": SearchcraftSelect;
2377
2670
  "searchcraft-slider": SearchcraftSlider;
2671
+ "searchcraft-summary-box": SearchcraftSummaryBox;
2378
2672
  "searchcraft-theme": SearchcraftTheme;
2379
2673
  "searchcraft-toggle-button": SearchcraftToggleButton;
2380
2674
  }
@@ -2470,6 +2764,10 @@ declare module "@stencil/core" {
2470
2764
  * ```
2471
2765
  */
2472
2766
  "searchcraft-input-label": LocalJSX.SearchcraftInputLabel & JSXBase.HTMLAttributes<HTMLSearchcraftInputLabelElement>;
2767
+ /**
2768
+ * Renders a loading spinner/loading state for use in things like the summary box.
2769
+ */
2770
+ "searchcraft-loading": LocalJSX.SearchcraftLoading & JSXBase.HTMLAttributes<HTMLSearchcraftLoadingElement>;
2473
2771
  /**
2474
2772
  * This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
2475
2773
  * @react-import ```jsx
@@ -2688,6 +2986,28 @@ declare module "@stencil/core" {
2688
2986
  * 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.
2689
2987
  */
2690
2988
  "searchcraft-slider": LocalJSX.SearchcraftSlider & JSXBase.HTMLAttributes<HTMLSearchcraftSliderElement>;
2989
+ /**
2990
+ * This component renders a summary box for RAG search result summaries.
2991
+ * When the user makes a search, a network call is made to retrieve the summary content, which is then
2992
+ * rendered in this box.
2993
+ * NOTE: This component requires the usage of a read key that has "SUMMARY" permissions.
2994
+ * @react-import ```jsx
2995
+ * import { SearchcraftSummaryBox } from "@searchcraft/react-sdk";
2996
+ * ```
2997
+ * @vue-import ```jsx
2998
+ * import { SearchcraftSummaryBox } from "@searchcraft/vue-sdk";
2999
+ * ```
3000
+ * @js-example ```html
3001
+ * <searchcraft-summary-box />
3002
+ * ```
3003
+ * @react-example ```jsx
3004
+ * <SearchcraftSummaryBox />
3005
+ * ```
3006
+ * @vue-example ```jsx
3007
+ * <SearchcraftSummaryBox />
3008
+ * ```
3009
+ */
3010
+ "searchcraft-summary-box": LocalJSX.SearchcraftSummaryBox & JSXBase.HTMLAttributes<HTMLSearchcraftSummaryBoxElement>;
2691
3011
  /**
2692
3012
  * 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.'
2693
3013
  * @react-import ```jsx
@@ -2727,7 +3047,7 @@ declare module "@stencil/core" {
2727
3047
  * The consumer-facing `Searchcraft` class.
2728
3048
  */
2729
3049
  export declare class Searchcraft extends SearchcraftCore {
2730
- constructor(config: SearchcraftConfig);
3050
+ constructor(config: SearchcraftConfig, searchcraftId?: string | undefined);
2731
3051
  }
2732
3052
 
2733
3053
  export {