instantsearch.js 4.44.0 → 4.45.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 (36) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/cjs/connectors/hits-per-page/connectHitsPerPage.js +3 -1
  3. package/cjs/connectors/numeric-menu/connectNumericMenu.js +31 -43
  4. package/cjs/connectors/range/connectRange.js +7 -46
  5. package/cjs/connectors/rating-menu/connectRatingMenu.js +10 -4
  6. package/cjs/connectors/sort-by/connectSortBy.js +3 -1
  7. package/cjs/lib/version.js +1 -1
  8. package/cjs/widgets/clear-refinements/clear-refinements.js +2 -2
  9. package/dist/instantsearch.development.d.ts +29 -10
  10. package/dist/instantsearch.development.js +113 -124
  11. package/dist/instantsearch.development.js.map +1 -1
  12. package/dist/instantsearch.production.d.ts +29 -10
  13. package/dist/instantsearch.production.min.d.ts +29 -10
  14. package/dist/instantsearch.production.min.js +2 -2
  15. package/dist/instantsearch.production.min.js.map +1 -1
  16. package/es/components/Answers/Answers.d.ts +2 -2
  17. package/es/components/Hits/Hits.d.ts +2 -2
  18. package/es/components/InfiniteHits/InfiniteHits.d.ts +2 -2
  19. package/es/connectors/answers/connectAnswers.d.ts +2 -2
  20. package/es/connectors/autocomplete/connectAutocomplete.d.ts +2 -2
  21. package/es/connectors/hits-per-page/connectHitsPerPage.d.ts +5 -0
  22. package/es/connectors/hits-per-page/connectHitsPerPage.js +3 -1
  23. package/es/connectors/numeric-menu/connectNumericMenu.d.ts +8 -0
  24. package/es/connectors/numeric-menu/connectNumericMenu.js +32 -44
  25. package/es/connectors/range/connectRange.js +8 -47
  26. package/es/connectors/rating-menu/connectRatingMenu.d.ts +2 -0
  27. package/es/connectors/rating-menu/connectRatingMenu.js +10 -4
  28. package/es/connectors/sort-by/connectSortBy.d.ts +5 -0
  29. package/es/connectors/sort-by/connectSortBy.js +3 -1
  30. package/es/lib/insights/client.d.ts +2 -2
  31. package/es/lib/utils/createSendEventForHits.d.ts +3 -3
  32. package/es/lib/version.d.ts +1 -1
  33. package/es/lib/version.js +1 -1
  34. package/es/types/connector.d.ts +2 -2
  35. package/es/widgets/clear-refinements/clear-refinements.js +2 -2
  36. package/package.json +4 -3
@@ -1,11 +1,11 @@
1
1
  /** @jsx h */
2
2
  import { h } from 'preact';
3
3
  import type { AnswersCSSClasses, AnswersTemplates } from '../../widgets/answers/answers';
4
- import type { ComponentCSSClasses, Hits } from '../../types';
4
+ import type { ComponentCSSClasses, Hit } from '../../types';
5
5
  export declare type AnswersComponentCSSClasses = ComponentCSSClasses<AnswersCSSClasses>;
6
6
  export declare type AnswersComponentTemplates = Required<AnswersTemplates>;
7
7
  export declare type AnswersProps = {
8
- hits: Hits;
8
+ hits: Hit[];
9
9
  isLoading: boolean;
10
10
  cssClasses: AnswersComponentCSSClasses;
11
11
  templateProps: {
@@ -2,14 +2,14 @@
2
2
  import { h } from 'preact';
3
3
  import type { SearchResults } from 'algoliasearch-helper';
4
4
  import type { BindEventForHits, SendEventForHits } from '../../lib/utils';
5
- import type { ComponentCSSClasses, Hits as HitsArray } from '../../types';
5
+ import type { ComponentCSSClasses, Hit } from '../../types';
6
6
  import type { HitsCSSClasses, HitsTemplates } from '../../widgets/hits/hits';
7
7
  import type { PreparedTemplateProps } from '../../lib/utils/prepareTemplateProps';
8
8
  export declare type HitsComponentCSSClasses = ComponentCSSClasses<HitsCSSClasses>;
9
9
  export declare type HitsComponentTemplates = Required<HitsTemplates>;
10
10
  export declare type HitsProps = {
11
11
  results: SearchResults;
12
- hits: HitsArray;
12
+ hits: Hit[];
13
13
  sendEvent?: SendEventForHits;
14
14
  bindEvent?: BindEventForHits;
15
15
  cssClasses: HitsComponentCSSClasses;
@@ -1,14 +1,14 @@
1
1
  /** @jsx h */
2
2
  import { h } from 'preact';
3
3
  import type { SearchResults } from 'algoliasearch-helper';
4
- import type { ComponentCSSClasses, Hits } from '../../types';
4
+ import type { ComponentCSSClasses, Hit } from '../../types';
5
5
  import type { InfiniteHitsCSSClasses, InfiniteHitsTemplates } from '../../widgets/infinite-hits/infinite-hits';
6
6
  import type { SendEventForHits, BindEventForHits } from '../../lib/utils';
7
7
  export declare type InfiniteHitsComponentCSSClasses = ComponentCSSClasses<InfiniteHitsCSSClasses>;
8
8
  export declare type InfiniteHitsComponentTemplates = Required<InfiniteHitsTemplates>;
9
9
  export declare type InfiniteHitsProps = {
10
10
  cssClasses: InfiniteHitsComponentCSSClasses;
11
- hits: Hits;
11
+ hits: Hit[];
12
12
  results: SearchResults;
13
13
  hasShowPrevious: boolean;
14
14
  showPrevious: () => void;
@@ -1,9 +1,9 @@
1
- import type { Connector, Hits, FindAnswersOptions, WidgetRenderState } from '../../types';
1
+ import type { Connector, Hit, FindAnswersOptions, WidgetRenderState } from '../../types';
2
2
  export declare type AnswersRenderState = {
3
3
  /**
4
4
  * The matched hits from Algolia API.
5
5
  */
6
- hits: Hits;
6
+ hits: Hit[];
7
7
  /**
8
8
  * Whether it's still loading the results from the Answers API.
9
9
  */
@@ -1,6 +1,6 @@
1
1
  import type { SearchResults } from 'algoliasearch-helper';
2
2
  import type { SendEventForHits } from '../../lib/utils';
3
- import type { Hits, Connector, WidgetRenderState } from '../../types';
3
+ import type { Hit, Connector, WidgetRenderState } from '../../types';
4
4
  export declare type AutocompleteConnectorParams = {
5
5
  /**
6
6
  * Escapes HTML entities from hits string values.
@@ -25,7 +25,7 @@ export declare type AutocompleteRenderState = {
25
25
  /**
26
26
  * The resolved hits from the index matching the query.
27
27
  */
28
- hits: Hits;
28
+ hits: Hit[];
29
29
  /**
30
30
  * The full results object from the Algolia API.
31
31
  */
@@ -50,8 +50,13 @@ export declare type HitsPerPageRenderState = {
50
50
  refine: (value: number) => void;
51
51
  /**
52
52
  * Indicates whether or not the search has results.
53
+ * @deprecated Use `canRefine` instead.
53
54
  */
54
55
  hasNoResults: boolean;
56
+ /**
57
+ * Indicates if search state can be refined.
58
+ */
59
+ canRefine: boolean;
55
60
  };
56
61
  export declare type HitsPerPageWidgetDescription = {
57
62
  $$type: 'ais.hitsPerPage';
@@ -119,6 +119,7 @@ var connectHitsPerPage = function connectHitsPerPage(renderFn) {
119
119
  results = _ref5.results,
120
120
  createURL = _ref5.createURL,
121
121
  helper = _ref5.helper;
122
+ var canRefine = results ? results.nbHits > 0 : false;
122
123
  return {
123
124
  items: transformItems(normalizeItems(state), {
124
125
  results: results
@@ -128,7 +129,8 @@ var connectHitsPerPage = function connectHitsPerPage(renderFn) {
128
129
  state: state,
129
130
  createURL: createURL
130
131
  }),
131
- hasNoResults: results ? results.nbHits === 0 : true,
132
+ hasNoResults: !canRefine,
133
+ canRefine: canRefine,
132
134
  widgetParams: widgetParams
133
135
  };
134
136
  },
@@ -56,8 +56,16 @@ export declare type NumericMenuRenderState = {
56
56
  createURL: CreateURL<NumericMenuRenderStateItem['value']>;
57
57
  /**
58
58
  * `true` if the last search contains no result
59
+ * @deprecated Use `canRefine` instead.
59
60
  */
60
61
  hasNoResults: boolean;
62
+ /**
63
+ * Indicates if search state can be refined.
64
+ *
65
+ * This is `true` if the last search contains no result and
66
+ * "All" range is selected
67
+ */
68
+ canRefine: boolean;
61
69
  /**
62
70
  * Sets the selected value and trigger a new search
63
71
  */
@@ -1,3 +1,5 @@
1
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
2
+
1
3
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
4
 
3
5
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -16,7 +18,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
16
18
 
17
19
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
18
20
 
19
- import { checkRendering, createDocumentationMessageGenerator, isFiniteNumber, convertNumericRefinementsToFilters, noop } from "../../lib/utils/index.js";
21
+ import { checkRendering, createDocumentationMessageGenerator, isFiniteNumber, noop } from "../../lib/utils/index.js";
20
22
  var withUsage = createDocumentationMessageGenerator({
21
23
  name: 'numeric-menu',
22
24
  connector: true
@@ -24,46 +26,11 @@ var withUsage = createDocumentationMessageGenerator({
24
26
  var $$type = 'ais.numericMenu';
25
27
 
26
28
  var createSendEvent = function createSendEvent(_ref) {
27
- var instantSearchInstance = _ref.instantSearchInstance,
28
- helper = _ref.helper,
29
- attribute = _ref.attribute;
29
+ var instantSearchInstance = _ref.instantSearchInstance;
30
30
  return function () {
31
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
32
- args[_key] = arguments[_key];
33
- }
34
-
35
- if (args.length === 1) {
36
- instantSearchInstance.sendEventToInsights(args[0]);
37
- return;
38
- }
39
-
40
- var eventType = args[0],
41
- facetValue = args[1],
42
- _args$ = args[2],
43
- eventName = _args$ === void 0 ? 'Filter Applied' : _args$;
44
-
45
- if (eventType !== 'click') {
31
+ if (arguments.length === 1) {
32
+ instantSearchInstance.sendEventToInsights(arguments.length <= 0 ? undefined : arguments[0]);
46
33
  return;
47
- } // facetValue === "%7B%22start%22:5,%22end%22:10%7D"
48
-
49
-
50
- var filters = convertNumericRefinementsToFilters(getRefinedState(helper.state, attribute, facetValue), attribute);
51
-
52
- if (filters && filters.length > 0) {
53
- /*
54
- filters === ["price<=10", "price>=5"]
55
- */
56
- instantSearchInstance.sendEventToInsights({
57
- insightsMethod: 'clickedFilters',
58
- widgetType: $$type,
59
- eventType: eventType,
60
- payload: {
61
- eventName: eventName,
62
- index: helper.getIndex(),
63
- filters: filters
64
- },
65
- attribute: attribute
66
- });
67
34
  }
68
35
  };
69
36
  };
@@ -208,18 +175,39 @@ var connectNumericMenu = function connectNumericMenu(renderFn) {
208
175
 
209
176
  if (!connectorState.sendEvent) {
210
177
  connectorState.sendEvent = createSendEvent({
211
- instantSearchInstance: instantSearchInstance,
212
- helper: helper,
213
- attribute: attribute
178
+ instantSearchInstance: instantSearchInstance
214
179
  });
215
180
  }
216
181
 
182
+ var hasNoResults = results ? results.nbHits === 0 : true;
183
+ var preparedItems = prepareItems(state);
184
+ var allIsSelected = true;
185
+
186
+ var _iterator = _createForOfIteratorHelper(preparedItems),
187
+ _step;
188
+
189
+ try {
190
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
191
+ var item = _step.value;
192
+
193
+ if (item.isRefined && decodeURI(item.value) !== '{}') {
194
+ allIsSelected = false;
195
+ break;
196
+ }
197
+ }
198
+ } catch (err) {
199
+ _iterator.e(err);
200
+ } finally {
201
+ _iterator.f();
202
+ }
203
+
217
204
  return {
218
205
  createURL: connectorState.createURL(state),
219
- items: transformItems(prepareItems(state), {
206
+ items: transformItems(preparedItems, {
220
207
  results: results
221
208
  }),
222
- hasNoResults: results ? results.nbHits === 0 : true,
209
+ hasNoResults: hasNoResults,
210
+ canRefine: !(hasNoResults && allIsSelected),
223
211
  refine: connectorState.refine,
224
212
  sendEvent: connectorState.sendEvent,
225
213
  widgetParams: widgetParams
@@ -16,7 +16,7 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
16
16
 
17
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
18
 
19
- import { checkRendering, createDocumentationMessageGenerator, convertNumericRefinementsToFilters, isFiniteNumber, find, noop } from "../../lib/utils/index.js";
19
+ import { checkRendering, createDocumentationMessageGenerator, isFiniteNumber, find, noop } from "../../lib/utils/index.js";
20
20
  var withUsage = createDocumentationMessageGenerator({
21
21
  name: 'range-input',
22
22
  connector: true
@@ -148,50 +148,12 @@ var connectRange = function connectRange(renderFn) {
148
148
  return null;
149
149
  };
150
150
 
151
- var sendEventWithRefinedState = function sendEventWithRefinedState(refinedState, instantSearchInstance, helper) {
152
- var eventName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'Filter Applied';
153
- var filters = convertNumericRefinementsToFilters(refinedState, attribute);
154
-
155
- if (filters && filters.length > 0) {
156
- instantSearchInstance.sendEventToInsights({
157
- insightsMethod: 'clickedFilters',
158
- widgetType: $$type,
159
- eventType: 'click',
160
- payload: {
161
- eventName: eventName,
162
- index: helper.getIndex(),
163
- filters: filters
164
- },
165
- attribute: attribute
166
- });
167
- }
168
- };
169
-
170
- var createSendEvent = function createSendEvent(instantSearchInstance, helper, currentRange) {
151
+ var createSendEvent = function createSendEvent(instantSearchInstance) {
171
152
  return function () {
172
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
173
- args[_key] = arguments[_key];
174
- }
175
-
176
- if (args.length === 1) {
177
- instantSearchInstance.sendEventToInsights(args[0]);
153
+ if (arguments.length === 1) {
154
+ instantSearchInstance.sendEventToInsights(arguments.length <= 0 ? undefined : arguments[0]);
178
155
  return;
179
156
  }
180
-
181
- var eventType = args[0],
182
- facetValue = args[1],
183
- eventName = args[2];
184
-
185
- if (eventType !== 'click') {
186
- return;
187
- }
188
-
189
- var _facetValue = _slicedToArray(facetValue, 2),
190
- nextMin = _facetValue[0],
191
- nextMax = _facetValue[1];
192
-
193
- var refinedState = getRefinedState(helper, currentRange, nextMin, nextMax);
194
- sendEventWithRefinedState(refinedState, instantSearchInstance, helper, eventName);
195
157
  };
196
158
  };
197
159
 
@@ -237,7 +199,7 @@ var connectRange = function connectRange(renderFn) {
237
199
  return [min, max];
238
200
  }
239
201
 
240
- function _refine(instantSearchInstance, helper, currentRange) {
202
+ function _refine(helper, currentRange) {
241
203
  return function () {
242
204
  var _ref11 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [undefined, undefined],
243
205
  _ref12 = _slicedToArray(_ref11, 2),
@@ -247,7 +209,6 @@ var connectRange = function connectRange(renderFn) {
247
209
  var refinedState = getRefinedState(helper, currentRange, nextMin, nextMax);
248
210
 
249
211
  if (refinedState) {
250
- sendEventWithRefinedState(refinedState, instantSearchInstance, helper);
251
212
  helper.setState(refinedState).search();
252
213
  }
253
214
  };
@@ -293,12 +254,12 @@ var connectRange = function connectRange(renderFn) {
293
254
  // On first render pass an empty range
294
255
  // to be able to bypass the validation
295
256
  // related to it
296
- refine = _refine(instantSearchInstance, helper, {
257
+ refine = _refine(helper, {
297
258
  min: undefined,
298
259
  max: undefined
299
260
  });
300
261
  } else {
301
- refine = _refine(instantSearchInstance, helper, currentRange);
262
+ refine = _refine(helper, currentRange);
302
263
  }
303
264
 
304
265
  return {
@@ -306,7 +267,7 @@ var connectRange = function connectRange(renderFn) {
306
267
  canRefine: currentRange.min !== currentRange.max,
307
268
  format: rangeFormatter,
308
269
  range: currentRange,
309
- sendEvent: createSendEvent(instantSearchInstance, helper, currentRange),
270
+ sendEvent: createSendEvent(instantSearchInstance),
310
271
  widgetParams: _objectSpread(_objectSpread({}, widgetParams), {}, {
311
272
  precision: precision
312
273
  }),
@@ -56,6 +56,8 @@ export declare type RatingMenuRenderState = {
56
56
  refine: (value: string) => void;
57
57
  /**
58
58
  * `true` if the last search contains no result.
59
+ *
60
+ * @deprecated Use `canRefine` instead.
59
61
  */
60
62
  hasNoResults: boolean;
61
63
  /**
@@ -210,8 +210,11 @@ var connectRatingMenu = function connectRatingMenu(renderFn) {
210
210
  });
211
211
  }
212
212
 
213
- if (results) {
214
- var facetResults = results.getFacetValues(attribute, {});
213
+ var refinementIsApplied = false;
214
+ var totalCount = 0;
215
+ var facetResults = results === null || results === void 0 ? void 0 : results.getFacetValues(attribute, {});
216
+
217
+ if (results && facetResults) {
215
218
  var maxValuesPerFacet = facetResults.length;
216
219
  var maxDecimalPlaces = getFacetsMaxDecimalPlaces(facetResults);
217
220
  var maxFacets = Math.pow(10, maxDecimalPlaces) * max;
@@ -225,6 +228,7 @@ var connectRatingMenu = function connectRatingMenu(renderFn) {
225
228
 
226
229
  var _loop = function _loop(star) {
227
230
  var isRefined = refinedStar === star;
231
+ refinementIsApplied = refinementIsApplied || isRefined;
228
232
  var count = facetResults.filter(function (f) {
229
233
  return Number(f.name) >= star && Number(f.name) <= max;
230
234
  }).map(function (f) {
@@ -232,6 +236,7 @@ var connectRatingMenu = function connectRatingMenu(renderFn) {
232
236
  }).reduce(function (sum, current) {
233
237
  return sum + current;
234
238
  }, 0);
239
+ totalCount += count;
235
240
 
236
241
  if (refinedStar && !isRefined && count === 0) {
237
242
  // skip count==0 when at least 1 refinement is enabled
@@ -261,10 +266,11 @@ var connectRatingMenu = function connectRatingMenu(renderFn) {
261
266
  }
262
267
 
263
268
  facetValues = facetValues.reverse();
269
+ var hasNoResults = results ? results.nbHits === 0 : true;
264
270
  return {
265
271
  items: facetValues,
266
- hasNoResults: results ? results.nbHits === 0 : true,
267
- canRefine: facetValues.length > 0,
272
+ hasNoResults: hasNoResults,
273
+ canRefine: (!hasNoResults || refinementIsApplied) && totalCount > 0,
268
274
  refine: connectorState.toggleRefinementFactory(helper),
269
275
  sendEvent: sendEvent,
270
276
  createURL: connectorState.createURLFactory({
@@ -43,8 +43,13 @@ export declare type SortByRenderState = {
43
43
  refine: (value: string) => void;
44
44
  /**
45
45
  * `true` if the last search contains no result.
46
+ * @deprecated Use `canRefine` instead.
46
47
  */
47
48
  hasNoResults: boolean;
49
+ /**
50
+ * `true` if we can refine.
51
+ */
52
+ canRefine: boolean;
48
53
  };
49
54
  export declare type SortByWidgetDescription = {
50
55
  $$type: 'ais.sortBy';
@@ -77,13 +77,15 @@ var connectSortBy = function connectSortBy(renderFn) {
77
77
  };
78
78
  }
79
79
 
80
+ var hasNoResults = results ? results.nbHits === 0 : true;
80
81
  return {
81
82
  currentRefinement: state.index,
82
83
  options: transformItems(items, {
83
84
  results: results
84
85
  }),
85
86
  refine: connectorState.setIndex,
86
- hasNoResults: results ? results.nbHits === 0 : true,
87
+ hasNoResults: hasNoResults,
88
+ canRefine: !hasNoResults && items.length > 0,
87
89
  widgetParams: widgetParams
88
90
  };
89
91
  },
@@ -1,9 +1,9 @@
1
1
  import type { SearchResults } from 'algoliasearch-helper';
2
- import type { Hits, InsightsClientMethod, InsightsClientPayload, Connector } from '../../types';
2
+ import type { Hit, InsightsClientMethod, InsightsClientPayload, Connector } from '../../types';
3
3
  export declare const inferPayload: ({ method, results, hits, objectIDs, }: {
4
4
  method: InsightsClientMethod;
5
5
  results: SearchResults;
6
- hits: Hits;
6
+ hits: Hit[];
7
7
  objectIDs: string[];
8
8
  }) => Omit<InsightsClientPayload, 'eventName'>;
9
9
  /**
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * @jest-environment jsdom
3
3
  */
4
- import type { InstantSearch, Hit, Hits } from '../../types';
5
- declare type BuiltInSendEventForHits = (eventType: string, hits: Hit | Hits, eventName?: string) => void;
4
+ import type { InstantSearch, Hit } from '../../types';
5
+ declare type BuiltInSendEventForHits = (eventType: string, hits: Hit | Hit[], eventName?: string) => void;
6
6
  declare type CustomSendEventForHits = (customPayload: any) => void;
7
7
  export declare type SendEventForHits = BuiltInSendEventForHits & CustomSendEventForHits;
8
- declare type BuiltInBindEventForHits = (eventType: string, hits: Hit | Hits, eventName?: string) => string;
8
+ declare type BuiltInBindEventForHits = (eventType: string, hits: Hit | Hit[], eventName?: string) => string;
9
9
  declare type CustomBindEventForHits = (customPayload: any) => string;
10
10
  export declare type BindEventForHits = BuiltInBindEventForHits & CustomBindEventForHits;
11
11
  export declare function createSendEventForHits({ instantSearchInstance, index, widgetType, }: {
@@ -1,2 +1,2 @@
1
- declare const _default: "4.44.0";
1
+ declare const _default: "4.45.1";
2
2
  export default _default;
package/es/lib/version.js CHANGED
@@ -1 +1 @@
1
- export default '4.44.0';
1
+ export default '4.45.1';
@@ -1,7 +1,7 @@
1
1
  import type { SearchResults } from 'algoliasearch-helper';
2
2
  import type { InstantSearch } from './instantsearch';
3
3
  import type { InsightsClient } from './insights';
4
- import type { Hits } from './results';
4
+ import type { Hit } from './results';
5
5
  import type { UnknownWidgetParams, Widget, WidgetDescription } from './widget';
6
6
  /**
7
7
  * The base renderer options. All render functions receive
@@ -25,7 +25,7 @@ export declare type RendererOptions<TWidgetParams> = {
25
25
  * The mutable list of hits. The may change depending
26
26
  * of the given transform items function.
27
27
  */
28
- hits?: Hits;
28
+ hits?: Hit[];
29
29
  /**
30
30
  * The current insights client, if any.
31
31
  */
@@ -24,7 +24,7 @@ var renderer = function renderer(_ref) {
24
24
  templates = _ref.templates;
25
25
  return function (_ref2, isFirstRendering) {
26
26
  var refine = _ref2.refine,
27
- hasRefinements = _ref2.hasRefinements,
27
+ canRefine = _ref2.canRefine,
28
28
  instantSearchInstance = _ref2.instantSearchInstance;
29
29
 
30
30
  if (isFirstRendering) {
@@ -39,7 +39,7 @@ var renderer = function renderer(_ref) {
39
39
  render(h(ClearRefinements, {
40
40
  refine: refine,
41
41
  cssClasses: cssClasses,
42
- hasRefinements: hasRefinements,
42
+ hasRefinements: canRefine,
43
43
  templateProps: renderState.templateProps
44
44
  }), containerNode);
45
45
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instantsearch.js",
3
- "version": "4.44.0",
3
+ "version": "4.45.1",
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",
@@ -123,6 +123,7 @@
123
123
  "eslint-plugin-prettier": "3.4.0",
124
124
  "eslint-plugin-react": "7.18.0",
125
125
  "eslint-plugin-react-hooks": "2.3.0",
126
+ "eslint-plugin-deprecation": "1.3.2",
126
127
  "instantsearch-e2e-tests": "algolia/instantsearch-e2e-tests#2.0.2",
127
128
  "jest": "27.1.0",
128
129
  "jest-diff": "27.1.0",
@@ -157,11 +158,11 @@
157
158
  "bundlesize": [
158
159
  {
159
160
  "path": "./dist/instantsearch.production.min.js",
160
- "maxSize": "70.25 kB"
161
+ "maxSize": "70.50 kB"
161
162
  },
162
163
  {
163
164
  "path": "./dist/instantsearch.development.js",
164
- "maxSize": "155.00 kB"
165
+ "maxSize": "152.00 kB"
165
166
  }
166
167
  ]
167
168
  }