instantsearch.js 4.54.1 → 4.56.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 (114) hide show
  1. package/cjs/components/Breadcrumb/Breadcrumb.js +2 -2
  2. package/cjs/components/Hits/Hits.js +16 -7
  3. package/cjs/components/InfiniteHits/InfiniteHits.js +13 -2
  4. package/cjs/components/RangeInput/RangeInput.js +22 -11
  5. package/cjs/components/RefinementList/RefinementList.js +34 -52
  6. package/cjs/components/Slider/Rheostat.js +163 -249
  7. package/cjs/connectors/autocomplete/connectAutocomplete.js +1 -1
  8. package/cjs/connectors/geo-search/connectGeoSearch.js +1 -1
  9. package/cjs/connectors/hierarchical-menu/connectHierarchicalMenu.js +1 -1
  10. package/cjs/connectors/hits/connectHits.js +1 -1
  11. package/cjs/connectors/infinite-hits/connectInfiniteHits.js +55 -32
  12. package/cjs/connectors/menu/connectMenu.js +1 -1
  13. package/cjs/connectors/numeric-menu/connectNumericMenu.js +1 -1
  14. package/cjs/connectors/rating-menu/connectRatingMenu.js +7 -3
  15. package/cjs/connectors/refinement-list/connectRefinementList.js +1 -1
  16. package/cjs/connectors/toggle-refinement/connectToggleRefinement.js +14 -4
  17. package/cjs/helpers/insights.js +3 -4
  18. package/cjs/lib/InstantSearch.js +20 -6
  19. package/cjs/lib/insights/listener.js +43 -36
  20. package/cjs/lib/routers/history.js +55 -1
  21. package/cjs/lib/stateMappings/simple.js +1 -0
  22. package/cjs/lib/stateMappings/singleIndex.js +1 -0
  23. package/cjs/lib/utils/createSendEventForFacet.js +12 -2
  24. package/cjs/lib/utils/createSendEventForHits.js +34 -11
  25. package/cjs/lib/utils/render-args.js +3 -2
  26. package/cjs/lib/version.js +1 -1
  27. package/cjs/middlewares/createInsightsMiddleware.js +135 -33
  28. package/cjs/middlewares/createMetadataMiddleware.js +17 -5
  29. package/cjs/middlewares/createRouterMiddleware.js +5 -1
  30. package/cjs/widgets/hits/hits.js +1 -2
  31. package/cjs/widgets/hits-per-page/hits-per-page.js +3 -1
  32. package/cjs/widgets/index/index.js +8 -8
  33. package/cjs/widgets/infinite-hits/infinite-hits.js +1 -2
  34. package/dist/instantsearch.development.d.ts +143 -84
  35. package/dist/instantsearch.development.js +770 -584
  36. package/dist/instantsearch.development.js.map +1 -1
  37. package/dist/instantsearch.production.d.ts +143 -84
  38. package/dist/instantsearch.production.min.d.ts +143 -84
  39. package/dist/instantsearch.production.min.js +2 -2
  40. package/dist/instantsearch.production.min.js.map +1 -1
  41. package/es/components/Breadcrumb/Breadcrumb.d.ts +2 -2
  42. package/es/components/Breadcrumb/Breadcrumb.js +2 -2
  43. package/es/components/GeoSearchControls/GeoSearchButton.d.ts +1 -1
  44. package/es/components/GeoSearchControls/GeoSearchControls.d.ts +3 -3
  45. package/es/components/GeoSearchControls/GeoSearchToggle.d.ts +1 -1
  46. package/es/components/Hits/Hits.d.ts +5 -5
  47. package/es/components/Hits/Hits.js +15 -5
  48. package/es/components/InfiniteHits/InfiniteHits.d.ts +3 -2
  49. package/es/components/InfiniteHits/InfiniteHits.js +13 -2
  50. package/es/components/Pagination/Pagination.d.ts +2 -2
  51. package/es/components/RangeInput/RangeInput.d.ts +7 -4
  52. package/es/components/RangeInput/RangeInput.js +22 -11
  53. package/es/components/RefinementList/RefinementList.d.ts +0 -1
  54. package/es/components/RefinementList/RefinementList.js +34 -52
  55. package/es/components/RelevantSort/RelevantSort.d.ts +1 -1
  56. package/es/components/Selector/Selector.d.ts +2 -2
  57. package/es/components/Slider/Rheostat.d.ts +23 -17
  58. package/es/components/Slider/Rheostat.js +163 -249
  59. package/es/components/Slider/Slider.d.ts +1 -1
  60. package/es/connectors/autocomplete/connectAutocomplete.js +1 -1
  61. package/es/connectors/current-refinements/connectCurrentRefinements.d.ts +2 -2
  62. package/es/connectors/dynamic-widgets/connectDynamicWidgets.d.ts +2 -2
  63. package/es/connectors/geo-search/connectGeoSearch.d.ts +7 -7
  64. package/es/connectors/geo-search/connectGeoSearch.js +1 -1
  65. package/es/connectors/hierarchical-menu/connectHierarchicalMenu.js +1 -1
  66. package/es/connectors/hits/connectHits.js +1 -1
  67. package/es/connectors/infinite-hits/connectInfiniteHits.js +56 -33
  68. package/es/connectors/menu/connectMenu.d.ts +2 -2
  69. package/es/connectors/menu/connectMenu.js +1 -1
  70. package/es/connectors/numeric-menu/connectNumericMenu.js +1 -1
  71. package/es/connectors/pagination/connectPagination.d.ts +1 -1
  72. package/es/connectors/range/connectRange.d.ts +3 -3
  73. package/es/connectors/rating-menu/connectRatingMenu.js +7 -3
  74. package/es/connectors/refinement-list/connectRefinementList.d.ts +3 -3
  75. package/es/connectors/refinement-list/connectRefinementList.js +1 -1
  76. package/es/connectors/relevant-sort/connectRelevantSort.d.ts +1 -1
  77. package/es/connectors/toggle-refinement/connectToggleRefinement.js +13 -3
  78. package/es/helpers/insights.d.ts +2 -1
  79. package/es/helpers/insights.js +3 -3
  80. package/es/lib/InstantSearch.d.ts +24 -14
  81. package/es/lib/InstantSearch.js +21 -7
  82. package/es/lib/insights/listener.d.ts +10 -6
  83. package/es/lib/insights/listener.js +42 -36
  84. package/es/lib/routers/history.d.ts +3 -2
  85. package/es/lib/routers/history.js +56 -2
  86. package/es/lib/stateMappings/simple.js +1 -0
  87. package/es/lib/stateMappings/singleIndex.js +1 -0
  88. package/es/lib/utils/createSendEventForFacet.js +12 -2
  89. package/es/lib/utils/createSendEventForHits.d.ts +8 -0
  90. package/es/lib/utils/createSendEventForHits.js +33 -11
  91. package/es/lib/utils/defer.d.ts +2 -2
  92. package/es/lib/utils/render-args.js +3 -2
  93. package/es/lib/version.d.ts +1 -1
  94. package/es/lib/version.js +1 -1
  95. package/es/middlewares/createInsightsMiddleware.d.ts +12 -12
  96. package/es/middlewares/createInsightsMiddleware.js +136 -34
  97. package/es/middlewares/createMetadataMiddleware.d.ts +3 -1
  98. package/es/middlewares/createMetadataMiddleware.js +17 -5
  99. package/es/middlewares/createRouterMiddleware.js +5 -1
  100. package/es/types/insights.d.ts +19 -1
  101. package/es/types/middleware.d.ts +22 -6
  102. package/es/types/router.d.ts +15 -7
  103. package/es/types/widget.d.ts +1 -1
  104. package/es/widgets/dynamic-widgets/dynamic-widgets.d.ts +2 -2
  105. package/es/widgets/geo-search/createHTMLMarker.d.ts +1 -1
  106. package/es/widgets/geo-search/geo-search.d.ts +1 -1
  107. package/es/widgets/hits/hits.js +2 -3
  108. package/es/widgets/hits-per-page/hits-per-page.js +3 -1
  109. package/es/widgets/index/index.d.ts +20 -20
  110. package/es/widgets/index/index.js +8 -8
  111. package/es/widgets/infinite-hits/infinite-hits.js +2 -3
  112. package/es/widgets/panel/panel.d.ts +2 -2
  113. package/es/widgets/range-slider/range-slider.d.ts +1 -1
  114. package/package.json +7 -7
@@ -8,7 +8,7 @@ import { cx } from '@algolia/ui-components-shared';
8
8
  import { h, render } from 'preact';
9
9
  import InfiniteHits from "../../components/InfiniteHits/InfiniteHits.js";
10
10
  import connectInfiniteHits from "../../connectors/infinite-hits/connectInfiniteHits.js";
11
- import { withInsights, withInsightsListener } from "../../lib/insights/index.js";
11
+ import { withInsights } from "../../lib/insights/index.js";
12
12
  import { component } from "../../lib/suit.js";
13
13
  import { prepareTemplateProps } from "../../lib/templating/index.js";
14
14
  import { getContainerNode, createDocumentationMessageGenerator } from "../../lib/utils/index.js";
@@ -17,7 +17,6 @@ var withUsage = createDocumentationMessageGenerator({
17
17
  name: 'infinite-hits'
18
18
  });
19
19
  var suit = component('InfiniteHits');
20
- var InfiniteHitsWithInsightsListener = withInsightsListener(InfiniteHits);
21
20
  var renderer = function renderer(_ref) {
22
21
  var containerNode = _ref.containerNode,
23
22
  cssClasses = _ref.cssClasses,
@@ -43,7 +42,7 @@ var renderer = function renderer(_ref) {
43
42
  });
44
43
  return;
45
44
  }
46
- render(h(InfiniteHitsWithInsightsListener, {
45
+ render(h(InfiniteHits, {
47
46
  cssClasses: cssClasses,
48
47
  hits: hits,
49
48
  results: results,
@@ -65,12 +65,12 @@ export type PanelWidgetParams<TWidgetFactory extends AnyWidgetFactory> = {
65
65
  * A function that is called on each render to determine if the
66
66
  * panel should be hidden based on the render options.
67
67
  */
68
- hidden?(options: PanelRenderOptions<TWidgetFactory>): boolean;
68
+ hidden?: (options: PanelRenderOptions<TWidgetFactory>) => boolean;
69
69
  /**
70
70
  * A function that is called on each render to determine if the
71
71
  * panel should be collapsed based on the render options.
72
72
  */
73
- collapsed?(options: PanelRenderOptions<TWidgetFactory>): boolean;
73
+ collapsed?: (options: PanelRenderOptions<TWidgetFactory>) => boolean;
74
74
  /**
75
75
  * The templates to use for the widget.
76
76
  */
@@ -18,7 +18,7 @@ type RangeSliderTooltipOptions = {
18
18
  * @example
19
19
  * { format(rawValue) {return '$' + Math.round(rawValue).toLocaleString() } }
20
20
  */
21
- format(value: number): string;
21
+ format: (value: number) => string;
22
22
  };
23
23
  export type RangeSliderWidgetParams = {
24
24
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instantsearch.js",
3
- "version": "4.54.1",
3
+ "version": "4.56.0",
4
4
  "description": "InstantSearch.js is a JavaScript library for building performant and instant search experiences with Algolia.",
5
5
  "homepage": "https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/",
6
6
  "types": "es/index.d.ts",
@@ -33,12 +33,12 @@
33
33
  "@types/google.maps": "^3.45.3",
34
34
  "@types/hogan.js": "^3.0.0",
35
35
  "@types/qs": "^6.5.3",
36
- "algoliasearch-helper": "^3.11.3",
36
+ "algoliasearch-helper": "^3.13.0",
37
37
  "hogan.js": "^3.0.2",
38
38
  "htm": "^3.0.0",
39
39
  "preact": "^10.10.0",
40
40
  "qs": "^6.5.1 < 6.10",
41
- "search-insights": "^2.1.0"
41
+ "search-insights": "^2.6.0"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "algoliasearch": ">= 3.1 < 6"
@@ -55,9 +55,9 @@
55
55
  "version": "./scripts/version/update-version.js"
56
56
  },
57
57
  "devDependencies": {
58
- "@instantsearch/mocks": "1.11.0",
59
- "@instantsearch/tests": "1.11.0",
60
- "@instantsearch/testutils": "1.0.14",
58
+ "@instantsearch/mocks": "1.13.0",
59
+ "@instantsearch/tests": "1.13.0",
60
+ "@instantsearch/testutils": "1.2.0",
61
61
  "@storybook/html": "5.3.9",
62
62
  "@types/scriptjs": "0.0.2",
63
63
  "algoliasearch": "4.14.3",
@@ -65,5 +65,5 @@
65
65
  "scriptjs": "2.5.9",
66
66
  "webpack": "4.41.5"
67
67
  },
68
- "gitHead": "1f81b61cf0e78aeb7022d5e9eca0d49de727dc64"
68
+ "gitHead": "ea054eab1484a3d167db83bc768f6ea134add5f9"
69
69
  }