instantsearch.js 4.60.0 → 4.62.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 (38) hide show
  1. package/cjs/components/SearchBox/SearchBox.js +2 -2
  2. package/cjs/connectors/breadcrumb/connectBreadcrumb.js +14 -5
  3. package/cjs/connectors/dynamic-widgets/connectDynamicWidgets.js +2 -3
  4. package/cjs/connectors/hierarchical-menu/connectHierarchicalMenu.js +14 -5
  5. package/cjs/connectors/menu/connectMenu.js +14 -5
  6. package/cjs/connectors/numeric-menu/connectNumericMenu.js +14 -5
  7. package/cjs/connectors/rating-menu/connectRatingMenu.js +15 -6
  8. package/cjs/connectors/refinement-list/connectRefinementList.js +14 -5
  9. package/cjs/lib/InstantSearch.js +5 -2
  10. package/cjs/lib/utils/hydrateSearchClient.js +39 -29
  11. package/cjs/lib/version.js +1 -1
  12. package/cjs/widgets/search-box/defaultTemplates.js +9 -3
  13. package/dist/instantsearch.development.d.ts +23 -3
  14. package/dist/instantsearch.development.js +167 -81
  15. package/dist/instantsearch.development.js.map +1 -1
  16. package/dist/instantsearch.production.d.ts +23 -3
  17. package/dist/instantsearch.production.min.d.ts +23 -3
  18. package/dist/instantsearch.production.min.js +2 -2
  19. package/dist/instantsearch.production.min.js.map +1 -1
  20. package/es/components/SearchBox/SearchBox.js +2 -2
  21. package/es/connectors/breadcrumb/connectBreadcrumb.js +14 -5
  22. package/es/connectors/dynamic-widgets/connectDynamicWidgets.d.ts +12 -2
  23. package/es/connectors/dynamic-widgets/connectDynamicWidgets.js +2 -3
  24. package/es/connectors/hierarchical-menu/connectHierarchicalMenu.js +14 -5
  25. package/es/connectors/menu/connectMenu.js +14 -5
  26. package/es/connectors/numeric-menu/connectNumericMenu.js +14 -5
  27. package/es/connectors/rating-menu/connectRatingMenu.d.ts +1 -1
  28. package/es/connectors/rating-menu/connectRatingMenu.js +15 -6
  29. package/es/connectors/refinement-list/connectRefinementList.js +14 -5
  30. package/es/lib/InstantSearch.d.ts +10 -0
  31. package/es/lib/InstantSearch.js +5 -2
  32. package/es/lib/utils/hydrateSearchClient.d.ts +5 -2
  33. package/es/lib/utils/hydrateSearchClient.js +39 -29
  34. package/es/lib/utils/render-args.d.ts +4 -4
  35. package/es/lib/version.d.ts +1 -1
  36. package/es/lib/version.js +1 -1
  37. package/es/widgets/search-box/defaultTemplates.js +10 -3
  38. package/package.json +6 -6
@@ -1130,11 +1130,21 @@ declare type DynamicWidgetsConnectorParams = {
1130
1130
  }>;
1131
1131
  /**
1132
1132
  * To prevent unneeded extra network requests when widgets mount or unmount,
1133
- * we request all facet values.
1133
+ * we request all facet values by default. If you want to only request the
1134
+ * facet values that are needed, you can set this option to the list of
1135
+ * attributes you want to display.
1136
+ *
1137
+ * If `facets` is set to `['*']`, we request all facet values.
1138
+ *
1139
+ * Any facets that are requested due to the `facetOrdering` result are always
1140
+ * requested by the widget that mounted itself.
1141
+ *
1142
+ * Setting `facets` to a value other than `['*']` will only prevent extra
1143
+ * requests if all potential facets are listed.
1134
1144
  *
1135
1145
  * @default ['*']
1136
1146
  */
1137
- facets?: ['*'] | never[];
1147
+ facets?: ['*'] | string[];
1138
1148
  /**
1139
1149
  * If you have more than 20 facet values pinned, you need to increase the
1140
1150
  * maxValuesPerFacet to at least that value.
@@ -2617,6 +2627,16 @@ declare type InstantSearchOptions<TUiState extends UiState = UiState, TRouteStat
2617
2627
  * @default false
2618
2628
  */
2619
2629
  preserveSharedStateOnUnmount?: boolean;
2630
+ /**
2631
+ * Changes the way root levels of hierarchical facets have their count displayed.
2632
+ *
2633
+ * If `false` (by default), the count of the refined root level is updated to match the count of the actively refined parent level.
2634
+ *
2635
+ * If `true`, the count of the root level stays the same as the count of all children levels.
2636
+ *
2637
+ * @default false
2638
+ */
2639
+ persistHierarchicalRootCount?: boolean;
2620
2640
  };
2621
2641
  };
2622
2642
 
@@ -3965,7 +3985,7 @@ declare type RatingMenuWidgetDescription = {
3965
3985
  };
3966
3986
  indexUiState: {
3967
3987
  ratingMenu: {
3968
- [attribute: string]: number;
3988
+ [attribute: string]: number | undefined;
3969
3989
  };
3970
3990
  };
3971
3991
  };
@@ -1130,11 +1130,21 @@ declare type DynamicWidgetsConnectorParams = {
1130
1130
  }>;
1131
1131
  /**
1132
1132
  * To prevent unneeded extra network requests when widgets mount or unmount,
1133
- * we request all facet values.
1133
+ * we request all facet values by default. If you want to only request the
1134
+ * facet values that are needed, you can set this option to the list of
1135
+ * attributes you want to display.
1136
+ *
1137
+ * If `facets` is set to `['*']`, we request all facet values.
1138
+ *
1139
+ * Any facets that are requested due to the `facetOrdering` result are always
1140
+ * requested by the widget that mounted itself.
1141
+ *
1142
+ * Setting `facets` to a value other than `['*']` will only prevent extra
1143
+ * requests if all potential facets are listed.
1134
1144
  *
1135
1145
  * @default ['*']
1136
1146
  */
1137
- facets?: ['*'] | never[];
1147
+ facets?: ['*'] | string[];
1138
1148
  /**
1139
1149
  * If you have more than 20 facet values pinned, you need to increase the
1140
1150
  * maxValuesPerFacet to at least that value.
@@ -2617,6 +2627,16 @@ declare type InstantSearchOptions<TUiState extends UiState = UiState, TRouteStat
2617
2627
  * @default false
2618
2628
  */
2619
2629
  preserveSharedStateOnUnmount?: boolean;
2630
+ /**
2631
+ * Changes the way root levels of hierarchical facets have their count displayed.
2632
+ *
2633
+ * If `false` (by default), the count of the refined root level is updated to match the count of the actively refined parent level.
2634
+ *
2635
+ * If `true`, the count of the root level stays the same as the count of all children levels.
2636
+ *
2637
+ * @default false
2638
+ */
2639
+ persistHierarchicalRootCount?: boolean;
2620
2640
  };
2621
2641
  };
2622
2642
 
@@ -3965,7 +3985,7 @@ declare type RatingMenuWidgetDescription = {
3965
3985
  };
3966
3986
  indexUiState: {
3967
3987
  ratingMenu: {
3968
- [attribute: string]: number;
3988
+ [attribute: string]: number | undefined;
3969
3989
  };
3970
3990
  };
3971
3991
  };