@coveo/atomic 3.31.2-pre.1707e4b34c → 3.31.2-pre.1c8be76f9e

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 (99) hide show
  1. package/dist/atomic/_atomic.esm.js +1 -1
  2. package/dist/atomic/atomic.esm.js.map +1 -1
  3. package/dist/atomic/components/_index.d.ts +0 -2
  4. package/dist/atomic/components/_index.js +0 -1
  5. package/dist/atomic/components/analytics-config.js +1 -1
  6. package/dist/atomic/components/components/commerce/atomic-commerce-breadbox/atomic-commerce-breadbox.tw.css.js +1 -1
  7. package/dist/atomic/components/components/commerce/atomic-commerce-interface/atomic-commerce-interface.js +15 -26
  8. package/dist/atomic/components/components/commerce/atomic-commerce-interface/atomic-commerce-interface.tw.css.js +1 -1
  9. package/dist/atomic/components/components/commerce/atomic-commerce-layout/atomic-commerce-layout.tw.css.js +1 -1
  10. package/dist/atomic/components/components/commerce/atomic-commerce-load-more-products/atomic-commerce-load-more-products.tw.css.js +1 -1
  11. package/dist/atomic/components/components/commerce/atomic-commerce-product-list/atomic-commerce-product-list.tw.css.js +1 -1
  12. package/dist/atomic/components/components/commerce/atomic-commerce-query-summary/atomic-commerce-query-summary.tw.css.js +1 -1
  13. package/dist/atomic/components/components/commerce/atomic-commerce-recommendation-interface/atomic-commerce-recommendation-interface.js +16 -35
  14. package/dist/atomic/components/components/commerce/atomic-commerce-recommendation-interface/atomic-commerce-recommendation-interface.tw.css.js +1 -1
  15. package/dist/atomic/components/components/commerce/atomic-commerce-recommendation-list/atomic-commerce-recommendation-list.tw.css.js +1 -1
  16. package/dist/atomic/components/components/commerce/atomic-commerce-refine-modal/atomic-commerce-refine-modal.tw.css.js +1 -1
  17. package/dist/atomic/components/components/commerce/atomic-commerce-refine-toggle/atomic-commerce-refine-toggle.tw.css.js +1 -1
  18. package/dist/atomic/components/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.js +3 -0
  19. package/dist/atomic/components/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.tw.css.js +1 -1
  20. package/dist/atomic/components/components/commerce/atomic-commerce-sort-dropdown/atomic-commerce-sort-dropdown.tw.css.js +1 -1
  21. package/dist/atomic/components/components/commerce/atomic-product/atomic-product.tw.css.js +1 -1
  22. package/dist/atomic/components/components/commerce/atomic-product-children/atomic-product-children.tw.css.js +1 -1
  23. package/dist/atomic/components/components/commerce/atomic-product-description/atomic-product-description.tw.css.js +1 -1
  24. package/dist/atomic/components/components/commerce/atomic-product-excerpt/atomic-product-excerpt.tw.css.js +1 -1
  25. package/dist/atomic/components/components/commerce/atomic-product-field-condition/atomic-product-field-condition.js +70 -0
  26. package/dist/atomic/components/components/commerce/atomic-product-link/atomic-product-link.tw.css.js +1 -1
  27. package/dist/atomic/components/components/commerce/atomic-product-multi-value-text/atomic-product-multi-value-text.tw.css.js +1 -1
  28. package/dist/atomic/components/components/commerce/atomic-product-price/atomic-product-price.tw.css.js +1 -1
  29. package/dist/atomic/components/components/commerce/atomic-product-template/atomic-product-template.js +1 -0
  30. package/dist/atomic/components/components/commerce/index.js +1 -0
  31. package/dist/atomic/components/components/commerce/lazy-index.js +1 -0
  32. package/dist/atomic/components/components/common/atomic-icon/atomic-icon.tw.css.js +1 -1
  33. package/dist/atomic/components/components/common/facets/facet-common.tw.css.js +1 -1
  34. package/dist/atomic/components/components/common/facets/facet-search/facet-search.tw.css.js +1 -1
  35. package/dist/atomic/components/components/common/facets/facet-value-box/facet-value-box.tw.css.js +1 -1
  36. package/dist/atomic/components/components/common/facets/facet-value-checkbox/facet-value-checkbox.tw.css.js +1 -1
  37. package/dist/atomic/components/components/common/facets/facet-value-exclude/facet-value-exclude.tw.css.js +1 -1
  38. package/dist/atomic/components/components/common/interface/interface-controller.js +89 -0
  39. package/dist/atomic/components/components/common/refine-modal/refine-modal-common.tw.css.js +1 -1
  40. package/dist/atomic/components/global/environment.js +1 -1
  41. package/dist/atomic/components/global/tailwind.default.css.js +1 -1
  42. package/dist/atomic/components/index.js.map +1 -1
  43. package/dist/atomic/components/themes/accessible.css.js +1 -1
  44. package/dist/atomic/components/themes/coveo.css.js +1 -1
  45. package/dist/atomic/components/utils/coveo.tw.css.js +1 -1
  46. package/dist/atomic/components/utils/tailwind-utilities/aspect-square.tw.css.js +1 -1
  47. package/dist/atomic/components/utils/tailwind-utilities/components.tw.css.js +1 -1
  48. package/dist/atomic/components/utils/tailwind-utilities/hide-scrollbar.tw.css.js +1 -1
  49. package/dist/atomic/components/utils/tailwind-utilities/link-style.tw.css.js +1 -1
  50. package/dist/atomic/components/utils/tailwind-utilities/set-font-size.tw.css.js +1 -1
  51. package/dist/atomic/components/utils/tailwind-utilities/utilities.tw.css.js +1 -1
  52. package/dist/atomic/components/utils/tailwind.global.tw.css.js +1 -1
  53. package/dist/atomic/{p-aaef485e.entry.js → p-16aba904.entry.js} +2 -2
  54. package/dist/atomic/{p-c996657d.js → p-5cb01552.js} +2 -2
  55. package/dist/atomic/{p-0577471c.entry.js → p-9e77e09f.entry.js} +2 -2
  56. package/dist/atomic/{p-222d9586.entry.js → p-b573855a.entry.js} +2 -2
  57. package/dist/cjs/_loader.cjs.js +1 -1
  58. package/dist/cjs/{analytics-config-eb93e5ee.js → analytics-config-aabaf235.js} +2 -2
  59. package/dist/cjs/{analytics-config-eb93e5ee.js.map → analytics-config-aabaf235.js.map} +1 -1
  60. package/dist/cjs/atomic-insight-interface.cjs.entry.js +1 -1
  61. package/dist/cjs/atomic-recs-interface.cjs.entry.js +1 -1
  62. package/dist/cjs/atomic-search-interface.cjs.entry.js +1 -1
  63. package/dist/cjs/atomic.cjs.js +1 -1
  64. package/dist/cjs/index-757bc886.js +0 -4
  65. package/dist/cjs/version.cjs.js +2 -2
  66. package/dist/esm/_loader.js +1 -1
  67. package/dist/esm/{analytics-config-11a6a380.js → analytics-config-8adc1641.js} +2 -2
  68. package/dist/esm/{analytics-config-11a6a380.js.map → analytics-config-8adc1641.js.map} +1 -1
  69. package/dist/esm/atomic-insight-interface.entry.js +1 -1
  70. package/dist/esm/atomic-recs-interface.entry.js +1 -1
  71. package/dist/esm/atomic-search-interface.entry.js +1 -1
  72. package/dist/esm/atomic.js +1 -1
  73. package/dist/esm/index-3f35faca.js +0 -4
  74. package/dist/esm/version.js +2 -2
  75. package/dist/types/components/commerce/atomic-commerce-interface/atomic-commerce-interface.d.ts +3 -4
  76. package/dist/types/components/commerce/atomic-commerce-recommendation-interface/atomic-commerce-recommendation-interface.d.ts +5 -6
  77. package/dist/types/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.d.ts +3 -0
  78. package/dist/types/components/commerce/atomic-product-field-condition/atomic-product-field-condition.d.ts +24 -13
  79. package/dist/types/components/commerce/atomic-product-template/atomic-product-template.d.ts +1 -0
  80. package/dist/types/components/commerce/index.d.ts +1 -0
  81. package/dist/types/components/common/interface/i18n.d.ts +1 -1
  82. package/dist/types/components/common/interface/{interface-common.d.ts → interface-controller.d.ts} +14 -11
  83. package/dist/types/components.d.ts +0 -69
  84. package/docs/atomic-docs.json +31 -164
  85. package/package.json +3 -3
  86. package/dist/atomic/components/atomic-product-field-condition.d.ts +0 -11
  87. package/dist/atomic/components/atomic-product-field-condition.js +0 -131
  88. package/dist/atomic/components/atomic-product-field-condition.js.map +0 -1
  89. package/dist/atomic/components/components/common/interface/interface-common.js +0 -95
  90. package/dist/atomic/p-a0b3c6e2.entry.js +0 -2
  91. package/dist/atomic/p-a0b3c6e2.entry.js.map +0 -1
  92. package/dist/cjs/atomic-product-field-condition.cjs.entry.js +0 -119
  93. package/dist/cjs/atomic-product-field-condition.cjs.entry.js.map +0 -1
  94. package/dist/esm/atomic-product-field-condition.entry.js +0 -115
  95. package/dist/esm/atomic-product-field-condition.entry.js.map +0 -1
  96. /package/dist/atomic/{p-aaef485e.entry.js.map → p-16aba904.entry.js.map} +0 -0
  97. /package/dist/atomic/{p-c996657d.js.map → p-5cb01552.js.map} +0 -0
  98. /package/dist/atomic/{p-0577471c.entry.js.map → p-9e77e09f.entry.js.map} +0 -0
  99. /package/dist/atomic/{p-222d9586.entry.js.map → p-b573855a.entry.js.map} +0 -0
@@ -1584,31 +1584,6 @@ export namespace Components {
1584
1584
  */
1585
1585
  interface AtomicPopover {
1586
1586
  }
1587
- /**
1588
- * The `atomic-product-field-condition` component takes a list of conditions that, if fulfilled, apply the template in which it's defined.
1589
- * The condition properties can be based on any top-level product property of the `product` object, not restricted to fields (e.g., `ec_name`).
1590
- * @alpha
1591
- */
1592
- interface AtomicProductFieldCondition {
1593
- /**
1594
- * Verifies whether the specified fields are defined.
1595
- */
1596
- "ifDefined"?: string;
1597
- /**
1598
- * Verifies whether the specified fields are not defined.
1599
- */
1600
- "ifNotDefined"?: string;
1601
- /**
1602
- * Verifies whether the specified fields match the specified values.
1603
- * @type {Record<string, string[]>}
1604
- */
1605
- "mustMatch": Record<string, string[]>;
1606
- /**
1607
- * Verifies whether the specified fields do not match the specified values.
1608
- * @type {Record<string, string[]>}
1609
- */
1610
- "mustNotMatch": Record<string, string[]>;
1611
- }
1612
1587
  /**
1613
1588
  * The `atomic-product-image` component renders an image from a product field.
1614
1589
  * @alpha
@@ -4080,17 +4055,6 @@ declare global {
4080
4055
  prototype: HTMLAtomicPopoverElement;
4081
4056
  new (): HTMLAtomicPopoverElement;
4082
4057
  };
4083
- /**
4084
- * The `atomic-product-field-condition` component takes a list of conditions that, if fulfilled, apply the template in which it's defined.
4085
- * The condition properties can be based on any top-level product property of the `product` object, not restricted to fields (e.g., `ec_name`).
4086
- * @alpha
4087
- */
4088
- interface HTMLAtomicProductFieldConditionElement extends Components.AtomicProductFieldCondition, HTMLStencilElement {
4089
- }
4090
- var HTMLAtomicProductFieldConditionElement: {
4091
- prototype: HTMLAtomicProductFieldConditionElement;
4092
- new (): HTMLAtomicProductFieldConditionElement;
4093
- };
4094
4058
  /**
4095
4059
  * The `atomic-product-image` component renders an image from a product field.
4096
4060
  * @alpha
@@ -5180,7 +5144,6 @@ declare global {
5180
5144
  "atomic-numeric-range": HTMLAtomicNumericRangeElement;
5181
5145
  "atomic-pager": HTMLAtomicPagerElement;
5182
5146
  "atomic-popover": HTMLAtomicPopoverElement;
5183
- "atomic-product-field-condition": HTMLAtomicProductFieldConditionElement;
5184
5147
  "atomic-product-image": HTMLAtomicProductImageElement;
5185
5148
  "atomic-product-rating": HTMLAtomicProductRatingElement;
5186
5149
  "atomic-product-section-actions": HTMLAtomicProductSectionActionsElement;
@@ -6737,31 +6700,6 @@ declare namespace LocalJSX {
6737
6700
  */
6738
6701
  interface AtomicPopover {
6739
6702
  }
6740
- /**
6741
- * The `atomic-product-field-condition` component takes a list of conditions that, if fulfilled, apply the template in which it's defined.
6742
- * The condition properties can be based on any top-level product property of the `product` object, not restricted to fields (e.g., `ec_name`).
6743
- * @alpha
6744
- */
6745
- interface AtomicProductFieldCondition {
6746
- /**
6747
- * Verifies whether the specified fields are defined.
6748
- */
6749
- "ifDefined"?: string;
6750
- /**
6751
- * Verifies whether the specified fields are not defined.
6752
- */
6753
- "ifNotDefined"?: string;
6754
- /**
6755
- * Verifies whether the specified fields match the specified values.
6756
- * @type {Record<string, string[]>}
6757
- */
6758
- "mustMatch"?: Record<string, string[]>;
6759
- /**
6760
- * Verifies whether the specified fields do not match the specified values.
6761
- * @type {Record<string, string[]>}
6762
- */
6763
- "mustNotMatch"?: Record<string, string[]>;
6764
- }
6765
6703
  /**
6766
6704
  * The `atomic-product-image` component renders an image from a product field.
6767
6705
  * @alpha
@@ -8376,7 +8314,6 @@ declare namespace LocalJSX {
8376
8314
  "atomic-numeric-range": AtomicNumericRange;
8377
8315
  "atomic-pager": AtomicPager;
8378
8316
  "atomic-popover": AtomicPopover;
8379
- "atomic-product-field-condition": AtomicProductFieldCondition;
8380
8317
  "atomic-product-image": AtomicProductImage;
8381
8318
  "atomic-product-rating": AtomicProductRating;
8382
8319
  "atomic-product-section-actions": AtomicProductSectionActions;
@@ -8689,12 +8626,6 @@ declare module "@stencil/core" {
8689
8626
  * The `atomic-popover` component displays any facet as a popover menu.
8690
8627
  */
8691
8628
  "atomic-popover": LocalJSX.AtomicPopover & JSXBase.HTMLAttributes<HTMLAtomicPopoverElement>;
8692
- /**
8693
- * The `atomic-product-field-condition` component takes a list of conditions that, if fulfilled, apply the template in which it's defined.
8694
- * The condition properties can be based on any top-level product property of the `product` object, not restricted to fields (e.g., `ec_name`).
8695
- * @alpha
8696
- */
8697
- "atomic-product-field-condition": LocalJSX.AtomicProductFieldCondition & JSXBase.HTMLAttributes<HTMLAtomicProductFieldConditionElement>;
8698
8629
  /**
8699
8630
  * The `atomic-product-image` component renders an image from a product field.
8700
8631
  * @alpha
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2025-07-31T14:15:48",
2
+ "timestamp": "2025-07-31T16:54:54",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "4.20.0",
@@ -6562,139 +6562,6 @@
6562
6562
  ]
6563
6563
  }
6564
6564
  },
6565
- {
6566
- "filePath": "src/components/commerce/atomic-product-field-condition/atomic-product-field-condition.tsx",
6567
- "encapsulation": "none",
6568
- "tag": "atomic-product-field-condition",
6569
- "docs": "The `atomic-product-field-condition` component takes a list of conditions that, if fulfilled, apply the template in which it's defined.\nThe condition properties can be based on any top-level product property of the `product` object, not restricted to fields (e.g., `ec_name`).",
6570
- "docsTags": [
6571
- {
6572
- "name": "alpha"
6573
- }
6574
- ],
6575
- "usage": {},
6576
- "props": [
6577
- {
6578
- "name": "ifDefined",
6579
- "type": "string | undefined",
6580
- "complexType": {
6581
- "original": "string",
6582
- "resolved": "string | undefined",
6583
- "references": {}
6584
- },
6585
- "mutable": false,
6586
- "attr": "if-defined",
6587
- "reflectToAttr": true,
6588
- "docs": "Verifies whether the specified fields are defined.",
6589
- "docsTags": [],
6590
- "values": [
6591
- {
6592
- "type": "string"
6593
- },
6594
- {
6595
- "type": "undefined"
6596
- }
6597
- ],
6598
- "optional": true,
6599
- "required": false
6600
- },
6601
- {
6602
- "name": "ifNotDefined",
6603
- "type": "string | undefined",
6604
- "complexType": {
6605
- "original": "string",
6606
- "resolved": "string | undefined",
6607
- "references": {}
6608
- },
6609
- "mutable": false,
6610
- "attr": "if-not-defined",
6611
- "reflectToAttr": true,
6612
- "docs": "Verifies whether the specified fields are not defined.",
6613
- "docsTags": [],
6614
- "values": [
6615
- {
6616
- "type": "string"
6617
- },
6618
- {
6619
- "type": "undefined"
6620
- }
6621
- ],
6622
- "optional": true,
6623
- "required": false
6624
- },
6625
- {
6626
- "name": "mustMatch",
6627
- "type": "{ [x: string]: string[]; }",
6628
- "complexType": {
6629
- "original": "Record<string, string[]>",
6630
- "resolved": "{ [x: string]: string[]; }",
6631
- "references": {
6632
- "Record": {
6633
- "location": "global",
6634
- "id": "global::Record"
6635
- }
6636
- }
6637
- },
6638
- "mutable": false,
6639
- "reflectToAttr": false,
6640
- "docs": "Verifies whether the specified fields match the specified values.",
6641
- "docsTags": [
6642
- {
6643
- "name": "type",
6644
- "text": "{Record<string, string[]>}"
6645
- }
6646
- ],
6647
- "default": "{}",
6648
- "values": [
6649
- {
6650
- "type": "{ [x: string]: string[]; }"
6651
- }
6652
- ],
6653
- "optional": false,
6654
- "required": false
6655
- },
6656
- {
6657
- "name": "mustNotMatch",
6658
- "type": "{ [x: string]: string[]; }",
6659
- "complexType": {
6660
- "original": "Record<string, string[]>",
6661
- "resolved": "{ [x: string]: string[]; }",
6662
- "references": {
6663
- "Record": {
6664
- "location": "global",
6665
- "id": "global::Record"
6666
- }
6667
- }
6668
- },
6669
- "mutable": false,
6670
- "reflectToAttr": false,
6671
- "docs": "Verifies whether the specified fields do not match the specified values.",
6672
- "docsTags": [
6673
- {
6674
- "name": "type",
6675
- "text": "{Record<string, string[]>}"
6676
- }
6677
- ],
6678
- "default": "{}",
6679
- "values": [
6680
- {
6681
- "type": "{ [x: string]: string[]; }"
6682
- }
6683
- ],
6684
- "optional": false,
6685
- "required": false
6686
- }
6687
- ],
6688
- "methods": [],
6689
- "events": [],
6690
- "listeners": [],
6691
- "styles": [],
6692
- "slots": [],
6693
- "parts": [],
6694
- "dependents": [],
6695
- "dependencies": [],
6696
- "dependencyGraph": {}
6697
- },
6698
6565
  {
6699
6566
  "filePath": "src/components/commerce/atomic-product-image/atomic-product-image.tsx",
6700
6567
  "encapsulation": "shadow",
@@ -7209,10 +7076,10 @@
7209
7076
  "props": [
7210
7077
  {
7211
7078
  "name": "imageSize",
7212
- "type": "undefined | ({ readonly [x: number]: string; [Symbol.iterator]: () => IterableIterator<string>; normalize: { (form: \"NFC\" | \"NFD\" | \"NFKC\" | \"NFKD\"): string; (form?: string | undefined): string; }; charAt: (pos: number) => string; charCodeAt: (index: number) => number; concat: (...strings: string[]) => string; indexOf: (searchString: string, position?: number | undefined) => number; lastIndexOf: (searchString: string, position?: number | undefined) => number; localeCompare: { (that: string): number; (that: string, locales?: string | string[] | undefined, options?: CollatorOptions | undefined): number; (that: string, locales?: LocalesArgument, options?: CollatorOptions | undefined): number; }; match: { (regexp: string | RegExp): RegExpMatchArray | null; (matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null; }; replace: { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string; (searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string; }; search: { (regexp: string | RegExp): number; (searcher: { [Symbol.search](string: string): number; }): number; }; slice: (start?: number | undefined, end?: number | undefined) => string; split: { (separator: string | RegExp, limit?: number | undefined): string[]; (splitter: { [Symbol.split](string: string, limit?: number | undefined): string[]; }, limit?: number | undefined): string[]; }; substring: (start: number, end?: number | undefined) => string; toLowerCase: () => string; toLocaleLowerCase: { (locales?: string | string[] | undefined): string; (locales?: LocalesArgument): string; }; toUpperCase: () => string; toLocaleUpperCase: { (locales?: string | string[] | undefined): string; (locales?: LocalesArgument): string; }; trim: () => string; readonly length: number; substr: (from: number, length?: number | undefined) => string; codePointAt: (pos: number) => number | undefined; includes: (searchString: string, position?: number | undefined) => boolean; endsWith: (searchString: string, endPosition?: number | undefined) => boolean; repeat: (count: number) => string; startsWith: (searchString: string, position?: number | undefined) => boolean; anchor: (name: string) => string; big: () => string; blink: () => string; bold: () => string; fixed: () => string; fontcolor: (color: string) => string; fontsize: { (size: number): string; (size: string): string; }; italics: () => string; link: (url: string) => string; small: () => string; strike: () => string; sub: () => string; sup: () => string; padStart: { (maxLength: number, fillString?: string | undefined): string; (length: number, fillStr?: string | undefined): string; }; padEnd: { (maxLength: number, fillString?: string | undefined): string; (length: number, fillStr?: string | undefined): string; }; trimEnd: () => string; trimStart: () => string; trimLeft: () => string; trimRight: () => string; matchAll: (regexp: RegExp) => IterableIterator<RegExpExecArray>; replaceAll: { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; }; at: { (index: number): string | undefined; (index: number): string; }; escapeHTML: () => string; unescapeHTML: () => string; toString: () => string; valueOf: () => string; })",
7079
+ "type": "undefined | ({ readonly [x: number]: string; [Symbol.iterator]: () => IterableIterator<string>; readonly length: number; toString: () => string; concat: (...strings: string[]) => string; slice: (start?: number | undefined, end?: number | undefined) => string; indexOf: (searchString: string, position?: number | undefined) => number; lastIndexOf: (searchString: string, position?: number | undefined) => number; includes: (searchString: string, position?: number | undefined) => boolean; at: { (index: number): string | undefined; (index: number): string; }; link: (url: string) => string; search: { (regexp: string | RegExp): number; (searcher: { [Symbol.search](string: string): number; }): number; }; small: () => string; sub: () => string; sup: () => string; big: () => string; blink: () => string; strike: () => string; normalize: { (form: \"NFC\" | \"NFD\" | \"NFKC\" | \"NFKD\"): string; (form?: string | undefined): string; }; charAt: (pos: number) => string; charCodeAt: (index: number) => number; localeCompare: { (that: string): number; (that: string, locales?: string | string[] | undefined, options?: CollatorOptions | undefined): number; (that: string, locales?: LocalesArgument, options?: CollatorOptions | undefined): number; }; match: { (regexp: string | RegExp): RegExpMatchArray | null; (matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null; }; replace: { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string; (searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string; }; split: { (separator: string | RegExp, limit?: number | undefined): string[]; (splitter: { [Symbol.split](string: string, limit?: number | undefined): string[]; }, limit?: number | undefined): string[]; }; substring: (start: number, end?: number | undefined) => string; toLowerCase: () => string; toLocaleLowerCase: { (locales?: string | string[] | undefined): string; (locales?: LocalesArgument): string; }; toUpperCase: () => string; toLocaleUpperCase: { (locales?: string | string[] | undefined): string; (locales?: LocalesArgument): string; }; trim: () => string; substr: (from: number, length?: number | undefined) => string; codePointAt: (pos: number) => number | undefined; endsWith: (searchString: string, endPosition?: number | undefined) => boolean; repeat: (count: number) => string; startsWith: (searchString: string, position?: number | undefined) => boolean; anchor: (name: string) => string; bold: () => string; fixed: () => string; fontcolor: (color: string) => string; fontsize: { (size: number): string; (size: string): string; }; italics: () => string; padStart: { (maxLength: number, fillString?: string | undefined): string; (length: number, fillStr?: string | undefined): string; }; padEnd: { (maxLength: number, fillString?: string | undefined): string; (length: number, fillStr?: string | undefined): string; }; trimEnd: () => string; trimStart: () => string; trimLeft: () => string; trimRight: () => string; matchAll: (regexp: RegExp) => IterableIterator<RegExpExecArray>; replaceAll: { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; }; escapeHTML: () => string; unescapeHTML: () => string; valueOf: () => string; })",
7213
7080
  "complexType": {
7214
7081
  "original": "Omit<ItemDisplayImageSize, 'icon'>",
7215
- "resolved": "undefined | ({ readonly [x: number]: string; [Symbol.iterator]: () => IterableIterator<string>; normalize: { (form: \"NFC\" | \"NFD\" | \"NFKC\" | \"NFKD\"): string; (form?: string | undefined): string; }; charAt: (pos: number) => string; charCodeAt: (index: number) => number; concat: (...strings: string[]) => string; indexOf: (searchString: string, position?: number | undefined) => number; lastIndexOf: (searchString: string, position?: number | undefined) => number; localeCompare: { (that: string): number; (that: string, locales?: string | string[] | undefined, options?: CollatorOptions | undefined): number; (that: string, locales?: LocalesArgument, options?: CollatorOptions | undefined): number; }; match: { (regexp: string | RegExp): RegExpMatchArray | null; (matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null; }; replace: { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string; (searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string; }; search: { (regexp: string | RegExp): number; (searcher: { [Symbol.search](string: string): number; }): number; }; slice: (start?: number | undefined, end?: number | undefined) => string; split: { (separator: string | RegExp, limit?: number | undefined): string[]; (splitter: { [Symbol.split](string: string, limit?: number | undefined): string[]; }, limit?: number | undefined): string[]; }; substring: (start: number, end?: number | undefined) => string; toLowerCase: () => string; toLocaleLowerCase: { (locales?: string | string[] | undefined): string; (locales?: LocalesArgument): string; }; toUpperCase: () => string; toLocaleUpperCase: { (locales?: string | string[] | undefined): string; (locales?: LocalesArgument): string; }; trim: () => string; readonly length: number; substr: (from: number, length?: number | undefined) => string; codePointAt: (pos: number) => number | undefined; includes: (searchString: string, position?: number | undefined) => boolean; endsWith: (searchString: string, endPosition?: number | undefined) => boolean; repeat: (count: number) => string; startsWith: (searchString: string, position?: number | undefined) => boolean; anchor: (name: string) => string; big: () => string; blink: () => string; bold: () => string; fixed: () => string; fontcolor: (color: string) => string; fontsize: { (size: number): string; (size: string): string; }; italics: () => string; link: (url: string) => string; small: () => string; strike: () => string; sub: () => string; sup: () => string; padStart: { (maxLength: number, fillString?: string | undefined): string; (length: number, fillStr?: string | undefined): string; }; padEnd: { (maxLength: number, fillString?: string | undefined): string; (length: number, fillStr?: string | undefined): string; }; trimEnd: () => string; trimStart: () => string; trimLeft: () => string; trimRight: () => string; matchAll: (regexp: RegExp) => IterableIterator<RegExpExecArray>; replaceAll: { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; }; at: { (index: number): string | undefined; (index: number): string; }; escapeHTML: () => string; unescapeHTML: () => string; toString: () => string; valueOf: () => string; })",
7082
+ "resolved": "undefined | ({ readonly [x: number]: string; [Symbol.iterator]: () => IterableIterator<string>; readonly length: number; toString: () => string; concat: (...strings: string[]) => string; slice: (start?: number | undefined, end?: number | undefined) => string; indexOf: (searchString: string, position?: number | undefined) => number; lastIndexOf: (searchString: string, position?: number | undefined) => number; includes: (searchString: string, position?: number | undefined) => boolean; at: { (index: number): string | undefined; (index: number): string; }; link: (url: string) => string; search: { (regexp: string | RegExp): number; (searcher: { [Symbol.search](string: string): number; }): number; }; small: () => string; sub: () => string; sup: () => string; big: () => string; blink: () => string; strike: () => string; normalize: { (form: \"NFC\" | \"NFD\" | \"NFKC\" | \"NFKD\"): string; (form?: string | undefined): string; }; charAt: (pos: number) => string; charCodeAt: (index: number) => number; localeCompare: { (that: string): number; (that: string, locales?: string | string[] | undefined, options?: CollatorOptions | undefined): number; (that: string, locales?: LocalesArgument, options?: CollatorOptions | undefined): number; }; match: { (regexp: string | RegExp): RegExpMatchArray | null; (matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null; }; replace: { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string; (searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string; }; split: { (separator: string | RegExp, limit?: number | undefined): string[]; (splitter: { [Symbol.split](string: string, limit?: number | undefined): string[]; }, limit?: number | undefined): string[]; }; substring: (start: number, end?: number | undefined) => string; toLowerCase: () => string; toLocaleLowerCase: { (locales?: string | string[] | undefined): string; (locales?: LocalesArgument): string; }; toUpperCase: () => string; toLocaleUpperCase: { (locales?: string | string[] | undefined): string; (locales?: LocalesArgument): string; }; trim: () => string; substr: (from: number, length?: number | undefined) => string; codePointAt: (pos: number) => number | undefined; endsWith: (searchString: string, endPosition?: number | undefined) => boolean; repeat: (count: number) => string; startsWith: (searchString: string, position?: number | undefined) => boolean; anchor: (name: string) => string; bold: () => string; fixed: () => string; fontcolor: (color: string) => string; fontsize: { (size: number): string; (size: string): string; }; italics: () => string; padStart: { (maxLength: number, fillString?: string | undefined): string; (length: number, fillStr?: string | undefined): string; }; padEnd: { (maxLength: number, fillString?: string | undefined): string; (length: number, fillStr?: string | undefined): string; }; trimEnd: () => string; trimStart: () => string; trimLeft: () => string; trimRight: () => string; matchAll: (regexp: RegExp) => IterableIterator<RegExpExecArray>; replaceAll: { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; }; escapeHTML: () => string; unescapeHTML: () => string; valueOf: () => string; })",
7216
7083
  "references": {
7217
7084
  "Omit": {
7218
7085
  "location": "global",
@@ -7234,7 +7101,28 @@
7234
7101
  "type": "undefined"
7235
7102
  },
7236
7103
  {
7237
- "type": "({ readonly [x: number]: string; [Symbol.iterator]: () => IterableIterator<string>; normalize: { (form: \"NFC\""
7104
+ "type": "({ readonly [x: number]: string; [Symbol.iterator]: () => IterableIterator<string>; readonly length: number; toString: () => string; concat: (...strings: string[]) => string; slice: (start?: number"
7105
+ },
7106
+ {
7107
+ "type": "undefined, end?: number"
7108
+ },
7109
+ {
7110
+ "type": "undefined) => string; indexOf: (searchString: string, position?: number"
7111
+ },
7112
+ {
7113
+ "type": "undefined) => number; lastIndexOf: (searchString: string, position?: number"
7114
+ },
7115
+ {
7116
+ "type": "undefined) => number; includes: (searchString: string, position?: number"
7117
+ },
7118
+ {
7119
+ "type": "undefined) => boolean; at: { (index: number): string"
7120
+ },
7121
+ {
7122
+ "type": "undefined; (index: number): string; }; link: (url: string) => string; search: { (regexp: string"
7123
+ },
7124
+ {
7125
+ "type": "RegExp): number; (searcher: { [Symbol.search](string: string): number; }): number; }; small: () => string; sub: () => string; sup: () => string; big: () => string; blink: () => string; strike: () => string; normalize: { (form: \"NFC\""
7238
7126
  },
7239
7127
  {
7240
7128
  "value": "NFD",
@@ -7248,13 +7136,7 @@
7248
7136
  "type": "\"NFKD\"): string; (form?: string"
7249
7137
  },
7250
7138
  {
7251
- "type": "undefined): string; }; charAt: (pos: number) => string; charCodeAt: (index: number) => number; concat: (...strings: string[]) => string; indexOf: (searchString: string, position?: number"
7252
- },
7253
- {
7254
- "type": "undefined) => number; lastIndexOf: (searchString: string, position?: number"
7255
- },
7256
- {
7257
- "type": "undefined) => number; localeCompare: { (that: string): number; (that: string, locales?: string"
7139
+ "type": "undefined): string; }; charAt: (pos: number) => string; charCodeAt: (index: number) => number; localeCompare: { (that: string): number; (that: string, locales?: string"
7258
7140
  },
7259
7141
  {
7260
7142
  "type": "string[]"
@@ -7284,16 +7166,7 @@
7284
7166
  "type": "RegExp, replaceValue: string): string; (searchValue: string"
7285
7167
  },
7286
7168
  {
7287
- "type": "RegExp, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string; (searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string; }; search: { (regexp: string"
7288
- },
7289
- {
7290
- "type": "RegExp): number; (searcher: { [Symbol.search](string: string): number; }): number; }; slice: (start?: number"
7291
- },
7292
- {
7293
- "type": "undefined, end?: number"
7294
- },
7295
- {
7296
- "type": "undefined) => string; split: { (separator: string"
7169
+ "type": "RegExp, replacer: (substring: string, ...args: any[]) => string): string; (searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string; (searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string; }; split: { (separator: string"
7297
7170
  },
7298
7171
  {
7299
7172
  "type": "RegExp, limit?: number"
@@ -7320,22 +7193,19 @@
7320
7193
  "type": "string[]"
7321
7194
  },
7322
7195
  {
7323
- "type": "undefined): string; (locales?: LocalesArgument): string; }; trim: () => string; readonly length: number; substr: (from: number, length?: number"
7196
+ "type": "undefined): string; (locales?: LocalesArgument): string; }; trim: () => string; substr: (from: number, length?: number"
7324
7197
  },
7325
7198
  {
7326
7199
  "type": "undefined) => string; codePointAt: (pos: number) => number"
7327
7200
  },
7328
7201
  {
7329
- "type": "undefined; includes: (searchString: string, position?: number"
7330
- },
7331
- {
7332
- "type": "undefined) => boolean; endsWith: (searchString: string, endPosition?: number"
7202
+ "type": "undefined; endsWith: (searchString: string, endPosition?: number"
7333
7203
  },
7334
7204
  {
7335
7205
  "type": "undefined) => boolean; repeat: (count: number) => string; startsWith: (searchString: string, position?: number"
7336
7206
  },
7337
7207
  {
7338
- "type": "undefined) => boolean; anchor: (name: string) => string; big: () => string; blink: () => string; bold: () => string; fixed: () => string; fontcolor: (color: string) => string; fontsize: { (size: number): string; (size: string): string; }; italics: () => string; link: (url: string) => string; small: () => string; strike: () => string; sub: () => string; sup: () => string; padStart: { (maxLength: number, fillString?: string"
7208
+ "type": "undefined) => boolean; anchor: (name: string) => string; bold: () => string; fixed: () => string; fontcolor: (color: string) => string; fontsize: { (size: number): string; (size: string): string; }; italics: () => string; padStart: { (maxLength: number, fillString?: string"
7339
7209
  },
7340
7210
  {
7341
7211
  "type": "undefined): string; (length: number, fillStr?: string"
@@ -7353,10 +7223,7 @@
7353
7223
  "type": "RegExp, replaceValue: string): string; (searchValue: string"
7354
7224
  },
7355
7225
  {
7356
- "type": "RegExp, replacer: (substring: string, ...args: any[]) => string): string; }; at: { (index: number): string"
7357
- },
7358
- {
7359
- "type": "undefined; (index: number): string; }; escapeHTML: () => string; unescapeHTML: () => string; toString: () => string; valueOf: () => string; })"
7226
+ "type": "RegExp, replacer: (substring: string, ...args: any[]) => string): string; }; escapeHTML: () => string; unescapeHTML: () => string; valueOf: () => string; })"
7360
7227
  }
7361
7228
  ],
7362
7229
  "optional": true,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coveo/atomic",
3
3
  "type": "module",
4
- "version": "3.31.2-pre.1707e4b34c",
4
+ "version": "3.31.2-pre.1c8be76f9e",
5
5
  "description": "A web-component library for building modern UIs interfacing with the Coveo platform",
6
6
  "homepage": "https://docs.coveo.com/en/atomic/latest/",
7
7
  "repository": {
@@ -72,7 +72,7 @@
72
72
  "dependencies": {
73
73
  "@lit/context": "1.1.6",
74
74
  "@coveo/bueno": "1.0.24",
75
- "@coveo/headless": "3.27.8-pre.1707e4b34c",
75
+ "@coveo/headless": "3.27.8-pre.1c8be76f9e",
76
76
  "@popperjs/core": "2.11.8",
77
77
  "@salesforce-ux/design-system": "2.27.2",
78
78
  "@stencil/core": "4.20.0",
@@ -158,7 +158,7 @@
158
158
  },
159
159
  "peerDependencies": {
160
160
  "@coveo/bueno": "1.0.24",
161
- "@coveo/headless": "3.27.8-pre.1707e4b34c",
161
+ "@coveo/headless": "3.27.8-pre.1c8be76f9e",
162
162
  "typescript": ">=5.0.0"
163
163
  },
164
164
  "peerDependenciesMeta": {
@@ -1,11 +0,0 @@
1
- import type { Components, JSX } from "../../types/components";
2
-
3
- interface AtomicProductFieldCondition extends Components.AtomicProductFieldCondition, HTMLElement {}
4
- export const AtomicProductFieldCondition: {
5
- prototype: AtomicProductFieldCondition;
6
- new (): AtomicProductFieldCondition;
7
- };
8
- /**
9
- * Used to define this component and all nested components recursively.
10
- */
11
- export const defineCustomElement: () => void;
@@ -1,131 +0,0 @@
1
- import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
- import { M as MapProp } from './props-utils.js';
3
- import './purify.js';
4
- import { ProductTemplatesHelpers } from '@coveo/headless/commerce';
5
- import { P as ProductContext } from './stencil-product-template-decorators.js';
6
-
7
- // TODO: Replace by Set.prototype.intersection in July 2025
8
- function intersection(setA, setB) {
9
- const result = new Set();
10
- for (const elem of setA) {
11
- if (setB.has(elem)) {
12
- result.add(elem);
13
- }
14
- }
15
- return result;
16
- }
17
-
18
- function makeMatchConditions(mustMatch, mustNotMatch) {
19
- const conditions = [];
20
- for (const field in mustMatch) {
21
- if (mustNotMatch[field]) {
22
- const mustNotMatchValues = new Set(mustNotMatch[field]);
23
- const mustMatchValues = new Set(mustMatch[field]);
24
- const commonValues = intersection(mustNotMatchValues, mustMatchValues);
25
- if (commonValues.size > 0) {
26
- console.error(`Conflicting match conditions for field ${field}, the template will be ignored.`, commonValues);
27
- return [() => false];
28
- }
29
- }
30
- conditions.push(ProductTemplatesHelpers.fieldMustMatch(field, mustMatch[field]));
31
- }
32
- for (const field in mustNotMatch) {
33
- conditions.push(ProductTemplatesHelpers.fieldMustNotMatch(field, mustNotMatch[field]));
34
- }
35
- return conditions;
36
- }
37
-
38
- function makeDefinedConditions(ifDefined, ifNotDefined) {
39
- const conditions = [];
40
- if (ifDefined) {
41
- const fieldNames = ifDefined.split(',');
42
- conditions.push(ProductTemplatesHelpers.fieldsMustBeDefined(fieldNames));
43
- }
44
- if (ifNotDefined) {
45
- const fieldNames = ifNotDefined.split(',');
46
- conditions.push(ProductTemplatesHelpers.fieldsMustNotBeDefined(fieldNames));
47
- }
48
- return conditions;
49
- }
50
-
51
- var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
52
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
53
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
54
- r = Reflect.decorate(decorators, target, key, desc);
55
- else
56
- for (var i = decorators.length - 1; i >= 0; i--)
57
- if (d = decorators[i])
58
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
59
- return c > 3 && r && Object.defineProperty(target, key, r), r;
60
- };
61
- const AtomicProductFieldCondition$1 = /*@__PURE__*/ proxyCustomElement(class AtomicProductFieldCondition extends HTMLElement {
62
- constructor() {
63
- super();
64
- this.__registerHost();
65
- /**
66
- * Verifies whether the specified fields match the specified values.
67
- * @type {Record<string, string[]>}
68
- */
69
- this.mustMatch = {};
70
- /**
71
- * Verifies whether the specified fields do not match the specified values.
72
- * @type {Record<string, string[]>}
73
- */
74
- this.mustNotMatch = {};
75
- this.conditions = [];
76
- this.shouldBeRemoved = false;
77
- this.ifDefined = undefined;
78
- this.ifNotDefined = undefined;
79
- this.mustMatch = {};
80
- this.mustNotMatch = {};
81
- }
82
- componentWillLoad() {
83
- this.conditions = makeDefinedConditions(this.ifDefined, this.ifNotDefined);
84
- this.conditions.push(...makeMatchConditions(this.mustMatch, this.mustNotMatch));
85
- }
86
- render() {
87
- if (!this.conditions.every((condition) => condition(this.product))) {
88
- this.shouldBeRemoved = true;
89
- return '';
90
- }
91
- return h("slot", null);
92
- }
93
- componentDidLoad() {
94
- this.shouldBeRemoved && this.host.remove();
95
- }
96
- get host() { return this; }
97
- }, [4, "atomic-product-field-condition", {
98
- "ifDefined": [513, "if-defined"],
99
- "ifNotDefined": [513, "if-not-defined"],
100
- "mustMatch": [16],
101
- "mustNotMatch": [16]
102
- }]);
103
- __decorate([
104
- MapProp({ splitValues: true })
105
- ], AtomicProductFieldCondition$1.prototype, "mustMatch", void 0);
106
- __decorate([
107
- MapProp({ splitValues: true })
108
- ], AtomicProductFieldCondition$1.prototype, "mustNotMatch", void 0);
109
- __decorate([
110
- ProductContext()
111
- ], AtomicProductFieldCondition$1.prototype, "product", void 0);
112
- function defineCustomElement$1() {
113
- if (typeof customElements === "undefined") {
114
- return;
115
- }
116
- const components = ["atomic-product-field-condition"];
117
- components.forEach(tagName => { switch (tagName) {
118
- case "atomic-product-field-condition":
119
- if (!customElements.get(tagName)) {
120
- customElements.define(tagName, AtomicProductFieldCondition$1);
121
- }
122
- break;
123
- } });
124
- }
125
-
126
- const AtomicProductFieldCondition = AtomicProductFieldCondition$1;
127
- const defineCustomElement = defineCustomElement$1;
128
-
129
- export { AtomicProductFieldCondition, defineCustomElement };
130
-
131
- //# sourceMappingURL=atomic-product-field-condition.js.map
@@ -1 +0,0 @@
1
- {"file":"atomic-product-field-condition.js","mappings":";;;;;;AAAA;SACgB,YAAY,CAAI,IAAY,EAAE,IAAY;IACxD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAK,CAAC;IAC5B,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE;QACvB,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAClB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SAClB;KACF;IACD,OAAO,MAAM,CAAC;AAChB;;SCsBgB,mBAAmB,CACjC,SAAmC,EACnC,YAAsC;IAEtC,MAAM,UAAU,GAA+B,EAAE,CAAC;IAClD,KAAK,MAAM,KAAK,IAAI,SAAS,EAAE;QAC7B,IAAI,YAAY,CAAC,KAAK,CAAC,EAAE;YACvB,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;YACxD,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;YAClD,MAAM,YAAY,GAAG,YAAY,CAAC,kBAAkB,EAAE,eAAe,CAAC,CAAC;YACvE,IAAI,YAAY,CAAC,IAAI,GAAG,CAAC,EAAE;gBACzB,OAAO,CAAC,KAAK,CACX,0CAA0C,KAAK,iCAAiC,EAChF,YAAY,CACb,CAAC;gBACF,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC;aACtB;SACF;QACD,UAAU,CAAC,IAAI,CACb,uBAAuB,CAAC,cAAc,CAAC,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAChE,CAAC;KACH;IAED,KAAK,MAAM,KAAK,IAAI,YAAY,EAAE;QAChC,UAAU,CAAC,IAAI,CACb,uBAAuB,CAAC,iBAAiB,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,CACtE,CAAC;KACH;IACD,OAAO,UAAU,CAAC;AACpB;;SCoHgB,qBAAqB,CACnC,SAAkB,EAClB,YAAqB;IAErB,MAAM,UAAU,GAA+B,EAAE,CAAC;IAClD,IAAI,SAAS,EAAE;QACb,MAAM,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACxC,UAAU,CAAC,IAAI,CAAC,uBAAuB,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC;KAC1E;IAED,IAAI,YAAY,EAAE;QAChB,MAAM,UAAU,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC3C,UAAU,CAAC,IAAI,CAAC,uBAAuB,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAAC,CAAC;KAC7E;IACD,OAAO,UAAU,CAAC;AACpB;;;;;;;;;;;;MC7KaA,6BAA2B;;;;;;;;QAgBA,cAAS,GAC7C,EAAE,CAAC;;;;;QAMiC,iBAAY,GAChD,EAAE,CAAC;QAEG,eAAU,GAA+B,EAAE,CAAC;QAC5C,oBAAe,GAAG,KAAK,CAAC;;;yBAV9B,EAAE;4BAOF,EAAE;;IAOG,iBAAiB;QACtB,IAAI,CAAC,UAAU,GAAG,qBAAqB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAC3E,IAAI,CAAC,UAAU,CAAC,IAAI,CAClB,GAAG,mBAAmB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAC1D,CAAC;KACH;IAEM,MAAM;QACX,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE;YAClE,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;YAC5B,OAAO,EAAE,CAAC;SACX;QAED,OAAO,eAAQ,CAAC;KACjB;IAEM,gBAAgB;QACrB,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;KAC5C;;;;;;;;AAjCqC;IAA7B,OAAO,CAAC,EAAC,WAAW,EAAE,IAAI,EAAC,CAAC;gEAChC;AAMiC;IAA7B,OAAO,CAAC,EAAC,WAAW,EAAE,IAAI,EAAC,CAAC;mEAChC;AAKqB;IAAzB,cAAc,EAAE;8DAA2B;;;;;;;;;;;;;;;;;;;;","names":["AtomicProductFieldCondition"],"sources":["src/utils/set.ts","src/components/common/product-template/product-template-common.ts","src/components/common/product-template/stencil-product-template-common.tsx","src/components/commerce/atomic-product-field-condition/atomic-product-field-condition.tsx"],"sourcesContent":["// TODO: Replace by Set.prototype.intersection in July 2025\nexport function intersection<T>(setA: Set<T>, setB: Set<T>): Set<T> {\n const result = new Set<T>();\n for (const elem of setA) {\n if (setB.has(elem)) {\n result.add(elem);\n }\n }\n return result;\n}\n","import {\n type ProductTemplateCondition,\n ProductTemplatesHelpers,\n} from '@coveo/headless/commerce';\nimport {intersection} from '../../../utils/set';\nimport {isElementNode, isVisualNode} from '../../../utils/utils';\nimport {tableElementTagName} from '../../search/atomic-table-result/table-element-utils';\nimport {isResultSectionNode} from '../layout/sections';\n\ntype TemplateNodeType =\n | 'section'\n | 'metadata'\n | 'table-column-definition'\n | 'other';\n\nexport function getTemplateNodeType(node: Node): TemplateNodeType {\n if (isResultSectionNode(node)) {\n return 'section';\n }\n if (!isVisualNode(node)) {\n return 'metadata';\n }\n if (\n isElementNode(node) &&\n node.tagName.toLowerCase() === tableElementTagName\n ) {\n return 'table-column-definition';\n }\n return 'other';\n}\n\nexport function makeMatchConditions(\n mustMatch: Record<string, string[]>,\n mustNotMatch: Record<string, string[]>\n): ProductTemplateCondition[] {\n const conditions: ProductTemplateCondition[] = [];\n for (const field in mustMatch) {\n if (mustNotMatch[field]) {\n const mustNotMatchValues = new Set(mustNotMatch[field]);\n const mustMatchValues = new Set(mustMatch[field]);\n const commonValues = intersection(mustNotMatchValues, mustMatchValues);\n if (commonValues.size > 0) {\n console.error(\n `Conflicting match conditions for field ${field}, the template will be ignored.`,\n commonValues\n );\n return [() => false];\n }\n }\n conditions.push(\n ProductTemplatesHelpers.fieldMustMatch(field, mustMatch[field])\n );\n }\n\n for (const field in mustNotMatch) {\n conditions.push(\n ProductTemplatesHelpers.fieldMustNotMatch(field, mustNotMatch[field])\n );\n }\n return conditions;\n}\n\nexport function makeDefinedConditions(\n ifDefined?: string,\n ifNotDefined?: string\n): ProductTemplateCondition[] {\n const conditions: ProductTemplateCondition[] = [];\n if (ifDefined) {\n const fieldNames = ifDefined.split(',');\n conditions.push(ProductTemplatesHelpers.fieldsMustBeDefined(fieldNames));\n }\n\n if (ifNotDefined) {\n const fieldNames = ifNotDefined.split(',');\n conditions.push(ProductTemplatesHelpers.fieldsMustNotBeDefined(fieldNames));\n }\n return conditions;\n}\n","import {aggregate, isElementNode, isVisualNode} from '@/src/utils/utils';\nimport {\n ProductTemplate,\n ProductTemplateCondition,\n ProductTemplatesHelpers,\n} from '@coveo/headless/commerce';\nimport {h} from '@stencil/core';\nimport {tableElementTagName} from '../../search/atomic-table-result/table-element-utils';\nimport {ItemTarget} from '../layout/display-options';\nimport {isResultSectionNode} from '../layout/sections';\n\nexport {makeMatchConditions} from './product-template-common';\n\nexport type TemplateContent = DocumentFragment;\n\ninterface ProductTemplateCommonProps {\n allowEmpty?: boolean;\n host: HTMLDivElement;\n validParents: string[];\n setError: (error: Error) => void;\n}\n\ntype TemplateNodeType =\n | 'section'\n | 'metadata'\n | 'table-column-definition'\n | 'other';\n\nexport function getTemplateNodeType(node: Node): TemplateNodeType {\n if (isResultSectionNode(node)) {\n return 'section';\n }\n if (!isVisualNode(node)) {\n return 'metadata';\n }\n if (\n isElementNode(node) &&\n node.tagName.toLowerCase() === tableElementTagName\n ) {\n return 'table-column-definition';\n }\n return 'other';\n}\n\nfunction groupNodesByType(nodes: NodeList) {\n return aggregate(Array.from(nodes), (node) => getTemplateNodeType(node));\n}\n\n/**\n * @deprecated Use `ProductTemplateController` Reactive controller instead.\n */\nexport class ProductTemplateCommon {\n private host: HTMLDivElement;\n public matchConditions: ProductTemplateCondition[] = [];\n private gridCellLinkTarget?: ItemTarget;\n\n constructor({\n host,\n setError,\n validParents,\n allowEmpty = false,\n }: ProductTemplateCommonProps) {\n this.host = host;\n this.validateTemplate(host, setError, validParents, allowEmpty);\n }\n\n validateTemplate(\n host: HTMLDivElement,\n setError: (error: Error) => void,\n validParents: string[],\n allowEmpty = true\n ) {\n const hasValidParent = validParents\n .map((p) => p.toUpperCase())\n .includes(host.parentElement?.nodeName || '');\n const tagName = host.nodeName.toLowerCase();\n\n if (!hasValidParent) {\n setError(\n new Error(\n `The \"${tagName}\" component has to be the child of one of the following: ${validParents\n .map((p) => `\"${p.toLowerCase()}\"`)\n .join(', ')}.`\n )\n );\n return;\n }\n\n if (\n host.parentElement?.attributes.getNamedItem('display')?.value === 'grid'\n ) {\n this.gridCellLinkTarget = host.parentElement?.attributes.getNamedItem(\n 'grid-cell-link-target'\n )?.value as ItemTarget;\n }\n\n const template = host.querySelector('template');\n if (!template) {\n setError(\n new Error(\n `The \"${tagName}\" component must contain a \"template\" element as a child.`\n )\n );\n return;\n }\n\n if (!allowEmpty && !template.innerHTML.trim()) {\n setError(\n new Error(`The \"template\" tag inside \"${tagName}\" cannot be empty.`)\n );\n return;\n }\n\n if (template.content.querySelector('script')) {\n console.warn(\n 'Any \"script\" tags defined inside of \"template\" elements are not supported and will not be executed when the products are rendered.',\n host\n );\n }\n\n const {section: sectionNodes, other: otherNodes} = groupNodesByType(\n template.content.childNodes\n );\n if (sectionNodes?.length && otherNodes?.length) {\n console.warn(\n 'Product templates should only contain section elements or non-section elements. Future updates could unpredictably affect this product template.',\n host,\n {sectionNodes, otherNodes}\n );\n }\n }\n\n getTemplate(\n conditions: ProductTemplateCondition[],\n error: Error\n ): ProductTemplate<TemplateContent> | null {\n if (error) {\n return null;\n }\n\n return {\n conditions: conditions.concat(this.matchConditions),\n content: getTemplateElement(this.host).content!,\n linkContent: this.getLinkTemplateElement(this.host).content!,\n priority: 1,\n };\n }\n\n renderIfError(error: Error) {\n if (error) {\n return (\n <atomic-component-error\n element={this.host}\n error={error}\n ></atomic-component-error>\n );\n }\n }\n getDefaultLinkTemplateElement() {\n const linkTemplate = document.createElement('template');\n linkTemplate.innerHTML = `<atomic-product-link>${this.gridCellLinkTarget ? `<a slot=\"attributes\" target=\"${this.gridCellLinkTarget}\"></a>` : ''}</atomic-product-link>`;\n return linkTemplate;\n }\n\n getLinkTemplateElement(host: HTMLElement) {\n return (\n host.querySelector<HTMLTemplateElement>('template[slot=\"link\"]') ??\n this.getDefaultLinkTemplateElement()\n );\n }\n}\n\nfunction getTemplateElement(host: HTMLElement) {\n return host.querySelector<HTMLTemplateElement>('template:not([slot])')!;\n}\n\nexport function makeDefinedConditions(\n ifDefined?: string,\n ifNotDefined?: string\n): ProductTemplateCondition[] {\n const conditions: ProductTemplateCondition[] = [];\n if (ifDefined) {\n const fieldNames = ifDefined.split(',');\n conditions.push(ProductTemplatesHelpers.fieldsMustBeDefined(fieldNames));\n }\n\n if (ifNotDefined) {\n const fieldNames = ifNotDefined.split(',');\n conditions.push(ProductTemplatesHelpers.fieldsMustNotBeDefined(fieldNames));\n }\n return conditions;\n}\n","import {Product, ProductTemplateCondition} from '@coveo/headless/commerce';\nimport {Component, Prop, h, Element} from '@stencil/core';\nimport {MapProp} from '../../../utils/props-utils';\nimport {\n makeDefinedConditions,\n makeMatchConditions,\n} from '../../common/product-template/stencil-product-template-common';\nimport {ProductContext} from '../product-template-component-utils/stencil-product-template-decorators';\n\n/**\n * The `atomic-product-field-condition` component takes a list of conditions that, if fulfilled, apply the template in which it's defined.\n * The condition properties can be based on any top-level product property of the `product` object, not restricted to fields (e.g., `ec_name`).\n * @alpha\n */\n@Component({\n tag: 'atomic-product-field-condition',\n shadow: false,\n})\nexport class AtomicProductFieldCondition {\n @Element() host!: HTMLElement;\n\n /**\n * Verifies whether the specified fields are defined.\n */\n @Prop({reflect: true}) ifDefined?: string;\n /**\n * Verifies whether the specified fields are not defined.\n */\n @Prop({reflect: true}) ifNotDefined?: string;\n\n /**\n * Verifies whether the specified fields match the specified values.\n * @type {Record<string, string[]>}\n */\n @Prop() @MapProp({splitValues: true}) mustMatch: Record<string, string[]> =\n {};\n\n /**\n * Verifies whether the specified fields do not match the specified values.\n * @type {Record<string, string[]>}\n */\n @Prop() @MapProp({splitValues: true}) mustNotMatch: Record<string, string[]> =\n {};\n\n private conditions: ProductTemplateCondition[] = [];\n private shouldBeRemoved = false;\n\n @ProductContext() private product!: Product;\n\n public componentWillLoad() {\n this.conditions = makeDefinedConditions(this.ifDefined, this.ifNotDefined);\n this.conditions.push(\n ...makeMatchConditions(this.mustMatch, this.mustNotMatch)\n );\n }\n\n public render() {\n if (!this.conditions.every((condition) => condition(this.product))) {\n this.shouldBeRemoved = true;\n return '';\n }\n\n return <slot />;\n }\n\n public componentDidLoad() {\n this.shouldBeRemoved && this.host.remove();\n }\n}\n"],"version":3}