instantsearch.js 4.43.0 → 4.44.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.
- package/CHANGELOG.md +29 -0
- package/cjs/components/Highlight/Highlight.js +33 -0
- package/cjs/components/InternalHighlight/InternalHighlight.js +16 -0
- package/cjs/components/ReverseHighlight/ReverseHighlight.js +33 -0
- package/cjs/components/ReverseSnippet/ReverseSnippet.js +33 -0
- package/cjs/components/Snippet/Snippet.js +33 -0
- package/cjs/connectors/numeric-menu/connectNumericMenu.js +4 -41
- package/cjs/connectors/range/connectRange.js +7 -46
- package/cjs/connectors/rating-menu/connectRatingMenu.js +1 -1
- package/cjs/helpers/components/Highlight.js +45 -0
- package/cjs/helpers/components/ReverseHighlight.js +58 -0
- package/cjs/helpers/components/ReverseSnippet.js +58 -0
- package/cjs/helpers/components/Snippet.js +45 -0
- package/cjs/helpers/components/index.js +57 -0
- package/cjs/lib/InstantSearch.js +11 -1
- package/cjs/lib/version.js +1 -1
- package/dist/instantsearch.development.d.ts +10 -10
- package/dist/instantsearch.development.js +25 -116
- package/dist/instantsearch.development.js.map +1 -1
- package/dist/instantsearch.production.d.ts +10 -10
- package/dist/instantsearch.production.min.d.ts +10 -10
- package/dist/instantsearch.production.min.js +2 -2
- package/dist/instantsearch.production.min.js.map +1 -1
- package/es/components/Highlight/Highlight.d.ts +7 -0
- package/es/components/Highlight/Highlight.js +24 -0
- package/es/components/InternalHighlight/InternalHighlight.d.ts +2 -0
- package/es/components/InternalHighlight/InternalHighlight.js +6 -0
- package/es/components/ReverseHighlight/ReverseHighlight.d.ts +7 -0
- package/es/components/ReverseHighlight/ReverseHighlight.js +24 -0
- package/es/components/ReverseSnippet/ReverseSnippet.d.ts +7 -0
- package/es/components/ReverseSnippet/ReverseSnippet.js +24 -0
- package/es/components/Snippet/Snippet.d.ts +7 -0
- package/es/components/Snippet/Snippet.js +24 -0
- package/es/connectors/geo-search/connectGeoSearch.d.ts +10 -10
- package/es/connectors/numeric-menu/connectNumericMenu.js +5 -42
- package/es/connectors/range/connectRange.js +8 -47
- package/es/connectors/rating-menu/connectRatingMenu.js +1 -1
- package/es/helpers/components/Highlight.d.ts +10 -0
- package/es/helpers/components/Highlight.js +31 -0
- package/es/helpers/components/ReverseHighlight.d.ts +10 -0
- package/es/helpers/components/ReverseHighlight.js +44 -0
- package/es/helpers/components/ReverseSnippet.d.ts +10 -0
- package/es/helpers/components/ReverseSnippet.js +44 -0
- package/es/helpers/components/Snippet.d.ts +10 -0
- package/es/helpers/components/Snippet.js +31 -0
- package/es/helpers/components/index.d.ts +4 -0
- package/es/helpers/components/index.js +4 -0
- package/es/lib/InstantSearch.js +11 -1
- package/es/lib/version.d.ts +1 -1
- package/es/lib/version.js +1 -1
- package/es/types/results.d.ts +1 -1
- package/es/types/utils.d.ts +4 -0
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
## [4.44.1](https://github.com/algolia/instantsearch.js/compare/v4.44.0...v4.44.1) (2022-08-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **connectNumericMenu + connectRange:** stop sending invalid clickedFilters event ([#5085](https://github.com/algolia/instantsearch.js/issues/5085)) ([20996c7](https://github.com/algolia/instantsearch.js/commit/20996c7a159988c58e00ff24d2d2dc98af8b980f))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# [4.44.0](https://github.com/algolia/instantsearch.js/compare/v4.43.1...v4.44.0) (2022-08-08)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **geo-search:** make `GeoHit` type generic ([#5083](https://github.com/algolia/instantsearch.js/issues/5083)) ([3d3c7b2](https://github.com/algolia/instantsearch.js/commit/3d3c7b298b74effe9bb722a04fbb47dc39a4bd95))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## [4.43.1](https://github.com/algolia/instantsearch.js/compare/v4.43.0...v4.43.1) (2022-07-11)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* **errors:** rethrow error as error if it's an object ([#5075](https://github.com/algolia/instantsearch.js/issues/5075)) ([34132bb](https://github.com/algolia/instantsearch.js/commit/34132bba38c05fa2f5e4e54c6889e9335e62e4f4))
|
|
25
|
+
* **ratingMenu:** don't warn if results are artificial ([#5073](https://github.com/algolia/instantsearch.js/issues/5073)) ([d747d23](https://github.com/algolia/instantsearch.js/commit/d747d23b28c380fe82a40eeab06c57359af8004a))
|
|
26
|
+
* **types:** use correct case for _geoloc property ([#5074](https://github.com/algolia/instantsearch.js/issues/5074)) ([6fed7d8](https://github.com/algolia/instantsearch.js/commit/6fed7d870c3607980776d33a3697f8e2789aa08b))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
1
30
|
# [4.43.0](https://github.com/algolia/instantsearch.js/compare/v4.42.0...v4.43.0) (2022-06-28)
|
|
2
31
|
|
|
3
32
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Highlight = Highlight;
|
|
7
|
+
|
|
8
|
+
var _uiComponentsShared = require("@algolia/ui-components-shared");
|
|
9
|
+
|
|
10
|
+
var _preact = require("preact");
|
|
11
|
+
|
|
12
|
+
var _InternalHighlight = require("../InternalHighlight/InternalHighlight.js");
|
|
13
|
+
|
|
14
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
|
+
|
|
16
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
17
|
+
|
|
18
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
19
|
+
|
|
20
|
+
function Highlight(_ref) {
|
|
21
|
+
var _ref$classNames = _ref.classNames,
|
|
22
|
+
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
23
|
+
props = _objectWithoutProperties(_ref, ["classNames"]);
|
|
24
|
+
|
|
25
|
+
return (0, _preact.h)(_InternalHighlight.InternalHighlight, _extends({
|
|
26
|
+
classNames: {
|
|
27
|
+
root: (0, _uiComponentsShared.cx)('ais-Highlight', classNames.root),
|
|
28
|
+
highlighted: (0, _uiComponentsShared.cx)('ais-Highlight-highlighted', classNames.highlighted),
|
|
29
|
+
nonHighlighted: (0, _uiComponentsShared.cx)('ais-Highlight-nonHighlighted', classNames.nonHighlighted),
|
|
30
|
+
separator: (0, _uiComponentsShared.cx)('ais-Highlight-separator', classNames.separator)
|
|
31
|
+
}
|
|
32
|
+
}, props));
|
|
33
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.InternalHighlight = void 0;
|
|
7
|
+
|
|
8
|
+
var _uiComponentsHighlightVdom = require("@algolia/ui-components-highlight-vdom");
|
|
9
|
+
|
|
10
|
+
var _preact = require("preact");
|
|
11
|
+
|
|
12
|
+
var InternalHighlight = (0, _uiComponentsHighlightVdom.createHighlightComponent)({
|
|
13
|
+
createElement: _preact.createElement,
|
|
14
|
+
Fragment: _preact.Fragment
|
|
15
|
+
});
|
|
16
|
+
exports.InternalHighlight = InternalHighlight;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ReverseHighlight = ReverseHighlight;
|
|
7
|
+
|
|
8
|
+
var _uiComponentsShared = require("@algolia/ui-components-shared");
|
|
9
|
+
|
|
10
|
+
var _preact = require("preact");
|
|
11
|
+
|
|
12
|
+
var _InternalHighlight = require("../InternalHighlight/InternalHighlight.js");
|
|
13
|
+
|
|
14
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
|
+
|
|
16
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
17
|
+
|
|
18
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
19
|
+
|
|
20
|
+
function ReverseHighlight(_ref) {
|
|
21
|
+
var _ref$classNames = _ref.classNames,
|
|
22
|
+
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
23
|
+
props = _objectWithoutProperties(_ref, ["classNames"]);
|
|
24
|
+
|
|
25
|
+
return (0, _preact.h)(_InternalHighlight.InternalHighlight, _extends({
|
|
26
|
+
classNames: {
|
|
27
|
+
root: (0, _uiComponentsShared.cx)('ais-ReverseHighlight', classNames.root),
|
|
28
|
+
highlighted: (0, _uiComponentsShared.cx)('ais-ReverseHighlight-highlighted', classNames.highlighted),
|
|
29
|
+
nonHighlighted: (0, _uiComponentsShared.cx)('ais-ReverseHighlight-nonHighlighted', classNames.nonHighlighted),
|
|
30
|
+
separator: (0, _uiComponentsShared.cx)('ais-ReverseHighlight-separator', classNames.separator)
|
|
31
|
+
}
|
|
32
|
+
}, props));
|
|
33
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ReverseSnippet = ReverseSnippet;
|
|
7
|
+
|
|
8
|
+
var _uiComponentsShared = require("@algolia/ui-components-shared");
|
|
9
|
+
|
|
10
|
+
var _preact = require("preact");
|
|
11
|
+
|
|
12
|
+
var _InternalHighlight = require("../InternalHighlight/InternalHighlight.js");
|
|
13
|
+
|
|
14
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
|
+
|
|
16
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
17
|
+
|
|
18
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
19
|
+
|
|
20
|
+
function ReverseSnippet(_ref) {
|
|
21
|
+
var _ref$classNames = _ref.classNames,
|
|
22
|
+
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
23
|
+
props = _objectWithoutProperties(_ref, ["classNames"]);
|
|
24
|
+
|
|
25
|
+
return (0, _preact.h)(_InternalHighlight.InternalHighlight, _extends({
|
|
26
|
+
classNames: {
|
|
27
|
+
root: (0, _uiComponentsShared.cx)('ais-ReverseSnippet', classNames.root),
|
|
28
|
+
highlighted: (0, _uiComponentsShared.cx)('ais-ReverseSnippet-highlighted', classNames.highlighted),
|
|
29
|
+
nonHighlighted: (0, _uiComponentsShared.cx)('ais-ReverseSnippet-nonHighlighted', classNames.nonHighlighted),
|
|
30
|
+
separator: (0, _uiComponentsShared.cx)('ais-ReverseSnippet-separator', classNames.separator)
|
|
31
|
+
}
|
|
32
|
+
}, props));
|
|
33
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Snippet = Snippet;
|
|
7
|
+
|
|
8
|
+
var _uiComponentsShared = require("@algolia/ui-components-shared");
|
|
9
|
+
|
|
10
|
+
var _preact = require("preact");
|
|
11
|
+
|
|
12
|
+
var _InternalHighlight = require("../InternalHighlight/InternalHighlight.js");
|
|
13
|
+
|
|
14
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
|
+
|
|
16
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
17
|
+
|
|
18
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
19
|
+
|
|
20
|
+
function Snippet(_ref) {
|
|
21
|
+
var _ref$classNames = _ref.classNames,
|
|
22
|
+
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
23
|
+
props = _objectWithoutProperties(_ref, ["classNames"]);
|
|
24
|
+
|
|
25
|
+
return (0, _preact.h)(_InternalHighlight.InternalHighlight, _extends({
|
|
26
|
+
classNames: {
|
|
27
|
+
root: (0, _uiComponentsShared.cx)('ais-Snippet', classNames.root),
|
|
28
|
+
highlighted: (0, _uiComponentsShared.cx)('ais-Snippet-highlighted', classNames.highlighted),
|
|
29
|
+
nonHighlighted: (0, _uiComponentsShared.cx)('ais-Snippet-nonHighlighted', classNames.nonHighlighted),
|
|
30
|
+
separator: (0, _uiComponentsShared.cx)('ais-Snippet-separator', classNames.separator)
|
|
31
|
+
}
|
|
32
|
+
}, props));
|
|
33
|
+
}
|
|
@@ -32,47 +32,12 @@ var withUsage = (0, _index.createDocumentationMessageGenerator)({
|
|
|
32
32
|
var $$type = 'ais.numericMenu';
|
|
33
33
|
|
|
34
34
|
var createSendEvent = function createSendEvent(_ref) {
|
|
35
|
-
var instantSearchInstance = _ref.instantSearchInstance
|
|
36
|
-
helper = _ref.helper,
|
|
37
|
-
attribute = _ref.attribute;
|
|
35
|
+
var instantSearchInstance = _ref.instantSearchInstance;
|
|
38
36
|
return function () {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (args.length === 1) {
|
|
44
|
-
instantSearchInstance.sendEventToInsights(args[0]);
|
|
37
|
+
if (arguments.length === 1) {
|
|
38
|
+
instantSearchInstance.sendEventToInsights(arguments.length <= 0 ? undefined : arguments[0]);
|
|
45
39
|
return;
|
|
46
40
|
}
|
|
47
|
-
|
|
48
|
-
var eventType = args[0],
|
|
49
|
-
facetValue = args[1],
|
|
50
|
-
_args$ = args[2],
|
|
51
|
-
eventName = _args$ === void 0 ? 'Filter Applied' : _args$;
|
|
52
|
-
|
|
53
|
-
if (eventType !== 'click') {
|
|
54
|
-
return;
|
|
55
|
-
} // facetValue === "%7B%22start%22:5,%22end%22:10%7D"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
var filters = (0, _index.convertNumericRefinementsToFilters)(getRefinedState(helper.state, attribute, facetValue), attribute);
|
|
59
|
-
|
|
60
|
-
if (filters && filters.length > 0) {
|
|
61
|
-
/*
|
|
62
|
-
filters === ["price<=10", "price>=5"]
|
|
63
|
-
*/
|
|
64
|
-
instantSearchInstance.sendEventToInsights({
|
|
65
|
-
insightsMethod: 'clickedFilters',
|
|
66
|
-
widgetType: $$type,
|
|
67
|
-
eventType: eventType,
|
|
68
|
-
payload: {
|
|
69
|
-
eventName: eventName,
|
|
70
|
-
index: helper.getIndex(),
|
|
71
|
-
filters: filters
|
|
72
|
-
},
|
|
73
|
-
attribute: attribute
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
41
|
};
|
|
77
42
|
};
|
|
78
43
|
|
|
@@ -216,9 +181,7 @@ var connectNumericMenu = function connectNumericMenu(renderFn) {
|
|
|
216
181
|
|
|
217
182
|
if (!connectorState.sendEvent) {
|
|
218
183
|
connectorState.sendEvent = createSendEvent({
|
|
219
|
-
instantSearchInstance: instantSearchInstance
|
|
220
|
-
helper: helper,
|
|
221
|
-
attribute: attribute
|
|
184
|
+
instantSearchInstance: instantSearchInstance
|
|
222
185
|
});
|
|
223
186
|
}
|
|
224
187
|
|
|
@@ -156,50 +156,12 @@ var connectRange = function connectRange(renderFn) {
|
|
|
156
156
|
return null;
|
|
157
157
|
};
|
|
158
158
|
|
|
159
|
-
var
|
|
160
|
-
var eventName = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'Filter Applied';
|
|
161
|
-
var filters = (0, _index.convertNumericRefinementsToFilters)(refinedState, attribute);
|
|
162
|
-
|
|
163
|
-
if (filters && filters.length > 0) {
|
|
164
|
-
instantSearchInstance.sendEventToInsights({
|
|
165
|
-
insightsMethod: 'clickedFilters',
|
|
166
|
-
widgetType: $$type,
|
|
167
|
-
eventType: 'click',
|
|
168
|
-
payload: {
|
|
169
|
-
eventName: eventName,
|
|
170
|
-
index: helper.getIndex(),
|
|
171
|
-
filters: filters
|
|
172
|
-
},
|
|
173
|
-
attribute: attribute
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
var createSendEvent = function createSendEvent(instantSearchInstance, helper, currentRange) {
|
|
159
|
+
var createSendEvent = function createSendEvent(instantSearchInstance) {
|
|
179
160
|
return function () {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
if (args.length === 1) {
|
|
185
|
-
instantSearchInstance.sendEventToInsights(args[0]);
|
|
161
|
+
if (arguments.length === 1) {
|
|
162
|
+
instantSearchInstance.sendEventToInsights(arguments.length <= 0 ? undefined : arguments[0]);
|
|
186
163
|
return;
|
|
187
164
|
}
|
|
188
|
-
|
|
189
|
-
var eventType = args[0],
|
|
190
|
-
facetValue = args[1],
|
|
191
|
-
eventName = args[2];
|
|
192
|
-
|
|
193
|
-
if (eventType !== 'click') {
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
var _facetValue = _slicedToArray(facetValue, 2),
|
|
198
|
-
nextMin = _facetValue[0],
|
|
199
|
-
nextMax = _facetValue[1];
|
|
200
|
-
|
|
201
|
-
var refinedState = getRefinedState(helper, currentRange, nextMin, nextMax);
|
|
202
|
-
sendEventWithRefinedState(refinedState, instantSearchInstance, helper, eventName);
|
|
203
165
|
};
|
|
204
166
|
};
|
|
205
167
|
|
|
@@ -245,7 +207,7 @@ var connectRange = function connectRange(renderFn) {
|
|
|
245
207
|
return [min, max];
|
|
246
208
|
}
|
|
247
209
|
|
|
248
|
-
function _refine(
|
|
210
|
+
function _refine(helper, currentRange) {
|
|
249
211
|
return function () {
|
|
250
212
|
var _ref11 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [undefined, undefined],
|
|
251
213
|
_ref12 = _slicedToArray(_ref11, 2),
|
|
@@ -255,7 +217,6 @@ var connectRange = function connectRange(renderFn) {
|
|
|
255
217
|
var refinedState = getRefinedState(helper, currentRange, nextMin, nextMax);
|
|
256
218
|
|
|
257
219
|
if (refinedState) {
|
|
258
|
-
sendEventWithRefinedState(refinedState, instantSearchInstance, helper);
|
|
259
220
|
helper.setState(refinedState).search();
|
|
260
221
|
}
|
|
261
222
|
};
|
|
@@ -301,12 +262,12 @@ var connectRange = function connectRange(renderFn) {
|
|
|
301
262
|
// On first render pass an empty range
|
|
302
263
|
// to be able to bypass the validation
|
|
303
264
|
// related to it
|
|
304
|
-
refine = _refine(
|
|
265
|
+
refine = _refine(helper, {
|
|
305
266
|
min: undefined,
|
|
306
267
|
max: undefined
|
|
307
268
|
});
|
|
308
269
|
} else {
|
|
309
|
-
refine = _refine(
|
|
270
|
+
refine = _refine(helper, currentRange);
|
|
310
271
|
}
|
|
311
272
|
|
|
312
273
|
return {
|
|
@@ -314,7 +275,7 @@ var connectRange = function connectRange(renderFn) {
|
|
|
314
275
|
canRefine: currentRange.min !== currentRange.max,
|
|
315
276
|
format: rangeFormatter,
|
|
316
277
|
range: currentRange,
|
|
317
|
-
sendEvent: createSendEvent(instantSearchInstance
|
|
278
|
+
sendEvent: createSendEvent(instantSearchInstance),
|
|
318
279
|
widgetParams: _objectSpread(_objectSpread({}, widgetParams), {}, {
|
|
319
280
|
precision: precision
|
|
320
281
|
}),
|
|
@@ -223,7 +223,7 @@ var connectRatingMenu = function connectRatingMenu(renderFn) {
|
|
|
223
223
|
var maxValuesPerFacet = facetResults.length;
|
|
224
224
|
var maxDecimalPlaces = getFacetsMaxDecimalPlaces(facetResults);
|
|
225
225
|
var maxFacets = Math.pow(10, maxDecimalPlaces) * max;
|
|
226
|
-
process.env.NODE_ENV === 'development' ? (0, _index.warning)(maxFacets <= maxValuesPerFacet, getFacetValuesWarningMessage({
|
|
226
|
+
process.env.NODE_ENV === 'development' ? (0, _index.warning)(maxFacets <= maxValuesPerFacet || Boolean(results.__isArtificial), getFacetValuesWarningMessage({
|
|
227
227
|
maxDecimalPlaces: maxDecimalPlaces,
|
|
228
228
|
maxFacets: maxFacets,
|
|
229
229
|
maxValuesPerFacet: maxValuesPerFacet
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Highlight = Highlight;
|
|
7
|
+
|
|
8
|
+
var _preact = require("preact");
|
|
9
|
+
|
|
10
|
+
var _Highlight = require("../../components/Highlight/Highlight.js");
|
|
11
|
+
|
|
12
|
+
var _getHighlightedParts = _interopRequireDefault(require("../../lib/utils/getHighlightedParts.js"));
|
|
13
|
+
|
|
14
|
+
var _getPropertyByPath = _interopRequireDefault(require("../../lib/utils/getPropertyByPath.js"));
|
|
15
|
+
|
|
16
|
+
var _unescape = _interopRequireDefault(require("../../lib/utils/unescape.js"));
|
|
17
|
+
|
|
18
|
+
var _logger = require("../../lib/utils/logger.js");
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
23
|
+
|
|
24
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
25
|
+
|
|
26
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
27
|
+
|
|
28
|
+
function Highlight(_ref) {
|
|
29
|
+
var hit = _ref.hit,
|
|
30
|
+
attribute = _ref.attribute,
|
|
31
|
+
cssClasses = _ref.cssClasses,
|
|
32
|
+
props = _objectWithoutProperties(_ref, ["hit", "attribute", "cssClasses"]);
|
|
33
|
+
|
|
34
|
+
var property = (0, _getPropertyByPath.default)(hit._highlightResult, attribute) || [];
|
|
35
|
+
var properties = Array.isArray(property) ? property : [property];
|
|
36
|
+
process.env.NODE_ENV === 'development' ? (0, _logger.warning)(Boolean(properties.length), "Could not enable highlight for \"".concat(attribute.toString(), "\", will display an empty string.\nPlease check whether this attribute exists and is either searchable or specified in `attributesToHighlight`.\n\nSee: https://alg.li/highlighting\n")) : void 0;
|
|
37
|
+
var parts = properties.map(function (_ref2) {
|
|
38
|
+
var value = _ref2.value;
|
|
39
|
+
return (0, _getHighlightedParts.default)((0, _unescape.default)(value || ''));
|
|
40
|
+
});
|
|
41
|
+
return (0, _preact.h)(_Highlight.Highlight, _extends({}, props, {
|
|
42
|
+
parts: parts,
|
|
43
|
+
classNames: cssClasses
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ReverseHighlight = ReverseHighlight;
|
|
7
|
+
|
|
8
|
+
var _preact = require("preact");
|
|
9
|
+
|
|
10
|
+
var _ReverseHighlight = require("../../components/ReverseHighlight/ReverseHighlight.js");
|
|
11
|
+
|
|
12
|
+
var _getHighlightedParts = _interopRequireDefault(require("../../lib/utils/getHighlightedParts.js"));
|
|
13
|
+
|
|
14
|
+
var _getPropertyByPath = _interopRequireDefault(require("../../lib/utils/getPropertyByPath.js"));
|
|
15
|
+
|
|
16
|
+
var _unescape = _interopRequireDefault(require("../../lib/utils/unescape.js"));
|
|
17
|
+
|
|
18
|
+
var _logger = require("../../lib/utils/logger.js");
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
23
|
+
|
|
24
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
25
|
+
|
|
26
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
31
|
+
|
|
32
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
33
|
+
|
|
34
|
+
function ReverseHighlight(_ref) {
|
|
35
|
+
var hit = _ref.hit,
|
|
36
|
+
attribute = _ref.attribute,
|
|
37
|
+
cssClasses = _ref.cssClasses,
|
|
38
|
+
props = _objectWithoutProperties(_ref, ["hit", "attribute", "cssClasses"]);
|
|
39
|
+
|
|
40
|
+
var property = (0, _getPropertyByPath.default)(hit._highlightResult, attribute) || [];
|
|
41
|
+
var properties = Array.isArray(property) ? property : [property];
|
|
42
|
+
process.env.NODE_ENV === 'development' ? (0, _logger.warning)(Boolean(properties.length), "Could not enable highlight for \"".concat(attribute.toString(), "\", will display an empty string.\nPlease check whether this attribute exists and is either searchable or specified in `attributesToHighlight`.\n\nSee: https://alg.li/highlighting\n")) : void 0;
|
|
43
|
+
var parts = properties.map(function (_ref2) {
|
|
44
|
+
var value = _ref2.value;
|
|
45
|
+
return (0, _getHighlightedParts.default)((0, _unescape.default)(value || '')).map(function (_ref3) {
|
|
46
|
+
var isHighlighted = _ref3.isHighlighted,
|
|
47
|
+
rest = _objectWithoutProperties(_ref3, ["isHighlighted"]);
|
|
48
|
+
|
|
49
|
+
return _objectSpread(_objectSpread({}, rest), {}, {
|
|
50
|
+
isHighlighted: !isHighlighted
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
return (0, _preact.h)(_ReverseHighlight.ReverseHighlight, _extends({}, props, {
|
|
55
|
+
parts: parts,
|
|
56
|
+
classNames: cssClasses
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ReverseSnippet = ReverseSnippet;
|
|
7
|
+
|
|
8
|
+
var _preact = require("preact");
|
|
9
|
+
|
|
10
|
+
var _ReverseSnippet = require("../../components/ReverseSnippet/ReverseSnippet.js");
|
|
11
|
+
|
|
12
|
+
var _getHighlightedParts = _interopRequireDefault(require("../../lib/utils/getHighlightedParts.js"));
|
|
13
|
+
|
|
14
|
+
var _getPropertyByPath = _interopRequireDefault(require("../../lib/utils/getPropertyByPath.js"));
|
|
15
|
+
|
|
16
|
+
var _unescape = _interopRequireDefault(require("../../lib/utils/unescape.js"));
|
|
17
|
+
|
|
18
|
+
var _logger = require("../../lib/utils/logger.js");
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
23
|
+
|
|
24
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
25
|
+
|
|
26
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
31
|
+
|
|
32
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
33
|
+
|
|
34
|
+
function ReverseSnippet(_ref) {
|
|
35
|
+
var hit = _ref.hit,
|
|
36
|
+
attribute = _ref.attribute,
|
|
37
|
+
cssClasses = _ref.cssClasses,
|
|
38
|
+
props = _objectWithoutProperties(_ref, ["hit", "attribute", "cssClasses"]);
|
|
39
|
+
|
|
40
|
+
var property = (0, _getPropertyByPath.default)(hit._snippetResult, attribute) || [];
|
|
41
|
+
var properties = Array.isArray(property) ? property : [property];
|
|
42
|
+
process.env.NODE_ENV === 'development' ? (0, _logger.warning)(Boolean(properties.length), "Could not enable snippet for \"".concat(attribute.toString(), "\", will display an empty string.\nPlease check whether this attribute exists and is specified in `attributesToSnippet`.\n\nSee: https://alg.li/highlighting\n")) : void 0;
|
|
43
|
+
var parts = properties.map(function (_ref2) {
|
|
44
|
+
var value = _ref2.value;
|
|
45
|
+
return (0, _getHighlightedParts.default)((0, _unescape.default)(value || '')).map(function (_ref3) {
|
|
46
|
+
var isHighlighted = _ref3.isHighlighted,
|
|
47
|
+
rest = _objectWithoutProperties(_ref3, ["isHighlighted"]);
|
|
48
|
+
|
|
49
|
+
return _objectSpread(_objectSpread({}, rest), {}, {
|
|
50
|
+
isHighlighted: !isHighlighted
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
return (0, _preact.h)(_ReverseSnippet.ReverseSnippet, _extends({}, props, {
|
|
55
|
+
parts: parts,
|
|
56
|
+
classNames: cssClasses
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Snippet = Snippet;
|
|
7
|
+
|
|
8
|
+
var _preact = require("preact");
|
|
9
|
+
|
|
10
|
+
var _Snippet = require("../../components/Snippet/Snippet.js");
|
|
11
|
+
|
|
12
|
+
var _getHighlightedParts = _interopRequireDefault(require("../../lib/utils/getHighlightedParts.js"));
|
|
13
|
+
|
|
14
|
+
var _getPropertyByPath = _interopRequireDefault(require("../../lib/utils/getPropertyByPath.js"));
|
|
15
|
+
|
|
16
|
+
var _unescape = _interopRequireDefault(require("../../lib/utils/unescape.js"));
|
|
17
|
+
|
|
18
|
+
var _logger = require("../../lib/utils/logger.js");
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
23
|
+
|
|
24
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
25
|
+
|
|
26
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
27
|
+
|
|
28
|
+
function Snippet(_ref) {
|
|
29
|
+
var hit = _ref.hit,
|
|
30
|
+
attribute = _ref.attribute,
|
|
31
|
+
cssClasses = _ref.cssClasses,
|
|
32
|
+
props = _objectWithoutProperties(_ref, ["hit", "attribute", "cssClasses"]);
|
|
33
|
+
|
|
34
|
+
var property = (0, _getPropertyByPath.default)(hit._snippetResult, attribute) || [];
|
|
35
|
+
var properties = Array.isArray(property) ? property : [property];
|
|
36
|
+
process.env.NODE_ENV === 'development' ? (0, _logger.warning)(Boolean(properties.length), "Could not enable snippet for \"".concat(attribute.toString(), "\", will display an empty string.\nPlease check whether this attribute exists and is specified in `attributesToSnippet`.\n\nSee: https://alg.li/highlighting\n")) : void 0;
|
|
37
|
+
var parts = properties.map(function (_ref2) {
|
|
38
|
+
var value = _ref2.value;
|
|
39
|
+
return (0, _getHighlightedParts.default)((0, _unescape.default)(value || ''));
|
|
40
|
+
});
|
|
41
|
+
return (0, _preact.h)(_Snippet.Snippet, _extends({}, props, {
|
|
42
|
+
parts: parts,
|
|
43
|
+
classNames: cssClasses
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _Highlight = require("./Highlight.js");
|
|
8
|
+
|
|
9
|
+
Object.keys(_Highlight).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (key in exports && exports[key] === _Highlight[key]) return;
|
|
12
|
+
Object.defineProperty(exports, key, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _Highlight[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
var _ReverseHighlight = require("./ReverseHighlight.js");
|
|
21
|
+
|
|
22
|
+
Object.keys(_ReverseHighlight).forEach(function (key) {
|
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
|
24
|
+
if (key in exports && exports[key] === _ReverseHighlight[key]) return;
|
|
25
|
+
Object.defineProperty(exports, key, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function get() {
|
|
28
|
+
return _ReverseHighlight[key];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
var _ReverseSnippet = require("./ReverseSnippet.js");
|
|
34
|
+
|
|
35
|
+
Object.keys(_ReverseSnippet).forEach(function (key) {
|
|
36
|
+
if (key === "default" || key === "__esModule") return;
|
|
37
|
+
if (key in exports && exports[key] === _ReverseSnippet[key]) return;
|
|
38
|
+
Object.defineProperty(exports, key, {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function get() {
|
|
41
|
+
return _ReverseSnippet[key];
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
var _Snippet = require("./Snippet.js");
|
|
47
|
+
|
|
48
|
+
Object.keys(_Snippet).forEach(function (key) {
|
|
49
|
+
if (key === "default" || key === "__esModule") return;
|
|
50
|
+
if (key in exports && exports[key] === _Snippet[key]) return;
|
|
51
|
+
Object.defineProperty(exports, key, {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
get: function get() {
|
|
54
|
+
return _Snippet[key];
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
});
|
package/cjs/lib/InstantSearch.js
CHANGED
|
@@ -445,12 +445,22 @@ var InstantSearch = /*#__PURE__*/function (_EventEmitter) {
|
|
|
445
445
|
|
|
446
446
|
mainHelper.on('error', function (_ref4) {
|
|
447
447
|
var error = _ref4.error;
|
|
448
|
-
|
|
448
|
+
|
|
449
|
+
if (!(error instanceof Error)) {
|
|
450
|
+
// typescript lies here, error is in some cases { name: string, message: string }
|
|
451
|
+
var err = error;
|
|
452
|
+
error = Object.keys(err).reduce(function (acc, key) {
|
|
453
|
+
acc[key] = err[key];
|
|
454
|
+
return acc;
|
|
455
|
+
}, new Error(err.message));
|
|
456
|
+
} // If an error is emitted, it is re-thrown by events. In previous versions
|
|
449
457
|
// we emitted {error}, which is thrown as:
|
|
450
458
|
// "Uncaught, unspecified \"error\" event. ([object Object])"
|
|
451
459
|
// To avoid breaking changes, we make the error available in both
|
|
452
460
|
// `error` and `error.error`
|
|
453
461
|
// @MAJOR emit only error
|
|
462
|
+
|
|
463
|
+
|
|
454
464
|
error.error = error;
|
|
455
465
|
|
|
456
466
|
_this3.emit('error', error);
|