@coveo/atomic 3.63.0 → 3.64.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 (70) hide show
  1. package/custom-elements.json +12837 -12661
  2. package/dist/cjs/components/commerce/atomic-commerce-breadbox/atomic-commerce-breadbox.cjs +1 -0
  3. package/dist/cjs/components/commerce/atomic-commerce-category-facet/atomic-commerce-category-facet.cjs +1 -1
  4. package/dist/cjs/components/commerce/atomic-commerce-facet/atomic-commerce-facet.cjs +1 -1
  5. package/dist/cjs/components/commerce/atomic-product-field-condition/atomic-product-field-condition.cjs +1 -4
  6. package/dist/cjs/components/commerce/atomic-product-template/atomic-product-template.cjs +15 -1
  7. package/dist/cjs/components/common/facets/facet-search/facet-search-aria-live.cjs +21 -8
  8. package/dist/cjs/components/common/query-error/icon.cjs +7 -26
  9. package/dist/cjs/components/common/query-error/icons.cjs +68 -0
  10. package/dist/cjs/components/common/template-controller/template-utils.cjs +9 -0
  11. package/dist/cjs/components/insight/atomic-insight-facet/atomic-insight-facet.cjs +1 -1
  12. package/dist/cjs/components/insight/atomic-insight-result-children-template/atomic-insight-result-children-template.cjs +1 -5
  13. package/dist/cjs/components/insight/atomic-insight-result-template/atomic-insight-result-template.cjs +15 -1
  14. package/dist/cjs/components/insight/atomic-insight-smart-snippet/atomic-insight-smart-snippet.cjs +3 -3
  15. package/dist/cjs/components/recommendations/atomic-recs-result-template/atomic-recs-result-template.cjs +15 -1
  16. package/dist/cjs/components/search/atomic-category-facet/atomic-category-facet.cjs +1 -1
  17. package/dist/cjs/components/search/atomic-color-facet/atomic-color-facet.cjs +1 -1
  18. package/dist/cjs/components/search/atomic-facet/atomic-facet.cjs +1 -1
  19. package/dist/cjs/components/search/atomic-field-condition/atomic-field-condition.cjs +1 -4
  20. package/dist/cjs/components/search/atomic-result-children-template/atomic-result-children-template.cjs +15 -1
  21. package/dist/cjs/components/search/atomic-result-template/atomic-result-template.cjs +15 -1
  22. package/dist/cjs/decorators/bind-state.cjs +38 -8
  23. package/dist/cjs/decorators/with-tailwind-styles.cjs +2 -1
  24. package/dist/cjs/global/environment.cjs +1 -1
  25. package/dist/cjs/utils/init-queue.cjs +6 -4
  26. package/dist/cjs/utils/replace-breakpoint-utils.cjs +9 -4
  27. package/dist/cjs/versions.cjs +1 -1
  28. package/dist/esm/components/commerce/atomic-commerce-breadbox/atomic-commerce-breadbox.js +1 -0
  29. package/dist/esm/components/commerce/atomic-commerce-category-facet/atomic-commerce-category-facet.js +1 -1
  30. package/dist/esm/components/commerce/atomic-commerce-facet/atomic-commerce-facet.js +1 -1
  31. package/dist/esm/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.js +1 -1
  32. package/dist/esm/components/commerce/atomic-product-field-condition/atomic-product-field-condition.js +2 -5
  33. package/dist/esm/components/commerce/atomic-product-template/atomic-product-template.js +16 -2
  34. package/dist/esm/components/common/facets/facet-search/facet-search-aria-live.js +21 -8
  35. package/dist/esm/components/common/query-error/icon.js +5 -23
  36. package/dist/esm/components/common/query-error/icons.js +17 -0
  37. package/dist/esm/components/common/template-controller/template-utils.js +7 -1
  38. package/dist/esm/components/insight/atomic-insight-facet/atomic-insight-facet.js +1 -1
  39. package/dist/esm/components/insight/atomic-insight-result-children/atomic-insight-result-children.js +1 -1
  40. package/dist/esm/components/insight/atomic-insight-result-children-template/atomic-insight-result-children-template.js +2 -6
  41. package/dist/esm/components/insight/atomic-insight-result-template/atomic-insight-result-template.js +16 -2
  42. package/dist/esm/components/insight/atomic-insight-smart-snippet/atomic-insight-smart-snippet.js +3 -3
  43. package/dist/esm/components/recommendations/atomic-recs-result-template/atomic-recs-result-template.js +16 -2
  44. package/dist/esm/components/search/atomic-category-facet/atomic-category-facet.js +1 -1
  45. package/dist/esm/components/search/atomic-color-facet/atomic-color-facet.js +1 -1
  46. package/dist/esm/components/search/atomic-facet/atomic-facet.js +1 -1
  47. package/dist/esm/components/search/atomic-field-condition/atomic-field-condition.js +2 -5
  48. package/dist/esm/components/search/atomic-result-children-template/atomic-result-children-template.js +16 -2
  49. package/dist/esm/components/search/atomic-result-template/atomic-result-template.js +16 -2
  50. package/dist/esm/components/search/atomic-search-box/atomic-search-box.js +1 -1
  51. package/dist/esm/decorators/bind-state.js +38 -8
  52. package/dist/esm/decorators/with-tailwind-styles.js +2 -1
  53. package/dist/esm/global/environment.js +1 -1
  54. package/dist/esm/utils/init-queue.js +6 -4
  55. package/dist/esm/utils/replace-breakpoint-utils.js +9 -4
  56. package/dist/esm/versions.js +1 -1
  57. package/dist/types/components/commerce/atomic-product-template/atomic-product-template.d.ts +12 -0
  58. package/dist/types/components/common/atomic-smart-snippet-source/atomic-smart-snippet-source.d.ts +4 -4
  59. package/dist/types/components/common/facets/facet-search/facet-search-aria-live.d.ts +7 -1
  60. package/dist/types/components/common/query-error/icon.d.ts +6 -0
  61. package/dist/types/components/common/query-error/icons.d.ts +5 -0
  62. package/dist/types/components/common/template-controller/template-utils.d.ts +7 -0
  63. package/dist/types/components/insight/atomic-insight-result-children-template/atomic-insight-result-children-template.d.ts +4 -4
  64. package/dist/types/components/insight/atomic-insight-result-template/atomic-insight-result-template.d.ts +12 -0
  65. package/dist/types/components/recommendations/atomic-recs-result-template/atomic-recs-result-template.d.ts +12 -0
  66. package/dist/types/components/search/atomic-result-children-template/atomic-result-children-template.d.ts +12 -0
  67. package/dist/types/components/search/atomic-result-template/atomic-result-template.d.ts +12 -0
  68. package/dist/types/utils/init-queue.d.ts +3 -2
  69. package/docs/adr/0001-group-shared-modules-in-one-cdn-chunk.md +147 -0
  70. package/package.json +6 -6
@@ -79,6 +79,7 @@ class AtomicCommerceBreadbox extends external_lit_namespaceObject.LitElement {
79
79
  this.adaptBreadcrumbs();
80
80
  }
81
81
  disconnectedCallback() {
82
+ super.disconnectedCallback();
82
83
  this.resizeObserver?.disconnect();
83
84
  }
84
85
  get breadcrumbs() {
@@ -85,7 +85,7 @@ function _ts_metadata(metadataKey, metadataValue) {
85
85
  class AtomicCommerceCategoryFacet extends external_lit_namespaceObject.LitElement {
86
86
  initialize() {
87
87
  this.validateFacet();
88
- this.facet && (0, facet_search_aria_live_cjs_namespaceObject.announceFacetSearchResultsWithAriaLive)(this.facet, this.displayName, (msg)=>{
88
+ this.facet && (0, facet_search_aria_live_cjs_namespaceObject.announceFacetSearchResultsWithAriaLive)(this, this.facet, this.displayName, (msg)=>{
89
89
  this.facetSearchAriaMessage.message = msg;
90
90
  }, this.bindings.i18n);
91
91
  }
@@ -242,7 +242,7 @@ class AtomicCommerceFacet extends external_lit_namespaceObject.LitElement {
242
242
  if (!this.headerFocus) this.headerFocus = new accessibility_utils_cjs_namespaceObject.FocusTargetController(this, this.bindings);
243
243
  }
244
244
  initAriaLive() {
245
- (0, facet_search_aria_live_cjs_namespaceObject.announceFacetSearchResultsWithAriaLive)(this.facet, this.displayName, (msg)=>{
245
+ (0, facet_search_aria_live_cjs_namespaceObject.announceFacetSearchResultsWithAriaLive)(this, this.facet, this.displayName, (msg)=>{
246
246
  this.ariaLiveRegion.message = msg;
247
247
  }, this.bindings.i18n);
248
248
  }
@@ -51,10 +51,7 @@ function _ts_metadata(metadataKey, metadataValue) {
51
51
  class AtomicProductFieldCondition extends (0, light_dom_cjs_namespaceObject.LightDomMixin)(external_lit_namespaceObject.LitElement) {
52
52
  initialize() {}
53
53
  get conditions() {
54
- return [
55
- ...(0, template_utils_cjs_namespaceObject.makeDefinedConditions)(this.ifDefined, this.ifNotDefined, commerce_namespaceObject.ProductTemplatesHelpers),
56
- ...(0, template_utils_cjs_namespaceObject.makeMatchConditions)(this.mustMatch, this.mustNotMatch, commerce_namespaceObject.ProductTemplatesHelpers)
57
- ];
54
+ return (0, template_utils_cjs_namespaceObject.makeFieldConditions)(this, commerce_namespaceObject.ProductTemplatesHelpers);
58
55
  }
59
56
  render() {
60
57
  const product = this.productController.item;
@@ -51,7 +51,7 @@ function _ts_metadata(metadataKey, metadataValue) {
51
51
  class AtomicProductTemplate extends external_lit_namespaceObject.LitElement {
52
52
  connectedCallback() {
53
53
  super.connectedCallback();
54
- this.productTemplateController.matchConditions = (0, template_utils_cjs_namespaceObject.makeMatchConditions)(this.mustMatch, this.mustNotMatch, commerce_namespaceObject.ProductTemplatesHelpers);
54
+ this.productTemplateController.matchConditions = (0, template_utils_cjs_namespaceObject.makeFieldConditions)(this, commerce_namespaceObject.ProductTemplatesHelpers);
55
55
  }
56
56
  async getTemplate() {
57
57
  return this.productTemplateController.getTemplate(this.conditions);
@@ -82,6 +82,20 @@ _ts_decorate([
82
82
  }),
83
83
  _ts_metadata("design:type", Array)
84
84
  ], AtomicProductTemplate.prototype, "conditions", void 0);
85
+ _ts_decorate([
86
+ (0, decorators_js_namespaceObject.property)({
87
+ type: String,
88
+ attribute: 'if-defined'
89
+ }),
90
+ _ts_metadata("design:type", String)
91
+ ], AtomicProductTemplate.prototype, "ifDefined", void 0);
92
+ _ts_decorate([
93
+ (0, decorators_js_namespaceObject.property)({
94
+ type: String,
95
+ attribute: 'if-not-defined'
96
+ }),
97
+ _ts_metadata("design:type", String)
98
+ ], AtomicProductTemplate.prototype, "ifNotDefined", void 0);
85
99
  _ts_decorate([
86
100
  (0, props_utils_cjs_namespaceObject.mapProperty)({
87
101
  splitValues: true,
@@ -31,15 +31,28 @@ __webpack_require__.d(__webpack_exports__, {
31
31
  announceFacetSearchResultsWithAriaLive: ()=>announceFacetSearchResultsWithAriaLive
32
32
  });
33
33
  const external_facet_search_utils_cjs_namespaceObject = require("./facet-search-utils.cjs");
34
- function announceFacetSearchResultsWithAriaLive(facet, label, setAriaLive, i18n) {
34
+ function announceFacetSearchResultsWithAriaLive(host, facet, label, setAriaLive, i18n) {
35
35
  let prevState = facet.state.facetSearch;
36
- facet.subscribe(()=>{
37
- const nextState = facet.state.facetSearch;
38
- if ((0, external_facet_search_utils_cjs_namespaceObject.shouldUpdateFacetSearchComponent)(nextState, prevState) && nextState.query) setAriaLive(i18n.t('facet-search-results-count', {
39
- count: nextState.values.length,
40
- label
41
- }));
42
- prevState = nextState;
36
+ let unsubscribe;
37
+ host.addController({
38
+ hostConnected () {
39
+ if (unsubscribe) return;
40
+ let subscribing = true;
41
+ unsubscribe = facet.subscribe(()=>{
42
+ const nextState = facet.state.facetSearch;
43
+ if (!subscribing && (0, external_facet_search_utils_cjs_namespaceObject.shouldUpdateFacetSearchComponent)(nextState, prevState) && nextState.query) setAriaLive(i18n.t('facet-search-results-count', {
44
+ count: nextState.values.length,
45
+ label
46
+ }));
47
+ prevState = nextState;
48
+ });
49
+ subscribing = false;
50
+ },
51
+ hostDisconnected () {
52
+ if (host.isConnected) return;
53
+ unsubscribe?.();
54
+ unsubscribe = void 0;
55
+ }
43
56
  });
44
57
  }
45
58
  exports.announceFacetSearchResultsWithAriaLive = __webpack_exports__.announceFacetSearchResultsWithAriaLive;
@@ -37,43 +37,24 @@ var __webpack_require__ = {};
37
37
  var __webpack_exports__ = {};
38
38
  __webpack_require__.r(__webpack_exports__);
39
39
  __webpack_require__.d(__webpack_exports__, {
40
+ loadQueryErrorIcon: ()=>loadQueryErrorIcon,
40
41
  renderQueryErrorIcon: ()=>renderQueryErrorIcon
41
42
  });
42
43
  const external_lit_namespaceObject = require("lit");
43
- const cannot_access_cjs_namespaceObject = require("../../../images/cannot-access.cjs");
44
- var cannot_access_cjs_default = /*#__PURE__*/ __webpack_require__.n(cannot_access_cjs_namespaceObject);
45
- const indexing_cjs_namespaceObject = require("../../../images/indexing.cjs");
46
- var indexing_cjs_default = /*#__PURE__*/ __webpack_require__.n(indexing_cjs_namespaceObject);
44
+ const until_js_namespaceObject = require("lit/directives/until.js");
47
45
  const no_connection_cjs_namespaceObject = require("../../../images/no-connection.cjs");
48
46
  var no_connection_cjs_default = /*#__PURE__*/ __webpack_require__.n(no_connection_cjs_namespaceObject);
49
- const search_inactive_cjs_namespaceObject = require("../../../images/search-inactive.cjs");
50
- var search_inactive_cjs_default = /*#__PURE__*/ __webpack_require__.n(search_inactive_cjs_namespaceObject);
51
- const something_wrong_cjs_namespaceObject = require("../../../images/something-wrong.cjs");
52
- var something_wrong_cjs_default = /*#__PURE__*/ __webpack_require__.n(something_wrong_cjs_namespaceObject);
53
47
  require("../atomic-icon/atomic-icon.cjs");
54
- const renderQueryErrorIcon = ({ props })=>{
55
- const getIconFromErrorType = ()=>{
56
- switch(props.errorType){
57
- case 'Disconnected':
58
- return no_connection_cjs_default();
59
- case 'NoEndpointsException':
60
- return indexing_cjs_default();
61
- case 'InvalidTokenException':
62
- return cannot_access_cjs_default();
63
- case 'OrganizationIsPausedException':
64
- return search_inactive_cjs_default();
65
- default:
66
- return something_wrong_cjs_default();
67
- }
68
- };
69
- return (0, external_lit_namespaceObject.html)`<atomic-icon
48
+ const loadQueryErrorIcon = (errorType, loadIcons = ()=>import("./icons.cjs"))=>'Disconnected' === errorType ? no_connection_cjs_default() : loadIcons().then(({ getQueryErrorIcon })=>getQueryErrorIcon(errorType)).catch(()=>'');
49
+ const renderQueryErrorIcon = ({ props })=>(0, external_lit_namespaceObject.html)`<atomic-icon
70
50
  part="icon"
71
- icon=${getIconFromErrorType()}
51
+ icon=${(0, until_js_namespaceObject.until)(loadQueryErrorIcon(props.errorType), '')}
72
52
  class="w-1/2 max-w-lg"
73
53
  ></atomic-icon>`;
74
- };
54
+ exports.loadQueryErrorIcon = __webpack_exports__.loadQueryErrorIcon;
75
55
  exports.renderQueryErrorIcon = __webpack_exports__.renderQueryErrorIcon;
76
56
  for(var __rspack_i in __webpack_exports__)if (-1 === [
57
+ "loadQueryErrorIcon",
77
58
  "renderQueryErrorIcon"
78
59
  ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
79
60
  Object.defineProperty(exports, '__esModule', {
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.n = (module)=>{
5
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
6
+ __webpack_require__.d(getter, {
7
+ a: getter
8
+ });
9
+ return getter;
10
+ };
11
+ })();
12
+ (()=>{
13
+ __webpack_require__.d = (exports1, getters, values)=>{
14
+ var define = (defs, kind)=>{
15
+ for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
16
+ enumerable: true,
17
+ [kind]: defs[key]
18
+ });
19
+ };
20
+ define(getters, "get");
21
+ define(values, "value");
22
+ };
23
+ })();
24
+ (()=>{
25
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
26
+ })();
27
+ (()=>{
28
+ __webpack_require__.r = (exports1)=>{
29
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
30
+ value: 'Module'
31
+ });
32
+ Object.defineProperty(exports1, '__esModule', {
33
+ value: true
34
+ });
35
+ };
36
+ })();
37
+ var __webpack_exports__ = {};
38
+ __webpack_require__.r(__webpack_exports__);
39
+ __webpack_require__.d(__webpack_exports__, {
40
+ getQueryErrorIcon: ()=>getQueryErrorIcon
41
+ });
42
+ const cannot_access_cjs_namespaceObject = require("../../../images/cannot-access.cjs");
43
+ var cannot_access_cjs_default = /*#__PURE__*/ __webpack_require__.n(cannot_access_cjs_namespaceObject);
44
+ const indexing_cjs_namespaceObject = require("../../../images/indexing.cjs");
45
+ var indexing_cjs_default = /*#__PURE__*/ __webpack_require__.n(indexing_cjs_namespaceObject);
46
+ const search_inactive_cjs_namespaceObject = require("../../../images/search-inactive.cjs");
47
+ var search_inactive_cjs_default = /*#__PURE__*/ __webpack_require__.n(search_inactive_cjs_namespaceObject);
48
+ const something_wrong_cjs_namespaceObject = require("../../../images/something-wrong.cjs");
49
+ var something_wrong_cjs_default = /*#__PURE__*/ __webpack_require__.n(something_wrong_cjs_namespaceObject);
50
+ function getQueryErrorIcon(errorType) {
51
+ switch(errorType){
52
+ case 'NoEndpointsException':
53
+ return indexing_cjs_default();
54
+ case 'InvalidTokenException':
55
+ return cannot_access_cjs_default();
56
+ case 'OrganizationIsPausedException':
57
+ return search_inactive_cjs_default();
58
+ default:
59
+ return something_wrong_cjs_default();
60
+ }
61
+ }
62
+ exports.getQueryErrorIcon = __webpack_exports__.getQueryErrorIcon;
63
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
64
+ "getQueryErrorIcon"
65
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
66
+ Object.defineProperty(exports, '__esModule', {
67
+ value: true
68
+ });
@@ -29,6 +29,7 @@ var __webpack_exports__ = {};
29
29
  __webpack_require__.r(__webpack_exports__);
30
30
  __webpack_require__.d(__webpack_exports__, {
31
31
  makeDefinedConditions: ()=>makeDefinedConditions,
32
+ makeFieldConditions: ()=>makeFieldConditions,
32
33
  makeMatchConditions: ()=>makeMatchConditions
33
34
  });
34
35
  const set_cjs_namespaceObject = require("../../../utils/set.cjs");
@@ -63,10 +64,18 @@ function makeDefinedConditions(ifDefined, ifNotDefined, helpers) {
63
64
  }
64
65
  return conditions;
65
66
  }
67
+ function makeFieldConditions({ ifDefined, ifNotDefined, mustMatch, mustNotMatch }, helpers) {
68
+ return [
69
+ ...makeDefinedConditions(ifDefined, ifNotDefined, helpers),
70
+ ...makeMatchConditions(mustMatch, mustNotMatch, helpers)
71
+ ];
72
+ }
66
73
  exports.makeDefinedConditions = __webpack_exports__.makeDefinedConditions;
74
+ exports.makeFieldConditions = __webpack_exports__.makeFieldConditions;
67
75
  exports.makeMatchConditions = __webpack_exports__.makeMatchConditions;
68
76
  for(var __rspack_i in __webpack_exports__)if (-1 === [
69
77
  "makeDefinedConditions",
78
+ "makeFieldConditions",
70
79
  "makeMatchConditions"
71
80
  ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
72
81
  Object.defineProperty(exports, '__esModule', {
@@ -213,7 +213,7 @@ class AtomicInsightFacet extends external_lit_namespaceObject.LitElement {
213
213
  }
214
214
  initAriaLive() {
215
215
  this.facetSearchAriaLiveController = new accessibility_utils_cjs_namespaceObject.AriaLiveRegionController(this, 'facet-search');
216
- (0, facet_search_aria_live_cjs_namespaceObject.announceFacetSearchResultsWithAriaLive)(this.facet, this.label, (msg)=>{
216
+ (0, facet_search_aria_live_cjs_namespaceObject.announceFacetSearchResultsWithAriaLive)(this, this.facet, this.label, (msg)=>{
217
217
  this.facetSearchAriaLiveController.message = msg;
218
218
  }, this.bindings.i18n);
219
219
  }
@@ -51,11 +51,7 @@ function _ts_metadata(metadataKey, metadataValue) {
51
51
  class AtomicInsightResultChildrenTemplate extends external_lit_namespaceObject.LitElement {
52
52
  connectedCallback() {
53
53
  super.connectedCallback();
54
- this.conditions = [
55
- ...this.conditions,
56
- ...(0, template_utils_cjs_namespaceObject.makeDefinedConditions)(this.ifDefined, this.ifNotDefined, insight_namespaceObject.ResultTemplatesHelpers)
57
- ];
58
- this.resultTemplateController.matchConditions = (0, template_utils_cjs_namespaceObject.makeMatchConditions)(this.mustMatch, this.mustNotMatch, insight_namespaceObject.ResultTemplatesHelpers);
54
+ this.resultTemplateController.matchConditions = (0, template_utils_cjs_namespaceObject.makeFieldConditions)(this, insight_namespaceObject.ResultTemplatesHelpers);
59
55
  }
60
56
  render() {
61
57
  return external_lit_namespaceObject.nothing;
@@ -52,7 +52,7 @@ function _ts_metadata(metadataKey, metadataValue) {
52
52
  class AtomicInsightResultTemplate extends external_lit_namespaceObject.LitElement {
53
53
  connectedCallback() {
54
54
  super.connectedCallback();
55
- this.resultTemplateController.matchConditions = (0, template_utils_cjs_namespaceObject.makeMatchConditions)(this.mustMatch, this.mustNotMatch, insight_namespaceObject.ResultTemplatesHelpers);
55
+ this.resultTemplateController.matchConditions = (0, template_utils_cjs_namespaceObject.makeFieldConditions)(this, insight_namespaceObject.ResultTemplatesHelpers);
56
56
  }
57
57
  render() {
58
58
  return external_lit_namespaceObject.nothing;
@@ -83,6 +83,20 @@ _ts_decorate([
83
83
  }),
84
84
  _ts_metadata("design:type", Array)
85
85
  ], AtomicInsightResultTemplate.prototype, "conditions", void 0);
86
+ _ts_decorate([
87
+ (0, decorators_js_namespaceObject.property)({
88
+ type: String,
89
+ attribute: 'if-defined'
90
+ }),
91
+ _ts_metadata("design:type", String)
92
+ ], AtomicInsightResultTemplate.prototype, "ifDefined", void 0);
93
+ _ts_decorate([
94
+ (0, decorators_js_namespaceObject.property)({
95
+ type: String,
96
+ attribute: 'if-not-defined'
97
+ }),
98
+ _ts_metadata("design:type", String)
99
+ ], AtomicInsightResultTemplate.prototype, "ifNotDefined", void 0);
86
100
  _ts_decorate([
87
101
  (0, props_utils_cjs_namespaceObject.mapProperty)({
88
102
  splitValues: true,
@@ -94,10 +94,10 @@ class AtomicInsightSmartSnippet extends external_lit_namespaceObject.LitElement
94
94
  if (!source) return external_lit_namespaceObject.nothing;
95
95
  return (0, external_lit_namespaceObject.html)`<atomic-smart-snippet-source
96
96
  .anchorAttributes=${(0, attributes_slot_cjs_namespaceObject.getAttributesFromLinkSlotContent)(this, 'source-anchor-attributes')}
97
- .onBeginDelayedSelectSource=${this.smartSnippet.beginDelayedSelectSource}
98
- .onCancelPendingSelectSource=${this.smartSnippet.cancelPendingSelectSource}
99
- .onSelectSource=${this.smartSnippet.selectSource}
100
97
  .source=${source}
98
+ @select-source=${()=>this.smartSnippet.selectSource()}
99
+ @begin-delayed-select-source=${()=>this.smartSnippet.beginDelayedSelectSource()}
100
+ @cancel-pending-select-source=${()=>this.smartSnippet.cancelPendingSelectSource()}
101
101
  ></atomic-smart-snippet-source>`;
102
102
  }
103
103
  renderFeedbackBanner() {
@@ -53,7 +53,7 @@ function _ts_metadata(metadataKey, metadataValue) {
53
53
  class AtomicRecsResultTemplate extends external_lit_namespaceObject.LitElement {
54
54
  connectedCallback() {
55
55
  super.connectedCallback();
56
- this.recsResultTemplateController.matchConditions = (0, template_utils_cjs_namespaceObject.makeMatchConditions)(this.mustMatch, this.mustNotMatch, recommendation_namespaceObject.ResultTemplatesHelpers);
56
+ this.recsResultTemplateController.matchConditions = (0, template_utils_cjs_namespaceObject.makeFieldConditions)(this, recommendation_namespaceObject.ResultTemplatesHelpers);
57
57
  }
58
58
  render() {
59
59
  return external_lit_namespaceObject.nothing;
@@ -83,6 +83,20 @@ _ts_decorate([
83
83
  }),
84
84
  _ts_metadata("design:type", Array)
85
85
  ], AtomicRecsResultTemplate.prototype, "conditions", void 0);
86
+ _ts_decorate([
87
+ (0, decorators_js_namespaceObject.property)({
88
+ type: String,
89
+ attribute: 'if-defined'
90
+ }),
91
+ _ts_metadata("design:type", String)
92
+ ], AtomicRecsResultTemplate.prototype, "ifDefined", void 0);
93
+ _ts_decorate([
94
+ (0, decorators_js_namespaceObject.property)({
95
+ type: String,
96
+ attribute: 'if-not-defined'
97
+ }),
98
+ _ts_metadata("design:type", String)
99
+ ], AtomicRecsResultTemplate.prototype, "ifNotDefined", void 0);
86
100
  _ts_decorate([
87
101
  (0, props_utils_cjs_namespaceObject.mapProperty)({
88
102
  splitValues: true,
@@ -126,7 +126,7 @@ class AtomicCategoryFacet extends external_lit_namespaceObject.LitElement {
126
126
  options
127
127
  });
128
128
  this.facetId = this.facet.state.facetId;
129
- (0, facet_search_aria_live_cjs_namespaceObject.announceFacetSearchResultsWithAriaLive)(this.facet, this.label, (msg)=>{
129
+ (0, facet_search_aria_live_cjs_namespaceObject.announceFacetSearchResultsWithAriaLive)(this, this.facet, this.label, (msg)=>{
130
130
  this.facetSearchAriaMessage.message = msg;
131
131
  }, this.bindings.i18n);
132
132
  this.bindings.store.registerFacet('categoryFacets', this.facetInfo);
@@ -327,7 +327,7 @@ class AtomicColorFacet extends external_lit_namespaceObject.LitElement {
327
327
  }
328
328
  initAriaLive() {
329
329
  this.facetSearchAriaLive = new accessibility_utils_cjs_namespaceObject.AriaLiveRegionController(this, 'facet-search');
330
- (0, facet_search_aria_live_cjs_namespaceObject.announceFacetSearchResultsWithAriaLive)(this.facet, this.label, (msg)=>{
330
+ (0, facet_search_aria_live_cjs_namespaceObject.announceFacetSearchResultsWithAriaLive)(this, this.facet, this.label, (msg)=>{
331
331
  this.facetSearchAriaLive.message = msg;
332
332
  }, this.bindings.i18n);
333
333
  }
@@ -310,7 +310,7 @@ class AtomicFacet extends external_lit_namespaceObject.LitElement {
310
310
  }
311
311
  initAriaLive() {
312
312
  this.facetSearchAriaLive = new accessibility_utils_cjs_namespaceObject.AriaLiveRegionController(this, 'facet-search');
313
- (0, facet_search_aria_live_cjs_namespaceObject.announceFacetSearchResultsWithAriaLive)(this.facet, this.label, (msg)=>{
313
+ (0, facet_search_aria_live_cjs_namespaceObject.announceFacetSearchResultsWithAriaLive)(this, this.facet, this.label, (msg)=>{
314
314
  this.facetSearchAriaLive.message = msg;
315
315
  }, this.bindings.i18n);
316
316
  }
@@ -51,10 +51,7 @@ function _ts_metadata(metadataKey, metadataValue) {
51
51
  class AtomicFieldCondition extends (0, light_dom_cjs_namespaceObject.LightDomMixin)(external_lit_namespaceObject.LitElement) {
52
52
  initialize() {}
53
53
  get conditions() {
54
- return [
55
- ...(0, template_utils_cjs_namespaceObject.makeDefinedConditions)(this.ifDefined, this.ifNotDefined, headless_namespaceObject.ResultTemplatesHelpers),
56
- ...(0, template_utils_cjs_namespaceObject.makeMatchConditions)(this.mustMatch, this.mustNotMatch, headless_namespaceObject.ResultTemplatesHelpers)
57
- ];
54
+ return (0, template_utils_cjs_namespaceObject.makeFieldConditions)(this, headless_namespaceObject.ResultTemplatesHelpers);
58
55
  }
59
56
  getResult() {
60
57
  const item = this.resultController.item;
@@ -52,7 +52,7 @@ function _ts_metadata(metadataKey, metadataValue) {
52
52
  class AtomicResultChildrenTemplate extends external_lit_namespaceObject.LitElement {
53
53
  connectedCallback() {
54
54
  super.connectedCallback();
55
- this.resultTemplateController.matchConditions = (0, template_utils_cjs_namespaceObject.makeMatchConditions)(this.mustMatch, this.mustNotMatch, headless_namespaceObject.ResultTemplatesHelpers);
55
+ this.resultTemplateController.matchConditions = (0, template_utils_cjs_namespaceObject.makeFieldConditions)(this, headless_namespaceObject.ResultTemplatesHelpers);
56
56
  }
57
57
  render() {
58
58
  return external_lit_namespaceObject.nothing;
@@ -79,6 +79,20 @@ _ts_decorate([
79
79
  }),
80
80
  _ts_metadata("design:type", Array)
81
81
  ], AtomicResultChildrenTemplate.prototype, "conditions", void 0);
82
+ _ts_decorate([
83
+ (0, decorators_js_namespaceObject.property)({
84
+ type: String,
85
+ attribute: 'if-defined'
86
+ }),
87
+ _ts_metadata("design:type", String)
88
+ ], AtomicResultChildrenTemplate.prototype, "ifDefined", void 0);
89
+ _ts_decorate([
90
+ (0, decorators_js_namespaceObject.property)({
91
+ type: String,
92
+ attribute: 'if-not-defined'
93
+ }),
94
+ _ts_metadata("design:type", String)
95
+ ], AtomicResultChildrenTemplate.prototype, "ifNotDefined", void 0);
82
96
  _ts_decorate([
83
97
  (0, props_utils_cjs_namespaceObject.mapProperty)({
84
98
  splitValues: true,
@@ -53,7 +53,7 @@ function _ts_metadata(metadataKey, metadataValue) {
53
53
  class AtomicResultTemplate extends external_lit_namespaceObject.LitElement {
54
54
  connectedCallback() {
55
55
  super.connectedCallback();
56
- this.resultTemplateController.matchConditions = (0, template_utils_cjs_namespaceObject.makeMatchConditions)(this.mustMatch, this.mustNotMatch, headless_namespaceObject.ResultTemplatesHelpers);
56
+ this.resultTemplateController.matchConditions = (0, template_utils_cjs_namespaceObject.makeFieldConditions)(this, headless_namespaceObject.ResultTemplatesHelpers);
57
57
  }
58
58
  render() {
59
59
  return external_lit_namespaceObject.nothing;
@@ -84,6 +84,20 @@ _ts_decorate([
84
84
  }),
85
85
  _ts_metadata("design:type", Array)
86
86
  ], AtomicResultTemplate.prototype, "conditions", void 0);
87
+ _ts_decorate([
88
+ (0, decorators_js_namespaceObject.property)({
89
+ type: String,
90
+ attribute: 'if-defined'
91
+ }),
92
+ _ts_metadata("design:type", String)
93
+ ], AtomicResultTemplate.prototype, "ifDefined", void 0);
94
+ _ts_decorate([
95
+ (0, decorators_js_namespaceObject.property)({
96
+ type: String,
97
+ attribute: 'if-not-defined'
98
+ }),
99
+ _ts_metadata("design:type", String)
100
+ ], AtomicResultTemplate.prototype, "ifNotDefined", void 0);
87
101
  _ts_decorate([
88
102
  (0, props_utils_cjs_namespaceObject.mapProperty)({
89
103
  splitValues: true,
@@ -27,27 +27,57 @@ var __webpack_require__ = {};
27
27
  })();
28
28
  var __webpack_exports__ = {};
29
29
  __webpack_require__.r(__webpack_exports__);
30
+ const subscriptionsByComponent = new WeakMap();
31
+ function getSubscriptions(component) {
32
+ let subscriptions = subscriptionsByComponent.get(component);
33
+ if (!subscriptions) {
34
+ const newSubscriptions = new Set();
35
+ subscriptionsByComponent.set(component, newSubscriptions);
36
+ component.addController({
37
+ hostConnected () {
38
+ newSubscriptions.forEach((subscription)=>{
39
+ subscription.unsubscribe ??= subscription.subscribe();
40
+ });
41
+ },
42
+ hostDisconnected () {
43
+ if (component.isConnected) return;
44
+ newSubscriptions.forEach((subscription)=>{
45
+ subscription.unsubscribe?.();
46
+ subscription.unsubscribe = void 0;
47
+ });
48
+ }
49
+ });
50
+ subscriptions = newSubscriptions;
51
+ }
52
+ return subscriptions;
53
+ }
54
+ function releaseSubscriptions(component) {
55
+ const subscriptions = subscriptionsByComponent.get(component);
56
+ subscriptions?.forEach((subscription)=>subscription.unsubscribe?.());
57
+ subscriptions?.clear();
58
+ }
30
59
  function bindStateToController(controllerProperty, options) {
31
60
  return (proto, stateProperty)=>{
32
61
  const ctor = proto.constructor;
33
62
  ctor.addInitializer((instance)=>{
34
63
  const component = instance;
35
- const { disconnectedCallback, initialize } = component;
64
+ const { initialize } = component;
36
65
  component.initialize = function() {
66
+ releaseSubscriptions(component);
37
67
  initialize?.call(this);
38
68
  if (!initialize) return console.error(`ControllerState: The "initialize" method has to be defined and instantiate a controller for the property ${controllerProperty.toString()}`, component);
39
69
  if (!component[controllerProperty]) return console.error(`${controllerProperty.toString()} property is not defined on component`, component);
40
70
  if (options?.onUpdateCallbackMethod && !component[options.onUpdateCallbackMethod]) return console.error(`ControllerState: The onUpdateCallbackMethod property "${options.onUpdateCallbackMethod}" is not defined`, component);
41
71
  const controller = component[controllerProperty];
42
72
  const updateCallback = options?.onUpdateCallbackMethod ? component[options.onUpdateCallbackMethod] : void 0;
43
- const unsubscribeController = controller.subscribe(()=>{
44
- component[stateProperty] = controller.state;
45
- 'function' == typeof updateCallback && updateCallback();
46
- });
47
- component.disconnectedCallback = ()=>{
48
- component.isConnected || unsubscribeController?.();
49
- disconnectedCallback?.call(component);
73
+ const subscription = {
74
+ subscribe: ()=>controller.subscribe(()=>{
75
+ component[stateProperty] = controller.state;
76
+ 'function' == typeof updateCallback && updateCallback();
77
+ })
50
78
  };
79
+ if (component.isConnected) subscription.unsubscribe = subscription.subscribe();
80
+ getSubscriptions(component).add(subscription);
51
81
  };
52
82
  });
53
83
  };
@@ -42,6 +42,7 @@ __webpack_require__.d(__webpack_exports__, {
42
42
  const external_lit_namespaceObject = require("lit");
43
43
  const tailwind_global_tw_css_namespaceObject = require("../utils/tailwind.global.tw.css");
44
44
  var tailwind_global_tw_css_default = /*#__PURE__*/ __webpack_require__.n(tailwind_global_tw_css_namespaceObject);
45
+ const tailwindStyles = (0, external_lit_namespaceObject.unsafeCSS)(tailwind_global_tw_css_default());
45
46
  const tailwindPropertiesSheet = "u" > typeof window ? (()=>{
46
47
  const propCss = tailwind_global_tw_css_default();
47
48
  const fullCss = Array.isArray(propCss) ? propCss.join('') : propCss;
@@ -68,7 +69,7 @@ const withTailwindStyles = (Base)=>class extends Base {
68
69
  }
69
70
  static get styles() {
70
71
  const baseStyles = [
71
- (0, external_lit_namespaceObject.unsafeCSS)(tailwind_global_tw_css_default())
72
+ tailwindStyles
72
73
  ];
73
74
  const customStyles = Base.styles;
74
75
  if (Array.isArray(customStyles)) return [
@@ -32,7 +32,7 @@ function getWindow() {
32
32
  }
33
33
  function getAtomicEnvironment(headlessVersion) {
34
34
  return {
35
- version: "3.63.0",
35
+ version: "3.64.0",
36
36
  headlessVersion
37
37
  };
38
38
  }
@@ -31,11 +31,13 @@ function getWindow() {
31
31
  return window;
32
32
  }
33
33
  function getInitQueueNamespace() {
34
- if (!getWindow().initQueueNamespace) getWindow().initQueueNamespace = {
35
- eventQueueMap: new Map(),
36
- parentReadyMap: new Map()
34
+ const namespace = getWindow().initQueueNamespace ??= {
35
+ eventQueueMap: new WeakMap(),
36
+ parentReadyMap: new WeakMap()
37
37
  };
38
- return getWindow().initQueueNamespace;
38
+ if (namespace.eventQueueMap instanceof Map) namespace.eventQueueMap = new WeakMap(namespace.eventQueueMap);
39
+ if (namespace.parentReadyMap instanceof Map) namespace.parentReadyMap = new WeakMap(namespace.parentReadyMap);
40
+ return namespace;
39
41
  }
40
42
  function getEventQueueMap() {
41
43
  return getInitQueueNamespace().eventQueueMap;
@@ -38,11 +38,16 @@ function replaceMediaQuery(style, mobileBreakpoint) {
38
38
  return style.replace(regex, `(width >= ${mobileBreakpoint})`);
39
39
  }
40
40
  function replaceStyleSheet(element, mobileBreakpoint) {
41
- const stylesheets = element.shadowRoot?.adoptedStyleSheets;
42
- if (!stylesheets || !stylesheets.length) return;
43
- const stylesheet = stylesheets[0];
41
+ const shadowRoot = element.shadowRoot;
42
+ const [stylesheet, ...otherStylesheets] = shadowRoot?.adoptedStyleSheets ?? [];
43
+ if (!shadowRoot || !stylesheet) return;
44
44
  const style = Object.values(stylesheet.cssRules).map((rule)=>rule.cssText).join('');
45
- stylesheet.replaceSync(replaceMediaQuery(style, mobileBreakpoint));
45
+ const replacedStylesheet = new CSSStyleSheet();
46
+ replacedStylesheet.replaceSync(replaceMediaQuery(style, mobileBreakpoint));
47
+ shadowRoot.adoptedStyleSheets = [
48
+ replacedStylesheet,
49
+ ...otherStylesheets
50
+ ];
46
51
  }
47
52
  function replateStyleContent(element, breakpoint) {
48
53
  const styleTag = element.shadowRoot?.querySelector('style');
@@ -32,7 +32,7 @@ __webpack_require__.d(__webpack_exports__, {
32
32
  headlessVersion: ()=>package_json_namespaceObject.version
33
33
  });
34
34
  const package_json_namespaceObject = require("@coveo/headless/package.json");
35
- const atomicVersion = "3.63.0";
35
+ const atomicVersion = "3.64.0";
36
36
  exports.atomicVersion = __webpack_exports__.atomicVersion;
37
37
  exports.headlessVersion = __webpack_exports__.headlessVersion;
38
38
  for(var __rspack_i in __webpack_exports__)if (-1 === [
@@ -47,6 +47,7 @@ class AtomicCommerceBreadbox extends LitElement {
47
47
  this.adaptBreadcrumbs();
48
48
  }
49
49
  disconnectedCallback() {
50
+ super.disconnectedCallback();
50
51
  this.resizeObserver?.disconnect();
51
52
  }
52
53
  get breadcrumbs() {
@@ -42,7 +42,7 @@ function _ts_metadata(metadataKey, metadataValue) {
42
42
  class AtomicCommerceCategoryFacet extends LitElement {
43
43
  initialize() {
44
44
  this.validateFacet();
45
- this.facet && announceFacetSearchResultsWithAriaLive(this.facet, this.displayName, (msg)=>{
45
+ this.facet && announceFacetSearchResultsWithAriaLive(this, this.facet, this.displayName, (msg)=>{
46
46
  this.facetSearchAriaMessage.message = msg;
47
47
  }, this.bindings.i18n);
48
48
  }
@@ -196,7 +196,7 @@ class AtomicCommerceFacet extends LitElement {
196
196
  if (!this.headerFocus) this.headerFocus = new FocusTargetController(this, this.bindings);
197
197
  }
198
198
  initAriaLive() {
199
- announceFacetSearchResultsWithAriaLive(this.facet, this.displayName, (msg)=>{
199
+ announceFacetSearchResultsWithAriaLive(this, this.facet, this.displayName, (msg)=>{
200
200
  this.ariaLiveRegion.message = msg;
201
201
  }, this.bindings.i18n);
202
202
  }