instantsearch.js 4.73.4 → 4.74.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 (55) hide show
  1. package/cjs/connectors/answers/connectAnswers.js +3 -2
  2. package/cjs/connectors/configure-related-items/connectConfigureRelatedItems.js +2 -0
  3. package/cjs/connectors/index.js +7 -10
  4. package/cjs/connectors/voice-search/connectVoiceSearch.js +2 -1
  5. package/cjs/index.js +2 -0
  6. package/cjs/lib/version.js +1 -1
  7. package/cjs/templates/carousel/carousel.js +62 -0
  8. package/cjs/templates/index.js +16 -0
  9. package/cjs/widgets/configure-related-items/configure-related-items.js +2 -0
  10. package/cjs/widgets/frequently-bought-together/frequently-bought-together.js +36 -12
  11. package/cjs/widgets/index.js +7 -10
  12. package/cjs/widgets/looking-similar/looking-similar.js +37 -13
  13. package/cjs/widgets/related-products/related-products.js +37 -13
  14. package/cjs/widgets/trending-items/trending-items.js +38 -14
  15. package/dist/instantsearch.development.d.ts +119 -51
  16. package/dist/instantsearch.development.js +10284 -9961
  17. package/dist/instantsearch.development.js.map +1 -1
  18. package/dist/instantsearch.production.d.ts +119 -51
  19. package/dist/instantsearch.production.min.d.ts +119 -51
  20. package/dist/instantsearch.production.min.js +2 -2
  21. package/dist/instantsearch.production.min.js.map +1 -1
  22. package/es/connectors/answers/connectAnswers.js +3 -2
  23. package/es/connectors/configure-related-items/connectConfigureRelatedItems.d.ts +1 -0
  24. package/es/connectors/configure-related-items/connectConfigureRelatedItems.js +2 -0
  25. package/es/connectors/frequently-bought-together/connectFrequentlyBoughtTogether.d.ts +7 -7
  26. package/es/connectors/index.d.ts +2 -1
  27. package/es/connectors/index.js +4 -1
  28. package/es/connectors/looking-similar/connectLookingSimilar.d.ts +7 -7
  29. package/es/connectors/related-products/connectRelatedProducts.d.ts +7 -7
  30. package/es/connectors/trending-items/connectTrendingItems.d.ts +7 -7
  31. package/es/connectors/voice-search/connectVoiceSearch.js +2 -1
  32. package/es/index.js +5 -0
  33. package/es/lib/utils/render-args.d.ts +2 -2
  34. package/es/lib/version.d.ts +1 -1
  35. package/es/lib/version.js +1 -1
  36. package/es/templates/carousel/carousel.d.ts +22 -0
  37. package/es/templates/carousel/carousel.js +56 -0
  38. package/es/templates/index.d.ts +1 -0
  39. package/es/templates/index.js +1 -0
  40. package/es/types/widget.d.ts +3 -2
  41. package/es/widgets/configure-related-items/configure-related-items.d.ts +1 -0
  42. package/es/widgets/configure-related-items/configure-related-items.js +2 -0
  43. package/es/widgets/frequently-bought-together/frequently-bought-together.d.ts +15 -7
  44. package/es/widgets/frequently-bought-together/frequently-bought-together.js +36 -12
  45. package/es/widgets/geo-search/geo-search.d.ts +1 -1
  46. package/es/widgets/index/index.d.ts +3 -3
  47. package/es/widgets/index.d.ts +2 -1
  48. package/es/widgets/index.js +4 -1
  49. package/es/widgets/looking-similar/looking-similar.d.ts +15 -7
  50. package/es/widgets/looking-similar/looking-similar.js +37 -13
  51. package/es/widgets/related-products/related-products.d.ts +15 -7
  52. package/es/widgets/related-products/related-products.js +37 -13
  53. package/es/widgets/trending-items/trending-items.d.ts +15 -7
  54. package/es/widgets/trending-items/trending-items.js +38 -14
  55. package/package.json +8 -8
@@ -1,5 +1,6 @@
1
1
  import { AlgoliaSearchHelper } from 'algoliasearch-helper';
2
2
  import { Banner } from 'algoliasearch-helper';
3
+ import type { CarouselProps } from 'instantsearch-ui-components';
3
4
  import EventEmitter from '@algolia/events';
4
5
  import { FindAnswersOptions } from 'algoliasearch-helper/types/algoliasearch.js';
5
6
  import type { FrequentlyBoughtTogetherProps } from 'instantsearch-ui-components';
@@ -8,7 +9,7 @@ import type { HighlightClassNames as HighlightClassNames_2 } from 'instantsearch
8
9
  import type { HighlightProps as HighlightProps_3 } from 'instantsearch-ui-components';
9
10
  import type { HitsClassNames } from 'instantsearch-ui-components';
10
11
  import type { HoganOptions } from 'hogan.js';
11
- import type { html } from 'htm/preact';
12
+ import { html } from 'htm/preact';
12
13
  import type { InsightsClient as InsightsClient_2 } from 'search-insights';
13
14
  import type { InsightsMethodMap as InsightsMethodMap_2 } from 'search-insights';
14
15
  import type { LookingSimilarProps } from 'instantsearch-ui-components';
@@ -18,7 +19,7 @@ import { default as qs_2 } from 'qs';
18
19
  import type { RecommendClassNames } from 'instantsearch-ui-components';
19
20
  import { RecommendParameters } from 'algoliasearch-helper';
20
21
  import type { RecommendParametersOptions } from 'algoliasearch-helper';
21
- import type { RecommendResultItem } from 'algoliasearch-helper';
22
+ import { RecommendResponse } from 'algoliasearch-helper/types/algoliasearch.js';
22
23
  import type { RecommendResults } from 'algoliasearch-helper';
23
24
  import type { RelatedProductsProps } from 'instantsearch-ui-components';
24
25
  import { SearchClient } from 'algoliasearch-helper/types/algoliasearch.js';
@@ -27,6 +28,7 @@ import { SearchParameters } from 'algoliasearch-helper';
27
28
  import { SearchResults } from 'algoliasearch-helper';
28
29
  import type { TrendingItemsProps } from 'instantsearch-ui-components';
29
30
  import { VNode } from 'preact';
31
+ import type { VNode as VNode_2 } from 'instantsearch-ui-components';
30
32
 
31
33
  declare type AlgoliaHit<THit extends NonNullable<object> = Record<string, any>> = {
32
34
  objectID: string;
@@ -560,6 +562,15 @@ declare type BuiltInSendEventForHits = (eventType: string, hits: Hit | Hit[], ev
560
562
 
561
563
  declare type BuiltInSendEventForToggle = (eventType: string, isRefined: boolean, eventName?: string) => void;
562
564
 
565
+ declare function carousel<TObject extends Record<string, unknown>>({ cssClasses, templates, }?: CreateCarouselTemplateProps<TObject>): ({ items, templates: widgetTemplates, cssClasses: widgetCssClasses, }: CarouselTemplateProps<TObject>) => h.JSX.Element;
566
+
567
+ declare type CarouselTemplateProps<TObject extends Record<string, unknown>> = Pick<CarouselProps<TObject>, 'items'> & {
568
+ templates: {
569
+ item?: CarouselProps<TObject>['itemComponent'];
570
+ };
571
+ cssClasses?: Partial<CarouselProps<TObject>['classNames']>;
572
+ };
573
+
563
574
  declare const clearRefinements: ClearRefinementsWidget;
564
575
 
565
576
  declare type ClearRefinementsConnector = Connector<ClearRefinementsWidgetDescription, ClearRefinementsConnectorParams>;
@@ -666,8 +677,6 @@ declare type ConfigureConnectorParams = {
666
677
  searchParameters: PlainSearchParameters;
667
678
  };
668
679
 
669
- declare const configureRelatedItems: ConfigureRelatedItemsWidget;
670
-
671
680
  declare type ConfigureRelatedItemsConnector = Connector<ConfigureRelatedItemsWidgetDescription, ConfigureRelatedItemsConnectorParams>;
672
681
 
673
682
  declare type ConfigureRelatedItemsConnectorParams = {
@@ -733,8 +742,6 @@ declare const connectClearRefinements: ClearRefinementsConnector;
733
742
 
734
743
  declare const connectConfigure: ConfigureConnector;
735
744
 
736
- declare const connectConfigureRelatedItems: ConfigureRelatedItemsConnector;
737
-
738
745
  declare const connectCurrentRefinements: CurrentRefinementsConnector;
739
746
 
740
747
  declare const connectDynamicWidgets: DynamicWidgetsConnector;
@@ -1075,6 +1082,7 @@ declare type ConnectorRenderStates = AnswersWidgetDescription['indexRenderState'
1075
1082
  declare namespace connectors {
1076
1083
  export {
1077
1084
  EXPERIMENTAL_connectAnswers,
1085
+ EXPERIMENTAL_connectConfigureRelatedItems,
1078
1086
  EXPERIMENTAL_connectDynamicWidgets,
1079
1087
  connectDynamicWidgets,
1080
1088
  connectClearRefinements,
@@ -1101,7 +1109,6 @@ declare namespace connectors {
1101
1109
  _default_5 as connectGeoSearch,
1102
1110
  connectPoweredBy,
1103
1111
  connectConfigure,
1104
- connectConfigureRelatedItems as EXPERIMENTAL_connectConfigureRelatedItems,
1105
1112
  connectAutocomplete,
1106
1113
  connectQueryRules,
1107
1114
  connectVoiceSearch,
@@ -1189,6 +1196,14 @@ declare const connectToggleRefinement: ToggleRefinementConnector;
1189
1196
 
1190
1197
  declare const connectVoiceSearch: VoiceSearchConnector;
1191
1198
 
1199
+ declare type CreateCarouselTemplateProps<TObject extends Record<string, unknown>> = {
1200
+ templates?: Partial<{
1201
+ previous: Exclude<Template_2, string>;
1202
+ next: Exclude<Template_2, string>;
1203
+ }>;
1204
+ cssClasses?: Partial<CarouselProps<TObject>['classNames']>;
1205
+ };
1206
+
1192
1207
  declare function createInfiniteHitsSessionStorageCache(): InfiniteHitsCache;
1193
1208
 
1194
1209
  declare type CreateInsightsMiddleware = typeof createInsightsMiddleware;
@@ -1862,9 +1877,9 @@ declare const _default_12: <THit extends NonNullable<object> = BaseHit>(widgetPa
1862
1877
  error: InstantSearch["error"];
1863
1878
  createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;
1864
1879
  } & {
1865
- results: RecommendResultItem;
1880
+ results: RecommendResponse<any>;
1866
1881
  })): {
1867
- items: Hit<BaseHit>[] | Hit<THit>[];
1882
+ items: AlgoliaHit<BaseHit>[] | AlgoliaHit<THit>[];
1868
1883
  widgetParams: Partial<RelatedProductsWidgetParams<BaseHit>> & RelatedProductsConnectorParams<THit>;
1869
1884
  };
1870
1885
  dispose({ recommendState }: DisposeOptions): RecommendParameters;
@@ -2051,9 +2066,9 @@ declare const _default_13: <THit extends NonNullable<object> = BaseHit>(widgetPa
2051
2066
  error: InstantSearch["error"];
2052
2067
  createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;
2053
2068
  } & {
2054
- results: RecommendResultItem;
2069
+ results: RecommendResponse<any>;
2055
2070
  })): {
2056
- items: Hit<THit>[];
2071
+ items: AlgoliaHit<THit>[];
2057
2072
  widgetParams: Partial<TrendingItemsWidgetParams<BaseHit>> & TrendingItemsConnectorParams<THit>;
2058
2073
  };
2059
2074
  dispose({ recommendState }: DisposeOptions): RecommendParameters;
@@ -2240,9 +2255,9 @@ declare const _default_14: <THit extends NonNullable<object> = BaseHit>(widgetPa
2240
2255
  error: InstantSearch["error"];
2241
2256
  createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;
2242
2257
  } & {
2243
- results: RecommendResultItem;
2258
+ results: RecommendResponse<any>;
2244
2259
  })): {
2245
- items: Hit<THit>[];
2260
+ items: AlgoliaHit<THit>[];
2246
2261
  widgetParams: Partial<FrequentlyBoughtTogetherWidgetParams<BaseHit>> & FrequentlyBoughtTogetherConnectorParams<THit>;
2247
2262
  };
2248
2263
  dispose({ recommendState }: DisposeOptions): RecommendParameters;
@@ -2429,9 +2444,9 @@ declare const _default_15: <THit extends NonNullable<object> = BaseHit>(widgetPa
2429
2444
  error: InstantSearch["error"];
2430
2445
  createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;
2431
2446
  } & {
2432
- results: RecommendResultItem;
2447
+ results: RecommendResponse<any>;
2433
2448
  })): {
2434
- items: Hit<THit>[];
2449
+ items: AlgoliaHit<THit>[];
2435
2450
  widgetParams: Partial<LookingSimilarWidgetParams<BaseHit>> & LookingSimilarConnectorParams<THit>;
2436
2451
  };
2437
2452
  dispose({ recommendState }: DisposeOptions): RecommendParameters;
@@ -2725,9 +2740,9 @@ declare const _default_3: <TWidgetParams extends UnknownWidgetParams>(renderFn:
2725
2740
  error: InstantSearch["error"];
2726
2741
  createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;
2727
2742
  } & {
2728
- results: RecommendResultItem;
2743
+ results: RecommendResponse<any>;
2729
2744
  })): {
2730
- items: Hit<BaseHit>[] | Hit<THit>[];
2745
+ items: AlgoliaHit<BaseHit>[] | AlgoliaHit<THit>[];
2731
2746
  widgetParams: TWidgetParams & RelatedProductsConnectorParams<THit>;
2732
2747
  };
2733
2748
  dispose({ recommendState }: DisposeOptions): RecommendParameters;
@@ -2843,9 +2858,9 @@ declare const _default_4: <TWidgetParams extends UnknownWidgetParams>(renderFn:
2843
2858
  error: InstantSearch["error"];
2844
2859
  createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;
2845
2860
  } & {
2846
- results: RecommendResultItem;
2861
+ results: RecommendResponse<any>;
2847
2862
  })): {
2848
- items: Hit<THit>[];
2863
+ items: AlgoliaHit<THit>[];
2849
2864
  widgetParams: TWidgetParams & TrendingItemsConnectorParams<THit>;
2850
2865
  };
2851
2866
  dispose({ recommendState }: DisposeOptions): RecommendParameters;
@@ -3181,9 +3196,9 @@ declare const _default_6: <TWidgetParams extends UnknownWidgetParams>(renderFn:
3181
3196
  error: InstantSearch["error"];
3182
3197
  createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;
3183
3198
  } & {
3184
- results: RecommendResultItem;
3199
+ results: RecommendResponse<any>;
3185
3200
  })): {
3186
- items: Hit<THit>[];
3201
+ items: AlgoliaHit<THit>[];
3187
3202
  widgetParams: TWidgetParams & FrequentlyBoughtTogetherConnectorParams<THit>;
3188
3203
  };
3189
3204
  dispose({ recommendState }: DisposeOptions): RecommendParameters;
@@ -3299,9 +3314,9 @@ declare const _default_7: <TWidgetParams extends UnknownWidgetParams>(renderFn:
3299
3314
  error: InstantSearch["error"];
3300
3315
  createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;
3301
3316
  } & {
3302
- results: RecommendResultItem;
3317
+ results: RecommendResponse<any>;
3303
3318
  })): {
3304
- items: Hit<THit>[];
3319
+ items: AlgoliaHit<THit>[];
3305
3320
  widgetParams: TWidgetParams & LookingSimilarConnectorParams<THit>;
3306
3321
  };
3307
3322
  dispose({ recommendState }: DisposeOptions): RecommendParameters;
@@ -3395,7 +3410,7 @@ declare const _default_8: <THit extends GeoHit = GeoHit>(widgetParams: GeoSearch
3395
3410
  reset: string | string[];
3396
3411
  }> | undefined>;
3397
3412
  createMarker: CreateMarker;
3398
- markerOptions: GeoSearchMarker<typeof google.maps.MarkerOptions | Partial<HTMLMarkerArguments>>;
3413
+ markerOptions: GeoSearchMarker<google.maps.MarkerOptions | Partial<HTMLMarkerArguments>>;
3399
3414
  enableRefine: GeoSearchWidgetParams["enableRefine"];
3400
3415
  enableClearMapRefinement: GeoSearchWidgetParams["enableClearMapRefinement"];
3401
3416
  enableRefineControl: GeoSearchWidgetParams["enableRefineControl"];
@@ -3771,9 +3786,15 @@ declare type Expand<T> = T extends infer O ? {
3771
3786
  /** @deprecated answers is no longer supported */
3772
3787
  declare const EXPERIMENTAL_answers: AnswersWidget;
3773
3788
 
3789
+ /** @deprecated use relatedItems instead */
3790
+ declare const EXPERIMENTAL_configureRelatedItems: ConfigureRelatedItemsWidget;
3791
+
3774
3792
  /** @deprecated answers is no longer supported */
3775
3793
  declare const EXPERIMENTAL_connectAnswers: AnswersConnector;
3776
3794
 
3795
+ /** @deprecated use connectRelatedItems instead */
3796
+ declare const EXPERIMENTAL_connectConfigureRelatedItems: ConfigureRelatedItemsConnector;
3797
+
3777
3798
  /** @deprecated use connectDynamicWidgets */
3778
3799
  declare const EXPERIMENTAL_connectDynamicWidgets: DynamicWidgetsConnector;
3779
3800
 
@@ -3808,8 +3829,8 @@ declare type FrequentlyBoughtTogetherConnectorParams<THit extends NonNullable<ob
3808
3829
  /**
3809
3830
  * Function to transform the items passed to the templates.
3810
3831
  */
3811
- transformItems?: TransformItems<Hit<THit>, {
3812
- results: RecommendResultItem;
3832
+ transformItems?: TransformItems<AlgoliaHit<THit>, {
3833
+ results: RecommendResponse<AlgoliaHit<THit>>;
3813
3834
  }>;
3814
3835
  };
3815
3836
 
@@ -3819,24 +3840,33 @@ declare type FrequentlyBoughtTogetherRenderState<THit extends NonNullable<object
3819
3840
  /**
3820
3841
  * The matched recommendations from Algolia API.
3821
3842
  */
3822
- items: Array<Hit<THit>>;
3843
+ items: Array<AlgoliaHit<THit>>;
3823
3844
  };
3824
3845
 
3825
3846
  declare type FrequentlyBoughtTogetherTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{
3826
3847
  /**
3827
3848
  * Template to use when there are no results.
3828
3849
  */
3829
- empty: Template<RecommendResultItem<Hit<THit>>>;
3850
+ empty: Template<RecommendResponse<AlgoliaHit<THit>>>;
3830
3851
  /**
3831
3852
  * Template to use for the header of the widget.
3832
3853
  */
3833
- header: Template<Pick<Parameters<NonNullable<FrequentlyBoughtTogetherProps<Hit<THit>>['headerComponent']>>[0], 'items'> & {
3854
+ header: Template<Pick<Parameters<NonNullable<FrequentlyBoughtTogetherProps<AlgoliaHit<THit>>['headerComponent']>>[0], 'items'> & {
3834
3855
  cssClasses: RecommendClassNames;
3835
3856
  }>;
3836
3857
  /**
3837
3858
  * Template to use for each result. This template will receive an object containing a single record.
3838
3859
  */
3839
- item: Template<Hit<THit>>;
3860
+ item: Template<AlgoliaHit<THit>>;
3861
+ /**
3862
+ * Template to use to wrap all items.
3863
+ */
3864
+ layout: Template<Pick<Parameters<NonNullable<FrequentlyBoughtTogetherProps<AlgoliaHit<THit>>['layout']>>[0], 'items'> & {
3865
+ templates: {
3866
+ item: FrequentlyBoughtTogetherProps<AlgoliaHit<THit>>['itemComponent'];
3867
+ };
3868
+ cssClasses: Pick<FrequentlyBoughtTogetherCSSClasses, 'list' | 'item'>;
3869
+ }>;
3840
3870
  }>;
3841
3871
 
3842
3872
  declare type FrequentlyBoughtTogetherWidgetParams<THit extends NonNullable<object> = BaseHit> = {
@@ -4701,7 +4731,7 @@ declare type IndexWidget<TUiState extends UiState = UiState> = Omit<Widget<Index
4701
4731
  getIndexId: () => string;
4702
4732
  getHelper: () => AlgoliaSearchHelper | null;
4703
4733
  getResults: () => SearchResults | null;
4704
- getResultsForWidget: (widget: IndexWidget | Widget) => SearchResults | RecommendResultItem | null;
4734
+ getResultsForWidget: (widget: IndexWidget | Widget) => SearchResults | RecommendResponse<any> | null;
4705
4735
  getPreviousState: () => SearchParameters | null;
4706
4736
  getScopedResults: () => ScopedResult[];
4707
4737
  getParent: () => IndexWidget | null;
@@ -5147,6 +5177,7 @@ declare type InstantSearchModule = {
5147
5177
  middlewares: typeof middlewares;
5148
5178
  routers: typeof routers;
5149
5179
  stateMappings: typeof stateMappings;
5180
+ templates: typeof templates;
5150
5181
  createInfiniteHitsSessionStorageCache: typeof createInfiniteHitsSessionStorageCache;
5151
5182
  /** @deprecated use html tagged templates and the Highlight component instead */
5152
5183
  highlight: typeof helpers.highlight;
@@ -5314,8 +5345,8 @@ declare type LookingSimilarConnectorParams<THit extends NonNullable<object> = Ba
5314
5345
  /**
5315
5346
  * Function to transform the items passed to the templates.
5316
5347
  */
5317
- transformItems?: TransformItems<Hit<THit>, {
5318
- results: RecommendResultItem;
5348
+ transformItems?: TransformItems<AlgoliaHit<THit>, {
5349
+ results: RecommendResponse<AlgoliaHit<THit>>;
5319
5350
  }>;
5320
5351
  };
5321
5352
 
@@ -5325,24 +5356,33 @@ declare type LookingSimilarRenderState<THit extends NonNullable<object> = BaseHi
5325
5356
  /**
5326
5357
  * The matched recommendations from the Algolia API.
5327
5358
  */
5328
- items: Array<Hit<THit>>;
5359
+ items: Array<AlgoliaHit<THit>>;
5329
5360
  };
5330
5361
 
5331
5362
  declare type LookingSimilarTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{
5332
5363
  /**
5333
5364
  * Template to use when there are no results.
5334
5365
  */
5335
- empty: Template<RecommendResultItem<Hit<THit>>>;
5366
+ empty: Template<RecommendResponse<AlgoliaHit<THit>>>;
5336
5367
  /**
5337
5368
  * Template to use for the header of the widget.
5338
5369
  */
5339
- header: Template<Pick<Parameters<NonNullable<LookingSimilarProps<Hit<THit>>['headerComponent']>>[0], 'items'> & {
5370
+ header: Template<Pick<Parameters<NonNullable<LookingSimilarProps<AlgoliaHit<THit>>['headerComponent']>>[0], 'items'> & {
5340
5371
  cssClasses: RecommendClassNames;
5341
5372
  }>;
5342
5373
  /**
5343
5374
  * Template to use for each result. This template will receive an object containing a single record.
5344
5375
  */
5345
- item: Template<Hit<THit>>;
5376
+ item: Template<AlgoliaHit<THit>>;
5377
+ /**
5378
+ * Template to use to wrap all items.
5379
+ */
5380
+ layout: Template<Pick<Parameters<NonNullable<LookingSimilarProps<AlgoliaHit<THit>>['layout']>>[0], 'items'> & {
5381
+ templates: {
5382
+ item: LookingSimilarProps<AlgoliaHit<THit>>['itemComponent'];
5383
+ };
5384
+ cssClasses: Pick<LookingSimilarCSSClasses, 'list' | 'item'>;
5385
+ }>;
5346
5386
  }>;
5347
5387
 
5348
5388
  declare type LookingSimilarWidgetParams<THit extends NonNullable<object> = BaseHit> = {
@@ -6734,7 +6774,7 @@ declare type Read<THit extends NonNullable<object>> = ({ state, }: {
6734
6774
  }) => InfiniteHitsCachedHits<THit> | null;
6735
6775
 
6736
6776
  declare type RecommendRenderOptions = SharedRenderOptions & {
6737
- results: RecommendResultItem;
6777
+ results: RecommendResponse<any>;
6738
6778
  };
6739
6779
 
6740
6780
  declare type RecommendWidget<TWidgetDescription extends WidgetDescription & WidgetParams> = {
@@ -7116,8 +7156,8 @@ declare type RelatedProductsConnectorParams<THit extends NonNullable<object> = B
7116
7156
  /**
7117
7157
  * Function to transform the items passed to the templates.
7118
7158
  */
7119
- transformItems?: TransformItems<Hit<THit>, {
7120
- results: RecommendResultItem;
7159
+ transformItems?: TransformItems<AlgoliaHit<THit>, {
7160
+ results: RecommendResponse<AlgoliaHit<THit>>;
7121
7161
  }>;
7122
7162
  };
7123
7163
 
@@ -7127,24 +7167,33 @@ declare type RelatedProductsRenderState<THit extends NonNullable<object> = BaseH
7127
7167
  /**
7128
7168
  * The matched recommendations from the Algolia API.
7129
7169
  */
7130
- items: Array<Hit<THit>>;
7170
+ items: Array<AlgoliaHit<THit>>;
7131
7171
  };
7132
7172
 
7133
7173
  declare type RelatedProductsTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{
7134
7174
  /**
7135
7175
  * Template to use when there are no results.
7136
7176
  */
7137
- empty: Template<RecommendResultItem<Hit<THit>>>;
7177
+ empty: Template<RecommendResponse<AlgoliaHit<THit>>>;
7138
7178
  /**
7139
7179
  * Template to use for the header of the widget.
7140
7180
  */
7141
- header: Template<Pick<Parameters<NonNullable<RelatedProductsProps<Hit<THit>>['headerComponent']>>[0], 'items'> & {
7181
+ header: Template<Pick<Parameters<NonNullable<RelatedProductsProps<AlgoliaHit<THit>>['headerComponent']>>[0], 'items'> & {
7142
7182
  cssClasses: RecommendClassNames;
7143
7183
  }>;
7144
7184
  /**
7145
7185
  * Template to use for each result. This template will receive an object containing a single record.
7146
7186
  */
7147
- item: Template<Hit<THit>>;
7187
+ item: Template<AlgoliaHit<THit>>;
7188
+ /**
7189
+ * Template to use to wrap all items.
7190
+ */
7191
+ layout: Template<Pick<Parameters<NonNullable<RelatedProductsProps<AlgoliaHit<THit>>['layout']>>[0], 'items'> & {
7192
+ templates: {
7193
+ item: RelatedProductsProps<AlgoliaHit<THit>>['itemComponent'];
7194
+ };
7195
+ cssClasses: Pick<RelatedProductsCSSClasses, 'list' | 'item'>;
7196
+ }>;
7148
7197
  }>;
7149
7198
 
7150
7199
  declare type RelatedProductsWidgetParams<THit extends NonNullable<object> = BaseHit> = {
@@ -8024,6 +8073,10 @@ declare type Status = 'initial' | 'askingPermission' | 'waiting' | 'recognizing'
8024
8073
 
8025
8074
  declare type Template<TTemplateData = void> = string | ((data: TTemplateData, params: TemplateParams) => VNode | VNode[] | string | null);
8026
8075
 
8076
+ declare type Template_2 = (params: {
8077
+ html: typeof html;
8078
+ }) => VNode_2 | VNode_2[] | null;
8079
+
8027
8080
  declare type TemplateParams = {
8028
8081
  html: typeof html;
8029
8082
  components: {
@@ -8039,6 +8092,12 @@ declare type Templates = {
8039
8092
  [key: string]: Template<any> | TemplateWithBindEvent<any> | undefined;
8040
8093
  };
8041
8094
 
8095
+ declare namespace templates {
8096
+ export {
8097
+ carousel
8098
+ }
8099
+ }
8100
+
8042
8101
  declare type TemplatesConfig = {
8043
8102
  helpers?: HoganHelpers;
8044
8103
  compileOptions?: HoganOptions;
@@ -8261,8 +8320,8 @@ declare type TrendingItemsConnectorParams<THit extends NonNullable<object> = Bas
8261
8320
  /**
8262
8321
  * Function to transform the items passed to the templates.
8263
8322
  */
8264
- transformItems?: TransformItems<Hit<THit>, {
8265
- results: RecommendResultItem;
8323
+ transformItems?: TransformItems<AlgoliaHit<THit>, {
8324
+ results: RecommendResponse<AlgoliaHit<THit>>;
8266
8325
  }>;
8267
8326
  };
8268
8327
 
@@ -8272,24 +8331,33 @@ declare type TrendingItemsRenderState<THit extends NonNullable<object> = BaseHit
8272
8331
  /**
8273
8332
  * The matched recommendations from the Algolia API.
8274
8333
  */
8275
- items: Array<Hit<THit>>;
8334
+ items: Array<AlgoliaHit<THit>>;
8276
8335
  };
8277
8336
 
8278
8337
  declare type TrendingItemsTemplates<THit extends NonNullable<object> = BaseHit> = Partial<{
8279
8338
  /**
8280
8339
  * Template to use when there are no results.
8281
8340
  */
8282
- empty: Template<RecommendResultItem<Hit<THit>>>;
8341
+ empty: Template<RecommendResponse<AlgoliaHit<THit>>>;
8283
8342
  /**
8284
8343
  * Template to use for the header of the widget.
8285
8344
  */
8286
- header: Template<Pick<Parameters<NonNullable<TrendingItemsProps<Hit<THit>>['headerComponent']>>[0], 'items'> & {
8345
+ header: Template<Pick<Parameters<NonNullable<TrendingItemsProps<AlgoliaHit<THit>>['headerComponent']>>[0], 'items'> & {
8287
8346
  cssClasses: RecommendClassNames;
8288
8347
  }>;
8289
8348
  /**
8290
8349
  * Template to use for each result. This template will receive an object containing a single record.
8291
8350
  */
8292
- item: Template<Hit<THit>>;
8351
+ item: Template<AlgoliaHit<THit>>;
8352
+ /**
8353
+ * Template to use to wrap all items.
8354
+ */
8355
+ layout: Template<Pick<Parameters<NonNullable<TrendingItemsProps<AlgoliaHit<THit>>['layout']>>[0], 'items'> & {
8356
+ templates: {
8357
+ item: TrendingItemsProps<AlgoliaHit<THit>>['itemComponent'];
8358
+ };
8359
+ cssClasses: Pick<TrendingItemsCSSClasses, 'list' | 'item'>;
8360
+ }>;
8293
8361
  }>;
8294
8362
 
8295
8363
  declare type TrendingItemsWidgetParams<THit extends NonNullable<object> = BaseHit> = {
@@ -8446,6 +8514,7 @@ declare type WidgetRenderStates = AnalyticsWidgetDescription['indexRenderState']
8446
8514
  declare namespace widgets {
8447
8515
  export {
8448
8516
  EXPERIMENTAL_answers,
8517
+ EXPERIMENTAL_configureRelatedItems,
8449
8518
  EXPERIMENTAL_dynamicWidgets,
8450
8519
  dynamicWidgets,
8451
8520
  analytics,
@@ -8453,7 +8522,6 @@ declare namespace widgets {
8453
8522
  clearRefinements,
8454
8523
  configure,
8455
8524
  currentRefinements,
8456
- configureRelatedItems as EXPERIMENTAL_configureRelatedItems,
8457
8525
  _default_8 as geoSearch,
8458
8526
  hierarchicalMenu,
8459
8527
  _default_9 as hits,