instantsearch.js 4.44.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 +9 -0
- package/cjs/connectors/numeric-menu/connectNumericMenu.js +4 -41
- package/cjs/connectors/range/connectRange.js +7 -46
- package/cjs/lib/version.js +1 -1
- package/dist/instantsearch.development.js +13 -114
- package/dist/instantsearch.development.js.map +1 -1
- package/dist/instantsearch.production.min.js +2 -2
- package/dist/instantsearch.production.min.js.map +1 -1
- package/es/connectors/numeric-menu/connectNumericMenu.js +5 -42
- package/es/connectors/range/connectRange.js +8 -47
- package/es/lib/version.d.ts +1 -1
- package/es/lib/version.js +1 -1
- package/package.json +2 -2
|
@@ -16,7 +16,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
16
16
|
|
|
17
17
|
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
18
|
|
|
19
|
-
import { checkRendering, createDocumentationMessageGenerator, isFiniteNumber,
|
|
19
|
+
import { checkRendering, createDocumentationMessageGenerator, isFiniteNumber, noop } from "../../lib/utils/index.js";
|
|
20
20
|
var withUsage = createDocumentationMessageGenerator({
|
|
21
21
|
name: 'numeric-menu',
|
|
22
22
|
connector: true
|
|
@@ -24,47 +24,12 @@ var withUsage = createDocumentationMessageGenerator({
|
|
|
24
24
|
var $$type = 'ais.numericMenu';
|
|
25
25
|
|
|
26
26
|
var createSendEvent = function createSendEvent(_ref) {
|
|
27
|
-
var instantSearchInstance = _ref.instantSearchInstance
|
|
28
|
-
helper = _ref.helper,
|
|
29
|
-
attribute = _ref.attribute;
|
|
27
|
+
var instantSearchInstance = _ref.instantSearchInstance;
|
|
30
28
|
return function () {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if (args.length === 1) {
|
|
36
|
-
instantSearchInstance.sendEventToInsights(args[0]);
|
|
29
|
+
if (arguments.length === 1) {
|
|
30
|
+
instantSearchInstance.sendEventToInsights(arguments.length <= 0 ? undefined : arguments[0]);
|
|
37
31
|
return;
|
|
38
32
|
}
|
|
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') {
|
|
46
|
-
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
|
-
}
|
|
68
33
|
};
|
|
69
34
|
};
|
|
70
35
|
|
|
@@ -208,9 +173,7 @@ var connectNumericMenu = function connectNumericMenu(renderFn) {
|
|
|
208
173
|
|
|
209
174
|
if (!connectorState.sendEvent) {
|
|
210
175
|
connectorState.sendEvent = createSendEvent({
|
|
211
|
-
instantSearchInstance: instantSearchInstance
|
|
212
|
-
helper: helper,
|
|
213
|
-
attribute: attribute
|
|
176
|
+
instantSearchInstance: instantSearchInstance
|
|
214
177
|
});
|
|
215
178
|
}
|
|
216
179
|
|
|
@@ -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,
|
|
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
|
|
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
|
-
|
|
173
|
-
|
|
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(
|
|
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(
|
|
257
|
+
refine = _refine(helper, {
|
|
297
258
|
min: undefined,
|
|
298
259
|
max: undefined
|
|
299
260
|
});
|
|
300
261
|
} else {
|
|
301
|
-
refine = _refine(
|
|
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
|
|
270
|
+
sendEvent: createSendEvent(instantSearchInstance),
|
|
310
271
|
widgetParams: _objectSpread(_objectSpread({}, widgetParams), {}, {
|
|
311
272
|
precision: precision
|
|
312
273
|
}),
|
package/es/lib/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "4.44.
|
|
1
|
+
declare const _default: "4.44.1";
|
|
2
2
|
export default _default;
|
package/es/lib/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '4.44.
|
|
1
|
+
export default '4.44.1';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "instantsearch.js",
|
|
3
|
-
"version": "4.44.
|
|
3
|
+
"version": "4.44.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",
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
},
|
|
162
162
|
{
|
|
163
163
|
"path": "./dist/instantsearch.development.js",
|
|
164
|
-
"maxSize": "
|
|
164
|
+
"maxSize": "151.50 kB"
|
|
165
165
|
}
|
|
166
166
|
]
|
|
167
167
|
}
|