instantsearch.js 4.77.3 → 4.78.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/cjs/connectors/autocomplete/connectAutocomplete.js +4 -7
- package/cjs/connectors/frequently-bought-together/connectFrequentlyBoughtTogether.js +1 -3
- package/cjs/connectors/geo-search/connectGeoSearch.js +1 -3
- package/cjs/connectors/hits/connectHits.js +2 -6
- package/cjs/connectors/infinite-hits/connectInfiniteHits.js +2 -6
- package/cjs/connectors/looking-similar/connectLookingSimilar.js +1 -3
- package/cjs/connectors/rating-menu/connectRatingMenu.js +2 -1
- package/cjs/connectors/related-products/connectRelatedProducts.js +1 -3
- package/cjs/connectors/toggle-refinement/connectToggleRefinement.js +2 -1
- package/cjs/connectors/trending-items/connectTrendingItems.js +1 -3
- package/cjs/lib/utils/createSendEventForFacet.js +2 -1
- package/cjs/lib/utils/createSendEventForHits.js +11 -8
- package/cjs/lib/version.js +1 -1
- package/dist/instantsearch.development.js +43 -49
- 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/autocomplete/connectAutocomplete.js +4 -7
- package/es/connectors/frequently-bought-together/connectFrequentlyBoughtTogether.js +1 -3
- package/es/connectors/geo-search/connectGeoSearch.js +1 -3
- package/es/connectors/hits/connectHits.js +2 -6
- package/es/connectors/infinite-hits/connectInfiniteHits.js +2 -6
- package/es/connectors/looking-similar/connectLookingSimilar.js +1 -3
- package/es/connectors/rating-menu/connectRatingMenu.js +2 -1
- package/es/connectors/related-products/connectRelatedProducts.js +1 -3
- package/es/connectors/toggle-refinement/connectToggleRefinement.js +2 -1
- package/es/connectors/trending-items/connectTrendingItems.js +1 -3
- package/es/lib/utils/createSendEventForFacet.js +2 -1
- package/es/lib/utils/createSendEventForHits.d.ts +7 -6
- package/es/lib/utils/createSendEventForHits.js +11 -8
- package/es/lib/version.d.ts +1 -1
- package/es/lib/version.js +1 -1
- package/package.json +6 -6
|
@@ -64,7 +64,7 @@ var connectAutocomplete = function connectAutocomplete(renderFn) {
|
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
var indices = scopedResults.map(function (scopedResult) {
|
|
67
|
-
var _scopedResult$
|
|
67
|
+
var _scopedResult$results, _scopedResult$results2;
|
|
68
68
|
// We need to escape the hits because highlighting
|
|
69
69
|
// exposes HTML tags to the end-user.
|
|
70
70
|
if (scopedResult.results) {
|
|
@@ -72,16 +72,13 @@ var connectAutocomplete = function connectAutocomplete(renderFn) {
|
|
|
72
72
|
}
|
|
73
73
|
var sendEvent = (0, _utils.createSendEventForHits)({
|
|
74
74
|
instantSearchInstance: instantSearchInstance,
|
|
75
|
-
|
|
76
|
-
var _scopedResult$results;
|
|
77
|
-
return ((_scopedResult$results = scopedResult.results) === null || _scopedResult$results === void 0 ? void 0 : _scopedResult$results.index) || '';
|
|
78
|
-
},
|
|
75
|
+
helper: scopedResult.helper,
|
|
79
76
|
widgetType: _this.$$type
|
|
80
77
|
});
|
|
81
78
|
return {
|
|
82
79
|
indexId: scopedResult.indexId,
|
|
83
|
-
indexName: ((_scopedResult$
|
|
84
|
-
hits: ((_scopedResult$
|
|
80
|
+
indexName: ((_scopedResult$results = scopedResult.results) === null || _scopedResult$results === void 0 ? void 0 : _scopedResult$results.index) || '',
|
|
81
|
+
hits: ((_scopedResult$results2 = scopedResult.results) === null || _scopedResult$results2 === void 0 ? void 0 : _scopedResult$results2.hits) || [],
|
|
85
82
|
results: scopedResult.results || {},
|
|
86
83
|
sendEvent: sendEvent
|
|
87
84
|
};
|
|
@@ -58,9 +58,7 @@ var connectFrequentlyBoughtTogether = exports.default = function connectFrequent
|
|
|
58
58
|
if (!sendEvent) {
|
|
59
59
|
sendEvent = (0, _utils.createSendEventForHits)({
|
|
60
60
|
instantSearchInstance: instantSearchInstance,
|
|
61
|
-
|
|
62
|
-
return helper.getIndex();
|
|
63
|
-
},
|
|
61
|
+
helper: helper,
|
|
64
62
|
widgetType: this.$$type
|
|
65
63
|
});
|
|
66
64
|
}
|
|
@@ -155,9 +155,7 @@ var connectGeoSearch = exports.default = function connectGeoSearch(renderFn) {
|
|
|
155
155
|
if (!sendEvent) {
|
|
156
156
|
sendEvent = (0, _utils.createSendEventForHits)({
|
|
157
157
|
instantSearchInstance: instantSearchInstance,
|
|
158
|
-
|
|
159
|
-
return helper.getIndex();
|
|
160
|
-
},
|
|
158
|
+
helper: helper,
|
|
161
159
|
widgetType: $$type
|
|
162
160
|
});
|
|
163
161
|
}
|
|
@@ -57,17 +57,13 @@ var connectHits = exports.default = function connectHits(renderFn) {
|
|
|
57
57
|
if (!sendEvent) {
|
|
58
58
|
sendEvent = (0, _utils.createSendEventForHits)({
|
|
59
59
|
instantSearchInstance: instantSearchInstance,
|
|
60
|
-
|
|
61
|
-
return helper.getIndex();
|
|
62
|
-
},
|
|
60
|
+
helper: helper,
|
|
63
61
|
widgetType: this.$$type
|
|
64
62
|
});
|
|
65
63
|
}
|
|
66
64
|
if (!bindEvent) {
|
|
67
65
|
bindEvent = (0, _utils.createBindEventForHits)({
|
|
68
|
-
|
|
69
|
-
return helper.getIndex();
|
|
70
|
-
},
|
|
66
|
+
helper: helper,
|
|
71
67
|
widgetType: this.$$type,
|
|
72
68
|
instantSearchInstance: instantSearchInstance
|
|
73
69
|
});
|
|
@@ -162,15 +162,11 @@ var connectInfiniteHits = exports.default = function connectInfiniteHits(renderF
|
|
|
162
162
|
showMore = getShowMore(helper);
|
|
163
163
|
sendEvent = (0, _utils.createSendEventForHits)({
|
|
164
164
|
instantSearchInstance: instantSearchInstance,
|
|
165
|
-
|
|
166
|
-
return helper.getIndex();
|
|
167
|
-
},
|
|
165
|
+
helper: helper,
|
|
168
166
|
widgetType: this.$$type
|
|
169
167
|
});
|
|
170
168
|
bindEvent = (0, _utils.createBindEventForHits)({
|
|
171
|
-
|
|
172
|
-
return helper.getIndex();
|
|
173
|
-
},
|
|
169
|
+
helper: helper,
|
|
174
170
|
widgetType: this.$$type,
|
|
175
171
|
instantSearchInstance: instantSearchInstance
|
|
176
172
|
});
|
|
@@ -59,9 +59,7 @@ var connectLookingSimilar = exports.default = function connectLookingSimilar(ren
|
|
|
59
59
|
if (!sendEvent) {
|
|
60
60
|
sendEvent = (0, _utils.createSendEventForHits)({
|
|
61
61
|
instantSearchInstance: instantSearchInstance,
|
|
62
|
-
|
|
63
|
-
return helper.getIndex();
|
|
64
|
-
},
|
|
62
|
+
helper: helper,
|
|
65
63
|
widgetType: this.$$type
|
|
66
64
|
});
|
|
67
65
|
}
|
|
@@ -53,6 +53,7 @@ var createSendEvent = function createSendEvent(_ref) {
|
|
|
53
53
|
}
|
|
54
54
|
var isRefined = getRefinedStar() === Number(facetValue);
|
|
55
55
|
if (!isRefined) {
|
|
56
|
+
var _helper$lastResults;
|
|
56
57
|
instantSearchInstance.sendEventToInsights({
|
|
57
58
|
insightsMethod: 'clickedFilters',
|
|
58
59
|
widgetType: $$type,
|
|
@@ -60,7 +61,7 @@ var createSendEvent = function createSendEvent(_ref) {
|
|
|
60
61
|
eventModifier: eventModifier,
|
|
61
62
|
payload: {
|
|
62
63
|
eventName: eventName,
|
|
63
|
-
index: helper.
|
|
64
|
+
index: ((_helper$lastResults = helper.lastResults) === null || _helper$lastResults === void 0 ? void 0 : _helper$lastResults.index) || helper.state.index,
|
|
64
65
|
filters: ["".concat(attribute, ">=").concat(facetValue)]
|
|
65
66
|
},
|
|
66
67
|
attribute: attribute
|
|
@@ -59,9 +59,7 @@ var connectRelatedProducts = exports.default = function connectRelatedProducts(r
|
|
|
59
59
|
if (!sendEvent) {
|
|
60
60
|
sendEvent = (0, _utils.createSendEventForHits)({
|
|
61
61
|
instantSearchInstance: instantSearchInstance,
|
|
62
|
-
|
|
63
|
-
return helper.getIndex();
|
|
64
|
-
},
|
|
62
|
+
helper: helper,
|
|
65
63
|
widgetType: this.$$type
|
|
66
64
|
});
|
|
67
65
|
}
|
|
@@ -49,6 +49,7 @@ var createSendEvent = function createSendEvent(_ref) {
|
|
|
49
49
|
// only send an event when the refinement gets applied,
|
|
50
50
|
// not when it gets removed
|
|
51
51
|
if (!isRefined) {
|
|
52
|
+
var _helper$lastResults;
|
|
52
53
|
instantSearchInstance.sendEventToInsights({
|
|
53
54
|
insightsMethod: 'clickedFilters',
|
|
54
55
|
widgetType: $$type,
|
|
@@ -56,7 +57,7 @@ var createSendEvent = function createSendEvent(_ref) {
|
|
|
56
57
|
eventModifier: eventModifier,
|
|
57
58
|
payload: {
|
|
58
59
|
eventName: eventName,
|
|
59
|
-
index: helper.
|
|
60
|
+
index: ((_helper$lastResults = helper.lastResults) === null || _helper$lastResults === void 0 ? void 0 : _helper$lastResults.index) || helper.state.index,
|
|
60
61
|
filters: on.map(function (value) {
|
|
61
62
|
return "".concat(attribute, ":").concat(value);
|
|
62
63
|
})
|
|
@@ -60,9 +60,7 @@ var connectTrendingItems = exports.default = function connectTrendingItems(rende
|
|
|
60
60
|
if (!sendEvent) {
|
|
61
61
|
sendEvent = (0, _utils.createSendEventForHits)({
|
|
62
62
|
instantSearchInstance: instantSearchInstance,
|
|
63
|
-
|
|
64
|
-
return helper.getIndex();
|
|
65
|
-
},
|
|
63
|
+
helper: helper,
|
|
66
64
|
widgetType: this.$$type
|
|
67
65
|
});
|
|
68
66
|
}
|
|
@@ -40,6 +40,7 @@ function createSendEventForFacet(_ref) {
|
|
|
40
40
|
instantSearchInstance.sendEventToInsights(args[0]);
|
|
41
41
|
} else if (eventType === 'click' && args.length >= 2 && args.length <= 4) {
|
|
42
42
|
if (!(0, _isFacetRefined.isFacetRefined)(helper, attribute, facetValue)) {
|
|
43
|
+
var _helper$lastResults;
|
|
43
44
|
// send event only when the facet is being checked "ON"
|
|
44
45
|
instantSearchInstance.sendEventToInsights({
|
|
45
46
|
insightsMethod: 'clickedFilters',
|
|
@@ -48,7 +49,7 @@ function createSendEventForFacet(_ref) {
|
|
|
48
49
|
eventModifier: eventModifier,
|
|
49
50
|
payload: _objectSpread({
|
|
50
51
|
eventName: eventName,
|
|
51
|
-
index: helper.
|
|
52
|
+
index: ((_helper$lastResults = helper.lastResults) === null || _helper$lastResults === void 0 ? void 0 : _helper$lastResults.index) || helper.state.index,
|
|
52
53
|
filters: ["".concat(attribute, ":").concat(facetValue)]
|
|
53
54
|
}, additionalData),
|
|
54
55
|
attribute: attribute
|
|
@@ -28,7 +28,7 @@ function chunk(arr) {
|
|
|
28
28
|
return chunks;
|
|
29
29
|
}
|
|
30
30
|
function _buildEventPayloadsForHits(_ref) {
|
|
31
|
-
var
|
|
31
|
+
var helper = _ref.helper,
|
|
32
32
|
widgetType = _ref.widgetType,
|
|
33
33
|
methodName = _ref.methodName,
|
|
34
34
|
args = _ref.args,
|
|
@@ -79,13 +79,14 @@ function _buildEventPayloadsForHits(_ref) {
|
|
|
79
79
|
return [];
|
|
80
80
|
}
|
|
81
81
|
return hitsChunks.map(function (batch, i) {
|
|
82
|
+
var _helper$lastResults;
|
|
82
83
|
return {
|
|
83
84
|
insightsMethod: 'viewedObjectIDs',
|
|
84
85
|
widgetType: widgetType,
|
|
85
86
|
eventType: eventType,
|
|
86
87
|
payload: _objectSpread({
|
|
87
88
|
eventName: eventName || 'Hits Viewed',
|
|
88
|
-
index:
|
|
89
|
+
index: ((_helper$lastResults = helper.lastResults) === null || _helper$lastResults === void 0 ? void 0 : _helper$lastResults.index) || helper.state.index,
|
|
89
90
|
objectIDs: objectIDsByChunk[i]
|
|
90
91
|
}, additionalData),
|
|
91
92
|
hits: batch,
|
|
@@ -94,13 +95,14 @@ function _buildEventPayloadsForHits(_ref) {
|
|
|
94
95
|
});
|
|
95
96
|
} else if (eventType === 'click') {
|
|
96
97
|
return hitsChunks.map(function (batch, i) {
|
|
98
|
+
var _helper$lastResults2;
|
|
97
99
|
return {
|
|
98
100
|
insightsMethod: 'clickedObjectIDsAfterSearch',
|
|
99
101
|
widgetType: widgetType,
|
|
100
102
|
eventType: eventType,
|
|
101
103
|
payload: _objectSpread({
|
|
102
104
|
eventName: eventName || 'Hit Clicked',
|
|
103
|
-
index:
|
|
105
|
+
index: ((_helper$lastResults2 = helper.lastResults) === null || _helper$lastResults2 === void 0 ? void 0 : _helper$lastResults2.index) || helper.state.index,
|
|
104
106
|
queryID: queryID,
|
|
105
107
|
objectIDs: objectIDsByChunk[i],
|
|
106
108
|
positions: positionsByChunk[i]
|
|
@@ -111,13 +113,14 @@ function _buildEventPayloadsForHits(_ref) {
|
|
|
111
113
|
});
|
|
112
114
|
} else if (eventType === 'conversion') {
|
|
113
115
|
return hitsChunks.map(function (batch, i) {
|
|
116
|
+
var _helper$lastResults3;
|
|
114
117
|
return {
|
|
115
118
|
insightsMethod: 'convertedObjectIDsAfterSearch',
|
|
116
119
|
widgetType: widgetType,
|
|
117
120
|
eventType: eventType,
|
|
118
121
|
payload: _objectSpread({
|
|
119
122
|
eventName: eventName || 'Hit Converted',
|
|
120
|
-
index:
|
|
123
|
+
index: ((_helper$lastResults3 = helper.lastResults) === null || _helper$lastResults3 === void 0 ? void 0 : _helper$lastResults3.index) || helper.state.index,
|
|
121
124
|
queryID: queryID,
|
|
122
125
|
objectIDs: objectIDsByChunk[i]
|
|
123
126
|
}, additionalData),
|
|
@@ -133,7 +136,7 @@ function _buildEventPayloadsForHits(_ref) {
|
|
|
133
136
|
}
|
|
134
137
|
function createSendEventForHits(_ref2) {
|
|
135
138
|
var instantSearchInstance = _ref2.instantSearchInstance,
|
|
136
|
-
|
|
139
|
+
helper = _ref2.helper,
|
|
137
140
|
widgetType = _ref2.widgetType;
|
|
138
141
|
var sentEvents = {};
|
|
139
142
|
var timer = undefined;
|
|
@@ -143,7 +146,7 @@ function createSendEventForHits(_ref2) {
|
|
|
143
146
|
}
|
|
144
147
|
var payloads = _buildEventPayloadsForHits({
|
|
145
148
|
widgetType: widgetType,
|
|
146
|
-
|
|
149
|
+
helper: helper,
|
|
147
150
|
methodName: 'sendEvent',
|
|
148
151
|
args: args,
|
|
149
152
|
instantSearchInstance: instantSearchInstance
|
|
@@ -163,7 +166,7 @@ function createSendEventForHits(_ref2) {
|
|
|
163
166
|
return sendEventForHits;
|
|
164
167
|
}
|
|
165
168
|
function createBindEventForHits(_ref3) {
|
|
166
|
-
var
|
|
169
|
+
var helper = _ref3.helper,
|
|
167
170
|
widgetType = _ref3.widgetType,
|
|
168
171
|
instantSearchInstance = _ref3.instantSearchInstance;
|
|
169
172
|
var bindEventForHits = function bindEventForHits() {
|
|
@@ -172,7 +175,7 @@ function createBindEventForHits(_ref3) {
|
|
|
172
175
|
}
|
|
173
176
|
var payloads = _buildEventPayloadsForHits({
|
|
174
177
|
widgetType: widgetType,
|
|
175
|
-
|
|
178
|
+
helper: helper,
|
|
176
179
|
methodName: 'bindEvent',
|
|
177
180
|
args: args,
|
|
178
181
|
instantSearchInstance: instantSearchInstance
|
package/cjs/lib/version.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! InstantSearch.js 4.
|
|
1
|
+
/*! InstantSearch.js 4.78.1 | © Algolia, Inc. and contributors; MIT License | https://github.com/algolia/instantsearch */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
@@ -772,6 +772,7 @@
|
|
|
772
772
|
instantSearchInstance.sendEventToInsights(args[0]);
|
|
773
773
|
} else if (eventType === 'click' && args.length >= 2 && args.length <= 4) {
|
|
774
774
|
if (!isFacetRefined(helper, attribute, facetValue)) {
|
|
775
|
+
var _helper$lastResults;
|
|
775
776
|
// send event only when the facet is being checked "ON"
|
|
776
777
|
instantSearchInstance.sendEventToInsights({
|
|
777
778
|
insightsMethod: 'clickedFilters',
|
|
@@ -780,7 +781,7 @@
|
|
|
780
781
|
eventModifier: eventModifier,
|
|
781
782
|
payload: _objectSpread2({
|
|
782
783
|
eventName: eventName,
|
|
783
|
-
index: helper.
|
|
784
|
+
index: ((_helper$lastResults = helper.lastResults) === null || _helper$lastResults === void 0 ? void 0 : _helper$lastResults.index) || helper.state.index,
|
|
784
785
|
filters: ["".concat(attribute, ":").concat(facetValue)]
|
|
785
786
|
}, additionalData),
|
|
786
787
|
attribute: attribute
|
|
@@ -809,7 +810,7 @@
|
|
|
809
810
|
return chunks;
|
|
810
811
|
}
|
|
811
812
|
function _buildEventPayloadsForHits(_ref) {
|
|
812
|
-
var
|
|
813
|
+
var helper = _ref.helper,
|
|
813
814
|
widgetType = _ref.widgetType,
|
|
814
815
|
methodName = _ref.methodName,
|
|
815
816
|
args = _ref.args,
|
|
@@ -856,13 +857,14 @@
|
|
|
856
857
|
return [];
|
|
857
858
|
}
|
|
858
859
|
return hitsChunks.map(function (batch, i) {
|
|
860
|
+
var _helper$lastResults;
|
|
859
861
|
return {
|
|
860
862
|
insightsMethod: 'viewedObjectIDs',
|
|
861
863
|
widgetType: widgetType,
|
|
862
864
|
eventType: eventType,
|
|
863
865
|
payload: _objectSpread2({
|
|
864
866
|
eventName: eventName || 'Hits Viewed',
|
|
865
|
-
index:
|
|
867
|
+
index: ((_helper$lastResults = helper.lastResults) === null || _helper$lastResults === void 0 ? void 0 : _helper$lastResults.index) || helper.state.index,
|
|
866
868
|
objectIDs: objectIDsByChunk[i]
|
|
867
869
|
}, additionalData),
|
|
868
870
|
hits: batch,
|
|
@@ -871,13 +873,14 @@
|
|
|
871
873
|
});
|
|
872
874
|
} else if (eventType === 'click') {
|
|
873
875
|
return hitsChunks.map(function (batch, i) {
|
|
876
|
+
var _helper$lastResults2;
|
|
874
877
|
return {
|
|
875
878
|
insightsMethod: 'clickedObjectIDsAfterSearch',
|
|
876
879
|
widgetType: widgetType,
|
|
877
880
|
eventType: eventType,
|
|
878
881
|
payload: _objectSpread2({
|
|
879
882
|
eventName: eventName || 'Hit Clicked',
|
|
880
|
-
index:
|
|
883
|
+
index: ((_helper$lastResults2 = helper.lastResults) === null || _helper$lastResults2 === void 0 ? void 0 : _helper$lastResults2.index) || helper.state.index,
|
|
881
884
|
queryID: queryID,
|
|
882
885
|
objectIDs: objectIDsByChunk[i],
|
|
883
886
|
positions: positionsByChunk[i]
|
|
@@ -888,13 +891,14 @@
|
|
|
888
891
|
});
|
|
889
892
|
} else if (eventType === 'conversion') {
|
|
890
893
|
return hitsChunks.map(function (batch, i) {
|
|
894
|
+
var _helper$lastResults3;
|
|
891
895
|
return {
|
|
892
896
|
insightsMethod: 'convertedObjectIDsAfterSearch',
|
|
893
897
|
widgetType: widgetType,
|
|
894
898
|
eventType: eventType,
|
|
895
899
|
payload: _objectSpread2({
|
|
896
900
|
eventName: eventName || 'Hit Converted',
|
|
897
|
-
index:
|
|
901
|
+
index: ((_helper$lastResults3 = helper.lastResults) === null || _helper$lastResults3 === void 0 ? void 0 : _helper$lastResults3.index) || helper.state.index,
|
|
898
902
|
queryID: queryID,
|
|
899
903
|
objectIDs: objectIDsByChunk[i]
|
|
900
904
|
}, additionalData),
|
|
@@ -908,7 +912,7 @@
|
|
|
908
912
|
}
|
|
909
913
|
function createSendEventForHits(_ref2) {
|
|
910
914
|
var instantSearchInstance = _ref2.instantSearchInstance,
|
|
911
|
-
|
|
915
|
+
helper = _ref2.helper,
|
|
912
916
|
widgetType = _ref2.widgetType;
|
|
913
917
|
var sentEvents = {};
|
|
914
918
|
var timer = undefined;
|
|
@@ -918,7 +922,7 @@
|
|
|
918
922
|
}
|
|
919
923
|
var payloads = _buildEventPayloadsForHits({
|
|
920
924
|
widgetType: widgetType,
|
|
921
|
-
|
|
925
|
+
helper: helper,
|
|
922
926
|
methodName: 'sendEvent',
|
|
923
927
|
args: args,
|
|
924
928
|
instantSearchInstance: instantSearchInstance
|
|
@@ -938,7 +942,7 @@
|
|
|
938
942
|
return sendEventForHits;
|
|
939
943
|
}
|
|
940
944
|
function createBindEventForHits(_ref3) {
|
|
941
|
-
var
|
|
945
|
+
var helper = _ref3.helper,
|
|
942
946
|
widgetType = _ref3.widgetType,
|
|
943
947
|
instantSearchInstance = _ref3.instantSearchInstance;
|
|
944
948
|
var bindEventForHits = function bindEventForHits() {
|
|
@@ -947,7 +951,7 @@
|
|
|
947
951
|
}
|
|
948
952
|
var payloads = _buildEventPayloadsForHits({
|
|
949
953
|
widgetType: widgetType,
|
|
950
|
-
|
|
954
|
+
helper: helper,
|
|
951
955
|
methodName: 'bindEvent',
|
|
952
956
|
args: args,
|
|
953
957
|
instantSearchInstance: instantSearchInstance
|
|
@@ -2764,7 +2768,16 @@
|
|
|
2764
2768
|
var facets = state.facets
|
|
2765
2769
|
.concat(
|
|
2766
2770
|
state.disjunctiveFacets.map(function (value) {
|
|
2767
|
-
|
|
2771
|
+
if (
|
|
2772
|
+
state.disjunctiveFacetsRefinements &&
|
|
2773
|
+
state.disjunctiveFacetsRefinements[value] &&
|
|
2774
|
+
state.disjunctiveFacetsRefinements[value].length > 0
|
|
2775
|
+
) {
|
|
2776
|
+
// only tag a disjunctiveFacet as disjunctive if it has a value selected
|
|
2777
|
+
// this helps avoid hitting the limit of 20 disjunctive facets in the Composition API
|
|
2778
|
+
return 'disjunctive(' + value + ')';
|
|
2779
|
+
}
|
|
2780
|
+
return value;
|
|
2768
2781
|
})
|
|
2769
2782
|
)
|
|
2770
2783
|
.concat(requestBuilder._getHitsHierarchicalFacetsAttributes(state))
|
|
@@ -6583,7 +6596,7 @@
|
|
|
6583
6596
|
|
|
6584
6597
|
var sortAndMergeRecommendations_1 = sortAndMergeRecommendations;
|
|
6585
6598
|
|
|
6586
|
-
var version = '3.24.
|
|
6599
|
+
var version = '3.24.3';
|
|
6587
6600
|
|
|
6588
6601
|
var escapeFacetValue$4 = escapeFacetValue_1.escapeFacetValue;
|
|
6589
6602
|
|
|
@@ -9716,17 +9729,13 @@
|
|
|
9716
9729
|
if (!sendEvent) {
|
|
9717
9730
|
sendEvent = createSendEventForHits({
|
|
9718
9731
|
instantSearchInstance: instantSearchInstance,
|
|
9719
|
-
|
|
9720
|
-
return helper.getIndex();
|
|
9721
|
-
},
|
|
9732
|
+
helper: helper,
|
|
9722
9733
|
widgetType: this.$$type
|
|
9723
9734
|
});
|
|
9724
9735
|
}
|
|
9725
9736
|
if (!bindEvent) {
|
|
9726
9737
|
bindEvent = createBindEventForHits({
|
|
9727
|
-
|
|
9728
|
-
return helper.getIndex();
|
|
9729
|
-
},
|
|
9738
|
+
helper: helper,
|
|
9730
9739
|
widgetType: this.$$type,
|
|
9731
9740
|
instantSearchInstance: instantSearchInstance
|
|
9732
9741
|
});
|
|
@@ -10273,15 +10282,11 @@
|
|
|
10273
10282
|
showMore = getShowMore(helper);
|
|
10274
10283
|
sendEvent = createSendEventForHits({
|
|
10275
10284
|
instantSearchInstance: instantSearchInstance,
|
|
10276
|
-
|
|
10277
|
-
return helper.getIndex();
|
|
10278
|
-
},
|
|
10285
|
+
helper: helper,
|
|
10279
10286
|
widgetType: this.$$type
|
|
10280
10287
|
});
|
|
10281
10288
|
bindEvent = createBindEventForHits({
|
|
10282
|
-
|
|
10283
|
-
return helper.getIndex();
|
|
10284
|
-
},
|
|
10289
|
+
helper: helper,
|
|
10285
10290
|
widgetType: this.$$type,
|
|
10286
10291
|
instantSearchInstance: instantSearchInstance
|
|
10287
10292
|
});
|
|
@@ -11627,9 +11632,7 @@
|
|
|
11627
11632
|
if (!sendEvent) {
|
|
11628
11633
|
sendEvent = createSendEventForHits({
|
|
11629
11634
|
instantSearchInstance: instantSearchInstance,
|
|
11630
|
-
|
|
11631
|
-
return helper.getIndex();
|
|
11632
|
-
},
|
|
11635
|
+
helper: helper,
|
|
11633
11636
|
widgetType: this.$$type
|
|
11634
11637
|
});
|
|
11635
11638
|
}
|
|
@@ -11900,6 +11903,7 @@
|
|
|
11900
11903
|
}
|
|
11901
11904
|
var isRefined = getRefinedStar() === Number(facetValue);
|
|
11902
11905
|
if (!isRefined) {
|
|
11906
|
+
var _helper$lastResults;
|
|
11903
11907
|
instantSearchInstance.sendEventToInsights({
|
|
11904
11908
|
insightsMethod: 'clickedFilters',
|
|
11905
11909
|
widgetType: $$type$2,
|
|
@@ -11907,7 +11911,7 @@
|
|
|
11907
11911
|
eventModifier: eventModifier,
|
|
11908
11912
|
payload: {
|
|
11909
11913
|
eventName: eventName,
|
|
11910
|
-
index: helper.
|
|
11914
|
+
index: ((_helper$lastResults = helper.lastResults) === null || _helper$lastResults === void 0 ? void 0 : _helper$lastResults.index) || helper.state.index,
|
|
11911
11915
|
filters: ["".concat(attribute, ">=").concat(facetValue)]
|
|
11912
11916
|
},
|
|
11913
11917
|
attribute: attribute
|
|
@@ -12240,6 +12244,7 @@
|
|
|
12240
12244
|
// only send an event when the refinement gets applied,
|
|
12241
12245
|
// not when it gets removed
|
|
12242
12246
|
if (!isRefined) {
|
|
12247
|
+
var _helper$lastResults;
|
|
12243
12248
|
instantSearchInstance.sendEventToInsights({
|
|
12244
12249
|
insightsMethod: 'clickedFilters',
|
|
12245
12250
|
widgetType: $$type$3,
|
|
@@ -12247,7 +12252,7 @@
|
|
|
12247
12252
|
eventModifier: eventModifier,
|
|
12248
12253
|
payload: {
|
|
12249
12254
|
eventName: eventName,
|
|
12250
|
-
index: helper.
|
|
12255
|
+
index: ((_helper$lastResults = helper.lastResults) === null || _helper$lastResults === void 0 ? void 0 : _helper$lastResults.index) || helper.state.index,
|
|
12251
12256
|
filters: on.map(function (value) {
|
|
12252
12257
|
return "".concat(attribute, ":").concat(value);
|
|
12253
12258
|
})
|
|
@@ -12553,9 +12558,7 @@
|
|
|
12553
12558
|
if (!sendEvent) {
|
|
12554
12559
|
sendEvent = createSendEventForHits({
|
|
12555
12560
|
instantSearchInstance: instantSearchInstance,
|
|
12556
|
-
|
|
12557
|
-
return helper.getIndex();
|
|
12558
|
-
},
|
|
12561
|
+
helper: helper,
|
|
12559
12562
|
widgetType: this.$$type
|
|
12560
12563
|
});
|
|
12561
12564
|
}
|
|
@@ -12914,9 +12917,7 @@
|
|
|
12914
12917
|
if (!sendEvent) {
|
|
12915
12918
|
sendEvent = createSendEventForHits({
|
|
12916
12919
|
instantSearchInstance: instantSearchInstance,
|
|
12917
|
-
|
|
12918
|
-
return helper.getIndex();
|
|
12919
|
-
},
|
|
12920
|
+
helper: helper,
|
|
12920
12921
|
widgetType: $$type$4
|
|
12921
12922
|
});
|
|
12922
12923
|
}
|
|
@@ -13079,7 +13080,7 @@
|
|
|
13079
13080
|
};
|
|
13080
13081
|
}
|
|
13081
13082
|
var indices = scopedResults.map(function (scopedResult) {
|
|
13082
|
-
var _scopedResult$
|
|
13083
|
+
var _scopedResult$results, _scopedResult$results2;
|
|
13083
13084
|
// We need to escape the hits because highlighting
|
|
13084
13085
|
// exposes HTML tags to the end-user.
|
|
13085
13086
|
if (scopedResult.results) {
|
|
@@ -13087,16 +13088,13 @@
|
|
|
13087
13088
|
}
|
|
13088
13089
|
var sendEvent = createSendEventForHits({
|
|
13089
13090
|
instantSearchInstance: instantSearchInstance,
|
|
13090
|
-
|
|
13091
|
-
var _scopedResult$results;
|
|
13092
|
-
return ((_scopedResult$results = scopedResult.results) === null || _scopedResult$results === void 0 ? void 0 : _scopedResult$results.index) || '';
|
|
13093
|
-
},
|
|
13091
|
+
helper: scopedResult.helper,
|
|
13094
13092
|
widgetType: _this.$$type
|
|
13095
13093
|
});
|
|
13096
13094
|
return {
|
|
13097
13095
|
indexId: scopedResult.indexId,
|
|
13098
|
-
indexName: ((_scopedResult$
|
|
13099
|
-
hits: ((_scopedResult$
|
|
13096
|
+
indexName: ((_scopedResult$results = scopedResult.results) === null || _scopedResult$results === void 0 ? void 0 : _scopedResult$results.index) || '',
|
|
13097
|
+
hits: ((_scopedResult$results2 = scopedResult.results) === null || _scopedResult$results2 === void 0 ? void 0 : _scopedResult$results2.hits) || [],
|
|
13100
13098
|
results: scopedResult.results || {},
|
|
13101
13099
|
sendEvent: sendEvent
|
|
13102
13100
|
};
|
|
@@ -13655,9 +13653,7 @@
|
|
|
13655
13653
|
if (!sendEvent) {
|
|
13656
13654
|
sendEvent = createSendEventForHits({
|
|
13657
13655
|
instantSearchInstance: instantSearchInstance,
|
|
13658
|
-
|
|
13659
|
-
return helper.getIndex();
|
|
13660
|
-
},
|
|
13656
|
+
helper: helper,
|
|
13661
13657
|
widgetType: this.$$type
|
|
13662
13658
|
});
|
|
13663
13659
|
}
|
|
@@ -13751,9 +13747,7 @@
|
|
|
13751
13747
|
if (!sendEvent) {
|
|
13752
13748
|
sendEvent = createSendEventForHits({
|
|
13753
13749
|
instantSearchInstance: instantSearchInstance,
|
|
13754
|
-
|
|
13755
|
-
return helper.getIndex();
|
|
13756
|
-
},
|
|
13750
|
+
helper: helper,
|
|
13757
13751
|
widgetType: this.$$type
|
|
13758
13752
|
});
|
|
13759
13753
|
}
|
|
@@ -16417,7 +16411,7 @@
|
|
|
16417
16411
|
};
|
|
16418
16412
|
}
|
|
16419
16413
|
|
|
16420
|
-
var version$1 = '4.
|
|
16414
|
+
var version$1 = '4.78.1';
|
|
16421
16415
|
|
|
16422
16416
|
var withUsage$v = createDocumentationMessageGenerator({
|
|
16423
16417
|
name: 'instantsearch'
|