instantsearch.js 4.62.0 → 4.63.1
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/components/RefinementList/RefinementList.js +4 -4
- package/cjs/components/SearchBox/SearchBox.js +13 -7
- package/cjs/connectors/search-box/connectSearchBox.js +2 -2
- package/cjs/lib/routers/history.js +17 -4
- package/cjs/lib/version.js +1 -1
- package/cjs/middlewares/createInsightsMiddleware.js +16 -4
- package/dist/instantsearch.development.d.ts +11 -5
- package/dist/instantsearch.development.js +55 -24
- package/dist/instantsearch.development.js.map +1 -1
- package/dist/instantsearch.production.d.ts +11 -5
- package/dist/instantsearch.production.min.d.ts +11 -5
- package/dist/instantsearch.production.min.js +2 -2
- package/dist/instantsearch.production.min.js.map +1 -1
- package/es/components/RefinementList/RefinementList.js +4 -4
- package/es/components/SearchBox/SearchBox.js +13 -7
- package/es/connectors/search-box/connectSearchBox.js +2 -2
- package/es/lib/routers/history.d.ts +10 -2
- package/es/lib/routers/history.js +18 -5
- package/es/lib/version.d.ts +1 -1
- package/es/lib/version.js +1 -1
- package/es/middlewares/createInsightsMiddleware.js +16 -4
- package/es/widgets/toggle-refinement/toggle-refinement.d.ts +2 -4
- package/package.json +10 -10
|
@@ -486,11 +486,12 @@ declare class BrowserHistory<TRouteState> implements Router<TRouteState> {
|
|
|
486
486
|
private _start?;
|
|
487
487
|
private _dispose?;
|
|
488
488
|
private _push?;
|
|
489
|
+
private _cleanUrlOnDispose;
|
|
489
490
|
/**
|
|
490
491
|
* Initializes a new storage provider that syncs the search state to the URL
|
|
491
492
|
* using web APIs (`window.location.pushState` and `onpopstate` event).
|
|
492
493
|
*/
|
|
493
|
-
constructor({ windowTitle, writeDelay, createURL, parseURL, getLocation, start, dispose, push, }: BrowserHistoryArgs<TRouteState>);
|
|
494
|
+
constructor({ windowTitle, writeDelay, createURL, parseURL, getLocation, start, dispose, push, cleanUrlOnDispose, }: BrowserHistoryArgs<TRouteState>);
|
|
494
495
|
/**
|
|
495
496
|
* Reads the URL and returns a syncable UI search state.
|
|
496
497
|
*/
|
|
@@ -529,6 +530,13 @@ declare type BrowserHistoryArgs<TRouteState> = {
|
|
|
529
530
|
start?: (onUpdate: () => void) => void;
|
|
530
531
|
dispose?: () => void;
|
|
531
532
|
push?: (url: string) => void;
|
|
533
|
+
/**
|
|
534
|
+
* Whether the URL should be cleaned up when the router is disposed.
|
|
535
|
+
* This can be useful when closing a modal containing InstantSearch, to
|
|
536
|
+
* remove active refinements from the URL.
|
|
537
|
+
* @default true
|
|
538
|
+
*/
|
|
539
|
+
cleanUrlOnDispose?: boolean;
|
|
532
540
|
};
|
|
533
541
|
|
|
534
542
|
declare type BuiltInBindEventForHits = (eventType: string, hits: Hit | Hit[], eventName?: string, additionalData?: Record<string, any>) => string;
|
|
@@ -1813,7 +1821,7 @@ declare type HighlightProps_2 = Omit<HighlightProps_3, 'classNames'> & {
|
|
|
1813
1821
|
classNames?: Partial<HighlightClassNames>;
|
|
1814
1822
|
};
|
|
1815
1823
|
|
|
1816
|
-
declare function historyRouter<TRouteState = UiState>({ createURL, parseURL, writeDelay, windowTitle, getLocation, start, dispose, push, }?: Partial<BrowserHistoryArgs<TRouteState>>): BrowserHistory<TRouteState>;
|
|
1824
|
+
declare function historyRouter<TRouteState = UiState>({ createURL, parseURL, writeDelay, windowTitle, getLocation, start, dispose, push, cleanUrlOnDispose, }?: Partial<BrowserHistoryArgs<TRouteState>>): BrowserHistory<TRouteState>;
|
|
1817
1825
|
|
|
1818
1826
|
declare type Hit<THit extends BaseHit = Record<string, any>> = {
|
|
1819
1827
|
__position: number;
|
|
@@ -5328,9 +5336,7 @@ declare type ToggleRefinementTemplates = Partial<{
|
|
|
5328
5336
|
/**
|
|
5329
5337
|
* the text that describes the toggle action
|
|
5330
5338
|
*/
|
|
5331
|
-
labelText: Template<
|
|
5332
|
-
name: string;
|
|
5333
|
-
}>;
|
|
5339
|
+
labelText: Template<ToggleRefinementRenderState['value']>;
|
|
5334
5340
|
}>;
|
|
5335
5341
|
|
|
5336
5342
|
declare type ToggleRefinementValue = {
|
|
@@ -486,11 +486,12 @@ declare class BrowserHistory<TRouteState> implements Router<TRouteState> {
|
|
|
486
486
|
private _start?;
|
|
487
487
|
private _dispose?;
|
|
488
488
|
private _push?;
|
|
489
|
+
private _cleanUrlOnDispose;
|
|
489
490
|
/**
|
|
490
491
|
* Initializes a new storage provider that syncs the search state to the URL
|
|
491
492
|
* using web APIs (`window.location.pushState` and `onpopstate` event).
|
|
492
493
|
*/
|
|
493
|
-
constructor({ windowTitle, writeDelay, createURL, parseURL, getLocation, start, dispose, push, }: BrowserHistoryArgs<TRouteState>);
|
|
494
|
+
constructor({ windowTitle, writeDelay, createURL, parseURL, getLocation, start, dispose, push, cleanUrlOnDispose, }: BrowserHistoryArgs<TRouteState>);
|
|
494
495
|
/**
|
|
495
496
|
* Reads the URL and returns a syncable UI search state.
|
|
496
497
|
*/
|
|
@@ -529,6 +530,13 @@ declare type BrowserHistoryArgs<TRouteState> = {
|
|
|
529
530
|
start?: (onUpdate: () => void) => void;
|
|
530
531
|
dispose?: () => void;
|
|
531
532
|
push?: (url: string) => void;
|
|
533
|
+
/**
|
|
534
|
+
* Whether the URL should be cleaned up when the router is disposed.
|
|
535
|
+
* This can be useful when closing a modal containing InstantSearch, to
|
|
536
|
+
* remove active refinements from the URL.
|
|
537
|
+
* @default true
|
|
538
|
+
*/
|
|
539
|
+
cleanUrlOnDispose?: boolean;
|
|
532
540
|
};
|
|
533
541
|
|
|
534
542
|
declare type BuiltInBindEventForHits = (eventType: string, hits: Hit | Hit[], eventName?: string, additionalData?: Record<string, any>) => string;
|
|
@@ -1813,7 +1821,7 @@ declare type HighlightProps_2 = Omit<HighlightProps_3, 'classNames'> & {
|
|
|
1813
1821
|
classNames?: Partial<HighlightClassNames>;
|
|
1814
1822
|
};
|
|
1815
1823
|
|
|
1816
|
-
declare function historyRouter<TRouteState = UiState>({ createURL, parseURL, writeDelay, windowTitle, getLocation, start, dispose, push, }?: Partial<BrowserHistoryArgs<TRouteState>>): BrowserHistory<TRouteState>;
|
|
1824
|
+
declare function historyRouter<TRouteState = UiState>({ createURL, parseURL, writeDelay, windowTitle, getLocation, start, dispose, push, cleanUrlOnDispose, }?: Partial<BrowserHistoryArgs<TRouteState>>): BrowserHistory<TRouteState>;
|
|
1817
1825
|
|
|
1818
1826
|
declare type Hit<THit extends BaseHit = Record<string, any>> = {
|
|
1819
1827
|
__position: number;
|
|
@@ -5328,9 +5336,7 @@ declare type ToggleRefinementTemplates = Partial<{
|
|
|
5328
5336
|
/**
|
|
5329
5337
|
* the text that describes the toggle action
|
|
5330
5338
|
*/
|
|
5331
|
-
labelText: Template<
|
|
5332
|
-
name: string;
|
|
5333
|
-
}>;
|
|
5339
|
+
labelText: Template<ToggleRefinementRenderState['value']>;
|
|
5334
5340
|
}>;
|
|
5335
5341
|
|
|
5336
5342
|
declare type ToggleRefinementValue = {
|