@coveo/atomic 3.59.4 → 3.59.6

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 (48) hide show
  1. package/custom-elements.json +1956 -1907
  2. package/dist/cjs/components/commerce/atomic-commerce-pager/atomic-commerce-pager.cjs +1 -1
  3. package/dist/cjs/components/common/atomic-smart-snippet-expandable-answer/atomic-smart-snippet-expandable-answer.cjs +1 -0
  4. package/dist/cjs/components/common/expandable-text/expandable-text.cjs +3 -0
  5. package/dist/cjs/components/common/facets/facet-search/facet-search-aria-live.cjs +6 -7
  6. package/dist/cjs/components/common/generated-answer/generated-answer-controller.cjs +1 -1
  7. package/dist/cjs/components/common/generated-answer/show-button.cjs +1 -0
  8. package/dist/cjs/components/insight/atomic-insight-pager/atomic-insight-pager.cjs +1 -1
  9. package/dist/cjs/components/insight/atomic-insight-smart-snippet-suggestions/atomic-insight-smart-snippet-suggestions.cjs +3 -3
  10. package/dist/cjs/components/search/atomic-breadbox/atomic-breadbox.cjs +38 -1
  11. package/dist/cjs/components/search/atomic-did-you-mean/atomic-did-you-mean.cjs +38 -1
  12. package/dist/cjs/components/search/atomic-notifications/atomic-notifications.cjs +38 -1
  13. package/dist/cjs/components/search/atomic-numeric-facet/atomic-numeric-facet.cjs +4 -3
  14. package/dist/cjs/components/search/atomic-pager/atomic-pager.cjs +1 -1
  15. package/dist/cjs/components/search/atomic-refine-modal/atomic-refine-modal.cjs +38 -1
  16. package/dist/cjs/components/search/atomic-smart-snippet/atomic-smart-snippet.cjs +3 -3
  17. package/dist/cjs/components/search/atomic-smart-snippet-suggestions/atomic-smart-snippet-suggestions.cjs +3 -3
  18. package/dist/cjs/global/environment.cjs +1 -1
  19. package/dist/cjs/utils/hidden-state-controller.cjs +5 -4
  20. package/dist/cjs/versions.cjs +1 -1
  21. package/dist/esm/components/commerce/atomic-commerce-pager/atomic-commerce-pager.js +1 -1
  22. package/dist/esm/components/common/atomic-smart-snippet-expandable-answer/atomic-smart-snippet-expandable-answer.js +1 -0
  23. package/dist/esm/components/common/expandable-text/expandable-text.js +3 -0
  24. package/dist/esm/components/common/facets/facet-search/facet-search-aria-live.js +6 -7
  25. package/dist/esm/components/common/generated-answer/generated-answer-controller.js +1 -1
  26. package/dist/esm/components/common/generated-answer/show-button.js +1 -0
  27. package/dist/esm/components/insight/atomic-insight-pager/atomic-insight-pager.js +1 -1
  28. package/dist/esm/components/insight/atomic-insight-smart-snippet-suggestions/atomic-insight-smart-snippet-suggestions.js +3 -3
  29. package/dist/esm/components/search/atomic-breadbox/atomic-breadbox.js +38 -1
  30. package/dist/esm/components/search/atomic-did-you-mean/atomic-did-you-mean.js +38 -1
  31. package/dist/esm/components/search/atomic-notifications/atomic-notifications.js +38 -1
  32. package/dist/esm/components/search/atomic-numeric-facet/atomic-numeric-facet.js +4 -3
  33. package/dist/esm/components/search/atomic-pager/atomic-pager.js +1 -1
  34. package/dist/esm/components/search/atomic-refine-modal/atomic-refine-modal.js +38 -1
  35. package/dist/esm/components/search/atomic-smart-snippet/atomic-smart-snippet.js +3 -3
  36. package/dist/esm/components/search/atomic-smart-snippet-suggestions/atomic-smart-snippet-suggestions.js +3 -3
  37. package/dist/esm/global/environment.js +1 -1
  38. package/dist/esm/utils/hidden-state-controller.js +5 -4
  39. package/dist/esm/versions.js +1 -1
  40. package/dist/types/components/insight/atomic-insight-generated-answer/atomic-insight-generated-answer.d.ts +0 -1
  41. package/dist/types/components/search/atomic-breadbox/atomic-breadbox.d.ts +3 -0
  42. package/dist/types/components/search/atomic-did-you-mean/atomic-did-you-mean.d.ts +3 -0
  43. package/dist/types/components/search/atomic-generated-answer/atomic-generated-answer.d.ts +0 -1
  44. package/dist/types/components/search/atomic-notifications/atomic-notifications.d.ts +3 -0
  45. package/dist/types/components/search/atomic-numeric-facet/atomic-numeric-facet.d.ts +1 -1
  46. package/dist/types/components/search/atomic-refine-modal/atomic-refine-modal.d.ts +3 -0
  47. package/dist/types/utils/hidden-state-controller.d.ts +15 -0
  48. package/package.json +4 -4
@@ -16,6 +16,38 @@ import { errorGuard } from "../../../decorators/error-guard.js";
16
16
  import { withTailwindStyles } from "../../../decorators/with-tailwind-styles.js";
17
17
  import { AriaLiveRegionController, FocusTargetController } from "../../../utils/accessibility-utils.js";
18
18
  import { getFieldValueCaption } from "../../../utils/field-utils.js";
19
+ import { HiddenStateController } from "../../../utils/hidden-state-controller.js";
20
+ function _check_private_redeclaration(obj, privateCollection) {
21
+ if (privateCollection.has(obj)) throw new TypeError("Cannot initialize the same private elements twice on an object");
22
+ }
23
+ function _class_apply_descriptor_get(receiver, descriptor) {
24
+ if (descriptor.get) return descriptor.get.call(receiver);
25
+ return descriptor.value;
26
+ }
27
+ function _class_apply_descriptor_set(receiver, descriptor, value) {
28
+ if (descriptor.set) descriptor.set.call(receiver, value);
29
+ else {
30
+ if (!descriptor.writable) throw new TypeError("attempted to set read only private field");
31
+ descriptor.value = value;
32
+ }
33
+ }
34
+ function _class_extract_field_descriptor(receiver, privateMap, action) {
35
+ if (!privateMap.has(receiver)) throw new TypeError("attempted to " + action + " private field on non-instance");
36
+ return privateMap.get(receiver);
37
+ }
38
+ function _class_private_field_get(receiver, privateMap) {
39
+ var descriptor = _class_extract_field_descriptor(receiver, privateMap, "get");
40
+ return _class_apply_descriptor_get(receiver, descriptor);
41
+ }
42
+ function _class_private_field_init(obj, privateMap, value) {
43
+ _check_private_redeclaration(obj, privateMap);
44
+ privateMap.set(obj, value);
45
+ }
46
+ function _class_private_field_set(receiver, privateMap, value) {
47
+ var descriptor = _class_extract_field_descriptor(receiver, privateMap, "set");
48
+ _class_apply_descriptor_set(receiver, descriptor, value);
49
+ return value;
50
+ }
19
51
  function _ts_decorate(decorators, target, key, desc) {
20
52
  var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
21
53
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);
@@ -25,6 +57,7 @@ function _ts_decorate(decorators, target, key, desc) {
25
57
  function _ts_metadata(k, v) {
26
58
  if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
27
59
  }
60
+ var _hiddenState = /*#__PURE__*/ new WeakMap();
28
61
  class AtomicBreadbox extends LitElement {
29
62
  initialize() {
30
63
  this.breadcrumbManager = buildBreadcrumbManager(this.bindings.engine);
@@ -43,6 +76,7 @@ class AtomicBreadbox extends LitElement {
43
76
  }
44
77
  render() {
45
78
  const breadcrumbs = this.allBreadcrumbs;
79
+ _class_private_field_get(this, _hiddenState).isEmpty = !breadcrumbs.length;
46
80
  if (!breadcrumbs.length) return nothing;
47
81
  return html`${renderBreadcrumbContainer({
48
82
  props: {
@@ -261,7 +295,10 @@ class AtomicBreadbox extends LitElement {
261
295
  });
262
296
  }
263
297
  constructor(){
264
- super(), this.lastRemovedBreadcrumbIndex = 0, this.numberOfBreadcrumbs = 0, this.numberOfCollapsedBreadcrumbs = 0, this.isCollapsed = true, this.showMoreText = '', this.disableCollapse = false, this.breadboxAriaMessage = new AriaLiveRegionController(this, 'breadbox', true), this.pathLimit = 3;
298
+ super(), _class_private_field_init(this, _hiddenState, {
299
+ writable: true,
300
+ value: void 0
301
+ }), this.lastRemovedBreadcrumbIndex = 0, this.numberOfBreadcrumbs = 0, this.numberOfCollapsedBreadcrumbs = 0, _class_private_field_set(this, _hiddenState, new HiddenStateController(this)), this.isCollapsed = true, this.showMoreText = '', this.disableCollapse = false, this.breadboxAriaMessage = new AriaLiveRegionController(this, 'breadbox', true), this.pathLimit = 3;
265
302
  new ValidatePropsController(this, ()=>({
266
303
  pathLimit: this.pathLimit
267
304
  }), AtomicBreadbox.propsSchema);
@@ -10,9 +10,41 @@ import { bindingGuard } from "../../../decorators/binding-guard.js";
10
10
  import { bindings } from "../../../decorators/bindings.js";
11
11
  import { errorGuard } from "../../../decorators/error-guard.js";
12
12
  import { withTailwindStyles } from "../../../decorators/with-tailwind-styles.js";
13
+ import { HiddenStateController } from "../../../utils/hidden-state-controller.js";
13
14
  import { renderAutoCorrection } from "../../common/query-correction/auto-correction.js";
14
15
  import { renderCorrection } from "../../common/query-correction/correction.js";
15
16
  import { renderTriggerCorrection } from "../../common/query-correction/trigger-correction.js";
17
+ function _check_private_redeclaration(obj, privateCollection) {
18
+ if (privateCollection.has(obj)) throw new TypeError("Cannot initialize the same private elements twice on an object");
19
+ }
20
+ function _class_apply_descriptor_get(receiver, descriptor) {
21
+ if (descriptor.get) return descriptor.get.call(receiver);
22
+ return descriptor.value;
23
+ }
24
+ function _class_apply_descriptor_set(receiver, descriptor, value) {
25
+ if (descriptor.set) descriptor.set.call(receiver, value);
26
+ else {
27
+ if (!descriptor.writable) throw new TypeError("attempted to set read only private field");
28
+ descriptor.value = value;
29
+ }
30
+ }
31
+ function _class_extract_field_descriptor(receiver, privateMap, action) {
32
+ if (!privateMap.has(receiver)) throw new TypeError("attempted to " + action + " private field on non-instance");
33
+ return privateMap.get(receiver);
34
+ }
35
+ function _class_private_field_get(receiver, privateMap) {
36
+ var descriptor = _class_extract_field_descriptor(receiver, privateMap, "get");
37
+ return _class_apply_descriptor_get(receiver, descriptor);
38
+ }
39
+ function _class_private_field_init(obj, privateMap, value) {
40
+ _check_private_redeclaration(obj, privateMap);
41
+ privateMap.set(obj, value);
42
+ }
43
+ function _class_private_field_set(receiver, privateMap, value) {
44
+ var descriptor = _class_extract_field_descriptor(receiver, privateMap, "set");
45
+ _class_apply_descriptor_set(receiver, descriptor, value);
46
+ return value;
47
+ }
16
48
  function _ts_decorate(decorators, target, key, desc) {
17
49
  var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
18
50
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);
@@ -22,6 +54,7 @@ function _ts_decorate(decorators, target, key, desc) {
22
54
  function _ts_metadata(k, v) {
23
55
  if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
24
56
  }
57
+ var _hiddenState = /*#__PURE__*/ new WeakMap();
25
58
  class AtomicDidYouMean extends LitElement {
26
59
  initialize() {
27
60
  this.didYouMean = buildDidYouMean(this.bindings.engine, {
@@ -65,10 +98,14 @@ class AtomicDidYouMean extends LitElement {
65
98
  }
66
99
  render() {
67
100
  const hasCorrection = this.didYouMeanState.hasQueryCorrection || this.queryTriggerState.wasQueryModified;
101
+ _class_private_field_get(this, _hiddenState).isEmpty = !hasCorrection;
68
102
  return html`${when(hasCorrection, ()=>this.content)}`;
69
103
  }
70
104
  constructor(){
71
- super(), this.automaticallyCorrectQuery = true, this.queryCorrectionMode = 'next';
105
+ super(), _class_private_field_init(this, _hiddenState, {
106
+ writable: true,
107
+ value: void 0
108
+ }), _class_private_field_set(this, _hiddenState, new HiddenStateController(this)), this.automaticallyCorrectQuery = true, this.queryCorrectionMode = 'next';
72
109
  new ValidatePropsController(this, ()=>({
73
110
  queryCorrectionMode: this.queryCorrectionMode
74
111
  }), AtomicDidYouMean.propsSchema, false);
@@ -13,7 +13,39 @@ import { errorGuard } from "../../../decorators/error-guard.js";
13
13
  import { withTailwindStyles } from "../../../decorators/with-tailwind-styles.js";
14
14
  import { InitializeBindingsMixin } from "../../../mixins/bindings-mixin.js";
15
15
  import { AriaLiveRegionController } from "../../../utils/accessibility-utils.js";
16
+ import { HiddenStateController } from "../../../utils/hidden-state-controller.js";
16
17
  import info from "../../../images/info.js";
18
+ function _check_private_redeclaration(obj, privateCollection) {
19
+ if (privateCollection.has(obj)) throw new TypeError("Cannot initialize the same private elements twice on an object");
20
+ }
21
+ function _class_apply_descriptor_get(receiver, descriptor) {
22
+ if (descriptor.get) return descriptor.get.call(receiver);
23
+ return descriptor.value;
24
+ }
25
+ function _class_apply_descriptor_set(receiver, descriptor, value) {
26
+ if (descriptor.set) descriptor.set.call(receiver, value);
27
+ else {
28
+ if (!descriptor.writable) throw new TypeError("attempted to set read only private field");
29
+ descriptor.value = value;
30
+ }
31
+ }
32
+ function _class_extract_field_descriptor(receiver, privateMap, action) {
33
+ if (!privateMap.has(receiver)) throw new TypeError("attempted to " + action + " private field on non-instance");
34
+ return privateMap.get(receiver);
35
+ }
36
+ function _class_private_field_get(receiver, privateMap) {
37
+ var descriptor = _class_extract_field_descriptor(receiver, privateMap, "get");
38
+ return _class_apply_descriptor_get(receiver, descriptor);
39
+ }
40
+ function _class_private_field_init(obj, privateMap, value) {
41
+ _check_private_redeclaration(obj, privateMap);
42
+ privateMap.set(obj, value);
43
+ }
44
+ function _class_private_field_set(receiver, privateMap, value) {
45
+ var descriptor = _class_extract_field_descriptor(receiver, privateMap, "set");
46
+ _class_apply_descriptor_set(receiver, descriptor, value);
47
+ return value;
48
+ }
17
49
  function _ts_decorate(decorators, target, key, desc) {
18
50
  var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
51
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);
@@ -23,6 +55,7 @@ function _ts_decorate(decorators, target, key, desc) {
23
55
  function _ts_metadata(k, v) {
24
56
  if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
25
57
  }
58
+ var _hiddenState = /*#__PURE__*/ new WeakMap();
26
59
  class AtomicNotifications extends InitializeBindingsMixin(LitElement) {
27
60
  initialize() {
28
61
  this.notifyTrigger = buildNotifyTrigger(this.bindings.engine);
@@ -62,6 +95,7 @@ class AtomicNotifications extends InitializeBindingsMixin(LitElement) {
62
95
  `;
63
96
  }
64
97
  render() {
98
+ _class_private_field_get(this, _hiddenState).isEmpty = !this.notifications.length;
65
99
  if (!this.notifications.length) return nothing;
66
100
  this.ariaMessage.message = this.generateAriaMessage();
67
101
  return html`
@@ -75,7 +109,10 @@ class AtomicNotifications extends InitializeBindingsMixin(LitElement) {
75
109
  `;
76
110
  }
77
111
  constructor(){
78
- super(), this.headingLevel = 0, this.ariaMessage = new AriaLiveRegionController(this, 'notifications');
112
+ super(), _class_private_field_init(this, _hiddenState, {
113
+ writable: true,
114
+ value: void 0
115
+ }), this.headingLevel = 0, this.ariaMessage = new AriaLiveRegionController(this, 'notifications'), _class_private_field_set(this, _hiddenState, new HiddenStateController(this));
79
116
  new ValidatePropsController(this, ()=>({
80
117
  headingLevel: this.headingLevel
81
118
  }), AtomicNotifications.schema, false);
@@ -54,7 +54,7 @@ class AtomicNumericFacet extends LitElement {
54
54
  disconnectedCallback() {
55
55
  super.disconnectedCallback();
56
56
  if (!this.isConnected) {
57
- this.filterDependenciesManager?.stopWatching();
57
+ this.conditionManagers.forEach((manager)=>manager.stopWatching());
58
58
  this.removeNumberFormatListener?.();
59
59
  this.removeNumberInputApplyListener?.();
60
60
  this.unsubscribeFacetForRange?.();
@@ -167,6 +167,7 @@ class AtomicNumericFacet extends LitElement {
167
167
  this.unsubscribeFacetForRange = this.facetForRange.subscribe(()=>{
168
168
  this.facetState = this.facetForRange.state;
169
169
  });
170
+ this.conditionManagers.push(this.initializeDependenciesManager(this.facetState.facetId));
170
171
  return this.facetForRange;
171
172
  }
172
173
  initializeFilter() {
@@ -181,8 +182,8 @@ class AtomicNumericFacet extends LitElement {
181
182
  }
182
183
  }
183
184
  });
184
- this.filterDependenciesManager = this.initializeDependenciesManager(this.filter.state.facetId);
185
185
  this.filterState = this.filter.state;
186
+ this.conditionManagers.push(this.initializeDependenciesManager(this.filterState.facetId));
186
187
  this.unsubscribeFilter = this.filter.subscribe(()=>{
187
188
  this.filterState = this.filter.state;
188
189
  });
@@ -312,7 +313,7 @@ class AtomicNumericFacet extends LitElement {
312
313
  ${when(this.shouldRenderInput, ()=>this.renderInput())}`)}`))}`;
313
314
  }
314
315
  constructor(){
315
- super(), this.label = 'no-label', this.tabsIncluded = [], this.tabsExcluded = [], this.numberOfValues = 8, this.sortCriteria = 'ascending', this.rangeAlgorithm = 'equiprobable', this.displayValuesAs = 'checkbox', this.isCollapsed = false, this.headingLevel = 0, this.filterFacetCount = true, this.injectionDepth = 1000, this.manualRanges = [], this.formatter = defaultNumberFormatter;
316
+ super(), this.label = 'no-label', this.tabsIncluded = [], this.tabsExcluded = [], this.numberOfValues = 8, this.sortCriteria = 'ascending', this.rangeAlgorithm = 'equiprobable', this.displayValuesAs = 'checkbox', this.isCollapsed = false, this.headingLevel = 0, this.filterFacetCount = true, this.injectionDepth = 1000, this.manualRanges = [], this.formatter = defaultNumberFormatter, this.conditionManagers = [];
316
317
  new ValidatePropsController(this, ()=>({
317
318
  displayValuesAs: this.displayValuesAs,
318
319
  withInput: this.withInput
@@ -107,7 +107,7 @@ class AtomicPager extends InitializeBindingsMixin(LitElement) {
107
107
  }
108
108
  announcePageLoaded() {
109
109
  this.ariaMessage.message = this.bindings.i18n.t('pager-page-loaded', {
110
- pageNumber: this.pagerState.currentPage
110
+ page: this.pagerState.currentPage
111
111
  });
112
112
  }
113
113
  constructor(){
@@ -15,10 +15,42 @@ import { bindings } from "../../../decorators/bindings.js";
15
15
  import { errorGuard } from "../../../decorators/error-guard.js";
16
16
  import { watch } from "../../../decorators/watch.js";
17
17
  import { withTailwindStyles } from "../../../decorators/with-tailwind-styles.js";
18
+ import { HiddenStateController } from "../../../utils/hidden-state-controller.js";
18
19
  import { shouldDisplayOnCurrentTab } from "../../../utils/tab-utils.js";
19
20
  import { sortByDocumentPosition } from "../../../utils/utils.js";
20
21
  import { collapseFacetsAfter, sortFacetVisibility, triageFacetsByParents } from "../../common/facets/facet-common.js";
21
22
  import "../atomic-automatic-facet-generator/atomic-automatic-facet-generator.js";
23
+ function _check_private_redeclaration(obj, privateCollection) {
24
+ if (privateCollection.has(obj)) throw new TypeError("Cannot initialize the same private elements twice on an object");
25
+ }
26
+ function _class_apply_descriptor_get(receiver, descriptor) {
27
+ if (descriptor.get) return descriptor.get.call(receiver);
28
+ return descriptor.value;
29
+ }
30
+ function _class_apply_descriptor_set(receiver, descriptor, value) {
31
+ if (descriptor.set) descriptor.set.call(receiver, value);
32
+ else {
33
+ if (!descriptor.writable) throw new TypeError("attempted to set read only private field");
34
+ descriptor.value = value;
35
+ }
36
+ }
37
+ function _class_extract_field_descriptor(receiver, privateMap, action) {
38
+ if (!privateMap.has(receiver)) throw new TypeError("attempted to " + action + " private field on non-instance");
39
+ return privateMap.get(receiver);
40
+ }
41
+ function _class_private_field_get(receiver, privateMap) {
42
+ var descriptor = _class_extract_field_descriptor(receiver, privateMap, "get");
43
+ return _class_apply_descriptor_get(receiver, descriptor);
44
+ }
45
+ function _class_private_field_init(obj, privateMap, value) {
46
+ _check_private_redeclaration(obj, privateMap);
47
+ privateMap.set(obj, value);
48
+ }
49
+ function _class_private_field_set(receiver, privateMap, value) {
50
+ var descriptor = _class_extract_field_descriptor(receiver, privateMap, "set");
51
+ _class_apply_descriptor_set(receiver, descriptor, value);
52
+ return value;
53
+ }
22
54
  function _ts_decorate(decorators, target, key, desc) {
23
55
  var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
24
56
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);
@@ -28,6 +60,7 @@ function _ts_decorate(decorators, target, key, desc) {
28
60
  function _ts_metadata(k, v) {
29
61
  if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
30
62
  }
63
+ var _hiddenState = /*#__PURE__*/ new WeakMap();
31
64
  class AtomicRefineModal extends LitElement {
32
65
  initialize() {
33
66
  this.breadcrumbManager = buildBreadcrumbManager(this.bindings.engine);
@@ -152,6 +185,7 @@ class AtomicRefineModal extends LitElement {
152
185
  }) : nothing);
153
186
  }
154
187
  render() {
188
+ _class_private_field_get(this, _hiddenState).isEmpty = !this.isOpen;
155
189
  return html`${renderRefineModal({
156
190
  props: {
157
191
  i18n: this.bindings.i18n,
@@ -170,7 +204,10 @@ class AtomicRefineModal extends LitElement {
170
204
  `))}`;
171
205
  }
172
206
  constructor(...args){
173
- super(...args), this.isOpen = false, this.collapseFacetsAfter = 0, this.onSelectSortOption = (e)=>{
207
+ super(...args), _class_private_field_init(this, _hiddenState, {
208
+ writable: true,
209
+ value: void 0
210
+ }), this.isOpen = false, this.collapseFacetsAfter = 0, _class_private_field_set(this, _hiddenState, new HiddenStateController(this)), this.onSelectSortOption = (e)=>{
174
211
  const select = e.composedPath()[0];
175
212
  const option = this.options.find((option)=>option.expression === select.value);
176
213
  option && this.sort.sortBy(option.criteria);
@@ -163,9 +163,9 @@ class AtomicSmartSnippet extends LitElement {
163
163
  <atomic-smart-snippet-source
164
164
  .source=${source}
165
165
  .anchorAttributes=${getAttributesFromLinkSlotContent(this, 'source-anchor-attributes')}
166
- @selectSource=${this.smartSnippet.selectSource}
167
- @beginDelayedSelectSource=${this.smartSnippet.beginDelayedSelectSource}
168
- @cancelPendingSelectSource=${this.smartSnippet.cancelPendingSelectSource}
166
+ @select-source=${this.smartSnippet.selectSource}
167
+ @begin-delayed-select-source=${this.smartSnippet.beginDelayedSelectSource}
168
+ @cancel-pending-select-source=${this.smartSnippet.cancelPendingSelectSource}
169
169
  ></atomic-smart-snippet-source>
170
170
  `)}
171
171
  ${renderSmartSnippetFeedbackBanner({
@@ -100,9 +100,9 @@ class AtomicSmartSnippetSuggestions extends LitElement {
100
100
  })(html`
101
101
  <atomic-smart-snippet-source
102
102
  .anchorAttributes=${getAttributesFromLinkSlotContent(this, 'source-anchor-attributes')}
103
- @beginDelayedSelectSource=${()=>this.smartSnippetQuestionsList.beginDelayedSelectSource(questionAnswerId)}
104
- @cancelPendingSelectSource=${()=>this.smartSnippetQuestionsList.cancelPendingSelectSource(questionAnswerId)}
105
- @selectSource=${()=>this.smartSnippetQuestionsList.selectSource(questionAnswerId)}
103
+ @begin-delayed-select-source=${()=>this.smartSnippetQuestionsList.beginDelayedSelectSource(questionAnswerId)}
104
+ @cancel-pending-select-source=${()=>this.smartSnippetQuestionsList.cancelPendingSelectSource(questionAnswerId)}
105
+ @select-source=${()=>this.smartSnippetQuestionsList.selectSource(questionAnswerId)}
106
106
  .source=${source}
107
107
  ></atomic-smart-snippet-source>
108
108
  `);
@@ -3,7 +3,7 @@ function getWindow() {
3
3
  }
4
4
  function getAtomicEnvironment(headlessVersion) {
5
5
  return {
6
- version: "3.59.4",
6
+ version: "3.59.6",
7
7
  headlessVersion
8
8
  };
9
9
  }
@@ -4,13 +4,14 @@ const lightSheet = new CSSStyleSheet();
4
4
  lightSheet.replaceSync(':state(empty) { display: none }');
5
5
  class HiddenStateController {
6
6
  hostConnected() {
7
+ if (!this.internals) return;
7
8
  const root = this.host.shadowRoot;
8
9
  if (root) {
9
- if (!root.adoptedStyleSheets.includes(shadowSheet)) root.adoptedStyleSheets.push(shadowSheet);
10
- } else {
11
- const parentRoot = this.host.getRootNode();
12
- if (!parentRoot.adoptedStyleSheets.includes(lightSheet)) parentRoot.adoptedStyleSheets.push(lightSheet);
10
+ if (shadowSheet && !root.adoptedStyleSheets.includes(shadowSheet)) root.adoptedStyleSheets.push(shadowSheet);
11
+ return;
13
12
  }
13
+ const parent = this.host.getRootNode();
14
+ if (lightSheet && (parent instanceof Document || parent instanceof ShadowRoot) && !parent.adoptedStyleSheets.includes(lightSheet)) parent.adoptedStyleSheets.push(lightSheet);
14
15
  }
15
16
  set isEmpty(value) {
16
17
  if (value) this.internals.states.add('empty');
@@ -1,3 +1,3 @@
1
- const atomicVersion = "3.59.4";
1
+ const atomicVersion = "3.59.6";
2
2
  export { version as headlessVersion } from "@coveo/headless/package.json";
3
3
  export { atomicVersion };
@@ -4,7 +4,6 @@ import type { InsightBindings } from '../atomic-insight-interface/atomic-insight
4
4
  import type { InitializableComponent } from '../../../decorators/types';
5
5
  /**
6
6
  * The `atomic-insight-generated-answer` component uses Coveo Machine Learning (Coveo ML) models to automatically generate an answer to a query executed by the user.
7
- * For more information, see [About Relevance Generative Answering (RGA)](https://docs.coveo.com/en/n9de0370/)
8
7
  *
9
8
  * @slot no-answer-message - Lets you pass a custom sorry message when no answer is generated.
10
9
  *
@@ -16,8 +16,11 @@ import type { InitializableComponent } from '../../../decorators/types';
16
16
  * @part show-less - The button to display less breadcrumbs.
17
17
  * @part label - The "Filters" label.
18
18
  * @part clear - The button to clear all filters.
19
+ *
20
+ * @cssState empty - Hides the element when there are no breadcrumbs to display.
19
21
  */
20
22
  export declare class AtomicBreadbox extends LitElement implements InitializableComponent<Bindings> {
23
+ #private;
21
24
  static styles: CSSResultGroup;
22
25
  private static readonly propsSchema;
23
26
  private resizeObserver?;
@@ -13,8 +13,11 @@ import type { Bindings } from '../atomic-search-interface/atomic-search-interfac
13
13
  * @part correction-btn - The button used to manually correct a query.
14
14
  * @part undo-btn - The button used to undo a query changed by a query trigger.
15
15
  * @part highlight - The query highlights.
16
+ *
17
+ * @cssState empty - Hides the element when there is no query correction to display.
16
18
  */
17
19
  export declare class AtomicDidYouMean extends LitElement implements InitializableComponent<Bindings> {
20
+ #private;
18
21
  private static readonly propsSchema;
19
22
  bindings: Bindings;
20
23
  didYouMean: DidYouMean;
@@ -6,7 +6,6 @@ import type { Bindings } from '../atomic-search-interface/atomic-search-interfac
6
6
  import type { InitializableComponent } from '../../../decorators/types';
7
7
  /**
8
8
  * The `atomic-generated-answer` component uses Coveo Machine Learning (Coveo ML) models to automatically generate an answer to a query executed by the user.
9
- * For more information, see [About Relevance Generative Answering (RGA)](https://docs.coveo.com/en/n9de0370/)
10
9
  *
11
10
  * @slot no-answer-message - Lets you pass a custom sorry message when no answer is generated.
12
11
  *
@@ -12,8 +12,11 @@ declare const AtomicNotifications_base: typeof LitElement;
12
12
  * @part notification - The wrapper around a single notification.
13
13
  * @part icon - The icon of the notification.
14
14
  * @part text - The text of the notification.
15
+ *
16
+ * @cssState empty - Hides the element when there are no notifications to display.
15
17
  */
16
18
  export declare class AtomicNotifications extends AtomicNotifications_base implements InitializableComponent<Bindings> {
19
+ #private;
17
20
  private static readonly schema;
18
21
  bindings: Bindings;
19
22
  error: Error;
@@ -150,7 +150,7 @@ export declare class AtomicNumericFacet extends LitElement implements Initializa
150
150
  private manualRanges;
151
151
  private formatter;
152
152
  constructor();
153
- private filterDependenciesManager?;
153
+ private conditionManagers;
154
154
  private headerFocus?;
155
155
  private removeNumberFormatListener?;
156
156
  private removeNumberInputApplyListener?;
@@ -36,8 +36,11 @@ import '../atomic-automatic-facet-generator/atomic-automatic-facet-generator';
36
36
  * @part backdrop - The transparent backdrop hiding the content behind the modal.
37
37
  *
38
38
  * @cssprop --atomic-refine-modal-facet-margin - The margin between facets in the refine modal. Default is `20px`.
39
+ *
40
+ * @cssState empty - Hides the element when the modal is closed.
39
41
  */
40
42
  export declare class AtomicRefineModal extends LitElement implements InitializableComponent<Bindings> {
43
+ #private;
41
44
  static styles: CSSResultGroup;
42
45
  bindings: Bindings;
43
46
  error: Error;
@@ -0,0 +1,15 @@
1
+ import type { LitElement, ReactiveController } from 'lit';
2
+ /**
3
+ * A reactive controller that manages the `:state(empty)` custom state on a host element
4
+ * using `ElementInternals`. When `isEmpty` is `true`, the host is hidden via `display: none`.
5
+ *
6
+ * @cssState empty - Hides the host element when it has no content to display.
7
+ */
8
+ export declare class HiddenStateController implements ReactiveController {
9
+ private host;
10
+ private internals;
11
+ constructor(host: LitElement);
12
+ hostConnected(): void;
13
+ set isEmpty(value: boolean);
14
+ get isEmpty(): boolean;
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coveo/atomic",
3
- "version": "3.59.4",
3
+ "version": "3.59.6",
4
4
  "description": "A web-component library for building modern UIs interfacing with the Coveo platform",
5
5
  "homepage": "https://docs.coveo.com/en/atomic/latest/",
6
6
  "license": "Apache-2.0",
@@ -69,9 +69,9 @@
69
69
  "i18next-http-backend": "3.0.6",
70
70
  "lit": "3.3.3",
71
71
  "marked": "12.0.2",
72
- "@coveo/atomic-legacy": "0.0.20",
72
+ "@coveo/atomic-legacy": "0.0.21",
73
73
  "@coveo/bueno": "1.1.9",
74
- "@coveo/headless": "3.51.4"
74
+ "@coveo/headless": "3.51.5"
75
75
  },
76
76
  "devDependencies": {
77
77
  "@ag-ui/client": "0.0.53",
@@ -118,7 +118,7 @@
118
118
  "peerDependencies": {
119
119
  "typescript": ">=5.0.0",
120
120
  "@coveo/bueno": "^1.1.9",
121
- "@coveo/headless": "^3.51.4"
121
+ "@coveo/headless": "^3.51.5"
122
122
  },
123
123
  "peerDependenciesMeta": {
124
124
  "typescript": {