instantsearch.js 4.40.2 → 4.40.3

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.
@@ -149,7 +149,7 @@ function prepareItems(data) {
149
149
  if (currentItem.isRefined) {
150
150
  result.push({
151
151
  label: currentItem.name,
152
- value: currentItem.path
152
+ value: currentItem.escapedValue
153
153
  });
154
154
 
155
155
  if (Array.isArray(currentItem.data)) {
@@ -106,13 +106,14 @@ var connectHierarchicalMenu = function connectHierarchicalMenu(renderFn) {
106
106
  function _prepareFacetValues(facetValues) {
107
107
  return facetValues.slice(0, getLimit()).map(function (_ref2) {
108
108
  var label = _ref2.name,
109
- value = _ref2.path,
109
+ value = _ref2.escapedValue,
110
110
  data = _ref2.data,
111
- subValue = _objectWithoutProperties(_ref2, ["name", "path", "data"]);
111
+ path = _ref2.path,
112
+ subValue = _objectWithoutProperties(_ref2, ["name", "escapedValue", "data", "path"]);
112
113
 
113
114
  var item = _objectSpread(_objectSpread({}, subValue), {}, {
114
- label: label,
115
115
  value: value,
116
+ label: label,
116
117
  data: null
117
118
  });
118
119
 
@@ -161,8 +161,9 @@ var connectMenu = function connectMenu(renderFn) {
161
161
  canToggleShowMore = showMore && (isShowingMore || facetItems.length > getLimit());
162
162
  items = transformItems(facetItems.slice(0, getLimit()).map(function (_ref3) {
163
163
  var label = _ref3.name,
164
- value = _ref3.path,
165
- item = _objectWithoutProperties(_ref3, ["name", "path"]);
164
+ value = _ref3.escapedValue,
165
+ path = _ref3.path,
166
+ item = _objectWithoutProperties(_ref3, ["name", "escapedValue", "path"]);
166
167
 
167
168
  return _objectSpread(_objectSpread({}, item), {}, {
168
169
  label: label,
@@ -64,11 +64,12 @@ var connectRefinementList = function connectRefinementList(renderFn) {
64
64
 
65
65
  var formatItems = function formatItems(_ref2) {
66
66
  var label = _ref2.name,
67
- item = _objectWithoutProperties(_ref2, ["name"]);
67
+ value = _ref2.escapedValue,
68
+ item = _objectWithoutProperties(_ref2, ["name", "escapedValue"]);
68
69
 
69
70
  return _objectSpread(_objectSpread({}, item), {}, {
71
+ value: value,
70
72
  label: label,
71
- value: label,
72
73
  highlighted: label
73
74
  });
74
75
  };
@@ -126,11 +127,12 @@ var connectRefinementList = function connectRefinementList(renderFn) {
126
127
  Math.min(getLimit(), 100), tags).then(function (results) {
127
128
  var facetValues = escapeFacetValues ? escapeFacets(results.facetHits) : results.facetHits;
128
129
  var normalizedFacetValues = transformItems(facetValues.map(function (_ref3) {
129
- var value = _ref3.value,
130
- item = _objectWithoutProperties(_ref3, ["value"]);
130
+ var escapedValue = _ref3.escapedValue,
131
+ value = _ref3.value,
132
+ item = _objectWithoutProperties(_ref3, ["escapedValue", "value"]);
131
133
 
132
134
  return _objectSpread(_objectSpread({}, item), {}, {
133
- value: value,
135
+ value: escapedValue,
134
136
  label: value
135
137
  });
136
138
  }), {
@@ -1,2 +1,2 @@
1
- declare const _default: "4.40.2";
1
+ declare const _default: "4.40.3";
2
2
  export default _default;
package/es/lib/version.js CHANGED
@@ -1 +1 @@
1
- export default '4.40.2';
1
+ export default '4.40.3';
@@ -1,4 +1,4 @@
1
- import type { PlainSearchParameters, SearchResults } from 'algoliasearch-helper';
1
+ import type { PlainSearchParameters, SearchForFacetValues, SearchResults } from 'algoliasearch-helper';
2
2
  export declare type HitAttributeHighlightResult = {
3
3
  value: string;
4
4
  matchLevel: 'none' | 'partial' | 'full';
@@ -52,12 +52,7 @@ export declare type Hits = Hit[];
52
52
  export declare type EscapedHits<THit = Hit> = THit[] & {
53
53
  __escaped: boolean;
54
54
  };
55
- export declare type FacetHit = {
56
- value: string;
57
- highlighted: string;
58
- count: number;
59
- isRefined: boolean;
60
- };
55
+ export declare type FacetHit = SearchForFacetValues.Hit;
61
56
  export declare type FacetRefinement = {
62
57
  value: string;
63
58
  type: 'conjunctive' | 'disjunctive' | 'exclude';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instantsearch.js",
3
- "version": "4.40.2",
3
+ "version": "4.40.3",
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",
@@ -56,7 +56,7 @@
56
56
  "@types/google.maps": "^3.45.3",
57
57
  "@types/hogan.js": "^3.0.0",
58
58
  "@types/qs": "^6.5.3",
59
- "algoliasearch-helper": "^3.7.4",
59
+ "algoliasearch-helper": "^3.8.0",
60
60
  "classnames": "^2.2.5",
61
61
  "@algolia/events": "^4.0.1",
62
62
  "hogan.js": "^3.0.2",