@searchcraft/javascript-sdk 0.10.7 → 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 +530 -217
  3. package/dist/components/index.js +1655 -8
  4. package/dist/components/index.js.map +1 -1
  5. package/dist/components/{p-e99cd628.js → p-0c495408.js} +30 -20
  6. package/dist/components/p-0c495408.js.map +1 -0
  7. package/dist/components/{p-b4cac872.js → p-1d5c5536.js} +18 -8
  8. package/dist/components/p-1d5c5536.js.map +1 -0
  9. package/dist/components/{p-274c5cc8.js → p-3286bbb3.js} +22 -10
  10. package/dist/components/p-3286bbb3.js.map +1 -0
  11. package/dist/components/{p-ea48ccae.js → p-3e41546c.js} +17 -8
  12. package/dist/components/p-3e41546c.js.map +1 -0
  13. package/dist/components/{p-adc6236e.js → p-87435aac.js} +31 -20
  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-b01f8216.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-acab4d41.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-320e3895.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 +6072 -4862
  64. package/dist/hydrate/index.mjs +6072 -4862
  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 +10 -3
  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 +256 -6
  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-062d6b80.js +0 -1940
  125. package/dist/components/p-062d6b80.js.map +0 -1
  126. package/dist/components/p-274c5cc8.js.map +0 -1
  127. package/dist/components/p-320e3895.js.map +0 -1
  128. package/dist/components/p-810a7850.js.map +0 -1
  129. package/dist/components/p-acab4d41.js.map +0 -1
  130. package/dist/components/p-adc6236e.js.map +0 -1
  131. package/dist/components/p-b01f8216.js.map +0 -1
  132. package/dist/components/p-b4cac872.js.map +0 -1
  133. package/dist/components/p-e99cd628.js.map +0 -1
  134. package/dist/components/p-ea48ccae.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[];
77
+ }
78
+ /**
79
+ * The type representing a measure request.
80
+ */
81
+ export interface MeasureRequest {
82
+ event_name: MeasureEventName;
83
+ properties: MeasureRequestProperties;
84
+ user: MeasureRequestUser;
14
85
  }
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;
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
  }
@@ -549,6 +603,10 @@ declare class SearchClient {
549
603
  * Getter for the base url used by the /search endpoint.
550
604
  */
551
605
  private get baseSearchUrl();
606
+ /**
607
+ * Immediately cancels all pending search requests.
608
+ */
609
+ abortRequests: () => void;
552
610
  /**
553
611
  * Make the request to get the search results.
554
612
  * @param {properties} properties - The properties for the search.
@@ -565,49 +623,13 @@ declare class SearchClient {
565
623
  */
566
624
  private formatParamsForRequest;
567
625
  }
568
- /**
569
- * Javascript Class providing the functionality to interact with the Searchcraft BE
570
- */
571
- export declare class SearchcraftCore {
572
- config: SearchcraftConfig;
573
- measureClient: MeasureClient | undefined;
574
- searchClient: SearchClient | undefined;
575
- adClient: AdClient | undefined;
576
- userId: string;
577
- private requestTimeout;
578
- private subscriptionEvents;
579
- constructor(config: SearchcraftConfig, sdkInfo: SearchcraftSDKInfo);
580
- private initInputForms;
581
- /**
582
- * When changes happen in the DOM, we want to link any input forms found to the instance of the core.
583
- */
584
- private startObservingMutations;
585
- private initClients;
586
- emitEvent<T extends SubscriptionEventName>(eventName: T, event: SubscriptionEventMap[T]): void;
587
- subscribe<T extends SubscriptionEventName>(eventName: T, callback: SubscriptionEventCallback<T>): UnsubscribeFunction;
588
- /**
589
- * Called when a `<searchcraft-ad>` component is rendered
590
- */
591
- handleAdContainerRendered(data: {
592
- adClientResponseItem?: AdClientResponseItem;
593
- adContainerId: string;
594
- adSource: SearchcraftAdSource;
595
- searchTerm: string;
596
- }): void;
597
- /**
598
- * Called when a `<searchcraft-ad>` is viewed
599
- */
600
- handleAdContainerViewed(data: {
601
- adClientResponseItem?: AdClientResponseItem;
602
- adContainerId: string;
603
- adSource: SearchcraftAdSource;
604
- searchTerm: string;
605
- }): void;
606
- /**
607
- * Perform various actions when the input is cleared
608
- */
609
- handleInputCleared(): void;
610
- 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;
611
633
  }
612
634
  /**
613
635
  * Callable functions made available by the SearchcraftStore.
@@ -615,20 +637,12 @@ export declare class SearchcraftCore {
615
637
  export interface SearchcraftStateFunctions {
616
638
  addFacetPathsForIndexField: (field: FacetPathsForIndexField) => void;
617
639
  addRangeValueForIndexField: (field: RangeValueForIndexField) => void;
618
- getSearchcraftCore: () => SearchcraftCore | undefined;
619
- init: (searchcraft: SearchcraftCore | undefined, debug?: boolean) => void;
620
640
  removeFacetPathsForIndexField: (fieldName: string) => void;
621
641
  removeRangeValueForIndexField: (fieldName: string) => void;
622
- resetFacetPaths: () => void;
642
+ resetSearchValues: () => void;
623
643
  search: () => Promise<void>;
624
- set: (state: Partial<SearchcraftState> | ((state: SearchcraftState) => Partial<SearchcraftState>)) => SearchcraftState;
625
- setAdClientResponseItems: (items: AdClientResponseItem[]) => void;
626
- setSearchClientResponseItemsFromResponse: (request: SearchClientRequestProperties | string, response: SearchcraftResponse, items: SearchClientResponseItem[], supplementalResponse: SearchcraftResponse | undefined) => void;
627
- setInitialSearchClientResponseItemsFromResponse: (request: SearchClientRequestProperties | string, response: SearchcraftResponse, items: SearchClientResponseItem[]) => void;
628
- setInitialQuery: (query: string) => void;
629
644
  setPopoverVisibility: (isVisible: boolean) => void;
630
645
  setSearchResultsCount: (count: number) => void;
631
- setSearchClientResponseItems: (items: SearchClientResponseItem[]) => void;
632
646
  setSearchResultsPage: (page: number) => void;
633
647
  setSearchResultsPerPage: (perPage: number) => void;
634
648
  setSearchTerm: (searchTerm: string) => void;
@@ -644,19 +658,19 @@ export interface SearchcraftStateFunctions {
644
658
  */
645
659
  export interface SearchcraftStateValues {
646
660
  adClientResponseItems: AdClientResponseItem[];
661
+ cachedAdClientResponseItems: AdClientResponseItem[];
647
662
  core: SearchcraftCore | undefined;
648
663
  hotkey: string;
649
664
  hotkeyModifier: "ctrl" | "meta" | "alt" | "option";
650
- logger: Logger | undefined;
651
665
  facetPathsForIndexFields: Record<string, FacetPathsForIndexField>;
652
- initialQuery: string;
653
- initialSearchClientResponseItems: SearchClientResponseItem[];
654
666
  isPopoverVisible: boolean;
655
667
  isSearchInProgress: boolean;
656
668
  rangeValueForIndexFields: Record<string, RangeValueForIndexField>;
657
669
  searchMode: "fuzzy" | "exact";
658
- searchClientRequest: SearchClientRequestProperties | string | undefined | null;
670
+ searchClientRequest?: SearchClientRequest;
671
+ searchClientRequestProperties: SearchClientRequestProperties | string | undefined | null;
659
672
  searchClientResponseItems: SearchClientResponseItem[];
673
+ cachedSearchClientResponseItems: SearchClientResponseItem[];
660
674
  searchResponseTimeTaken: number | undefined;
661
675
  searchResponseFacetPrime: FacetPrime | undefined | null;
662
676
  supplementalFacetPrime: FacetPrime | undefined | null;
@@ -666,11 +680,60 @@ export interface SearchcraftStateValues {
666
680
  searchTerm: string;
667
681
  orderByField: string | undefined | null;
668
682
  sortType: "asc" | "desc" | undefined | null;
669
- afterInit: (state: SearchcraftState) => void;
683
+ summary: string;
684
+ hasSummaryBox: boolean;
685
+ isSummaryLoading: boolean;
686
+ summaryClient?: SummaryClient;
670
687
  }
671
688
  export interface SearchcraftState extends SearchcraftStateFunctions, SearchcraftStateValues {
672
689
  }
673
- 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
+ }
674
737
  export type SearchcraftSelectOption = {
675
738
  label: string;
676
739
  value: string | number;
@@ -682,11 +745,15 @@ export namespace Components {
682
745
  */
683
746
  interface SearchcraftAd {
684
747
  "adClientResponseItem"?: AdClientResponseItem;
685
- "adSource": SearchcraftAdSource;
748
+ "adSource": "Custom" | "Nativo" | "adMarketplace";
686
749
  /**
687
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.
688
751
  */
689
752
  "renderPosition": "interstitial" | "top" | "bottom";
753
+ /**
754
+ * The id of the Searchcraft instance that this component should use.
755
+ */
756
+ "searchcraftId"?: string;
690
757
  }
691
758
  /**
692
759
  * This web component represents a button.
@@ -752,6 +819,10 @@ export namespace Components {
752
819
  * The name of the field where facets are applied.
753
820
  */
754
821
  "fieldName": string;
822
+ /**
823
+ * The id of the Searchcraft instance that this component should use.
824
+ */
825
+ "searchcraftId"?: string;
755
826
  }
756
827
  /**
757
828
  * This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.
@@ -784,6 +855,10 @@ export namespace Components {
784
855
  * The items to filter.
785
856
  */
786
857
  "items": FilterItem[];
858
+ /**
859
+ * The id of the Searchcraft instance that this component should use.
860
+ */
861
+ "searchcraftId"?: string;
787
862
  }
788
863
  /**
789
864
  * This web component provides a user-friendly interface for querying an indexed dataset, enabling users to easily search large collections of data.
@@ -817,7 +892,6 @@ export namespace Components {
817
892
  * Where to place the search button.
818
893
  */
819
894
  "buttonPlacement"?: "left" | "right" | "none";
820
- "core"?: SearchcraftCore;
821
895
  /**
822
896
  * The label rendered above the input.
823
897
  */
@@ -830,6 +904,10 @@ export namespace Components {
830
904
  * The input element's placeholder value.
831
905
  */
832
906
  "placeholderValue"?: string;
907
+ /**
908
+ * The id of the Searchcraft instance that this component should use.
909
+ */
910
+ "searchcraftId"?: string;
833
911
  }
834
912
  /**
835
913
  * This web component serves as the input label for the searchcraft-input-form component.
@@ -844,6 +922,12 @@ export namespace Components {
844
922
  "inputLabelClassName"?: string | undefined;
845
923
  "label": string;
846
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
+ }
847
931
  /**
848
932
  * This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
849
933
  * @react-import ```jsx
@@ -863,6 +947,10 @@ export namespace Components {
863
947
  * ```
864
948
  */
865
949
  interface SearchcraftPagination {
950
+ /**
951
+ * The id of the Searchcraft instance that this component should use.
952
+ */
953
+ "searchcraftId"?: string;
866
954
  }
867
955
  /**
868
956
  * Renders a button which, when clicked, turns on popover visibility.
@@ -905,6 +993,10 @@ export namespace Components {
905
993
  * ```
906
994
  */
907
995
  interface SearchcraftPopoverButton {
996
+ /**
997
+ * The id of the Searchcraft instance that this component should use.
998
+ */
999
+ "searchcraftId"?: string;
908
1000
  /**
909
1001
  * A callback function responsible for rendering the button contents.
910
1002
  */
@@ -918,6 +1010,10 @@ export namespace Components {
918
1010
  * Renders the footer for the searchcraft-popover-form.
919
1011
  */
920
1012
  interface SearchcraftPopoverFooter {
1013
+ /**
1014
+ * The id of the Searchcraft instance that this component should use.
1015
+ */
1016
+ "searchcraftId"?: string;
921
1017
  }
922
1018
  /**
923
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.
@@ -956,6 +1052,10 @@ export namespace Components {
956
1052
  * Formats the content rendered for each result.
957
1053
  */
958
1054
  "popoverResultMappings"?: PopoverResultMappings;
1055
+ /**
1056
+ * The id of the Searchcraft instance that this component should use.
1057
+ */
1058
+ "searchcraftId"?: string;
959
1059
  /**
960
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.
961
1061
  */
@@ -971,6 +1071,10 @@ export namespace Components {
971
1071
  "documentPosition": number;
972
1072
  "item": SearchClientResponseItem | undefined;
973
1073
  "popoverResultMappings": PopoverResultMappings | undefined;
1074
+ /**
1075
+ * The id of the Searchcraft instance that this component should use.
1076
+ */
1077
+ "searchcraftId"?: string;
974
1078
  }
975
1079
  /**
976
1080
  * This web component is designed to display a list of results within a popover interface.
@@ -991,6 +1095,10 @@ export namespace Components {
991
1095
  "searchClientResponseItems": SearchClientResponseItem[] | undefined;
992
1096
  "searchResultsPage": number;
993
1097
  "searchResultsPerPage": number;
1098
+ /**
1099
+ * The id of the Searchcraft instance that this component should use.
1100
+ */
1101
+ "searchcraftId"?: string;
994
1102
  }
995
1103
  /**
996
1104
  * This web component is designed to display the number of results returned from a search query.
@@ -1027,6 +1135,10 @@ export namespace Components {
1027
1135
  * ```
1028
1136
  */
1029
1137
  interface SearchcraftResultsInfo {
1138
+ /**
1139
+ * The id of the Searchcraft instance that this component should use.
1140
+ */
1141
+ "searchcraftId"?: string;
1030
1142
  /**
1031
1143
  * A callback function responsible for rendering the results info.
1032
1144
  */
@@ -1045,6 +1157,10 @@ export namespace Components {
1045
1157
  */
1046
1158
  "index": number;
1047
1159
  "item"?: SearchClientResponseItem;
1160
+ /**
1161
+ * The id of the Searchcraft instance that this component should use.
1162
+ */
1163
+ "searchcraftId"?: string;
1048
1164
  /**
1049
1165
  * A callback function responsible for rendering a result.
1050
1166
  */
@@ -1096,6 +1212,10 @@ export namespace Components {
1096
1212
  * A query that will appears when the component initializes or the search term is ''..
1097
1213
  */
1098
1214
  "initialQuery"?: string;
1215
+ /**
1216
+ * The id of the Searchcraft instance that this component should use.
1217
+ */
1218
+ "searchcraftId"?: string;
1099
1219
  /**
1100
1220
  * A callback function responsible for rendering a result. Passed to `searchcraft-search-result`.
1101
1221
  */
@@ -1125,6 +1245,10 @@ export namespace Components {
1125
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.
1126
1246
  */
1127
1247
  "increment": string | number;
1248
+ /**
1249
+ * The id of the Searchcraft instance that this component should use.
1250
+ */
1251
+ "searchcraftId"?: string;
1128
1252
  }
1129
1253
  /**
1130
1254
  * This web component is designed to allow users to select between a group of options.
@@ -1192,6 +1316,33 @@ export namespace Components {
1192
1316
  */
1193
1317
  "step": number;
1194
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
+ }
1195
1346
  /**
1196
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.'
1197
1348
  * @react-import ```jsx
@@ -1220,6 +1371,10 @@ export namespace Components {
1220
1371
  * The label.
1221
1372
  */
1222
1373
  "label": string;
1374
+ /**
1375
+ * The id of the Searchcraft instance that this component should use.
1376
+ */
1377
+ "searchcraftId"?: string;
1223
1378
  /**
1224
1379
  * The secondary label displayed below the main label.
1225
1380
  */
@@ -1411,6 +1566,15 @@ declare global {
1411
1566
  prototype: HTMLSearchcraftInputLabelElement;
1412
1567
  new (): HTMLSearchcraftInputLabelElement;
1413
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
+ };
1414
1578
  /**
1415
1579
  * This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
1416
1580
  * @react-import ```jsx
@@ -1711,6 +1875,33 @@ declare global {
1711
1875
  prototype: HTMLSearchcraftSliderElement;
1712
1876
  new (): HTMLSearchcraftSliderElement;
1713
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
+ };
1714
1905
  /**
1715
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.'
1716
1907
  * @react-import ```jsx
@@ -1763,6 +1954,7 @@ declare global {
1763
1954
  "searchcraft-filter-panel": HTMLSearchcraftFilterPanelElement;
1764
1955
  "searchcraft-input-form": HTMLSearchcraftInputFormElement;
1765
1956
  "searchcraft-input-label": HTMLSearchcraftInputLabelElement;
1957
+ "searchcraft-loading": HTMLSearchcraftLoadingElement;
1766
1958
  "searchcraft-pagination": HTMLSearchcraftPaginationElement;
1767
1959
  "searchcraft-popover-button": HTMLSearchcraftPopoverButtonElement;
1768
1960
  "searchcraft-popover-footer": HTMLSearchcraftPopoverFooterElement;
@@ -1775,6 +1967,7 @@ declare global {
1775
1967
  "searchcraft-search-results-per-page": HTMLSearchcraftSearchResultsPerPageElement;
1776
1968
  "searchcraft-select": HTMLSearchcraftSelectElement;
1777
1969
  "searchcraft-slider": HTMLSearchcraftSliderElement;
1970
+ "searchcraft-summary-box": HTMLSearchcraftSummaryBoxElement;
1778
1971
  "searchcraft-theme": HTMLSearchcraftThemeElement;
1779
1972
  "searchcraft-toggle-button": HTMLSearchcraftToggleButtonElement;
1780
1973
  }
@@ -1785,11 +1978,15 @@ declare namespace LocalJSX {
1785
1978
  */
1786
1979
  interface SearchcraftAd {
1787
1980
  "adClientResponseItem"?: AdClientResponseItem;
1788
- "adSource"?: SearchcraftAdSource;
1981
+ "adSource"?: "Custom" | "Nativo" | "adMarketplace";
1789
1982
  /**
1790
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.
1791
1984
  */
1792
1985
  "renderPosition"?: "interstitial" | "top" | "bottom";
1986
+ /**
1987
+ * The id of the Searchcraft instance that this component should use.
1988
+ */
1989
+ "searchcraftId"?: string;
1793
1990
  }
1794
1991
  /**
1795
1992
  * This web component represents a button.
@@ -1865,6 +2062,10 @@ declare namespace LocalJSX {
1865
2062
  "onFacetSelectionUpdated"?: (event: SearchcraftFacetListCustomEvent<{
1866
2063
  paths: string[];
1867
2064
  }>) => void;
2065
+ /**
2066
+ * The id of the Searchcraft instance that this component should use.
2067
+ */
2068
+ "searchcraftId"?: string;
1868
2069
  }
1869
2070
  /**
1870
2071
  * This web component represents a series of filters that allows users to refine and control their search queries by applying various filter criteria.
@@ -1897,6 +2098,10 @@ declare namespace LocalJSX {
1897
2098
  * The items to filter.
1898
2099
  */
1899
2100
  "items"?: FilterItem[];
2101
+ /**
2102
+ * The id of the Searchcraft instance that this component should use.
2103
+ */
2104
+ "searchcraftId"?: string;
1900
2105
  }
1901
2106
  /**
1902
2107
  * This web component provides a user-friendly interface for querying an indexed dataset, enabling users to easily search large collections of data.
@@ -1930,7 +2135,6 @@ declare namespace LocalJSX {
1930
2135
  * Where to place the search button.
1931
2136
  */
1932
2137
  "buttonPlacement"?: "left" | "right" | "none";
1933
- "core"?: SearchcraftCore;
1934
2138
  /**
1935
2139
  * The label rendered above the input.
1936
2140
  */
@@ -1955,6 +2159,10 @@ declare namespace LocalJSX {
1955
2159
  * The input element's placeholder value.
1956
2160
  */
1957
2161
  "placeholderValue"?: string;
2162
+ /**
2163
+ * The id of the Searchcraft instance that this component should use.
2164
+ */
2165
+ "searchcraftId"?: string;
1958
2166
  }
1959
2167
  /**
1960
2168
  * This web component serves as the input label for the searchcraft-input-form component.
@@ -1969,6 +2177,12 @@ declare namespace LocalJSX {
1969
2177
  "inputLabelClassName"?: string | undefined;
1970
2178
  "label"?: string;
1971
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
+ }
1972
2186
  /**
1973
2187
  * This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
1974
2188
  * @react-import ```jsx
@@ -1988,6 +2202,10 @@ declare namespace LocalJSX {
1988
2202
  * ```
1989
2203
  */
1990
2204
  interface SearchcraftPagination {
2205
+ /**
2206
+ * The id of the Searchcraft instance that this component should use.
2207
+ */
2208
+ "searchcraftId"?: string;
1991
2209
  }
1992
2210
  /**
1993
2211
  * Renders a button which, when clicked, turns on popover visibility.
@@ -2030,6 +2248,10 @@ declare namespace LocalJSX {
2030
2248
  * ```
2031
2249
  */
2032
2250
  interface SearchcraftPopoverButton {
2251
+ /**
2252
+ * The id of the Searchcraft instance that this component should use.
2253
+ */
2254
+ "searchcraftId"?: string;
2033
2255
  /**
2034
2256
  * A callback function responsible for rendering the button contents.
2035
2257
  */
@@ -2043,6 +2265,10 @@ declare namespace LocalJSX {
2043
2265
  * Renders the footer for the searchcraft-popover-form.
2044
2266
  */
2045
2267
  interface SearchcraftPopoverFooter {
2268
+ /**
2269
+ * The id of the Searchcraft instance that this component should use.
2270
+ */
2271
+ "searchcraftId"?: string;
2046
2272
  }
2047
2273
  /**
2048
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.
@@ -2081,6 +2307,10 @@ declare namespace LocalJSX {
2081
2307
  * Formats the content rendered for each result.
2082
2308
  */
2083
2309
  "popoverResultMappings"?: PopoverResultMappings;
2310
+ /**
2311
+ * The id of the Searchcraft instance that this component should use.
2312
+ */
2313
+ "searchcraftId"?: string;
2084
2314
  /**
2085
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.
2086
2316
  */
@@ -2096,6 +2326,10 @@ declare namespace LocalJSX {
2096
2326
  "documentPosition"?: number;
2097
2327
  "item"?: SearchClientResponseItem | undefined;
2098
2328
  "popoverResultMappings"?: PopoverResultMappings | undefined;
2329
+ /**
2330
+ * The id of the Searchcraft instance that this component should use.
2331
+ */
2332
+ "searchcraftId"?: string;
2099
2333
  }
2100
2334
  /**
2101
2335
  * This web component is designed to display a list of results within a popover interface.
@@ -2116,6 +2350,10 @@ declare namespace LocalJSX {
2116
2350
  "searchClientResponseItems"?: SearchClientResponseItem[] | undefined;
2117
2351
  "searchResultsPage": number;
2118
2352
  "searchResultsPerPage": number;
2353
+ /**
2354
+ * The id of the Searchcraft instance that this component should use.
2355
+ */
2356
+ "searchcraftId"?: string;
2119
2357
  }
2120
2358
  /**
2121
2359
  * This web component is designed to display the number of results returned from a search query.
@@ -2152,6 +2390,10 @@ declare namespace LocalJSX {
2152
2390
  * ```
2153
2391
  */
2154
2392
  interface SearchcraftResultsInfo {
2393
+ /**
2394
+ * The id of the Searchcraft instance that this component should use.
2395
+ */
2396
+ "searchcraftId"?: string;
2155
2397
  /**
2156
2398
  * A callback function responsible for rendering the results info.
2157
2399
  */
@@ -2170,6 +2412,10 @@ declare namespace LocalJSX {
2170
2412
  */
2171
2413
  "index": number;
2172
2414
  "item"?: SearchClientResponseItem;
2415
+ /**
2416
+ * The id of the Searchcraft instance that this component should use.
2417
+ */
2418
+ "searchcraftId"?: string;
2173
2419
  /**
2174
2420
  * A callback function responsible for rendering a result.
2175
2421
  */
@@ -2221,6 +2467,10 @@ declare namespace LocalJSX {
2221
2467
  * A query that will appears when the component initializes or the search term is ''..
2222
2468
  */
2223
2469
  "initialQuery"?: string;
2470
+ /**
2471
+ * The id of the Searchcraft instance that this component should use.
2472
+ */
2473
+ "searchcraftId"?: string;
2224
2474
  /**
2225
2475
  * A callback function responsible for rendering a result. Passed to `searchcraft-search-result`.
2226
2476
  */
@@ -2250,6 +2500,10 @@ declare namespace LocalJSX {
2250
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.
2251
2501
  */
2252
2502
  "increment"?: string | number;
2503
+ /**
2504
+ * The id of the Searchcraft instance that this component should use.
2505
+ */
2506
+ "searchcraftId"?: string;
2253
2507
  }
2254
2508
  /**
2255
2509
  * This web component is designed to allow users to select between a group of options.
@@ -2325,6 +2579,33 @@ declare namespace LocalJSX {
2325
2579
  */
2326
2580
  "step"?: number;
2327
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
+ }
2328
2609
  /**
2329
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.'
2330
2611
  * @react-import ```jsx
@@ -2357,6 +2638,10 @@ declare namespace LocalJSX {
2357
2638
  * When the toggle element is changed.
2358
2639
  */
2359
2640
  "onToggleUpdated"?: (event: SearchcraftToggleButtonCustomEvent<boolean>) => void;
2641
+ /**
2642
+ * The id of the Searchcraft instance that this component should use.
2643
+ */
2644
+ "searchcraftId"?: string;
2360
2645
  /**
2361
2646
  * The secondary label displayed below the main label.
2362
2647
  */
@@ -2370,6 +2655,7 @@ declare namespace LocalJSX {
2370
2655
  "searchcraft-filter-panel": SearchcraftFilterPanel;
2371
2656
  "searchcraft-input-form": SearchcraftInputForm;
2372
2657
  "searchcraft-input-label": SearchcraftInputLabel;
2658
+ "searchcraft-loading": SearchcraftLoading;
2373
2659
  "searchcraft-pagination": SearchcraftPagination;
2374
2660
  "searchcraft-popover-button": SearchcraftPopoverButton;
2375
2661
  "searchcraft-popover-footer": SearchcraftPopoverFooter;
@@ -2382,6 +2668,7 @@ declare namespace LocalJSX {
2382
2668
  "searchcraft-search-results-per-page": SearchcraftSearchResultsPerPage;
2383
2669
  "searchcraft-select": SearchcraftSelect;
2384
2670
  "searchcraft-slider": SearchcraftSlider;
2671
+ "searchcraft-summary-box": SearchcraftSummaryBox;
2385
2672
  "searchcraft-theme": SearchcraftTheme;
2386
2673
  "searchcraft-toggle-button": SearchcraftToggleButton;
2387
2674
  }
@@ -2477,6 +2764,10 @@ declare module "@stencil/core" {
2477
2764
  * ```
2478
2765
  */
2479
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>;
2480
2771
  /**
2481
2772
  * This web component is designed to facilitate pagination of search results. Once a query is submitted, calculates the number for pages.
2482
2773
  * @react-import ```jsx
@@ -2695,6 +2986,28 @@ declare module "@stencil/core" {
2695
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.
2696
2987
  */
2697
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>;
2698
3011
  /**
2699
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.'
2700
3013
  * @react-import ```jsx
@@ -2734,7 +3047,7 @@ declare module "@stencil/core" {
2734
3047
  * The consumer-facing `Searchcraft` class.
2735
3048
  */
2736
3049
  export declare class Searchcraft extends SearchcraftCore {
2737
- constructor(config: SearchcraftConfig);
3050
+ constructor(config: SearchcraftConfig, searchcraftId?: string | undefined);
2738
3051
  }
2739
3052
 
2740
3053
  export {