instantsearch.js 4.64.2 → 4.64.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.
@@ -63,7 +63,9 @@ var connectAutocomplete = function connectAutocomplete(renderFn) {
63
63
  scopedResult.results.hits = escapeHTML ? escapeHits(scopedResult.results.hits) : scopedResult.results.hits;
64
64
  var sendEvent = createSendEventForHits({
65
65
  instantSearchInstance: instantSearchInstance,
66
- index: scopedResult.results.index,
66
+ getIndex: function getIndex() {
67
+ return scopedResult.results.index;
68
+ },
67
69
  widgetType: _this.$$type
68
70
  });
69
71
  return {
@@ -149,7 +149,9 @@ var connectGeoSearch = function connectGeoSearch(renderFn) {
149
149
  if (!sendEvent) {
150
150
  sendEvent = createSendEventForHits({
151
151
  instantSearchInstance: instantSearchInstance,
152
- index: helper.getIndex(),
152
+ getIndex: function getIndex() {
153
+ return helper.getIndex();
154
+ },
153
155
  widgetType: $$type
154
156
  });
155
157
  }
@@ -48,13 +48,17 @@ var connectHits = function connectHits(renderFn) {
48
48
  if (!sendEvent) {
49
49
  sendEvent = createSendEventForHits({
50
50
  instantSearchInstance: instantSearchInstance,
51
- index: helper.getIndex(),
51
+ getIndex: function getIndex() {
52
+ return helper.getIndex();
53
+ },
52
54
  widgetType: this.$$type
53
55
  });
54
56
  }
55
57
  if (!bindEvent) {
56
58
  bindEvent = createBindEventForHits({
57
- index: helper.getIndex(),
59
+ getIndex: function getIndex() {
60
+ return helper.getIndex();
61
+ },
58
62
  widgetType: this.$$type,
59
63
  instantSearchInstance: instantSearchInstance
60
64
  });
@@ -155,11 +155,15 @@ var connectInfiniteHits = function connectInfiniteHits(renderFn) {
155
155
  showMore = getShowMore(helper);
156
156
  sendEvent = createSendEventForHits({
157
157
  instantSearchInstance: instantSearchInstance,
158
- index: helper.getIndex(),
158
+ getIndex: function getIndex() {
159
+ return helper.getIndex();
160
+ },
159
161
  widgetType: this.$$type
160
162
  });
161
163
  bindEvent = createBindEventForHits({
162
- index: helper.getIndex(),
164
+ getIndex: function getIndex() {
165
+ return helper.getIndex();
166
+ },
163
167
  widgetType: this.$$type,
164
168
  instantSearchInstance: instantSearchInstance
165
169
  });
@@ -6,20 +6,20 @@ export type SendEventForHits = BuiltInSendEventForHits & CustomSendEventForHits;
6
6
  export type BuiltInBindEventForHits = (eventType: string, hits: Hit | Hit[], eventName?: string, additionalData?: Record<string, any>) => string;
7
7
  export type CustomBindEventForHits = (customPayload: any) => string;
8
8
  export type BindEventForHits = BuiltInBindEventForHits & CustomBindEventForHits;
9
- export declare function _buildEventPayloadsForHits({ index, widgetType, methodName, args, instantSearchInstance, }: {
9
+ export declare function _buildEventPayloadsForHits({ getIndex, widgetType, methodName, args, instantSearchInstance, }: {
10
10
  widgetType: string;
11
- index: string;
11
+ getIndex: () => string;
12
12
  methodName: 'sendEvent' | 'bindEvent';
13
13
  args: any[];
14
14
  instantSearchInstance: InstantSearch;
15
15
  }): InsightsEvent[];
16
- export declare function createSendEventForHits({ instantSearchInstance, index, widgetType, }: {
16
+ export declare function createSendEventForHits({ instantSearchInstance, getIndex, widgetType, }: {
17
17
  instantSearchInstance: InstantSearch;
18
- index: string;
18
+ getIndex: () => string;
19
19
  widgetType: string;
20
20
  }): SendEventForHits;
21
- export declare function createBindEventForHits({ index, widgetType, instantSearchInstance, }: {
22
- index: string;
21
+ export declare function createBindEventForHits({ getIndex, widgetType, instantSearchInstance, }: {
22
+ getIndex: () => string;
23
23
  widgetType: string;
24
24
  instantSearchInstance: InstantSearch;
25
25
  }): BindEventForHits;
@@ -20,7 +20,7 @@ function chunk(arr) {
20
20
  return chunks;
21
21
  }
22
22
  export function _buildEventPayloadsForHits(_ref) {
23
- var index = _ref.index,
23
+ var getIndex = _ref.getIndex,
24
24
  widgetType = _ref.widgetType,
25
25
  methodName = _ref.methodName,
26
26
  args = _ref.args,
@@ -77,7 +77,7 @@ export function _buildEventPayloadsForHits(_ref) {
77
77
  eventType: eventType,
78
78
  payload: _objectSpread({
79
79
  eventName: eventName || 'Hits Viewed',
80
- index: index,
80
+ index: getIndex(),
81
81
  objectIDs: objectIDsByChunk[i]
82
82
  }, additionalData),
83
83
  hits: batch,
@@ -92,7 +92,7 @@ export function _buildEventPayloadsForHits(_ref) {
92
92
  eventType: eventType,
93
93
  payload: _objectSpread({
94
94
  eventName: eventName || 'Hit Clicked',
95
- index: index,
95
+ index: getIndex(),
96
96
  queryID: queryID,
97
97
  objectIDs: objectIDsByChunk[i],
98
98
  positions: positionsByChunk[i]
@@ -109,7 +109,7 @@ export function _buildEventPayloadsForHits(_ref) {
109
109
  eventType: eventType,
110
110
  payload: _objectSpread({
111
111
  eventName: eventName || 'Hit Converted',
112
- index: index,
112
+ index: getIndex(),
113
113
  queryID: queryID,
114
114
  objectIDs: objectIDsByChunk[i]
115
115
  }, additionalData),
@@ -125,7 +125,7 @@ export function _buildEventPayloadsForHits(_ref) {
125
125
  }
126
126
  export function createSendEventForHits(_ref2) {
127
127
  var instantSearchInstance = _ref2.instantSearchInstance,
128
- index = _ref2.index,
128
+ getIndex = _ref2.getIndex,
129
129
  widgetType = _ref2.widgetType;
130
130
  var sentEvents = {};
131
131
  var timer = undefined;
@@ -135,7 +135,7 @@ export function createSendEventForHits(_ref2) {
135
135
  }
136
136
  var payloads = _buildEventPayloadsForHits({
137
137
  widgetType: widgetType,
138
- index: index,
138
+ getIndex: getIndex,
139
139
  methodName: 'sendEvent',
140
140
  args: args,
141
141
  instantSearchInstance: instantSearchInstance
@@ -155,7 +155,7 @@ export function createSendEventForHits(_ref2) {
155
155
  return sendEventForHits;
156
156
  }
157
157
  export function createBindEventForHits(_ref3) {
158
- var index = _ref3.index,
158
+ var getIndex = _ref3.getIndex,
159
159
  widgetType = _ref3.widgetType,
160
160
  instantSearchInstance = _ref3.instantSearchInstance;
161
161
  var bindEventForHits = function bindEventForHits() {
@@ -164,7 +164,7 @@ export function createBindEventForHits(_ref3) {
164
164
  }
165
165
  var payloads = _buildEventPayloadsForHits({
166
166
  widgetType: widgetType,
167
- index: index,
167
+ getIndex: getIndex,
168
168
  methodName: 'bindEvent',
169
169
  args: args,
170
170
  instantSearchInstance: instantSearchInstance
@@ -1,2 +1,2 @@
1
- declare const _default: "4.64.2";
1
+ declare const _default: "4.64.3";
2
2
  export default _default;
package/es/lib/version.js CHANGED
@@ -1 +1 @@
1
- export default '4.64.2';
1
+ export default '4.64.3';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instantsearch.js",
3
- "version": "4.64.2",
3
+ "version": "4.64.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",
@@ -55,9 +55,9 @@
55
55
  "version": "./scripts/version/update-version.js"
56
56
  },
57
57
  "devDependencies": {
58
- "@instantsearch/mocks": "1.36.0",
59
- "@instantsearch/tests": "1.36.0",
60
- "@instantsearch/testutils": "1.25.0",
58
+ "@instantsearch/mocks": "1.37.0",
59
+ "@instantsearch/tests": "1.37.0",
60
+ "@instantsearch/testutils": "1.26.0",
61
61
  "@storybook/html": "5.3.9",
62
62
  "@types/scriptjs": "0.0.2",
63
63
  "algoliasearch": "4.14.3",
@@ -65,5 +65,5 @@
65
65
  "scriptjs": "2.5.9",
66
66
  "webpack": "4.47.0"
67
67
  },
68
- "gitHead": "c8411331353d700fab508849c7e93f782f37e4e6"
68
+ "gitHead": "9afbaecd8ae25e3b3746be05f858a83b03843102"
69
69
  }