instantsearch.js 4.56.9 → 4.56.11
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/README.md +9 -10
- package/cjs/components/CurrentRefinements/CurrentRefinements.js +2 -1
- package/cjs/components/Pagination/Pagination.js +3 -2
- package/cjs/components/SearchBox/SearchBox.js +1 -1
- package/cjs/lib/InstantSearch.js +1 -1
- package/cjs/lib/routers/history.js +1 -1
- package/cjs/lib/server.js +11 -6
- package/cjs/lib/version.js +1 -1
- package/cjs/widgets/index/index.js +1 -1
- package/dist/instantsearch.development.d.ts +3 -9
- package/dist/instantsearch.development.js +12 -10
- package/dist/instantsearch.development.js.map +1 -1
- package/dist/instantsearch.production.d.ts +3 -9
- package/dist/instantsearch.production.min.d.ts +3 -9
- package/dist/instantsearch.production.min.js +2 -2
- package/dist/instantsearch.production.min.js.map +1 -1
- package/es/components/CurrentRefinements/CurrentRefinements.js +2 -1
- package/es/components/Pagination/Pagination.js +3 -2
- package/es/components/SearchBox/SearchBox.js +1 -1
- package/es/lib/InstantSearch.d.ts +1 -1
- package/es/lib/InstantSearch.js +1 -1
- package/es/lib/routers/history.d.ts +1 -1
- package/es/lib/routers/history.js +1 -1
- package/es/lib/server.js +11 -6
- package/es/lib/version.d.ts +1 -1
- package/es/lib/version.js +1 -1
- package/es/middlewares/createInsightsMiddleware.d.ts +2 -8
- package/es/widgets/index/index.js +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
InstantSearch.js is a vanilla JavaScript library that lets you create an instant-search result experience using [Algolia][algolia-website]’s search API. It is part of the InstantSearch family:
|
|
14
14
|
|
|
15
|
-
**InstantSearch.js** | [React InstantSearch][
|
|
15
|
+
**InstantSearch.js** | [React InstantSearch][instantsearch-github] | [Vue InstantSearch][instantsearch-github] | [Angular InstantSearch][instantsearch-angular-github] | [React InstantSearch Native][instantsearch-github] | [InstantSearch Android][instantsearch-android-github] | [InstantSearch iOS][instantsearch-ios-github]
|
|
16
16
|
|
|
17
17
|
<details>
|
|
18
18
|
<summary><strong>Table of contents</strong></summary>
|
|
@@ -169,7 +169,7 @@ To start contributing to code, you need to:
|
|
|
169
169
|
1. Run the development mode: `yarn storybook`
|
|
170
170
|
1. [Open the stories](http://localhost:6006)
|
|
171
171
|
|
|
172
|
-
Please read [our contribution process](https://github.com/algolia/instantsearch
|
|
172
|
+
Please read [our contribution process](https://github.com/algolia/instantsearch/blob/master/CONTRIBUTING.md) to learn more.
|
|
173
173
|
|
|
174
174
|
## License
|
|
175
175
|
|
|
@@ -179,14 +179,13 @@ InstantSearch.js is [MIT licensed][license-url].
|
|
|
179
179
|
|
|
180
180
|
[license-url]: LICENSE
|
|
181
181
|
[algolia-website]: https://www.algolia.com/?utm_source=instantsearch.js&utm_campaign=repository
|
|
182
|
-
[
|
|
183
|
-
[vue-instantsearch-github]: https://github.com/algolia/vue-instantsearch
|
|
182
|
+
[instantsearch-github]: https://github.com/algolia/instantsearch/
|
|
184
183
|
[instantsearch-android-github]: https://github.com/algolia/instantsearch-android
|
|
185
184
|
[instantsearch-ios-github]: https://github.com/algolia/instantsearch-ios
|
|
186
185
|
[instantsearch-angular-github]: https://github.com/algolia/angular-instantsearch
|
|
187
|
-
[contributing-bugreport]: https://github.com/algolia/instantsearch
|
|
188
|
-
[contributing-featurerequest]: https://github.com/algolia/instantsearch
|
|
189
|
-
[contributing-newissue]: https://github.com/algolia/instantsearch
|
|
190
|
-
[contributing-label-easy]: https://github.com/algolia/instantsearch
|
|
191
|
-
[contributing-label-bug]: https://github.com/algolia/instantsearch
|
|
192
|
-
[contributing-label-chore]: https://github.com/algolia/instantsearch
|
|
186
|
+
[contributing-bugreport]: https://github.com/algolia/instantsearch/issues/new?template=BUG_REPORT.yml&labels=triage,Library%3A%20InstantSearch.js
|
|
187
|
+
[contributing-featurerequest]: https://github.com/algolia/instantsearch/discussions/new?category=ideas&labels=triage,Library%3A%20InstantSearch.js&title=Feature%20request%3A%20
|
|
188
|
+
[contributing-newissue]: https://github.com/algolia/instantsearch/issues/new?labels=triage,Library%3A%20InstantSearch.js
|
|
189
|
+
[contributing-label-easy]: https://github.com/algolia/instantsearch/issues?q=is%3Aopen+is%3Aissue+label%3A%22Difficulty%3A+Easy%22+label%3A%22Library%3A%20InstantSearch.js%22
|
|
190
|
+
[contributing-label-bug]: https://github.com/algolia/instantsearch/issues?q=is%3Aissue+is%3Aopen+label%3A%22Type%3A+Bug%22+label%3A%22Library%3A%20InstantSearch.js%22
|
|
191
|
+
[contributing-label-chore]: https://github.com/algolia/instantsearch/issues?q=is%3Aissue+is%3Aopen+label%3A%22Type%3A+Chore%22+label%3A%22Library%3A%20InstantSearch.js%22
|
|
@@ -39,7 +39,7 @@ var CurrentRefinements = function CurrentRefinements(_ref2) {
|
|
|
39
39
|
className: cssClasses.item
|
|
40
40
|
}, (0, _preact.h)("span", {
|
|
41
41
|
className: cssClasses.label
|
|
42
|
-
}, (0, _utils.capitalize)(item.label), ":"), item.refinements.map(function (refinement) {
|
|
42
|
+
}, (0, _utils.capitalize)(item.label), ": "), item.refinements.map(function (refinement) {
|
|
43
43
|
return (0, _preact.h)("span", {
|
|
44
44
|
key: createItemKey(refinement),
|
|
45
45
|
className: cssClasses.category
|
|
@@ -47,6 +47,7 @@ var CurrentRefinements = function CurrentRefinements(_ref2) {
|
|
|
47
47
|
className: cssClasses.categoryLabel
|
|
48
48
|
}, refinement.attribute === 'query' ? (0, _preact.h)("q", null, refinement.label) : refinement.label), (0, _preact.h)("button", {
|
|
49
49
|
className: cssClasses.delete,
|
|
50
|
+
type: "button",
|
|
50
51
|
onClick: handleClick(item.refine.bind(null, refinement))
|
|
51
52
|
}, "\u2715"));
|
|
52
53
|
}));
|
|
@@ -94,11 +94,12 @@ function PaginationLink(_ref) {
|
|
|
94
94
|
createURL = _ref.createURL,
|
|
95
95
|
createClickHandler = _ref.createClickHandler;
|
|
96
96
|
return (0, _preact.h)("li", {
|
|
97
|
-
className: (0, _uiComponentsShared.cx)(cssClasses.item,
|
|
97
|
+
className: (0, _uiComponentsShared.cx)(cssClasses.item, isDisabled && cssClasses.disabledItem, className, isSelected && cssClasses.selectedItem)
|
|
98
98
|
}, isDisabled ? (0, _preact.h)(_Template.default, {
|
|
99
99
|
rootTagName: "span",
|
|
100
100
|
rootProps: {
|
|
101
|
-
className: cssClasses.link
|
|
101
|
+
className: cssClasses.link,
|
|
102
|
+
'aria-label': ariaLabel
|
|
102
103
|
},
|
|
103
104
|
templateKey: templateKey,
|
|
104
105
|
templates: templates,
|
|
@@ -128,7 +128,7 @@ var SearchBox = /*#__PURE__*/function (_Component) {
|
|
|
128
128
|
/**
|
|
129
129
|
* when the user is typing, we don't want to replace the query typed
|
|
130
130
|
* by the user (state.query) with the query exposed by the connector (props.query)
|
|
131
|
-
* see: https://github.com/algolia/instantsearch
|
|
131
|
+
* see: https://github.com/algolia/instantsearch/issues/4141
|
|
132
132
|
*/
|
|
133
133
|
if (!this.state.focused && nextProps.query !== this.state.query) {
|
|
134
134
|
this.setState({
|
package/cjs/lib/InstantSearch.js
CHANGED
|
@@ -480,7 +480,7 @@ var InstantSearch = /*#__PURE__*/function (_EventEmitter) {
|
|
|
480
480
|
/**
|
|
481
481
|
* Removes all widgets without triggering a search afterwards. This is an **EXPERIMENTAL** feature,
|
|
482
482
|
* if you find an issue with it, please
|
|
483
|
-
* [open an issue](https://github.com/algolia/instantsearch
|
|
483
|
+
* [open an issue](https://github.com/algolia/instantsearch/issues/new?title=Problem%20with%20dispose).
|
|
484
484
|
* @return {undefined} This method does not return anything
|
|
485
485
|
*/
|
|
486
486
|
}, {
|
|
@@ -180,7 +180,7 @@ var BrowserHistory = /*#__PURE__*/function () {
|
|
|
180
180
|
*
|
|
181
181
|
* It always generates the full URL, not a relative one.
|
|
182
182
|
* This allows to handle cases like using a <base href>.
|
|
183
|
-
* See: https://github.com/algolia/instantsearch
|
|
183
|
+
* See: https://github.com/algolia/instantsearch/issues/790
|
|
184
184
|
*/
|
|
185
185
|
}, {
|
|
186
186
|
key: "createURL",
|
package/cjs/lib/server.js
CHANGED
|
@@ -49,12 +49,17 @@ function getInitialResults(rootIndex) {
|
|
|
49
49
|
var initialResults = {};
|
|
50
50
|
(0, _utils.walkIndex)(rootIndex, function (widget) {
|
|
51
51
|
var searchResults = widget.getResults();
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
if (searchResults) {
|
|
53
|
+
initialResults[widget.getIndexId()] = {
|
|
54
|
+
// We convert the Helper state to a plain object to pass parsable data
|
|
55
|
+
// structures from server to client.
|
|
56
|
+
state: _objectSpread({}, searchResults._state),
|
|
57
|
+
results: searchResults._rawResults
|
|
58
|
+
};
|
|
59
|
+
}
|
|
58
60
|
});
|
|
61
|
+
if (Object.keys(initialResults).length === 0) {
|
|
62
|
+
throw new Error('The root index does not have any results. Make sure you have at least one widget that provides results.');
|
|
63
|
+
}
|
|
59
64
|
return initialResults;
|
|
60
65
|
}
|
package/cjs/lib/version.js
CHANGED
|
@@ -373,7 +373,7 @@ var index = function index(widgetParams) {
|
|
|
373
373
|
// configuration step. This is mainly for backward compatibility with custom
|
|
374
374
|
// widgets. When the subscription happens before the `init` step, the (static)
|
|
375
375
|
// configuration of the widget is pushed in the URL. That's what we want to avoid.
|
|
376
|
-
// https://github.com/algolia/instantsearch
|
|
376
|
+
// https://github.com/algolia/instantsearch/pull/994/commits/4a672ae3fd78809e213de0368549ef12e9dc9454
|
|
377
377
|
helper.on('change', function (event) {
|
|
378
378
|
var state = event.state;
|
|
379
379
|
var _uiState = event._uiState;
|
|
@@ -509,7 +509,7 @@ declare class BrowserHistory<TRouteState> implements Router<TRouteState> {
|
|
|
509
509
|
*
|
|
510
510
|
* It always generates the full URL, not a relative one.
|
|
511
511
|
* This allows to handle cases like using a <base href>.
|
|
512
|
-
* See: https://github.com/algolia/instantsearch
|
|
512
|
+
* See: https://github.com/algolia/instantsearch/issues/790
|
|
513
513
|
*/
|
|
514
514
|
createURL(routeState: TRouteState): string;
|
|
515
515
|
/**
|
|
@@ -2349,13 +2349,7 @@ declare type InsightsMethodMap = InsightsMethodMap_2;
|
|
|
2349
2349
|
|
|
2350
2350
|
declare type InsightsProps<TInsightsClient extends ProvidedInsightsClient = ProvidedInsightsClient> = {
|
|
2351
2351
|
insightsClient?: TInsightsClient;
|
|
2352
|
-
insightsInitParams?:
|
|
2353
|
-
userHasOptedOut?: boolean;
|
|
2354
|
-
useCookie?: boolean;
|
|
2355
|
-
anonymousUserToken?: boolean;
|
|
2356
|
-
cookieDuration?: number;
|
|
2357
|
-
region?: 'de' | 'us';
|
|
2358
|
-
};
|
|
2352
|
+
insightsInitParams?: Partial<InsightsMethodMap['init'][0]>;
|
|
2359
2353
|
onEvent?: (event: InsightsEvent, insightsClient: TInsightsClient) => void;
|
|
2360
2354
|
};
|
|
2361
2355
|
|
|
@@ -2449,7 +2443,7 @@ declare class InstantSearch<TUiState extends UiState = UiState, TRouteState = TU
|
|
|
2449
2443
|
/**
|
|
2450
2444
|
* Removes all widgets without triggering a search afterwards. This is an **EXPERIMENTAL** feature,
|
|
2451
2445
|
* if you find an issue with it, please
|
|
2452
|
-
* [open an issue](https://github.com/algolia/instantsearch
|
|
2446
|
+
* [open an issue](https://github.com/algolia/instantsearch/issues/new?title=Problem%20with%20dispose).
|
|
2453
2447
|
* @return {undefined} This method does not return anything
|
|
2454
2448
|
*/
|
|
2455
2449
|
dispose(): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! InstantSearch.js 4.56.
|
|
1
|
+
/*! InstantSearch.js 4.56.11 | © 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) :
|
|
@@ -9911,7 +9911,7 @@
|
|
|
9911
9911
|
|
|
9912
9912
|
var SearchResults_1 = SearchResults;
|
|
9913
9913
|
|
|
9914
|
-
var version = '3.14.
|
|
9914
|
+
var version = '3.14.1';
|
|
9915
9915
|
|
|
9916
9916
|
var escapeFacetValue$4 = escapeFacetValue_1.escapeFacetValue;
|
|
9917
9917
|
|
|
@@ -13847,7 +13847,7 @@
|
|
|
13847
13847
|
*
|
|
13848
13848
|
* It always generates the full URL, not a relative one.
|
|
13849
13849
|
* This allows to handle cases like using a <base href>.
|
|
13850
|
-
* See: https://github.com/algolia/instantsearch
|
|
13850
|
+
* See: https://github.com/algolia/instantsearch/issues/790
|
|
13851
13851
|
*/
|
|
13852
13852
|
}, {
|
|
13853
13853
|
key: "createURL",
|
|
@@ -14431,7 +14431,7 @@
|
|
|
14431
14431
|
// configuration step. This is mainly for backward compatibility with custom
|
|
14432
14432
|
// widgets. When the subscription happens before the `init` step, the (static)
|
|
14433
14433
|
// configuration of the widget is pushed in the URL. That's what we want to avoid.
|
|
14434
|
-
// https://github.com/algolia/instantsearch
|
|
14434
|
+
// https://github.com/algolia/instantsearch/pull/994/commits/4a672ae3fd78809e213de0368549ef12e9dc9454
|
|
14435
14435
|
helper.on('change', function (event) {
|
|
14436
14436
|
var state = event.state;
|
|
14437
14437
|
var _uiState = event._uiState;
|
|
@@ -14617,7 +14617,7 @@
|
|
|
14617
14617
|
};
|
|
14618
14618
|
}
|
|
14619
14619
|
|
|
14620
|
-
var version$1 = '4.56.
|
|
14620
|
+
var version$1 = '4.56.11';
|
|
14621
14621
|
|
|
14622
14622
|
var withUsage$r = createDocumentationMessageGenerator({
|
|
14623
14623
|
name: 'instantsearch'
|
|
@@ -15069,7 +15069,7 @@
|
|
|
15069
15069
|
/**
|
|
15070
15070
|
* Removes all widgets without triggering a search afterwards. This is an **EXPERIMENTAL** feature,
|
|
15071
15071
|
* if you find an issue with it, please
|
|
15072
|
-
* [open an issue](https://github.com/algolia/instantsearch
|
|
15072
|
+
* [open an issue](https://github.com/algolia/instantsearch/issues/new?title=Problem%20with%20dispose).
|
|
15073
15073
|
* @return {undefined} This method does not return anything
|
|
15074
15074
|
*/
|
|
15075
15075
|
}, {
|
|
@@ -17091,7 +17091,7 @@
|
|
|
17091
17091
|
className: cssClasses.item
|
|
17092
17092
|
}, h("span", {
|
|
17093
17093
|
className: cssClasses.label
|
|
17094
|
-
}, capitalize(item.label), ":"), item.refinements.map(function (refinement) {
|
|
17094
|
+
}, capitalize(item.label), ": "), item.refinements.map(function (refinement) {
|
|
17095
17095
|
return h("span", {
|
|
17096
17096
|
key: createItemKey(refinement),
|
|
17097
17097
|
className: cssClasses.category
|
|
@@ -17099,6 +17099,7 @@
|
|
|
17099
17099
|
className: cssClasses.categoryLabel
|
|
17100
17100
|
}, refinement.attribute === 'query' ? h("q", null, refinement.label) : refinement.label), h("button", {
|
|
17101
17101
|
className: cssClasses.delete,
|
|
17102
|
+
type: "button",
|
|
17102
17103
|
onClick: handleClick(item.refine.bind(null, refinement))
|
|
17103
17104
|
}, "\u2715"));
|
|
17104
17105
|
}));
|
|
@@ -17827,7 +17828,7 @@
|
|
|
17827
17828
|
/**
|
|
17828
17829
|
* when the user is typing, we don't want to replace the query typed
|
|
17829
17830
|
* by the user (state.query) with the query exposed by the connector (props.query)
|
|
17830
|
-
* see: https://github.com/algolia/instantsearch
|
|
17831
|
+
* see: https://github.com/algolia/instantsearch/issues/4141
|
|
17831
17832
|
*/
|
|
17832
17833
|
if (!this.state.focused && nextProps.query !== this.state.query) {
|
|
17833
17834
|
this.setState({
|
|
@@ -19225,11 +19226,12 @@
|
|
|
19225
19226
|
createURL = _ref.createURL,
|
|
19226
19227
|
createClickHandler = _ref.createClickHandler;
|
|
19227
19228
|
return h("li", {
|
|
19228
|
-
className: cx(cssClasses.item,
|
|
19229
|
+
className: cx(cssClasses.item, isDisabled && cssClasses.disabledItem, className, isSelected && cssClasses.selectedItem)
|
|
19229
19230
|
}, isDisabled ? h(Template, {
|
|
19230
19231
|
rootTagName: "span",
|
|
19231
19232
|
rootProps: {
|
|
19232
|
-
className: cssClasses.link
|
|
19233
|
+
className: cssClasses.link,
|
|
19234
|
+
'aria-label': ariaLabel
|
|
19233
19235
|
},
|
|
19234
19236
|
templateKey: templateKey,
|
|
19235
19237
|
templates: templates,
|