algolia-experiences 1.5.11 → 1.5.13
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.
|
@@ -5844,7 +5844,7 @@
|
|
|
5844
5844
|
|
|
5845
5845
|
var sortAndMergeRecommendations_1 = sortAndMergeRecommendations;
|
|
5846
5846
|
|
|
5847
|
-
var version = '3.
|
|
5847
|
+
var version = '3.26.0';
|
|
5848
5848
|
|
|
5849
5849
|
var escapeFacetValue$3 = escapeFacetValue_1.escapeFacetValue;
|
|
5850
5850
|
|
|
@@ -6280,6 +6280,16 @@
|
|
|
6280
6280
|
query: query,
|
|
6281
6281
|
});
|
|
6282
6282
|
|
|
6283
|
+
var hide =
|
|
6284
|
+
(this.lastResults &&
|
|
6285
|
+
this.lastResults.index === state.index &&
|
|
6286
|
+
this.lastResults.renderingContent &&
|
|
6287
|
+
this.lastResults.renderingContent.facetOrdering &&
|
|
6288
|
+
this.lastResults.renderingContent.facetOrdering.values &&
|
|
6289
|
+
this.lastResults.renderingContent.facetOrdering.values[facet] &&
|
|
6290
|
+
this.lastResults.renderingContent.facetOrdering.values[facet].hide) ||
|
|
6291
|
+
[];
|
|
6292
|
+
|
|
6283
6293
|
return searchForFacetValuesPromise.then(
|
|
6284
6294
|
function addIsRefined(content) {
|
|
6285
6295
|
self._currentNbQueries--;
|
|
@@ -6287,7 +6297,11 @@
|
|
|
6287
6297
|
|
|
6288
6298
|
content = Array.isArray(content) ? content[0] : content;
|
|
6289
6299
|
|
|
6290
|
-
content.facetHits.forEach(function (f) {
|
|
6300
|
+
content.facetHits.forEach(function (f, i) {
|
|
6301
|
+
if (hide.indexOf(f.value) > -1) {
|
|
6302
|
+
content.facetHits.splice(i, 1);
|
|
6303
|
+
return;
|
|
6304
|
+
}
|
|
6291
6305
|
f.escapedValue = escapeFacetValue$3(f.value);
|
|
6292
6306
|
f.isRefined = isDisjunctive
|
|
6293
6307
|
? state.isDisjunctiveFacetRefined(facet, f.escapedValue)
|
|
@@ -13055,7 +13069,7 @@
|
|
|
13055
13069
|
};
|
|
13056
13070
|
}
|
|
13057
13071
|
|
|
13058
|
-
var version$1 = '4.
|
|
13072
|
+
var version$1 = '4.79.1';
|
|
13059
13073
|
|
|
13060
13074
|
function _typeof$j(o) {
|
|
13061
13075
|
"@babel/helpers - typeof";
|
|
@@ -13255,6 +13269,8 @@
|
|
|
13255
13269
|
_defineProperty$h(_assertThisInitialized$1(_this), "_searchStalledTimer", void 0);
|
|
13256
13270
|
_defineProperty$h(_assertThisInitialized$1(_this), "_initialUiState", void 0);
|
|
13257
13271
|
_defineProperty$h(_assertThisInitialized$1(_this), "_initialResults", void 0);
|
|
13272
|
+
_defineProperty$h(_assertThisInitialized$1(_this), "_manuallyResetScheduleSearch", false);
|
|
13273
|
+
_defineProperty$h(_assertThisInitialized$1(_this), "_resetScheduleSearch", void 0);
|
|
13258
13274
|
_defineProperty$h(_assertThisInitialized$1(_this), "_createURL", void 0);
|
|
13259
13275
|
_defineProperty$h(_assertThisInitialized$1(_this), "_searchFunction", void 0);
|
|
13260
13276
|
_defineProperty$h(_assertThisInitialized$1(_this), "_mainHelperSearch", void 0);
|
|
@@ -13647,14 +13663,25 @@
|
|
|
13647
13663
|
// because we already have the results to render. This skips the initial
|
|
13648
13664
|
// network request on the browser on `start`.
|
|
13649
13665
|
this.scheduleSearch = defer(noop);
|
|
13650
|
-
|
|
13651
|
-
|
|
13652
|
-
|
|
13653
|
-
|
|
13654
|
-
|
|
13655
|
-
|
|
13656
|
-
|
|
13657
|
-
|
|
13666
|
+
if (this._manuallyResetScheduleSearch) {
|
|
13667
|
+
// If `_manuallyResetScheduleSearch` is passed, it means that we don't
|
|
13668
|
+
// want to rely on a single `defer` to reset the `scheduleSearch`.
|
|
13669
|
+
// Instead, the consumer will call `_resetScheduleSearch` to restore
|
|
13670
|
+
// the original `scheduleSearch` function.
|
|
13671
|
+
// This happens in the React flavour after rendering.
|
|
13672
|
+
this._resetScheduleSearch = function () {
|
|
13673
|
+
_this3.scheduleSearch = originalScheduleSearch;
|
|
13674
|
+
};
|
|
13675
|
+
} else {
|
|
13676
|
+
// We also skip the initial network request when widgets are dynamically
|
|
13677
|
+
// added in the first tick (that's the case in all the framework-based flavors).
|
|
13678
|
+
// When we add a widget to `index`, it calls `scheduleSearch`. We can rely
|
|
13679
|
+
// on our `defer` util to restore the original `scheduleSearch` value once
|
|
13680
|
+
// widgets are added to hook back to the regular lifecycle.
|
|
13681
|
+
defer(function () {
|
|
13682
|
+
_this3.scheduleSearch = originalScheduleSearch;
|
|
13683
|
+
})();
|
|
13684
|
+
}
|
|
13658
13685
|
}
|
|
13659
13686
|
// We only schedule a search when widgets have been added before `start()`
|
|
13660
13687
|
// because there are listeners that can use these results.
|
|
@@ -13894,18 +13921,13 @@
|
|
|
13894
13921
|
|
|
13895
13922
|
var _extends_1 = createCommonjsModule(function (module) {
|
|
13896
13923
|
function _extends() {
|
|
13897
|
-
module.exports = _extends = Object.assign ? Object.assign.bind() : function (
|
|
13898
|
-
for (var
|
|
13899
|
-
var
|
|
13900
|
-
for (var
|
|
13901
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
13902
|
-
target[key] = source[key];
|
|
13903
|
-
}
|
|
13904
|
-
}
|
|
13924
|
+
return module.exports = _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
13925
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
13926
|
+
var t = arguments[e];
|
|
13927
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
13905
13928
|
}
|
|
13906
|
-
return
|
|
13907
|
-
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
13908
|
-
return _extends.apply(this, arguments);
|
|
13929
|
+
return n;
|
|
13930
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _extends.apply(null, arguments);
|
|
13909
13931
|
}
|
|
13910
13932
|
module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
13911
13933
|
});
|
|
@@ -13913,63 +13935,57 @@
|
|
|
13913
13935
|
var _extends$1 = unwrapExports(_extends_1);
|
|
13914
13936
|
|
|
13915
13937
|
var _typeof_1 = createCommonjsModule(function (module) {
|
|
13916
|
-
function _typeof(
|
|
13938
|
+
function _typeof(o) {
|
|
13917
13939
|
"@babel/helpers - typeof";
|
|
13918
13940
|
|
|
13919
|
-
return
|
|
13920
|
-
return typeof
|
|
13921
|
-
} : function (
|
|
13922
|
-
return
|
|
13923
|
-
}, module.exports.__esModule = true, module.exports["default"] = module.exports
|
|
13941
|
+
return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
13942
|
+
return typeof o;
|
|
13943
|
+
} : function (o) {
|
|
13944
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
13945
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
|
|
13924
13946
|
}
|
|
13925
13947
|
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
13926
13948
|
});
|
|
13927
13949
|
|
|
13928
13950
|
unwrapExports(_typeof_1);
|
|
13929
13951
|
|
|
13930
|
-
var
|
|
13952
|
+
var toPrimitive_1 = createCommonjsModule(function (module) {
|
|
13931
13953
|
var _typeof = _typeof_1["default"];
|
|
13932
|
-
function
|
|
13933
|
-
if (
|
|
13934
|
-
var
|
|
13935
|
-
if (
|
|
13936
|
-
var
|
|
13937
|
-
if (
|
|
13954
|
+
function toPrimitive(t, r) {
|
|
13955
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
13956
|
+
var e = t[Symbol.toPrimitive];
|
|
13957
|
+
if (void 0 !== e) {
|
|
13958
|
+
var i = e.call(t, r || "default");
|
|
13959
|
+
if ("object" != _typeof(i)) return i;
|
|
13938
13960
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
13939
13961
|
}
|
|
13940
|
-
return (
|
|
13962
|
+
return ("string" === r ? String : Number)(t);
|
|
13941
13963
|
}
|
|
13942
|
-
module.exports =
|
|
13964
|
+
module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
13943
13965
|
});
|
|
13944
13966
|
|
|
13945
|
-
unwrapExports(
|
|
13967
|
+
unwrapExports(toPrimitive_1);
|
|
13946
13968
|
|
|
13947
|
-
var
|
|
13969
|
+
var toPropertyKey_1 = createCommonjsModule(function (module) {
|
|
13948
13970
|
var _typeof = _typeof_1["default"];
|
|
13949
13971
|
|
|
13950
|
-
function
|
|
13951
|
-
var
|
|
13952
|
-
return _typeof(
|
|
13972
|
+
function toPropertyKey(t) {
|
|
13973
|
+
var i = toPrimitive_1(t, "string");
|
|
13974
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
13953
13975
|
}
|
|
13954
|
-
module.exports =
|
|
13976
|
+
module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
13955
13977
|
});
|
|
13956
13978
|
|
|
13957
|
-
unwrapExports(
|
|
13979
|
+
unwrapExports(toPropertyKey_1);
|
|
13958
13980
|
|
|
13959
13981
|
var defineProperty = createCommonjsModule(function (module) {
|
|
13960
|
-
function _defineProperty(
|
|
13961
|
-
|
|
13962
|
-
|
|
13963
|
-
|
|
13964
|
-
|
|
13965
|
-
|
|
13966
|
-
|
|
13967
|
-
writable: true
|
|
13968
|
-
});
|
|
13969
|
-
} else {
|
|
13970
|
-
obj[key] = value;
|
|
13971
|
-
}
|
|
13972
|
-
return obj;
|
|
13982
|
+
function _defineProperty(e, r, t) {
|
|
13983
|
+
return (r = toPropertyKey_1(r)) in e ? Object.defineProperty(e, r, {
|
|
13984
|
+
value: t,
|
|
13985
|
+
enumerable: !0,
|
|
13986
|
+
configurable: !0,
|
|
13987
|
+
writable: !0
|
|
13988
|
+
}) : e[r] = t, e;
|
|
13973
13989
|
}
|
|
13974
13990
|
module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
13975
13991
|
});
|
|
@@ -13977,17 +13993,14 @@
|
|
|
13977
13993
|
var _defineProperty$i = unwrapExports(defineProperty);
|
|
13978
13994
|
|
|
13979
13995
|
var objectWithoutPropertiesLoose = createCommonjsModule(function (module) {
|
|
13980
|
-
function _objectWithoutPropertiesLoose(
|
|
13981
|
-
if (
|
|
13982
|
-
var
|
|
13983
|
-
var
|
|
13984
|
-
|
|
13985
|
-
|
|
13986
|
-
key = sourceKeys[i];
|
|
13987
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
13988
|
-
target[key] = source[key];
|
|
13996
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
13997
|
+
if (null == r) return {};
|
|
13998
|
+
var t = {};
|
|
13999
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
14000
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
14001
|
+
t[n] = r[n];
|
|
13989
14002
|
}
|
|
13990
|
-
return
|
|
14003
|
+
return t;
|
|
13991
14004
|
}
|
|
13992
14005
|
module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
13993
14006
|
});
|
|
@@ -13995,20 +14008,16 @@
|
|
|
13995
14008
|
unwrapExports(objectWithoutPropertiesLoose);
|
|
13996
14009
|
|
|
13997
14010
|
var objectWithoutProperties = createCommonjsModule(function (module) {
|
|
13998
|
-
function _objectWithoutProperties(
|
|
13999
|
-
if (
|
|
14000
|
-
var
|
|
14001
|
-
|
|
14011
|
+
function _objectWithoutProperties(e, t) {
|
|
14012
|
+
if (null == e) return {};
|
|
14013
|
+
var o,
|
|
14014
|
+
r,
|
|
14015
|
+
i = objectWithoutPropertiesLoose(e, t);
|
|
14002
14016
|
if (Object.getOwnPropertySymbols) {
|
|
14003
|
-
var
|
|
14004
|
-
for (
|
|
14005
|
-
key = sourceSymbolKeys[i];
|
|
14006
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
14007
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
14008
|
-
target[key] = source[key];
|
|
14009
|
-
}
|
|
14017
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
14018
|
+
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
14010
14019
|
}
|
|
14011
|
-
return
|
|
14020
|
+
return i;
|
|
14012
14021
|
}
|
|
14013
14022
|
module.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
14014
14023
|
});
|
|
@@ -17129,9 +17138,7 @@
|
|
|
17129
17138
|
if (!results || state.hierarchicalFacets.length === 0) {
|
|
17130
17139
|
return [];
|
|
17131
17140
|
}
|
|
17132
|
-
var
|
|
17133
|
-
facetName = _state$hierarchicalFa[0].name;
|
|
17134
|
-
var facetValues = results.getFacetValues(facetName, {});
|
|
17141
|
+
var facetValues = results.getFacetValues(hierarchicalFacetName, {});
|
|
17135
17142
|
var facetItems = facetValues && !Array.isArray(facetValues) && facetValues.data ? facetValues.data : [];
|
|
17136
17143
|
var items = transformItems(shiftItemsValues(prepareItems(facetItems)), {
|
|
17137
17144
|
results: results
|
|
@@ -19003,6 +19010,9 @@
|
|
|
19003
19010
|
}, {
|
|
19004
19011
|
key: "refineFirstValue",
|
|
19005
19012
|
value: function refineFirstValue() {
|
|
19013
|
+
if (this.props.searchableSelectOnSubmit === false) {
|
|
19014
|
+
return;
|
|
19015
|
+
}
|
|
19006
19016
|
var firstValue = this.props.facetValues && this.props.facetValues[0];
|
|
19007
19017
|
if (firstValue) {
|
|
19008
19018
|
var actualValue = firstValue.value;
|
|
@@ -21109,9 +21119,11 @@
|
|
|
21109
21119
|
state: normalizeState(state)
|
|
21110
21120
|
}) || {};
|
|
21111
21121
|
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];
|
|
21112
|
-
if (!
|
|
21122
|
+
if (!showPrevious) {
|
|
21113
21123
|
showPrevious = getShowPrevious(helper);
|
|
21114
21124
|
showMore = getShowMore(helper);
|
|
21125
|
+
}
|
|
21126
|
+
if (!sendEvent) {
|
|
21115
21127
|
sendEvent = createSendEventForHits({
|
|
21116
21128
|
instantSearchInstance: instantSearchInstance,
|
|
21117
21129
|
helper: helper,
|
|
@@ -21122,6 +21134,8 @@
|
|
|
21122
21134
|
widgetType: this.$$type,
|
|
21123
21135
|
instantSearchInstance: instantSearchInstance
|
|
21124
21136
|
});
|
|
21137
|
+
}
|
|
21138
|
+
if (!results) {
|
|
21125
21139
|
isFirstPage = state.page === undefined || getFirstReceivedPage(state, cachedHits) === 0;
|
|
21126
21140
|
} else {
|
|
21127
21141
|
var _state$disjunctiveFac, _state$hierarchicalFa;
|
|
@@ -27098,7 +27112,8 @@
|
|
|
27098
27112
|
showMore = _ref.showMore,
|
|
27099
27113
|
searchable = _ref.searchable,
|
|
27100
27114
|
searchablePlaceholder = _ref.searchablePlaceholder,
|
|
27101
|
-
searchableIsAlwaysActive = _ref.searchableIsAlwaysActive
|
|
27115
|
+
searchableIsAlwaysActive = _ref.searchableIsAlwaysActive,
|
|
27116
|
+
searchableSelectOnSubmit = _ref.searchableSelectOnSubmit;
|
|
27102
27117
|
return function (_ref2, isFirstRendering) {
|
|
27103
27118
|
var refine = _ref2.refine,
|
|
27104
27119
|
items = _ref2.items,
|
|
@@ -27138,7 +27153,8 @@
|
|
|
27138
27153
|
toggleShowMore: toggleShowMore,
|
|
27139
27154
|
isShowingMore: isShowingMore,
|
|
27140
27155
|
hasExhaustiveItems: hasExhaustiveItems,
|
|
27141
|
-
canToggleShowMore: canToggleShowMore
|
|
27156
|
+
canToggleShowMore: canToggleShowMore,
|
|
27157
|
+
searchableSelectOnSubmit: searchableSelectOnSubmit
|
|
27142
27158
|
}), containerNode);
|
|
27143
27159
|
};
|
|
27144
27160
|
};
|
|
@@ -27178,6 +27194,8 @@
|
|
|
27178
27194
|
searchableEscapeFacetValues = _ref3$searchableEscap === void 0 ? true : _ref3$searchableEscap,
|
|
27179
27195
|
_ref3$searchableIsAlw = _ref3.searchableIsAlwaysActive,
|
|
27180
27196
|
searchableIsAlwaysActive = _ref3$searchableIsAlw === void 0 ? true : _ref3$searchableIsAlw,
|
|
27197
|
+
_ref3$searchableSelec = _ref3.searchableSelectOnSubmit,
|
|
27198
|
+
searchableSelectOnSubmit = _ref3$searchableSelec === void 0 ? true : _ref3$searchableSelec,
|
|
27181
27199
|
_ref3$cssClasses = _ref3.cssClasses,
|
|
27182
27200
|
userCssClasses = _ref3$cssClasses === void 0 ? {} : _ref3$cssClasses,
|
|
27183
27201
|
_ref3$templates = _ref3.templates,
|
|
@@ -27269,6 +27287,7 @@
|
|
|
27269
27287
|
searchable: searchable,
|
|
27270
27288
|
searchablePlaceholder: searchablePlaceholder,
|
|
27271
27289
|
searchableIsAlwaysActive: searchableIsAlwaysActive,
|
|
27290
|
+
searchableSelectOnSubmit: searchableSelectOnSubmit,
|
|
27272
27291
|
showMore: showMore
|
|
27273
27292
|
});
|
|
27274
27293
|
var makeWidget = connectRefinementList(specializedRenderer, function () {
|