instantsearch.js 4.58.0 → 4.60.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.
Files changed (43) hide show
  1. package/README.md +1 -1
  2. package/cjs/components/Pagination/Pagination.js +4 -4
  3. package/cjs/components/RefinementList/RefinementList.js +2 -1
  4. package/cjs/components/SearchBox/SearchBox.js +5 -2
  5. package/cjs/components/Selector/Selector.js +4 -2
  6. package/cjs/components/Slider/Slider.js +3 -1
  7. package/cjs/lib/InstantSearch.js +27 -5
  8. package/cjs/lib/utils/createSendEventForFacet.js +12 -5
  9. package/cjs/lib/utils/createSendEventForHits.js +12 -6
  10. package/cjs/lib/utils/hydrateSearchClient.js +116 -0
  11. package/cjs/lib/utils/index.js +11 -0
  12. package/cjs/lib/version.js +1 -1
  13. package/cjs/middlewares/createInsightsMiddleware.js +15 -4
  14. package/cjs/widgets/sort-by/sort-by.js +2 -1
  15. package/dist/instantsearch.development.d.ts +4 -3
  16. package/dist/instantsearch.development.js +184 -34
  17. package/dist/instantsearch.development.js.map +1 -1
  18. package/dist/instantsearch.production.d.ts +4 -3
  19. package/dist/instantsearch.production.min.d.ts +4 -3
  20. package/dist/instantsearch.production.min.js +2 -2
  21. package/dist/instantsearch.production.min.js.map +1 -1
  22. package/es/components/Pagination/Pagination.js +4 -4
  23. package/es/components/RefinementList/RefinementList.js +2 -1
  24. package/es/components/SearchBox/SearchBox.d.ts +3 -0
  25. package/es/components/SearchBox/SearchBox.js +5 -2
  26. package/es/components/Selector/Selector.d.ts +2 -1
  27. package/es/components/Selector/Selector.js +4 -2
  28. package/es/components/Slider/Slider.js +3 -1
  29. package/es/lib/InstantSearch.d.ts +1 -0
  30. package/es/lib/InstantSearch.js +28 -6
  31. package/es/lib/utils/createSendEventForFacet.d.ts +1 -1
  32. package/es/lib/utils/createSendEventForFacet.js +12 -5
  33. package/es/lib/utils/createSendEventForHits.d.ts +2 -2
  34. package/es/lib/utils/createSendEventForHits.js +12 -6
  35. package/es/lib/utils/hydrateSearchClient.d.ts +2 -0
  36. package/es/lib/utils/hydrateSearchClient.js +110 -0
  37. package/es/lib/utils/index.d.ts +1 -0
  38. package/es/lib/utils/index.js +1 -0
  39. package/es/lib/version.d.ts +1 -1
  40. package/es/lib/version.js +1 -1
  41. package/es/middlewares/createInsightsMiddleware.js +15 -4
  42. package/es/widgets/sort-by/sort-by.js +2 -1
  43. package/package.json +6 -6
@@ -1,4 +1,4 @@
1
- /*! InstantSearch.js 4.58.0 | © Algolia, Inc. and contributors; MIT License | https://github.com/algolia/instantsearch */
1
+ /*! InstantSearch.js 4.60.0 | © 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) :
@@ -752,7 +752,9 @@
752
752
  }
753
753
  var facetValue = args[1],
754
754
  _args$ = args[2],
755
- eventName = _args$ === void 0 ? 'Filter Applied' : _args$;
755
+ eventName = _args$ === void 0 ? 'Filter Applied' : _args$,
756
+ _args$2 = args[3],
757
+ additionalData = _args$2 === void 0 ? {} : _args$2;
756
758
  var _args$0$split = args[0].split(':'),
757
759
  _args$0$split2 = _slicedToArray(_args$0$split, 2),
758
760
  eventType = _args$0$split2[0],
@@ -760,7 +762,7 @@
760
762
  var attribute = typeof attr === 'string' ? attr : attr(facetValue);
761
763
  if (args.length === 1 && _typeof(args[0]) === 'object') {
762
764
  instantSearchInstance.sendEventToInsights(args[0]);
763
- } else if (eventType === 'click' && (args.length === 2 || args.length === 3)) {
765
+ } else if (eventType === 'click' && args.length >= 2 && args.length <= 4) {
764
766
  if (!isFacetRefined(helper, attribute, facetValue)) {
765
767
  // send event only when the facet is being checked "ON"
766
768
  instantSearchInstance.sendEventToInsights({
@@ -768,16 +770,16 @@
768
770
  widgetType: widgetType,
769
771
  eventType: eventType,
770
772
  eventModifier: eventModifier,
771
- payload: {
773
+ payload: _objectSpread2({
772
774
  eventName: eventName,
773
775
  index: helper.getIndex(),
774
776
  filters: ["".concat(attribute, ":").concat(facetValue)]
775
- },
777
+ }, additionalData),
776
778
  attribute: attribute
777
779
  });
778
780
  }
779
781
  } else {
780
- throw new Error("You need to pass two arguments like:\n sendEvent('click', facetValue);\n\nIf you want to send a custom payload, you can pass one object: sendEvent(customPayload);\n");
782
+ throw new Error("You need to pass between two and four arguments like:\n sendEvent('click', facetValue, eventName?, additionalData?);\n\nIf you want to send a custom payload, you can pass one object: sendEvent(customPayload);\n");
781
783
  }
782
784
  };
783
785
  return sendEventForFacet;
@@ -814,6 +816,7 @@
814
816
  eventModifier = _args$0$split2[1];
815
817
  var hits = args[1];
816
818
  var eventName = args[2];
819
+ var additionalData = args[3] || {};
817
820
  if (!hits) {
818
821
  {
819
822
  throw new Error("You need to pass hit or hits as the second argument like:\n ".concat(methodName, "(eventType, hit);\n "));
@@ -849,11 +852,11 @@
849
852
  insightsMethod: 'viewedObjectIDs',
850
853
  widgetType: widgetType,
851
854
  eventType: eventType,
852
- payload: {
855
+ payload: _objectSpread2({
853
856
  eventName: eventName || 'Hits Viewed',
854
857
  index: index,
855
858
  objectIDs: objectIDsByChunk[i]
856
- },
859
+ }, additionalData),
857
860
  hits: batch,
858
861
  eventModifier: eventModifier
859
862
  };
@@ -864,13 +867,13 @@
864
867
  insightsMethod: 'clickedObjectIDsAfterSearch',
865
868
  widgetType: widgetType,
866
869
  eventType: eventType,
867
- payload: {
870
+ payload: _objectSpread2({
868
871
  eventName: eventName || 'Hit Clicked',
869
872
  index: index,
870
873
  queryID: queryID,
871
874
  objectIDs: objectIDsByChunk[i],
872
875
  positions: positionsByChunk[i]
873
- },
876
+ }, additionalData),
874
877
  hits: batch,
875
878
  eventModifier: eventModifier
876
879
  };
@@ -881,12 +884,12 @@
881
884
  insightsMethod: 'convertedObjectIDsAfterSearch',
882
885
  widgetType: widgetType,
883
886
  eventType: eventType,
884
- payload: {
887
+ payload: _objectSpread2({
885
888
  eventName: eventName || 'Hit Converted',
886
889
  index: index,
887
890
  queryID: queryID,
888
891
  objectIDs: objectIDsByChunk[i]
889
- },
892
+ }, additionalData),
890
893
  hits: batch,
891
894
  eventModifier: eventModifier
892
895
  };
@@ -1408,6 +1411,111 @@
1408
1411
  });
1409
1412
  }
1410
1413
 
1414
+ // @ts-nocheck (types to be fixed during actual implementation)
1415
+
1416
+ function hydrateSearchClient(client, results) {
1417
+ if (!results) {
1418
+ return;
1419
+ }
1420
+
1421
+ // Disable cache hydration on:
1422
+ // - Algoliasearch API Client < v4 with cache disabled
1423
+ // - Third party clients (detected by the `addAlgoliaAgent` function missing)
1424
+
1425
+ if ((!client.transporter || client._cacheHydrated) && (!client._useCache || typeof client.addAlgoliaAgent !== 'function')) {
1426
+ return;
1427
+ }
1428
+
1429
+ // Algoliasearch API Client >= v4
1430
+ // To hydrate the client we need to populate the cache with the data from
1431
+ // the server (done in `hydrateSearchClientWithMultiIndexRequest` or
1432
+ // `hydrateSearchClientWithSingleIndexRequest`). But since there is no way
1433
+ // for us to compute the key the same way as `algoliasearch-client` we need
1434
+ // to populate it on a custom key and override the `search` method to
1435
+ // search on it first.
1436
+ if (client.transporter && !client._cacheHydrated) {
1437
+ client._cacheHydrated = true;
1438
+ var baseMethod = client.search;
1439
+ client.search = function (requests) {
1440
+ for (var _len = arguments.length, methodArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1441
+ methodArgs[_key - 1] = arguments[_key];
1442
+ }
1443
+ var requestsWithSerializedParams = requests.map(function (request) {
1444
+ return _objectSpread2(_objectSpread2({}, request), {}, {
1445
+ params: serializeQueryParameters(request.params)
1446
+ });
1447
+ });
1448
+ return client.transporter.responsesCache.get({
1449
+ method: 'search',
1450
+ args: [requestsWithSerializedParams].concat(methodArgs)
1451
+ }, function () {
1452
+ return baseMethod.apply(void 0, [requests].concat(methodArgs));
1453
+ });
1454
+ };
1455
+
1456
+ // Populate the cache with the data from the server
1457
+ client.transporter.responsesCache.set({
1458
+ method: 'search',
1459
+ args: [Object.keys(results).reduce(function (acc, key) {
1460
+ return acc.concat(results[key].results.map(function (request) {
1461
+ return {
1462
+ indexName: request.index,
1463
+ params: request.params
1464
+ };
1465
+ }));
1466
+ }, [])]
1467
+ }, {
1468
+ results: Object.keys(results).reduce(function (acc, key) {
1469
+ return acc.concat(results[key].results);
1470
+ }, [])
1471
+ });
1472
+ }
1473
+
1474
+ // Algoliasearch API Client < v4
1475
+ // Prior to client v4 we didn't have a proper API to hydrate the client
1476
+ // cache from the outside. The following code populates the cache with
1477
+ // a single-index result. You can find more information about the
1478
+ // computation of the key inside the client (see link below).
1479
+ // https://github.com/algolia/algoliasearch-client-javascript/blob/c27e89ff92b2a854ae6f40dc524bffe0f0cbc169/src/AlgoliaSearchCore.js#L232-L240
1480
+ if (!client.transporter) {
1481
+ var cacheKey = "/1/indexes/*/queries_body_".concat(JSON.stringify({
1482
+ requests: Object.keys(results).reduce(function (acc, key) {
1483
+ return acc.concat(results[key].rawResults.map(function (request) {
1484
+ return {
1485
+ indexName: request.index,
1486
+ params: request.params
1487
+ };
1488
+ }));
1489
+ }, [])
1490
+ }));
1491
+ client.cache = _objectSpread2(_objectSpread2({}, client.cache), {}, _defineProperty({}, cacheKey, JSON.stringify({
1492
+ results: Object.keys(results).reduce(function (acc, key) {
1493
+ return acc.concat(results[key].rawResults);
1494
+ }, [])
1495
+ })));
1496
+ }
1497
+ }
1498
+
1499
+ // This function is copied from the algoliasearch v4 API Client. If modified,
1500
+ // consider updating it also in `serializeQueryParameters` from `@algolia/transporter`.
1501
+ function serializeQueryParameters(parameters) {
1502
+ var isObjectOrArray = function isObjectOrArray(value) {
1503
+ return Object.prototype.toString.call(value) === '[object Object]' || Object.prototype.toString.call(value) === '[object Array]';
1504
+ };
1505
+ var encode = function encode(format) {
1506
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
1507
+ args[_key2 - 1] = arguments[_key2];
1508
+ }
1509
+ var i = 0;
1510
+ return format.replace(/%s/g, function () {
1511
+ return encodeURIComponent(args[i++]);
1512
+ });
1513
+ };
1514
+ return Object.keys(parameters).map(function (key) {
1515
+ return encode('%s=%s', key, isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key]);
1516
+ }).join('&');
1517
+ }
1518
+
1411
1519
  function isPrimitive(obj) {
1412
1520
  return obj !== Object(obj);
1413
1521
  }
@@ -9911,7 +10019,7 @@
9911
10019
 
9912
10020
  var SearchResults_1 = SearchResults;
9913
10021
 
9914
- var version = '3.14.2';
10022
+ var version = '3.15.0';
9915
10023
 
9916
10024
  var escapeFacetValue$4 = escapeFacetValue_1.escapeFacetValue;
9917
10025
 
@@ -12554,7 +12662,9 @@
12554
12662
  insightsInitParams = props.insightsInitParams,
12555
12663
  onEvent = props.onEvent,
12556
12664
  _props$$$internal = props.$$internal,
12557
- $$internal = _props$$$internal === void 0 ? false : _props$$$internal;
12665
+ $$internal = _props$$$internal === void 0 ? false : _props$$$internal,
12666
+ _props$$$automatic = props.$$automatic,
12667
+ $$automatic = _props$$$automatic === void 0 ? false : _props$$$automatic;
12558
12668
  var potentialInsightsClient = _insightsClient;
12559
12669
  if (!_insightsClient && _insightsClient !== null) {
12560
12670
  safelyRunOnBrowser(function (_ref) {
@@ -12645,6 +12755,7 @@
12645
12755
  return {
12646
12756
  $$type: 'ais.insights',
12647
12757
  $$internal: $$internal,
12758
+ $$automatic: $$automatic,
12648
12759
  onStateChange: function onStateChange() {},
12649
12760
  subscribe: function subscribe() {
12650
12761
  if (!insightsClient.shouldAddScript) return;
@@ -12670,9 +12781,14 @@
12670
12781
  userToken: helper.state.userToken,
12671
12782
  clickAnalytics: helper.state.clickAnalytics
12672
12783
  };
12673
- helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread2(_objectSpread2({}, helper.state), {}, {
12674
- clickAnalytics: true
12675
- }));
12784
+
12785
+ // We don't want to force clickAnalytics when the insights is enabled from the search response.
12786
+ // This means we don't enable insights for indices that don't opt in
12787
+ if (!$$automatic) {
12788
+ helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread2(_objectSpread2({}, helper.state), {}, {
12789
+ clickAnalytics: true
12790
+ }));
12791
+ }
12676
12792
  if (!$$internal) {
12677
12793
  instantSearchInstance.scheduleSearch();
12678
12794
  }
@@ -12739,6 +12855,9 @@
12739
12855
  } else if (event.insightsMethod) {
12740
12856
  // Source is used to differentiate events sent by instantsearch from those sent manually.
12741
12857
  event.payload.algoliaSource = ['instantsearch'];
12858
+ if ($$automatic) {
12859
+ event.payload.algoliaSource.push('instantsearch-automatic');
12860
+ }
12742
12861
  if (event.eventModifier === 'internal') {
12743
12862
  event.payload.algoliaSource.push('instantsearch-internal');
12744
12863
  }
@@ -14626,7 +14745,7 @@
14626
14745
  };
14627
14746
  }
14628
14747
 
14629
- var version$1 = '4.58.0';
14748
+ var version$1 = '4.60.0';
14630
14749
 
14631
14750
  var withUsage$r = createDocumentationMessageGenerator({
14632
14751
  name: 'instantsearch'
@@ -14678,6 +14797,7 @@
14678
14797
  _defineProperty(_assertThisInitialized(_this), "_createURL", void 0);
14679
14798
  _defineProperty(_assertThisInitialized(_this), "_searchFunction", void 0);
14680
14799
  _defineProperty(_assertThisInitialized(_this), "_mainHelperSearch", void 0);
14800
+ _defineProperty(_assertThisInitialized(_this), "_insights", void 0);
14681
14801
  _defineProperty(_assertThisInitialized(_this), "middleware", []);
14682
14802
  _defineProperty(_assertThisInitialized(_this), "sendEventToInsights", void 0);
14683
14803
  /**
@@ -14728,7 +14848,7 @@
14728
14848
  _options$routing = options.routing,
14729
14849
  routing = _options$routing === void 0 ? null : _options$routing,
14730
14850
  _options$insights = options.insights,
14731
- insights = _options$insights === void 0 ? false : _options$insights,
14851
+ insights = _options$insights === void 0 ? undefined : _options$insights,
14732
14852
  searchFunction = options.searchFunction,
14733
14853
  _options$stalledSearc = options.stalledSearchDelay,
14734
14854
  stalledSearchDelay = _options$stalledSearc === void 0 ? 200 : _options$stalledSearc,
@@ -14784,6 +14904,7 @@
14784
14904
  _this._createURL = defaultCreateURL;
14785
14905
  _this._initialUiState = initialUiState;
14786
14906
  _this._initialResults = null;
14907
+ _this._insights = insights;
14787
14908
  if (searchFunction) {
14788
14909
  _warning(false, "The `searchFunction` option is deprecated. Use `onStateChange` instead.") ;
14789
14910
  _this._searchFunction = searchFunction;
@@ -14795,8 +14916,9 @@
14795
14916
  _this.use(createRouterMiddleware(routerOptions));
14796
14917
  }
14797
14918
 
14798
- // This is the default middleware,
14799
- // any user-provided middleware will be added later and override this one.
14919
+ // This is the default Insights middleware,
14920
+ // added when `insights` is set to true by the user.
14921
+ // Any user-provided middleware will be added later and override this one.
14800
14922
  if (insights) {
14801
14923
  var insightsOptions = typeof insights === 'boolean' ? {} : insights;
14802
14924
  insightsOptions.$$internal = true;
@@ -15051,6 +15173,7 @@
15051
15173
  uiState: this._initialUiState
15052
15174
  });
15053
15175
  if (this._initialResults) {
15176
+ hydrateSearchClient(this.client, this._initialResults);
15054
15177
  var originalScheduleSearch = this.scheduleSearch;
15055
15178
  // We don't schedule a first search when initial results are provided
15056
15179
  // because we already have the results to render. This skips the initial
@@ -15088,6 +15211,24 @@
15088
15211
  var instance = _ref6.instance;
15089
15212
  instance.started();
15090
15213
  });
15214
+
15215
+ // This is the automatic Insights middleware,
15216
+ // added when `insights` is unset and the initial results possess `queryID`.
15217
+ // Any user-provided middleware will be added later and override this one.
15218
+ if (typeof this._insights === 'undefined') {
15219
+ mainHelper.derivedHelpers[0].once('result', function () {
15220
+ var hasAutomaticInsights = _this3.mainIndex.getScopedResults().some(function (_ref7) {
15221
+ var results = _ref7.results;
15222
+ return results === null || results === void 0 ? void 0 : results._automaticInsights;
15223
+ });
15224
+ if (hasAutomaticInsights) {
15225
+ _this3.use(createInsightsMiddleware({
15226
+ $$internal: true,
15227
+ $$automatic: true
15228
+ }));
15229
+ }
15230
+ });
15231
+ }
15091
15232
  }
15092
15233
 
15093
15234
  /**
@@ -15117,8 +15258,8 @@
15117
15258
  (_this$mainHelper2 = this.mainHelper) === null || _this$mainHelper2 === void 0 ? void 0 : _this$mainHelper2.removeAllListeners();
15118
15259
  this.mainHelper = null;
15119
15260
  this.helper = null;
15120
- this.middleware.forEach(function (_ref7) {
15121
- var instance = _ref7.instance;
15261
+ this.middleware.forEach(function (_ref8) {
15262
+ var instance = _ref8.instance;
15122
15263
  instance.unsubscribe();
15123
15264
  });
15124
15265
  }
@@ -17756,6 +17897,7 @@
17756
17897
  searchAsYouType: true,
17757
17898
  isSearchStalled: false,
17758
17899
  disabled: false,
17900
+ ariaLabel: 'Search',
17759
17901
  onChange: noop,
17760
17902
  onSubmit: noop,
17761
17903
  onReset: noop,
@@ -17872,7 +18014,8 @@
17872
18014
  showReset = _this$props4.showReset,
17873
18015
  showLoadingIndicator = _this$props4.showLoadingIndicator,
17874
18016
  templates = _this$props4.templates,
17875
- isSearchStalled = _this$props4.isSearchStalled;
18017
+ isSearchStalled = _this$props4.isSearchStalled,
18018
+ ariaLabel = _this$props4.ariaLabel;
17876
18019
  return h("div", {
17877
18020
  className: cssClasses.root
17878
18021
  }, h("form", {
@@ -17899,7 +18042,8 @@
17899
18042
  maxLength: 512,
17900
18043
  onInput: this.onInput,
17901
18044
  onBlur: this.onBlur,
17902
- onFocus: this.onFocus
18045
+ onFocus: this.onFocus,
18046
+ "aria-label": ariaLabel
17903
18047
  }), h(Template, {
17904
18048
  templateKey: "submit",
17905
18049
  rootTagName: "button",
@@ -18148,7 +18292,8 @@
18148
18292
  // This sets the search box to a controlled state because
18149
18293
  // we don't rely on the `refine` prop but on `onChange`.
18150
18294
  ,
18151
- searchAsYouType: false
18295
+ searchAsYouType: false,
18296
+ ariaLabel: "Search for filters"
18152
18297
  }));
18153
18298
  var facetValues = this.props.facetValues && this.props.facetValues.length > 0 && h("ul", {
18154
18299
  className: this.props.cssClasses.list
@@ -18517,13 +18662,15 @@
18517
18662
  var currentValue = _ref.currentValue,
18518
18663
  options = _ref.options,
18519
18664
  cssClasses = _ref.cssClasses,
18520
- setValue = _ref.setValue;
18665
+ setValue = _ref.setValue,
18666
+ ariaLabel = _ref.ariaLabel;
18521
18667
  return h("select", {
18522
18668
  className: cx(cssClasses.select),
18523
18669
  onChange: function onChange(event) {
18524
18670
  return setValue(event.target.value);
18525
18671
  },
18526
- value: "".concat(currentValue)
18672
+ value: "".concat(currentValue),
18673
+ "aria-label": ariaLabel
18527
18674
  }, options.map(function (option) {
18528
18675
  return h("option", {
18529
18676
  className: cx(cssClasses.option),
@@ -19183,7 +19330,7 @@
19183
19330
  }, h("ul", {
19184
19331
  className: props.cssClasses.list
19185
19332
  }, props.showFirst && h(PaginationLink, {
19186
- ariaLabel: "First",
19333
+ ariaLabel: "First Page",
19187
19334
  className: props.cssClasses.firstPageItem,
19188
19335
  isDisabled: props.isFirstPage,
19189
19336
  templates: props.templates,
@@ -19193,7 +19340,7 @@
19193
19340
  cssClasses: props.cssClasses,
19194
19341
  createClickHandler: createClickHandler
19195
19342
  }), props.showPrevious && h(PaginationLink, {
19196
- ariaLabel: "Previous",
19343
+ ariaLabel: "Previous Page",
19197
19344
  className: props.cssClasses.previousPageItem,
19198
19345
  isDisabled: props.isFirstPage,
19199
19346
  templates: props.templates,
@@ -19216,7 +19363,7 @@
19216
19363
  createClickHandler: createClickHandler
19217
19364
  });
19218
19365
  }), props.showNext && h(PaginationLink, {
19219
- ariaLabel: "Next",
19366
+ ariaLabel: "Next Page",
19220
19367
  className: props.cssClasses.nextPageItem,
19221
19368
  isDisabled: props.isLastPage,
19222
19369
  templates: props.templates,
@@ -19226,7 +19373,7 @@
19226
19373
  cssClasses: props.cssClasses,
19227
19374
  createClickHandler: createClickHandler
19228
19375
  }), props.showLast && h(PaginationLink, {
19229
- ariaLabel: "Last",
19376
+ ariaLabel: "Last Page, Page ".concat(props.nbPages),
19230
19377
  className: props.cssClasses.lastPageItem,
19231
19378
  isDisabled: props.isLastPage,
19232
19379
  templates: props.templates,
@@ -20723,8 +20870,10 @@
20723
20870
  parseFloat(props['aria-valuenow']) * 100) / 100;
20724
20871
  var value = _typeof(tooltips) === 'object' && tooltips.format ? tooltips.format(roundedValue) : roundedValue;
20725
20872
  var className = cx(props.className, props['data-handle-key'] === 0 && 'rheostat-handle-lower', props['data-handle-key'] === 1 && 'rheostat-handle-upper');
20873
+ var ariaLabel = props['data-handle-key'] === 0 ? 'Minimum Filter Handle' : 'Maximum Filter Handle';
20726
20874
  return h("div", _extends({}, props, {
20727
- className: className
20875
+ className: className,
20876
+ "aria-label": ariaLabel
20728
20877
  }), tooltips && h("div", {
20729
20878
  className: "rheostat-tooltip"
20730
20879
  }, value));
@@ -21646,7 +21795,8 @@
21646
21795
  cssClasses: cssClasses,
21647
21796
  currentValue: currentRefinement,
21648
21797
  options: options,
21649
- setValue: refine
21798
+ setValue: refine,
21799
+ ariaLabel: "Sort results by"
21650
21800
  })), containerNode);
21651
21801
  };
21652
21802
  };