@bridgeline-digital/hawksearch-handlebars-ui 4.0.2 → 5.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/changelog.md +17 -0
  2. package/dist/components/content/content-types/base-content.component.d.ts +1 -1
  3. package/dist/components/content/content-types/featured-items-content-item/featured-items-content-item.component.d.ts +1 -1
  4. package/dist/components/content/content-zone/content-zone.component.d.ts +1 -1
  5. package/dist/components/general/date-picker/date-picker.component.d.ts +1 -1
  6. package/dist/components/general/icon/icon.component.d.ts +1 -1
  7. package/dist/components/general/range-slider/range-slider.component.d.ts +1 -1
  8. package/dist/components/general/rating/rating.component.d.ts +1 -1
  9. package/dist/components/general/tooltip/tooltip.component.d.ts +1 -1
  10. package/dist/components/index.d.ts +1 -0
  11. package/dist/components/landing-pages/landing-page/landing-page.component.d.ts +1 -1
  12. package/dist/components/recommendations/recommendations/recommendations.component.d.ts +1 -1
  13. package/dist/components/recommendations/recommendations-item/recommendations-item.component.d.ts +1 -1
  14. package/dist/components/search/autocomplete/autocomplete.component.d.ts +1 -1
  15. package/dist/components/search/facet-types/base-facet.component.d.ts +1 -1
  16. package/dist/components/search/facet-wrapper/facet-wrapper.component.d.ts +1 -1
  17. package/dist/components/search/facets-list/facets-list.component.d.ts +1 -1
  18. package/dist/components/search/modified-query/modified-query.component.d.ts +1 -1
  19. package/dist/components/search/page-size/page-size.component.d.ts +1 -1
  20. package/dist/components/search/pagination/pagination.component.d.ts +1 -1
  21. package/dist/components/search/query-suggestions/query-suggestions.component.d.ts +1 -1
  22. package/dist/components/search/search-field/search-field.component.d.ts +1 -1
  23. package/dist/components/search/search-results/search-results.component.d.ts +1 -1
  24. package/dist/components/search/search-results-item/search-results-item.component.d.ts +1 -1
  25. package/dist/components/search/search-results-list/search-results-list.component.d.ts +1 -1
  26. package/dist/components/search/selected-facets/selected-facets.component.d.ts +1 -1
  27. package/dist/components/search/sorting/sorting.component.d.ts +1 -1
  28. package/dist/components/search/tabs/tabs.component.d.ts +1 -1
  29. package/dist/components/variants/index.d.ts +1 -0
  30. package/dist/components/variants/variant-selector/variant-selector.component.d.ts +23 -0
  31. package/dist/configuration/configuration.models.d.ts +101 -107
  32. package/dist/helpers/helpers.d.ts +18 -0
  33. package/dist/index.js +1 -1
  34. package/dist/index.js.map +1 -1
  35. package/dist/models/autocomplete.models.d.ts +2 -10
  36. package/dist/models/base.models.d.ts +49 -0
  37. package/dist/models/component.models.d.ts +10 -1
  38. package/dist/models/content.models.d.ts +10 -2
  39. package/dist/models/index.d.ts +1 -0
  40. package/dist/models/raw/index.d.ts +1 -0
  41. package/dist/models/raw/raw-base.models.d.ts +8 -0
  42. package/dist/models/raw/raw-recommendation.models.d.ts +10 -0
  43. package/dist/models/raw/raw-search.models.d.ts +2 -2
  44. package/dist/models/recommendation.models.d.ts +2 -10
  45. package/dist/models/search.models.d.ts +5 -13
  46. package/dist/services/autocomplete.service.d.ts +1 -2
  47. package/dist/services/base.service.d.ts +42 -4
  48. package/dist/services/index.d.ts +1 -0
  49. package/dist/services/recommendations.service.d.ts +1 -2
  50. package/dist/services/search.service.d.ts +1 -2
  51. package/dist/services/tracking.service.d.ts +1 -1
  52. package/dist/styles.69909e432fb2cc23cf6e035925be065f.css +1 -0
  53. package/dist/utilities/colors.d.ts +1 -0
  54. package/dist/utilities/index.d.ts +1 -0
  55. package/package.json +1 -1
  56. package/readme.md +1 -1
  57. package/dist/styles.d47f79757b4a33d3db5809736c115e15.css +0 -1
package/changelog.md CHANGED
@@ -1,3 +1,20 @@
1
+ # 5.0.0
2
+
3
+ ## New Features
4
+
5
+ 1. Added VariantSelectorComponent
6
+ 2. Implemented VariantSelectorComponent in default templates for search results, featured items, recommendations, and autocomplete
7
+
8
+ ## Bug Fixes
9
+
10
+ 1. Updated the `attributes` collection on recommendation items to split single string values by `|^|` into string arrays
11
+ 2. Added logic to catch HTTP errors in service layer
12
+
13
+ ## Breaking Changes
14
+
15
+ 1. Modified JSON structure for field mapping configuration
16
+ 2. The `attributes` collection on recommendation items now consists of the data in `customDict` from the API response rather than preserving `customDict` as a nested property
17
+
1
18
  # 4.0.2
2
19
 
3
20
  1. Updated `number` and `currency` Handlebars helpers to handle string values from API and made decimals parameter optional
@@ -1,6 +1,6 @@
1
+ import { BaseComponent } from '@components';
1
2
  import { BaseComponentConfig } from '@configuration';
2
3
  import { BaseComponentModel, ContentType } from '@models';
3
- import { BaseComponent } from '../../base.component';
4
4
  /**
5
5
  * @category Content
6
6
  */
@@ -1,6 +1,6 @@
1
+ import { BaseComponent } from '@components';
1
2
  import { FeaturedItemsContentItemComponentConfig, HawkSearchComponents } from '@configuration';
2
3
  import { FeaturedItemsContentItemComponentModel, SearchResultsItem } from '@models';
3
- import { BaseComponent } from '../../../base.component';
4
4
  /**
5
5
  * The Featured Items Content Item component displays information for an individual product or page.
6
6
  *
@@ -1,6 +1,6 @@
1
+ import { BaseComponent } from '@components';
1
2
  import { ContentZoneComponentConfig, HawkSearchComponents } from '@configuration';
2
3
  import { ContentZoneComponentModel, SearchResponse } from '@models';
3
- import { BaseComponent } from '../../base.component';
4
4
  /**
5
5
  * The Content Zone component renders a list of content items or Spotlight products as defined in the Merchandising section of HawkSearch.
6
6
  *
@@ -1,6 +1,6 @@
1
+ import { BaseComponent } from '@components';
1
2
  import { DatePickerComponentConfig, HawkSearchComponents } from '@configuration';
2
3
  import { DatePickerComponentModel } from '@models';
3
- import { BaseComponent } from '../../base.component';
4
4
  /**
5
5
  * The Date Picker component provides an intuitive interface that allows the user to select a range in ISO format. This component is currently only used within the {@link Components.DateRangeFacetComponent | Date Range Facet Component}.
6
6
  *
@@ -1,6 +1,6 @@
1
+ import { BaseComponent } from '@components';
1
2
  import { HawkSearchComponents, IconComponentConfig } from '@configuration';
2
3
  import { IconComponentModel } from '@models';
3
- import { BaseComponent } from '../../base.component';
4
4
  /**
5
5
  * The Icon component renders an SVG image inline with text content.
6
6
  *
@@ -1,6 +1,6 @@
1
+ import { BaseComponent } from '@components';
1
2
  import { HawkSearchComponents, RangeSliderComponentConfig } from '@configuration';
2
3
  import { RangeSliderComponentModel } from '@models';
3
- import { BaseComponent } from '../../base.component';
4
4
  /**
5
5
  * The Range Slider component provides a draggable interface that allows the user to select a range between 0-100. This component is currently only used within the {@link Components.RangeSliderFacetComponent | Range Slider Facet Component}.
6
6
  *
@@ -1,6 +1,6 @@
1
+ import { BaseComponent } from '@components';
1
2
  import { HawkSearchComponents, RatingComponentConfig } from '@configuration';
2
3
  import { RatingComponentModel } from '@models';
3
- import { BaseComponent } from '../../base.component';
4
4
  /**
5
5
  * The Rating component is used to display a visual representation of ratings for a particular product.
6
6
  *
@@ -1,6 +1,6 @@
1
+ import { BaseComponent } from '@components';
1
2
  import { HawkSearchComponents, TooltipComponentConfig } from '@configuration';
2
3
  import { TooltipComponentModel } from '@models';
3
- import { BaseComponent } from '../../base.component';
4
4
  /**
5
5
  * The Tooltip component is used to display a brief explanation or contextual information when the user hovers over an element.
6
6
  *
@@ -226,3 +226,4 @@ export * from './general';
226
226
  export * from './landing-pages';
227
227
  export * from './recommendations';
228
228
  export * from './search';
229
+ export * from './variants';
@@ -1,6 +1,6 @@
1
+ import { BaseComponent } from '@components';
1
2
  import { HawkSearchComponents, LandingPageComponentConfig } from '@configuration';
2
3
  import { LandingPageComponentModel, SearchResponse } from '@models';
3
- import { BaseComponent } from '../../base.component';
4
4
  /**
5
5
  * The Landing page component displays either a search results interface to display a subset of products, or a custom layout to display content items.
6
6
  *
@@ -1,6 +1,6 @@
1
+ import { BaseComponent } from '@components';
1
2
  import { HawkSearchComponents, RecommendationsComponentConfig } from '@configuration';
2
3
  import { RecommendationsComponentModel, RecommendationsWidget } from '@models';
3
- import { BaseComponent } from '../../base.component';
4
4
  /**
5
5
  * The Recommendations component displays a list of products determined by the rules configured in the HawkSearch admin.
6
6
  *
@@ -1,6 +1,6 @@
1
+ import { BaseComponent } from '@components';
1
2
  import { HawkSearchComponents, RecommendationsItemComponentConfig } from '@configuration';
2
3
  import { RecommendationsItem, RecommendationsItemComponentModel } from '@models';
3
- import { BaseComponent } from '../../base.component';
4
4
  /**
5
5
  * The Recommendations Item component displays information for an individual product or page.
6
6
  *
@@ -1,6 +1,6 @@
1
+ import { BaseComponent } from '@components';
1
2
  import { AutocompleteComponentConfig, HawkSearchComponents } from '@configuration';
2
3
  import { AutocompleteComponentModel, AutocompleteResponse } from '@models';
3
- import { BaseComponent } from '../../base.component';
4
4
  /**
5
5
  * The Autocomplete component displays a preview of search results after a user begins to type a query in the {@link Components.SearchFieldComponent}.
6
6
  *
@@ -1,6 +1,6 @@
1
+ import { BaseComponent } from '@components';
1
2
  import { BaseComponentConfig } from '@configuration';
2
3
  import { BaseComponentModel, Facet, FacetState } from '@models';
3
- import { BaseComponent } from '../../base.component';
4
4
  /**
5
5
  * The Base Facet component is inherited by all facet type copmonents.
6
6
  *
@@ -1,6 +1,6 @@
1
+ import { BaseComponent } from '@components';
1
2
  import { FacetWrapperComponentConfig, HawkSearchComponents } from '@configuration';
2
3
  import { Facet, FacetState, FacetWrapperComponentModel } from '@models';
3
- import { BaseComponent } from '../../base.component';
4
4
  /**
5
5
  * The Facet Wrapper component adds functionality common to all facet types such as expand/collapse, tooltip, and value search.
6
6
  *
@@ -1,6 +1,6 @@
1
+ import { BaseComponent } from '@components';
1
2
  import { FacetsListComponentConfig, HawkSearchComponents } from '@configuration';
2
3
  import { Facet, FacetsListComponentModel } from '@models';
3
- import { BaseComponent } from '../../base.component';
4
4
  /**
5
5
  * The Facets List component displays a list of available facets with a toggle to expand/collapse on mobile devices.
6
6
  *
@@ -1,6 +1,6 @@
1
+ import { BaseComponent } from '@components';
1
2
  import { HawkSearchComponents, ModifiedQueryComponentConfig } from '@configuration';
2
3
  import { ModifiedQueryComponentModel, ModifiedQueryData } from '@models';
3
- import { BaseComponent } from '../../base.component';
4
4
  /**
5
5
  * The Modified Query component is rendered when the spellchecker detects a spelling error and searches for the correctly-spelled query instead.
6
6
  *
@@ -1,6 +1,6 @@
1
+ import { BaseComponent } from '@components';
1
2
  import { HawkSearchComponents, PageSizeComponentConfig } from '@configuration';
2
3
  import { PageSizeComponentModel, PaginationOption } from '@models';
3
- import { BaseComponent } from '../../base.component';
4
4
  /**
5
5
  * The Page Size component is used to modify the number of search results displayed on each page.
6
6
  *
@@ -1,6 +1,6 @@
1
+ import { BaseComponent } from '@components';
1
2
  import { HawkSearchComponents, PaginationComponentConfig } from '@configuration';
2
3
  import { Pagination, PaginationComponentModel } from '@models';
3
- import { BaseComponent } from '../../base.component';
4
4
  /**
5
5
  * The Pagination component is used to navigate between different pages of a search results set.
6
6
  *
@@ -1,6 +1,6 @@
1
+ import { BaseComponent } from '@components';
1
2
  import { HawkSearchComponents, QuerySuggestionsComponentConfig } from '@configuration';
2
3
  import { QuerySuggestionsComponentModel, QuerySuggestionsData } from '@models';
3
- import { BaseComponent } from '../../base.component';
4
4
  /**
5
5
  * The Query Suggestions component displays a list of possible queries that the search engine detects the user may be looking for.
6
6
  *
@@ -1,6 +1,6 @@
1
+ import { BaseComponent } from '@components';
1
2
  import { HawkSearchComponents, SearchFieldComponentConfig } from '@configuration';
2
3
  import { SearchFieldComponentModel, SearchResponse } from '@models';
3
- import { BaseComponent } from '../../base.component';
4
4
  /**
5
5
  * The Search component contains a text input element which triggers the {@link Components.AutocompleteComponent | Autocomplete component} as the user types and executes a new search when the user hits the `enter` key.
6
6
  *
@@ -1,6 +1,6 @@
1
+ import { BaseComponent } from '@components';
1
2
  import { HawkSearchComponents, SearchResultsComponentConfig } from '@configuration';
2
3
  import { SearchResponse, SearchResultsComponentModel, SearchResultsMode } from '@models';
3
- import { BaseComponent } from '../../base.component';
4
4
  /**
5
5
  * The Search Results component encapsulates all components relating to search-results.
6
6
  *
@@ -1,6 +1,6 @@
1
+ import { BaseComponent } from '@components';
1
2
  import { HawkSearchComponents, SearchResultsItemComponentConfig } from '@configuration';
2
3
  import { SearchResultsItem, SearchResultsItemComponentModel } from '@models';
3
- import { BaseComponent } from '../../base.component';
4
4
  /**
5
5
  * The Search Results Item component displays information for an individual product or page.
6
6
  *
@@ -1,6 +1,6 @@
1
+ import { BaseComponent } from '@components';
1
2
  import { HawkSearchComponents, SearchResultsListComponentConfig } from '@configuration';
2
3
  import { SearchResultsItem, SearchResultsListComponentModel } from '@models';
3
- import { BaseComponent } from '../../base.component';
4
4
  /**
5
5
  * The Search Results List component is a wrapper around a group of {@link Components.SearchResultsItemComponent | Search Results Item} components.
6
6
  *
@@ -1,6 +1,6 @@
1
+ import { BaseComponent } from '@components';
1
2
  import { HawkSearchComponents, SelectedFacetsComponentConfig } from '@configuration';
2
3
  import { SelectedFacet, SelectedFacetsComponentModel } from '@models';
3
- import { BaseComponent } from '../../base.component';
4
4
  /**
5
5
  * The Selected Facets component displays a list of facets that have been selected by the user.
6
6
  *
@@ -1,6 +1,6 @@
1
+ import { BaseComponent } from '@components';
1
2
  import { HawkSearchComponents, SortingComponentConfig } from '@configuration';
2
3
  import { Sorting, SortingComponentModel } from '@models';
3
- import { BaseComponent } from '../../base.component';
4
4
  /**
5
5
  * The Sorting component is used to select the logic for ordering search results.
6
6
  *
@@ -1,6 +1,6 @@
1
+ import { BaseComponent } from '@components';
1
2
  import { HawkSearchComponents, TabsComponentConfig } from '@configuration';
2
3
  import { Facet, TabsComponentModel } from '@models';
3
- import { BaseComponent } from '../../base.component';
4
4
  /**
5
5
  * The Tabs component is used to segment search results by item type, often products and content.
6
6
  *
@@ -0,0 +1 @@
1
+ export * from './variant-selector/variant-selector.component';
@@ -0,0 +1,23 @@
1
+ import { BaseComponent } from '@components';
2
+ import { HawkSearchComponents, VariantSelectorComponentConfig } from '@configuration';
3
+ import { VariantSelectorComponentModel, Variants } from '@models';
4
+ /**
5
+ * The Variant Selector component is used to select a single variant within an item.
6
+ *
7
+ * ## Tag
8
+ * The tag for this component is `<hawksearch-variant-selector>`.
9
+ *
10
+ * ## Default Template
11
+ * The following is the default Handlebars template for this component. To create a custom template, it is recommended to use this as a starting point.
12
+ * {@embed ./variant-selector.component.hbs}
13
+ *
14
+ * @category Variants
15
+ */
16
+ export declare class VariantSelectorComponent extends BaseComponent<VariantSelectorComponentConfig, Variants, VariantSelectorComponentModel> {
17
+ protected componentName: keyof HawkSearchComponents;
18
+ protected defaultHtml: any;
19
+ protected bindFromEvent: boolean;
20
+ protected renderContent(): boolean;
21
+ protected getContentModel(): VariantSelectorComponentModel;
22
+ protected onRender(): void;
23
+ }
@@ -1,5 +1,5 @@
1
1
  import * as Handlebars from 'handlebars';
2
- import { SearchRequest, SearchResponse, SearchResultsItemType } from '@models';
2
+ import { ItemType, RecommendationsResponse, SearchRequest, SearchResponse } from '@models';
3
3
  import { AutocompleteService, RecommendationsService, SearchService, TrackingService } from '../services';
4
4
  export interface BaseComponentConfig {
5
5
  /**
@@ -194,6 +194,8 @@ export interface TabsComponentConfig extends BaseComponentConfig {
194
194
  }
195
195
  export interface TooltipComponentConfig extends BaseComponentConfig {
196
196
  }
197
+ export interface VariantSelectorComponentConfig extends BaseComponentConfig {
198
+ }
197
199
  export interface HawkSearchComponents {
198
200
  'autocomplete'?: AutocompleteComponentConfig;
199
201
  'checkbox-list-facet'?: CheckboxListFacetComponentConfig;
@@ -233,10 +235,82 @@ export interface HawkSearchComponents {
233
235
  'sorting'?: SortingComponentConfig;
234
236
  'tabs'?: TabsComponentConfig;
235
237
  'tooltip'?: TooltipComponentConfig;
238
+ 'variant-selector'?: VariantSelectorComponentConfig;
236
239
  }
237
240
  export type DisplayType = 'mobile' | 'tablet' | 'desktop';
238
241
  export interface Breakpoints<TValue> extends Record<DisplayType, TValue> {
239
242
  }
243
+ export interface FieldMappings {
244
+ /**
245
+ * #### Default Value
246
+ * `['description', 'longdescription']`
247
+ */
248
+ description?: string | Array<string>;
249
+ /**
250
+ * #### Default Value
251
+ * `['imageurl', 'image']`
252
+ */
253
+ imageUrl?: string | Array<string>;
254
+ /**
255
+ * #### Default Value
256
+ * `'price'`
257
+ */
258
+ price?: string | Array<string>;
259
+ /**
260
+ * #### Default Value
261
+ * `'rating'`
262
+ */
263
+ rating?: string | Array<string>;
264
+ /**
265
+ * #### Default Value
266
+ * `['saleprice']`
267
+ */
268
+ salePrice?: string | Array<string>;
269
+ /**
270
+ * #### Default Value
271
+ * `['sku']`
272
+ */
273
+ sku?: string | Array<string>;
274
+ /**
275
+ * #### Default Value
276
+ * `['title', 'name', 'itemname']`
277
+ */
278
+ title?: string | Array<string>;
279
+ /**
280
+ * #### Default Value
281
+ * `'type'`
282
+ */
283
+ type?: string | Array<string>;
284
+ /**
285
+ * #### Default Value
286
+ * `'url'`
287
+ */
288
+ url?: string;
289
+ }
290
+ export interface VariantFieldMappings extends FieldMappings {
291
+ /**
292
+ * #### Default Value
293
+ * `['id']`
294
+ */
295
+ id?: string | Array<string>;
296
+ color?: {
297
+ /**
298
+ * #### Default Value
299
+ * `['colorname', 'color']`
300
+ */
301
+ name?: string | Array<string>;
302
+ /**
303
+ * #### Default Value
304
+ * `['colorhex', 'colorvalue']`
305
+ */
306
+ hex?: string | Array<string>;
307
+ /**
308
+ * #### Default Value
309
+ * `['colorimageurl', 'colorimage']`
310
+ */
311
+ imageUrl?: string | Array<string>;
312
+ };
313
+ }
240
314
  export interface HawkSearchConfig {
241
315
  /**
242
316
  * The unique ID for your installation found in the HawkSearch admin
@@ -246,6 +320,10 @@ export interface HawkSearchConfig {
246
320
  * Specify an index to query rather than the default
247
321
  */
248
322
  index?: string;
323
+ /**
324
+ * Map item attributes to common object properties
325
+ */
326
+ fieldMappings?: FieldMappings;
249
327
  autocomplete?: {
250
328
  /**
251
329
  * The API used to retrieve search results
@@ -261,26 +339,6 @@ export interface HawkSearchConfig {
261
339
  * `false`
262
340
  */
263
341
  recommendationsEnabled?: boolean;
264
- /**
265
- * Map item attributes to common object properties
266
- */
267
- fieldMappings?: {
268
- /**
269
- * #### Default Value
270
- * `'price'`
271
- */
272
- price?: string;
273
- /**
274
- * #### Default Value
275
- * `'rating'`
276
- */
277
- rating?: string;
278
- /**
279
- * #### Default Value
280
- * `'saleprice'`
281
- */
282
- salePrice?: string;
283
- };
284
342
  };
285
343
  search?: {
286
344
  /**
@@ -304,51 +362,6 @@ export interface HawkSearchConfig {
304
362
  * `'-'`
305
363
  */
306
364
  facetExclusionPrefix?: string;
307
- /**
308
- * Map item attributes to common object properties
309
- */
310
- fieldMappings?: {
311
- /**
312
- * #### Default Value
313
- * `'longdescription'`
314
- */
315
- description?: string;
316
- /**
317
- * #### Default Value
318
- * `'image'`
319
- */
320
- imageUrl?: string;
321
- /**
322
- * #### Default Value
323
- * `'price'`
324
- */
325
- price?: string;
326
- /**
327
- * #### Default Value
328
- * `'rating'`
329
- */
330
- rating?: string;
331
- /**
332
- * #### Default Value
333
- * `'saleprice'`
334
- */
335
- salePrice?: string;
336
- /**
337
- * #### Default Value
338
- * `'itemname'`
339
- */
340
- title?: string;
341
- /**
342
- * #### Default Value
343
- * `'type'`
344
- */
345
- type?: string;
346
- /**
347
- * #### Default Value
348
- * `'url'`
349
- */
350
- url?: string;
351
- };
352
365
  /**
353
366
  * Specifies how search results should be classified
354
367
  */
@@ -359,7 +372,7 @@ export interface HawkSearchConfig {
359
372
  * #### Default Value
360
373
  * `'content'`
361
374
  */
362
- default: SearchResultsItemType;
375
+ default: ItemType;
363
376
  /**
364
377
  * List of values that will be considered a `product` result.
365
378
  *
@@ -412,46 +425,6 @@ export interface HawkSearchConfig {
412
425
  * `'https://recs-dev.hawksearch.net'`
413
426
  */
414
427
  endpointUrl?: string;
415
- /**
416
- * Map item attributes to common object properties
417
- */
418
- fieldMappings?: {
419
- /**
420
- * #### Default Value
421
- * `'longdescription'`
422
- */
423
- description?: string;
424
- /**
425
- * #### Default Value
426
- * `'image'`
427
- */
428
- imageUrl?: string;
429
- /**
430
- * #### Default Value
431
- * `'price'`
432
- */
433
- price?: string;
434
- /**
435
- * #### Default Value
436
- * `'rating'`
437
- */
438
- rating?: string;
439
- /**
440
- * #### Default Value
441
- * `'saleprice'`
442
- */
443
- salePrice?: string;
444
- /**
445
- * #### Default Value
446
- * `'itemname'`
447
- */
448
- title?: string;
449
- /**
450
- * #### Default Value
451
- * `'url'`
452
- */
453
- url?: string;
454
- };
455
428
  };
456
429
  tracking?: {
457
430
  /**
@@ -470,6 +443,24 @@ export interface HawkSearchConfig {
470
443
  */
471
444
  endpointUrl?: string;
472
445
  };
446
+ variants?: {
447
+ /**
448
+ * Specifies whether variant logic should be used if data is available
449
+ *
450
+ * #### Default Value
451
+ *
452
+ * `true`
453
+ */
454
+ enabled?: boolean;
455
+ /**
456
+ * When specified, this prefix is removed from the `attributes` collection on variant items. For example, if a value of `'child_'` is used and HawkSearch returns a field named `'child_color'`, it will be transformed to `'color'`.
457
+ */
458
+ fieldPrefix?: string;
459
+ /**
460
+ * Map item attributes to common object properties
461
+ */
462
+ fieldMappings?: VariantFieldMappings;
463
+ };
473
464
  /**
474
465
  * Specifies the minimum window widths that correspond to each breakpoint. This is used determine when certain content items are displayed.
475
466
  *
@@ -549,6 +540,9 @@ export interface HawkSearchConfig {
549
540
  export interface HawkSearchGlobal {
550
541
  config: HawkSearchConfig;
551
542
  handlebars: typeof Handlebars;
543
+ recommendationsResponses?: {
544
+ [widgetId: string]: RecommendationsResponse;
545
+ };
552
546
  searchRequest?: SearchRequest;
553
547
  searchResponse?: SearchResponse;
554
548
  services?: {
@@ -102,6 +102,24 @@ export declare function html(html: string): Handlebars.SafeString;
102
102
  * @returns Formatted currency string
103
103
  */
104
104
  export declare function currency(value: number | string | Array<number> | Array<string> | undefined, decimals: number | undefined, defaultValue?: number): string | undefined;
105
+ /**
106
+ * This function filters an array of objects based on whether a specified property value matches an optional condition, or, if omitted, has a truthy value
107
+ *
108
+ * @param values Array of objects to be filtered
109
+ * @param path Name of property or nested path to evaluate each object
110
+ * @param condition Optional condition
111
+ * @returns Formatted currency string
112
+ */
113
+ export declare function arrayFilterObjects(values: Array<any | undefined>, path: string, condition?: any): Array<any> | undefined;
114
+ /**
115
+ * This function returns whether any object in an array has a specified property value which matches an optional condition, or, if omitted, has a truthy value
116
+ *
117
+ * @param values Array of objects to be filtered
118
+ * @param path Name of property or nested path to evaluate each object
119
+ * @param condition Optional condition
120
+ * @returns Formatted currency string
121
+ */
122
+ export declare function arrayHasObjectsWithValue(values: Array<any | undefined>, path: string, condition?: any): boolean;
105
123
  /**
106
124
  * This function returns whether the first provided value is greater than the second provided value.
107
125
  *