instantsearch.js 4.56.3 → 4.56.5

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 (39) hide show
  1. package/cjs/connectors/breadcrumb/connectBreadcrumb.js +31 -4
  2. package/cjs/connectors/hierarchical-menu/connectHierarchicalMenu.js +9 -3
  3. package/cjs/connectors/hits-per-page/connectHitsPerPage.js +12 -3
  4. package/cjs/connectors/menu/connectMenu.js +7 -1
  5. package/cjs/connectors/numeric-menu/connectNumericMenu.js +7 -1
  6. package/cjs/connectors/pagination/connectPagination.js +7 -5
  7. package/cjs/connectors/rating-menu/connectRatingMenu.js +12 -3
  8. package/cjs/connectors/refinement-list/connectRefinementList.js +7 -1
  9. package/cjs/connectors/toggle-refinement/connectToggleRefinement.js +15 -3
  10. package/cjs/lib/version.js +1 -1
  11. package/cjs/middlewares/createRouterMiddleware.js +12 -2
  12. package/cjs/widgets/index/index.js +6 -3
  13. package/dist/instantsearch.development.d.ts +7 -3
  14. package/dist/instantsearch.development.js +127 -31
  15. package/dist/instantsearch.development.js.map +1 -1
  16. package/dist/instantsearch.production.d.ts +7 -3
  17. package/dist/instantsearch.production.min.d.ts +7 -3
  18. package/dist/instantsearch.production.min.js +2 -2
  19. package/dist/instantsearch.production.min.js.map +1 -1
  20. package/es/connectors/breadcrumb/connectBreadcrumb.js +31 -4
  21. package/es/connectors/hierarchical-menu/connectHierarchicalMenu.js +9 -3
  22. package/es/connectors/hits-per-page/connectHitsPerPage.d.ts +5 -1
  23. package/es/connectors/hits-per-page/connectHitsPerPage.js +12 -3
  24. package/es/connectors/menu/connectMenu.js +7 -1
  25. package/es/connectors/numeric-menu/connectNumericMenu.js +7 -1
  26. package/es/connectors/pagination/connectPagination.js +7 -5
  27. package/es/connectors/rating-menu/connectRatingMenu.js +12 -3
  28. package/es/connectors/refinement-list/connectRefinementList.js +7 -1
  29. package/es/connectors/toggle-refinement/connectToggleRefinement.d.ts +1 -1
  30. package/es/connectors/toggle-refinement/connectToggleRefinement.js +15 -3
  31. package/es/connectors/toggle-refinement/types.d.ts +5 -40
  32. package/es/lib/utils/render-args.d.ts +222 -2
  33. package/es/lib/version.d.ts +1 -1
  34. package/es/lib/version.js +1 -1
  35. package/es/middlewares/createRouterMiddleware.js +12 -2
  36. package/es/types/widget.d.ts +1 -1
  37. package/es/widgets/index/index.d.ts +1 -1
  38. package/es/widgets/index/index.js +6 -3
  39. package/package.json +5 -5
@@ -1915,6 +1915,10 @@ declare type HitsPerPageRenderState = {
1915
1915
  * Array of objects defining the different values and labels.
1916
1916
  */
1917
1917
  items: HitsPerPageRenderStateItem[];
1918
+ /**
1919
+ * Creates the URL for a single item name in the list.
1920
+ */
1921
+ createURL: CreateURL<HitsPerPageConnectorParamsItem['value']>;
1918
1922
  /**
1919
1923
  * Sets the number of hits per page and triggers a search.
1920
1924
  */
@@ -2077,7 +2081,7 @@ declare type IndexWidget<TUiState extends UiState = UiState> = Omit<Widget<Index
2077
2081
  getScopedResults: () => ScopedResult[];
2078
2082
  getParent: () => IndexWidget | null;
2079
2083
  getWidgets: () => Array<Widget | IndexWidget>;
2080
- createURL: (state: SearchParameters) => string;
2084
+ createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;
2081
2085
  addWidgets: (widgets: Array<Widget | IndexWidget>) => IndexWidget;
2082
2086
  removeWidgets: (widgets: Array<Widget | IndexWidget>) => IndexWidget;
2083
2087
  init: (options: IndexInitOptions) => void;
@@ -4836,7 +4840,7 @@ declare type SharedRenderOptions = {
4836
4840
  };
4837
4841
  status: InstantSearch['status'];
4838
4842
  error: InstantSearch['error'];
4839
- createURL: (state: SearchParameters) => string;
4843
+ createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;
4840
4844
  };
4841
4845
 
4842
4846
  declare function simpleStateMapping<TUiState extends UiState = UiState>(): StateMapping<TUiState, TUiState>;
@@ -5275,7 +5279,7 @@ declare type ToggleRefinementRenderState = {
5275
5279
  /**
5276
5280
  * Creates an URL for the next state.
5277
5281
  */
5278
- createURL: CreateURL<string>;
5282
+ createURL: CreateURL<void>;
5279
5283
  /**
5280
5284
  * Send a "Facet Clicked" Insights event.
5281
5285
  */
@@ -1915,6 +1915,10 @@ declare type HitsPerPageRenderState = {
1915
1915
  * Array of objects defining the different values and labels.
1916
1916
  */
1917
1917
  items: HitsPerPageRenderStateItem[];
1918
+ /**
1919
+ * Creates the URL for a single item name in the list.
1920
+ */
1921
+ createURL: CreateURL<HitsPerPageConnectorParamsItem['value']>;
1918
1922
  /**
1919
1923
  * Sets the number of hits per page and triggers a search.
1920
1924
  */
@@ -2077,7 +2081,7 @@ declare type IndexWidget<TUiState extends UiState = UiState> = Omit<Widget<Index
2077
2081
  getScopedResults: () => ScopedResult[];
2078
2082
  getParent: () => IndexWidget | null;
2079
2083
  getWidgets: () => Array<Widget | IndexWidget>;
2080
- createURL: (state: SearchParameters) => string;
2084
+ createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;
2081
2085
  addWidgets: (widgets: Array<Widget | IndexWidget>) => IndexWidget;
2082
2086
  removeWidgets: (widgets: Array<Widget | IndexWidget>) => IndexWidget;
2083
2087
  init: (options: IndexInitOptions) => void;
@@ -4836,7 +4840,7 @@ declare type SharedRenderOptions = {
4836
4840
  };
4837
4841
  status: InstantSearch['status'];
4838
4842
  error: InstantSearch['error'];
4839
- createURL: (state: SearchParameters) => string;
4843
+ createURL: (nextState: SearchParameters | ((state: IndexUiState) => IndexUiState)) => string;
4840
4844
  };
4841
4845
 
4842
4846
  declare function simpleStateMapping<TUiState extends UiState = UiState>(): StateMapping<TUiState, TUiState>;
@@ -5275,7 +5279,7 @@ declare type ToggleRefinementRenderState = {
5275
5279
  /**
5276
5280
  * Creates an URL for the next state.
5277
5281
  */
5278
- createURL: CreateURL<string>;
5282
+ createURL: CreateURL<void>;
5279
5283
  /**
5280
5284
  * Send a "Facet Clicked" Insights event.
5281
5285
  */