instantsearch.js 4.47.0 → 4.48.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.
@@ -1,2 +1,2 @@
1
- declare const _default: "4.47.0";
1
+ declare const _default: "4.48.0";
2
2
  export default _default;
package/es/lib/version.js CHANGED
@@ -1 +1 @@
1
- export default '4.47.0';
1
+ export default '4.48.0';
@@ -7,15 +7,15 @@ export declare type InsightsEvent = {
7
7
  hits?: Hit[];
8
8
  attribute?: string;
9
9
  };
10
- export declare type InsightsProps = {
11
- insightsClient: null | InsightsClient;
10
+ export declare type InsightsProps<TInsightsClient extends null | InsightsClient = InsightsClient | null> = {
11
+ insightsClient: TInsightsClient;
12
12
  insightsInitParams?: {
13
13
  userHasOptedOut?: boolean;
14
14
  useCookie?: boolean;
15
15
  cookieDuration?: number;
16
16
  region?: 'de' | 'us';
17
17
  };
18
- onEvent?: (event: InsightsEvent, insightsClient: null | InsightsClient) => void;
18
+ onEvent?: (event: InsightsEvent, insightsClient: TInsightsClient) => void;
19
19
  };
20
- export declare type CreateInsightsMiddleware = (props: InsightsProps) => InternalMiddleware;
21
- export declare const createInsightsMiddleware: CreateInsightsMiddleware;
20
+ export declare type CreateInsightsMiddleware = typeof createInsightsMiddleware;
21
+ export declare function createInsightsMiddleware<TInsightsClient extends null | InsightsClient>(props: InsightsProps<TInsightsClient>): InternalMiddleware;
@@ -18,7 +18,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
18
 
19
19
  import { getInsightsAnonymousUserTokenInternal } from "../helpers/index.js";
20
20
  import { warning, noop, getAppIdAndApiKey, find } from "../lib/utils/index.js";
21
- export var createInsightsMiddleware = function createInsightsMiddleware(props) {
21
+ export function createInsightsMiddleware(props) {
22
22
  var _ref = props || {},
23
23
  _insightsClient = _ref.insightsClient,
24
24
  insightsInitParams = _ref.insightsInitParams,
@@ -157,4 +157,4 @@ export var createInsightsMiddleware = function createInsightsMiddleware(props) {
157
157
  }
158
158
  };
159
159
  };
160
- };
160
+ }
@@ -36,7 +36,7 @@ export declare type IndexWidget = Omit<Widget<IndexWidgetDescription & {
36
36
  * @deprecated
37
37
  */
38
38
  getWidgetState(uiState: UiState): UiState;
39
- getWidgetUiState<TUiState = UiState>(uiState: TUiState): TUiState;
39
+ getWidgetUiState<TUiState extends UiState = UiState>(uiState: TUiState): TUiState;
40
40
  getWidgetSearchParameters(searchParameters: SearchParameters, searchParametersOptions: {
41
41
  uiState: IndexUiState;
42
42
  }): SearchParameters;
@@ -463,7 +463,7 @@ var index = function index(widgetParams) {
463
463
  getWidgetUiState: function getWidgetUiState(uiState) {
464
464
  return localWidgets.filter(isIndexWidget).reduce(function (previousUiState, innerIndex) {
465
465
  return innerIndex.getWidgetUiState(previousUiState);
466
- }, _objectSpread(_objectSpread({}, uiState), {}, _defineProperty({}, this.getIndexId(), localUiState)));
466
+ }, _objectSpread(_objectSpread({}, uiState), {}, _defineProperty({}, indexId, _objectSpread(_objectSpread({}, uiState[indexId]), localUiState))));
467
467
  },
468
468
  getWidgetState: function getWidgetState(uiState) {
469
469
  process.env.NODE_ENV === 'development' ? warning(false, 'The `getWidgetState` method is renamed `getWidgetUiState` and will no longer exist under that name in InstantSearch.js 5.x. Please use `getWidgetUiState` instead.') : void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instantsearch.js",
3
- "version": "4.47.0",
3
+ "version": "4.48.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",
@@ -42,7 +42,6 @@
42
42
  "test:e2e:local": "wdio scripts/wdio/local.conf.js",
43
43
  "test:e2e:saucelabs": "wdio scripts/wdio/saucelabs.conf.js",
44
44
  "test:size": "bundlesize",
45
- "test:argos": "argos upload functional-tests/screenshots --token $ARGOS_TOKEN || true",
46
45
  "test:exports": "node test/module/is-es-module.mjs",
47
46
  "release": "shipjs prepare"
48
47
  },