@coveo/atomic-react 3.11.29 → 3.11.30

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.
@@ -3349,7 +3349,7 @@ function getAugmentedNamespace(n) {
3349
3349
  var isInstance = false;
3350
3350
  try {
3351
3351
  isInstance = this instanceof a;
3352
- } catch {}
3352
+ } catch (e) {}
3353
3353
  if (isInstance) {
3354
3354
  return Reflect.construct(f, arguments, this.constructor);
3355
3355
  }
@@ -7250,7 +7250,7 @@ function getWindow$1() {
7250
7250
  }
7251
7251
  function getAtomicEnvironment(headlessVersion) {
7252
7252
  return {
7253
- version: "3.59.6",
7253
+ version: "3.59.7",
7254
7254
  headlessVersion
7255
7255
  };
7256
7256
  }
@@ -25776,14 +25776,29 @@ let AtomicDidYouMean$1 = class AtomicDidYouMean extends lit.LitElement {
25776
25776
  }
25777
25777
  render() {
25778
25778
  const hasCorrection = this.didYouMeanState.hasQueryCorrection || this.queryTriggerState.wasQueryModified;
25779
+ if (hasCorrection) this.ariaMessage.message = this.getAriaLiveMessage();
25779
25780
  _class_private_field_get$4(this, _hiddenState$2).isEmpty = !hasCorrection;
25780
25781
  return lit.html`${when_js.when(hasCorrection, ()=>this.content)}`;
25781
25782
  }
25783
+ getAriaLiveMessage() {
25784
+ const { hasQueryCorrection, wasAutomaticallyCorrected } = this.didYouMeanState;
25785
+ const hasTrigger = this.queryTriggerState.wasQueryModified;
25786
+ if (hasQueryCorrection && wasAutomaticallyCorrected) return this.bindings.i18n.t('query-auto-corrected-to', {
25787
+ query: this.didYouMeanState.wasCorrectedTo
25788
+ });
25789
+ if (hasQueryCorrection) return this.bindings.i18n.t('did-you-mean', {
25790
+ query: this.didYouMeanState.queryCorrection.correctedQuery
25791
+ });
25792
+ if (hasTrigger) return this.bindings.i18n.t('showing-results-for', {
25793
+ query: this.queryTriggerState.newQuery
25794
+ });
25795
+ return '';
25796
+ }
25782
25797
  constructor(){
25783
25798
  super(), _class_private_field_init$4(this, _hiddenState$2, {
25784
25799
  writable: true,
25785
25800
  value: void 0
25786
- }), _class_private_field_set$3(this, _hiddenState$2, new HiddenStateController(this)), this.automaticallyCorrectQuery = true, this.queryCorrectionMode = 'next';
25801
+ }), this.ariaMessage = new AriaLiveRegionController(this, 'did-you-mean'), _class_private_field_set$3(this, _hiddenState$2, new HiddenStateController(this)), this.automaticallyCorrectQuery = true, this.queryCorrectionMode = 'next';
25787
25802
  new ValidatePropsController(this, ()=>({
25788
25803
  queryCorrectionMode: this.queryCorrectionMode
25789
25804
  }), AtomicDidYouMean.propsSchema, false);
@@ -28061,7 +28076,7 @@ let AtomicNoResults$1 = class AtomicNoResults extends lit.LitElement {
28061
28076
  }
28062
28077
  render() {
28063
28078
  const { bindings: { i18n } } = this;
28064
- this.ariaMessage.message = getSummary(i18n, this.querySummaryState.query, this.searchStatusState.hasResults, 'no-results');
28079
+ this.ariaMessage.message = this.searchStatusState.firstSearchExecuted && !this.searchStatusState.isLoading ? getSummary(i18n, this.querySummaryState.query, this.searchStatusState.hasResults, 'no-results') : '';
28065
28080
  return lit.html`${noItemsGuard({
28066
28081
  isLoading: this.searchStatusState.isLoading,
28067
28082
  firstSearchExecuted: this.searchStatusState.firstSearchExecuted,