instantsearch.js 4.79.0 → 4.79.2
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/infinite-hits/connectInfiniteHits.js +19 -13
- package/cjs/lib/version.js +1 -1
- package/dist/instantsearch.development.js +71 -83
- 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/infinite-hits/connectInfiniteHits.js +19 -13
- package/es/lib/version.d.ts +1 -1
- package/es/lib/version.js +1 -1
- package/package.json +6 -6
|
@@ -98,22 +98,20 @@ var connectInfiniteHits = exports.default = function connectInfiniteHits(renderF
|
|
|
98
98
|
return Math.max.apply(Math, [page].concat(_toConsumableArray(pages)));
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
|
-
var getShowPrevious = function getShowPrevious(helper) {
|
|
101
|
+
var getShowPrevious = function getShowPrevious(helper, getCachedHits) {
|
|
102
102
|
return function () {
|
|
103
|
+
var cachedHits = getCachedHits();
|
|
103
104
|
// Using the helper's `overrideStateWithoutTriggeringChangeEvent` method
|
|
104
105
|
// avoid updating the browser URL when the user displays the previous page.
|
|
105
106
|
helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread(_objectSpread({}, helper.state), {}, {
|
|
106
|
-
page: getFirstReceivedPage(helper.state,
|
|
107
|
-
state: normalizeState(helper.state)
|
|
108
|
-
}) || {}) - 1
|
|
107
|
+
page: getFirstReceivedPage(helper.state, cachedHits) - 1
|
|
109
108
|
})).searchWithoutTriggeringOnStateChange();
|
|
110
109
|
};
|
|
111
110
|
};
|
|
112
|
-
var getShowMore = function getShowMore(helper) {
|
|
111
|
+
var getShowMore = function getShowMore(helper, getCachedHits) {
|
|
113
112
|
return function () {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}) || {}) + 1).search();
|
|
113
|
+
var cachedHits = getCachedHits();
|
|
114
|
+
helper.setPage(getLastReceivedPage(helper.state, cachedHits) + 1).search();
|
|
117
115
|
};
|
|
118
116
|
};
|
|
119
117
|
return {
|
|
@@ -145,6 +143,12 @@ var connectInfiniteHits = exports.default = function connectInfiniteHits(renderF
|
|
|
145
143
|
parent = _ref6.parent,
|
|
146
144
|
existingState = _ref6.state,
|
|
147
145
|
instantSearchInstance = _ref6.instantSearchInstance;
|
|
146
|
+
var getCacheHits = function getCacheHits() {
|
|
147
|
+
var state = parent.getPreviousState() || existingState;
|
|
148
|
+
return cache.read({
|
|
149
|
+
state: normalizeState(state)
|
|
150
|
+
}) || {};
|
|
151
|
+
};
|
|
148
152
|
var isFirstPage;
|
|
149
153
|
var currentPageHits = [];
|
|
150
154
|
/**
|
|
@@ -153,13 +157,15 @@ var connectInfiniteHits = exports.default = function connectInfiniteHits(renderF
|
|
|
153
157
|
* is loading.
|
|
154
158
|
*/
|
|
155
159
|
var state = parent.getPreviousState() || existingState;
|
|
156
|
-
var cachedHits =
|
|
157
|
-
state: normalizeState(state)
|
|
158
|
-
}) || {};
|
|
160
|
+
var cachedHits = getCacheHits();
|
|
159
161
|
var banner = results === null || results === void 0 ? void 0 : (_results$renderingCon = results.renderingContent) === null || _results$renderingCon === void 0 ? void 0 : (_results$renderingCon2 = _results$renderingCon.widgets) === null || _results$renderingCon2 === void 0 ? void 0 : (_results$renderingCon3 = _results$renderingCon2.banners) === null || _results$renderingCon3 === void 0 ? void 0 : _results$renderingCon3[0];
|
|
160
162
|
if (!showPrevious) {
|
|
161
|
-
showPrevious =
|
|
162
|
-
|
|
163
|
+
showPrevious = function showPrevious() {
|
|
164
|
+
return getShowPrevious(helper, getCacheHits)();
|
|
165
|
+
};
|
|
166
|
+
showMore = function showMore() {
|
|
167
|
+
return getShowMore(helper, getCacheHits)();
|
|
168
|
+
};
|
|
163
169
|
}
|
|
164
170
|
if (!sendEvent) {
|
|
165
171
|
sendEvent = (0, _utils.createSendEventForHits)({
|
package/cjs/lib/version.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! InstantSearch.js 4.79.
|
|
1
|
+
/*! InstantSearch.js 4.79.2 | © 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) :
|
|
@@ -10235,22 +10235,20 @@
|
|
|
10235
10235
|
return Math.max.apply(Math, [page].concat(_toConsumableArray(pages)));
|
|
10236
10236
|
}
|
|
10237
10237
|
};
|
|
10238
|
-
var getShowPrevious = function getShowPrevious(helper) {
|
|
10238
|
+
var getShowPrevious = function getShowPrevious(helper, getCachedHits) {
|
|
10239
10239
|
return function () {
|
|
10240
|
+
var cachedHits = getCachedHits();
|
|
10240
10241
|
// Using the helper's `overrideStateWithoutTriggeringChangeEvent` method
|
|
10241
10242
|
// avoid updating the browser URL when the user displays the previous page.
|
|
10242
10243
|
helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread2(_objectSpread2({}, helper.state), {}, {
|
|
10243
|
-
page: getFirstReceivedPage(helper.state,
|
|
10244
|
-
state: normalizeState(helper.state)
|
|
10245
|
-
}) || {}) - 1
|
|
10244
|
+
page: getFirstReceivedPage(helper.state, cachedHits) - 1
|
|
10246
10245
|
})).searchWithoutTriggeringOnStateChange();
|
|
10247
10246
|
};
|
|
10248
10247
|
};
|
|
10249
|
-
var getShowMore = function getShowMore(helper) {
|
|
10248
|
+
var getShowMore = function getShowMore(helper, getCachedHits) {
|
|
10250
10249
|
return function () {
|
|
10251
|
-
|
|
10252
|
-
|
|
10253
|
-
}) || {}) + 1).search();
|
|
10250
|
+
var cachedHits = getCachedHits();
|
|
10251
|
+
helper.setPage(getLastReceivedPage(helper.state, cachedHits) + 1).search();
|
|
10254
10252
|
};
|
|
10255
10253
|
};
|
|
10256
10254
|
return {
|
|
@@ -10282,6 +10280,12 @@
|
|
|
10282
10280
|
parent = _ref6.parent,
|
|
10283
10281
|
existingState = _ref6.state,
|
|
10284
10282
|
instantSearchInstance = _ref6.instantSearchInstance;
|
|
10283
|
+
var getCacheHits = function getCacheHits() {
|
|
10284
|
+
var state = parent.getPreviousState() || existingState;
|
|
10285
|
+
return cache.read({
|
|
10286
|
+
state: normalizeState(state)
|
|
10287
|
+
}) || {};
|
|
10288
|
+
};
|
|
10285
10289
|
var isFirstPage;
|
|
10286
10290
|
var currentPageHits = [];
|
|
10287
10291
|
/**
|
|
@@ -10290,13 +10294,15 @@
|
|
|
10290
10294
|
* is loading.
|
|
10291
10295
|
*/
|
|
10292
10296
|
var state = parent.getPreviousState() || existingState;
|
|
10293
|
-
var cachedHits =
|
|
10294
|
-
state: normalizeState(state)
|
|
10295
|
-
}) || {};
|
|
10297
|
+
var cachedHits = getCacheHits();
|
|
10296
10298
|
var banner = results === null || results === void 0 ? void 0 : (_results$renderingCon = results.renderingContent) === null || _results$renderingCon === void 0 ? void 0 : (_results$renderingCon2 = _results$renderingCon.widgets) === null || _results$renderingCon2 === void 0 ? void 0 : (_results$renderingCon3 = _results$renderingCon2.banners) === null || _results$renderingCon3 === void 0 ? void 0 : _results$renderingCon3[0];
|
|
10297
10299
|
if (!showPrevious) {
|
|
10298
|
-
showPrevious =
|
|
10299
|
-
|
|
10300
|
+
showPrevious = function showPrevious() {
|
|
10301
|
+
return getShowPrevious(helper, getCacheHits)();
|
|
10302
|
+
};
|
|
10303
|
+
showMore = function showMore() {
|
|
10304
|
+
return getShowMore(helper, getCacheHits)();
|
|
10305
|
+
};
|
|
10300
10306
|
}
|
|
10301
10307
|
if (!sendEvent) {
|
|
10302
10308
|
sendEvent = createSendEventForHits({
|
|
@@ -16434,7 +16440,7 @@
|
|
|
16434
16440
|
};
|
|
16435
16441
|
}
|
|
16436
16442
|
|
|
16437
|
-
var version$1 = '4.79.
|
|
16443
|
+
var version$1 = '4.79.2';
|
|
16438
16444
|
|
|
16439
16445
|
var withUsage$v = createDocumentationMessageGenerator({
|
|
16440
16446
|
name: 'instantsearch'
|
|
@@ -17123,18 +17129,13 @@
|
|
|
17123
17129
|
|
|
17124
17130
|
var _extends_1 = createCommonjsModule(function (module) {
|
|
17125
17131
|
function _extends() {
|
|
17126
|
-
module.exports = _extends = Object.assign ? Object.assign.bind() : function (
|
|
17127
|
-
for (var
|
|
17128
|
-
var
|
|
17129
|
-
for (var
|
|
17130
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
17131
|
-
target[key] = source[key];
|
|
17132
|
-
}
|
|
17133
|
-
}
|
|
17132
|
+
return module.exports = _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
17133
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
17134
|
+
var t = arguments[e];
|
|
17135
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
17134
17136
|
}
|
|
17135
|
-
return
|
|
17136
|
-
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
17137
|
-
return _extends.apply(this, arguments);
|
|
17137
|
+
return n;
|
|
17138
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _extends.apply(null, arguments);
|
|
17138
17139
|
}
|
|
17139
17140
|
module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
17140
17141
|
});
|
|
@@ -17142,63 +17143,57 @@
|
|
|
17142
17143
|
var _extends$1 = unwrapExports(_extends_1);
|
|
17143
17144
|
|
|
17144
17145
|
var _typeof_1 = createCommonjsModule(function (module) {
|
|
17145
|
-
function _typeof(
|
|
17146
|
+
function _typeof(o) {
|
|
17146
17147
|
"@babel/helpers - typeof";
|
|
17147
17148
|
|
|
17148
|
-
return
|
|
17149
|
-
return typeof
|
|
17150
|
-
} : function (
|
|
17151
|
-
return
|
|
17152
|
-
}, module.exports.__esModule = true, module.exports["default"] = module.exports
|
|
17149
|
+
return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
17150
|
+
return typeof o;
|
|
17151
|
+
} : function (o) {
|
|
17152
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
17153
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
|
|
17153
17154
|
}
|
|
17154
17155
|
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
17155
17156
|
});
|
|
17156
17157
|
|
|
17157
17158
|
unwrapExports(_typeof_1);
|
|
17158
17159
|
|
|
17159
|
-
var
|
|
17160
|
+
var toPrimitive_1 = createCommonjsModule(function (module) {
|
|
17160
17161
|
var _typeof = _typeof_1["default"];
|
|
17161
|
-
function
|
|
17162
|
-
if (
|
|
17163
|
-
var
|
|
17164
|
-
if (
|
|
17165
|
-
var
|
|
17166
|
-
if (
|
|
17162
|
+
function toPrimitive(t, r) {
|
|
17163
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
17164
|
+
var e = t[Symbol.toPrimitive];
|
|
17165
|
+
if (void 0 !== e) {
|
|
17166
|
+
var i = e.call(t, r || "default");
|
|
17167
|
+
if ("object" != _typeof(i)) return i;
|
|
17167
17168
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
17168
17169
|
}
|
|
17169
|
-
return (
|
|
17170
|
+
return ("string" === r ? String : Number)(t);
|
|
17170
17171
|
}
|
|
17171
|
-
module.exports =
|
|
17172
|
+
module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
17172
17173
|
});
|
|
17173
17174
|
|
|
17174
|
-
unwrapExports(
|
|
17175
|
+
unwrapExports(toPrimitive_1);
|
|
17175
17176
|
|
|
17176
|
-
var
|
|
17177
|
+
var toPropertyKey_1 = createCommonjsModule(function (module) {
|
|
17177
17178
|
var _typeof = _typeof_1["default"];
|
|
17178
17179
|
|
|
17179
|
-
function
|
|
17180
|
-
var
|
|
17181
|
-
return _typeof(
|
|
17180
|
+
function toPropertyKey(t) {
|
|
17181
|
+
var i = toPrimitive_1(t, "string");
|
|
17182
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
17182
17183
|
}
|
|
17183
|
-
module.exports =
|
|
17184
|
+
module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
17184
17185
|
});
|
|
17185
17186
|
|
|
17186
|
-
unwrapExports(
|
|
17187
|
+
unwrapExports(toPropertyKey_1);
|
|
17187
17188
|
|
|
17188
17189
|
var defineProperty = createCommonjsModule(function (module) {
|
|
17189
|
-
function _defineProperty(
|
|
17190
|
-
|
|
17191
|
-
|
|
17192
|
-
|
|
17193
|
-
|
|
17194
|
-
|
|
17195
|
-
|
|
17196
|
-
writable: true
|
|
17197
|
-
});
|
|
17198
|
-
} else {
|
|
17199
|
-
obj[key] = value;
|
|
17200
|
-
}
|
|
17201
|
-
return obj;
|
|
17190
|
+
function _defineProperty(e, r, t) {
|
|
17191
|
+
return (r = toPropertyKey_1(r)) in e ? Object.defineProperty(e, r, {
|
|
17192
|
+
value: t,
|
|
17193
|
+
enumerable: !0,
|
|
17194
|
+
configurable: !0,
|
|
17195
|
+
writable: !0
|
|
17196
|
+
}) : e[r] = t, e;
|
|
17202
17197
|
}
|
|
17203
17198
|
module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
17204
17199
|
});
|
|
@@ -17206,17 +17201,14 @@
|
|
|
17206
17201
|
var _defineProperty$1 = unwrapExports(defineProperty);
|
|
17207
17202
|
|
|
17208
17203
|
var objectWithoutPropertiesLoose = createCommonjsModule(function (module) {
|
|
17209
|
-
function _objectWithoutPropertiesLoose(
|
|
17210
|
-
if (
|
|
17211
|
-
var
|
|
17212
|
-
var
|
|
17213
|
-
|
|
17214
|
-
|
|
17215
|
-
key = sourceKeys[i];
|
|
17216
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
17217
|
-
target[key] = source[key];
|
|
17204
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
17205
|
+
if (null == r) return {};
|
|
17206
|
+
var t = {};
|
|
17207
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
17208
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
17209
|
+
t[n] = r[n];
|
|
17218
17210
|
}
|
|
17219
|
-
return
|
|
17211
|
+
return t;
|
|
17220
17212
|
}
|
|
17221
17213
|
module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
17222
17214
|
});
|
|
@@ -17224,20 +17216,16 @@
|
|
|
17224
17216
|
unwrapExports(objectWithoutPropertiesLoose);
|
|
17225
17217
|
|
|
17226
17218
|
var objectWithoutProperties = createCommonjsModule(function (module) {
|
|
17227
|
-
function _objectWithoutProperties(
|
|
17228
|
-
if (
|
|
17229
|
-
var
|
|
17230
|
-
|
|
17219
|
+
function _objectWithoutProperties(e, t) {
|
|
17220
|
+
if (null == e) return {};
|
|
17221
|
+
var o,
|
|
17222
|
+
r,
|
|
17223
|
+
i = objectWithoutPropertiesLoose(e, t);
|
|
17231
17224
|
if (Object.getOwnPropertySymbols) {
|
|
17232
|
-
var
|
|
17233
|
-
for (
|
|
17234
|
-
key = sourceSymbolKeys[i];
|
|
17235
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
17236
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
17237
|
-
target[key] = source[key];
|
|
17238
|
-
}
|
|
17225
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
17226
|
+
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
17239
17227
|
}
|
|
17240
|
-
return
|
|
17228
|
+
return i;
|
|
17241
17229
|
}
|
|
17242
17230
|
module.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
17243
17231
|
});
|