instantsearch.js 4.53.0 → 4.54.0
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/hierarchical-menu/connectHierarchicalMenu.js +4 -0
- package/cjs/connectors/menu/connectMenu.js +4 -0
- package/cjs/connectors/refinement-list/connectRefinementList.js +8 -0
- package/cjs/connectors/toggle-refinement/connectToggleRefinement.js +4 -0
- package/cjs/lib/version.js +1 -1
- package/cjs/widgets/places/places.js +1 -0
- package/dist/instantsearch.development.js +23 -2
- 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/hierarchical-menu/connectHierarchicalMenu.js +4 -0
- package/es/connectors/menu/connectMenu.js +5 -1
- package/es/connectors/refinement-list/connectRefinementList.js +9 -1
- package/es/connectors/toggle-refinement/connectToggleRefinement.js +5 -1
- package/es/lib/version.d.ts +1 -1
- package/es/lib/version.js +1 -1
- package/es/widgets/places/places.d.ts +1 -1
- package/es/widgets/places/places.js +1 -0
- package/package.json +5 -5
|
@@ -203,6 +203,10 @@ var connectHierarchicalMenu = function connectHierarchicalMenu(renderFn) {
|
|
|
203
203
|
getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref6) {
|
|
204
204
|
var uiState = _ref6.uiState;
|
|
205
205
|
var values = uiState.hierarchicalMenu && uiState.hierarchicalMenu[hierarchicalFacetName];
|
|
206
|
+
if (searchParameters.isConjunctiveFacet(hierarchicalFacetName) || searchParameters.isDisjunctiveFacet(hierarchicalFacetName)) {
|
|
207
|
+
process.env.NODE_ENV === 'development' ? warning(false, "HierarchicalMenu: Attribute \"".concat(hierarchicalFacetName, "\" is already used by another widget applying conjunctive or disjunctive faceting.\nAs this is not supported, please make sure to remove this other widget or this HierarchicalMenu widget will not work at all.")) : void 0;
|
|
208
|
+
return searchParameters;
|
|
209
|
+
}
|
|
206
210
|
if (searchParameters.isHierarchicalFacet(hierarchicalFacetName)) {
|
|
207
211
|
var facet = searchParameters.getHierarchicalFacetByName(hierarchicalFacetName);
|
|
208
212
|
process.env.NODE_ENV === 'development' ? warning(isEqual(facet.attributes, attributes) && facet.separator === separator && facet.rootPath === rootPath, 'Using Breadcrumb and HierarchicalMenu on the same facet with different options overrides the configuration of the HierarchicalMenu.') : void 0;
|
|
@@ -13,7 +13,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
13
13
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
14
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
15
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
16
|
-
import { checkRendering, createDocumentationMessageGenerator, createSendEventForFacet, noop } from "../../lib/utils/index.js";
|
|
16
|
+
import { checkRendering, createDocumentationMessageGenerator, createSendEventForFacet, noop, warning } from "../../lib/utils/index.js";
|
|
17
17
|
var withUsage = createDocumentationMessageGenerator({
|
|
18
18
|
name: 'menu',
|
|
19
19
|
connector: true
|
|
@@ -175,6 +175,10 @@ var connectMenu = function connectMenu(renderFn) {
|
|
|
175
175
|
getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref5) {
|
|
176
176
|
var uiState = _ref5.uiState;
|
|
177
177
|
var value = uiState.menu && uiState.menu[attribute];
|
|
178
|
+
if (searchParameters.isConjunctiveFacet(attribute) || searchParameters.isDisjunctiveFacet(attribute)) {
|
|
179
|
+
process.env.NODE_ENV === 'development' ? warning(false, "Menu: Attribute \"".concat(attribute, "\" is already used by another widget applying conjunctive or disjunctive faceting.\nAs this is not supported, please make sure to remove this other widget or this Menu widget will not work at all.")) : void 0;
|
|
180
|
+
return searchParameters;
|
|
181
|
+
}
|
|
178
182
|
var withFacetConfiguration = searchParameters.removeHierarchicalFacet(attribute).addHierarchicalFacet({
|
|
179
183
|
name: attribute,
|
|
180
184
|
attributes: [attribute]
|
|
@@ -8,7 +8,7 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
8
8
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
9
9
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
10
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
|
-
import { escapeFacets, TAG_PLACEHOLDER, TAG_REPLACEMENT, checkRendering, createDocumentationMessageGenerator, createSendEventForFacet, noop } from "../../lib/utils/index.js";
|
|
11
|
+
import { escapeFacets, TAG_PLACEHOLDER, TAG_REPLACEMENT, checkRendering, createDocumentationMessageGenerator, createSendEventForFacet, noop, warning } from "../../lib/utils/index.js";
|
|
12
12
|
var withUsage = createDocumentationMessageGenerator({
|
|
13
13
|
name: 'refinement-list',
|
|
14
14
|
connector: true
|
|
@@ -247,6 +247,14 @@ var connectRefinementList = function connectRefinementList(renderFn) {
|
|
|
247
247
|
getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref6) {
|
|
248
248
|
var uiState = _ref6.uiState;
|
|
249
249
|
var isDisjunctive = operator === 'or';
|
|
250
|
+
if (searchParameters.isHierarchicalFacet(attribute)) {
|
|
251
|
+
process.env.NODE_ENV === 'development' ? warning(false, "RefinementList: Attribute \"".concat(attribute, "\" is already used by another widget applying hierarchical faceting.\nAs this is not supported, please make sure to remove this other widget or this RefinementList widget will not work at all.")) : void 0;
|
|
252
|
+
return searchParameters;
|
|
253
|
+
}
|
|
254
|
+
if (isDisjunctive && searchParameters.isConjunctiveFacet(attribute) || !isDisjunctive && searchParameters.isDisjunctiveFacet(attribute)) {
|
|
255
|
+
process.env.NODE_ENV === 'development' ? warning(false, "RefinementList: Attribute \"".concat(attribute, "\" is used by another refinement list with a different operator.\nAs this is not supported, please make sure to only use this attribute with one of the two operators.")) : void 0;
|
|
256
|
+
return searchParameters;
|
|
257
|
+
}
|
|
250
258
|
var values = uiState.refinementList && uiState.refinementList[attribute];
|
|
251
259
|
var withoutRefinements = searchParameters.clearRefinements(attribute);
|
|
252
260
|
var withFacetConfiguration = isDisjunctive ? withoutRefinements.addDisjunctiveFacet(attribute) : withoutRefinements.addFacet(attribute);
|
|
@@ -4,7 +4,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
5
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
6
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
-
import { checkRendering, escapeFacetValue, createDocumentationMessageGenerator, find, noop, toArray } from "../../lib/utils/index.js";
|
|
7
|
+
import { checkRendering, escapeFacetValue, createDocumentationMessageGenerator, find, noop, toArray, warning } from "../../lib/utils/index.js";
|
|
8
8
|
var withUsage = createDocumentationMessageGenerator({
|
|
9
9
|
name: 'toggle-refinement',
|
|
10
10
|
connector: true
|
|
@@ -251,6 +251,10 @@ var connectToggleRefinement = function connectToggleRefinement(renderFn) {
|
|
|
251
251
|
},
|
|
252
252
|
getWidgetSearchParameters: function getWidgetSearchParameters(searchParameters, _ref11) {
|
|
253
253
|
var uiState = _ref11.uiState;
|
|
254
|
+
if (searchParameters.isHierarchicalFacet(attribute) || searchParameters.isConjunctiveFacet(attribute)) {
|
|
255
|
+
process.env.NODE_ENV === 'development' ? warning(false, "ToggleRefinement: Attribute \"".concat(attribute, "\" is already used by another widget of a different type.\nAs this is not supported, please make sure to remove this other widget or this ToggleRefinement widget will not work at all.")) : void 0;
|
|
256
|
+
return searchParameters;
|
|
257
|
+
}
|
|
254
258
|
var withFacetConfiguration = searchParameters.clearRefinements(attribute).addDisjunctiveFacet(attribute);
|
|
255
259
|
var isRefined = Boolean(uiState.toggle && uiState.toggle[attribute]);
|
|
256
260
|
if (isRefined) {
|
package/es/lib/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "4.
|
|
1
|
+
declare const _default: "4.54.0";
|
|
2
2
|
export default _default;
|
package/es/lib/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '4.
|
|
1
|
+
export default '4.54.0';
|
|
@@ -8,6 +8,7 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
8
8
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
9
9
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
10
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
|
+
/* Places.js is an optional dependency, no error should be reported if the package is missing */
|
|
11
12
|
/** @ts-ignore */
|
|
12
13
|
|
|
13
14
|
// using the type like this requires only one ts-ignore
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "instantsearch.js",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.54.0",
|
|
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.
|
|
59
|
-
"@instantsearch/tests": "1.
|
|
60
|
-
"@instantsearch/testutils": "1.0.
|
|
58
|
+
"@instantsearch/mocks": "1.10.0",
|
|
59
|
+
"@instantsearch/tests": "1.10.0",
|
|
60
|
+
"@instantsearch/testutils": "1.0.13",
|
|
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.41.5"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "419aa9869727dceeb49dfc5289a0b9241e0e5827"
|
|
69
69
|
}
|