instantsearch.js 4.56.3 → 4.56.4

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.
@@ -1,40 +1,5 @@
1
- import type { SendEventForFacet } from '../../lib/utils';
2
- import type { Connector, CreateURL, WidgetRenderState } from '../../types';
3
- type ToggleRefinementConnectorParams = {
4
- attribute: string;
5
- on: string | string[];
6
- off: string | string[];
7
- };
8
- type FacetValue = {
9
- isRefined: boolean;
10
- count: number;
11
- };
12
- type ToggleRefinementRenderState = {
13
- value: {
14
- name: string;
15
- isRefined: boolean;
16
- count: number | null;
17
- onFacetValue: FacetValue;
18
- offFacetValue: FacetValue;
19
- };
20
- createURL: CreateURL<string>;
21
- sendEvent: SendEventForFacet;
22
- canRefine: boolean;
23
- refine: (value: string) => void;
24
- };
25
- export type ToggleRefinementWidgetDescription = {
26
- $$type: 'ais.toggleRefinement';
27
- renderState: ToggleRefinementRenderState;
28
- indexRenderState: {
29
- toggleRefinement: {
30
- [attribute: string]: WidgetRenderState<ToggleRefinementRenderState, ToggleRefinementConnectorParams>;
31
- };
32
- };
33
- indexUiState: {
34
- toggle: {
35
- [attribute: string]: boolean;
36
- };
37
- };
38
- };
39
- export type ToggleRefinementConnector = Connector<ToggleRefinementWidgetDescription, ToggleRefinementConnectorParams>;
40
- export {};
1
+ export type {
2
+ /** @deprecated import from connectToggleRefinement directly */
3
+ ToggleRefinementConnector,
4
+ /** @deprecated import from connectToggleRefinement directly */
5
+ ToggleRefinementWidgetDescription, } from './connectToggleRefinement';
@@ -1,2 +1,2 @@
1
- declare const _default: "4.56.3";
1
+ declare const _default: "4.56.4";
2
2
  export default _default;
package/es/lib/version.js CHANGED
@@ -1 +1 @@
1
- export default '4.56.3';
1
+ export default '4.56.4';
@@ -44,7 +44,9 @@ export var createRouterMiddleware = function createRouterMiddleware() {
44
44
  subscribe: function subscribe() {
45
45
  instantSearchInstance._initialUiState = _objectSpread(_objectSpread({}, initialUiState), stateMapping.routeToState(router.read()));
46
46
  router.onUpdate(function (route) {
47
- instantSearchInstance.setUiState(stateMapping.routeToState(route));
47
+ if (instantSearchInstance.mainIndex.getWidgets().length > 0) {
48
+ instantSearchInstance.setUiState(stateMapping.routeToState(route));
49
+ }
48
50
  });
49
51
  },
50
52
  started: function started() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instantsearch.js",
3
- "version": "4.56.3",
3
+ "version": "4.56.4",
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.16.0",
59
- "@instantsearch/tests": "1.16.0",
60
- "@instantsearch/testutils": "1.5.0",
58
+ "@instantsearch/mocks": "1.17.0",
59
+ "@instantsearch/tests": "1.17.0",
60
+ "@instantsearch/testutils": "1.6.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.41.5"
67
67
  },
68
- "gitHead": "f550379829306217e021fd9c538ec4ebd0153b19"
68
+ "gitHead": "d441895874038286168b028c1a45193b1fce8eaf"
69
69
  }