@coveo/atomic 3.31.0-pre.f655c16250 → 3.31.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 (223) hide show
  1. package/dist/atomic/_atomic.esm.js +1 -1
  2. package/dist/atomic/components/analytics-config.js +1 -1
  3. package/dist/atomic/components/analytics-config.js.map +1 -1
  4. package/dist/atomic/components/atomic-folded-result-list.js +1 -1
  5. package/dist/atomic/components/atomic-folded-result-list.js.map +1 -1
  6. package/dist/atomic/components/atomic-insight-folded-result-list.js +2 -2
  7. package/dist/atomic/components/atomic-insight-folded-result-list.js.map +1 -1
  8. package/dist/atomic/components/atomic-insight-result-children.js +2 -2
  9. package/dist/atomic/components/atomic-insight-result-children.js.map +1 -1
  10. package/dist/atomic/components/atomic-ipx-result-link.js +1 -1
  11. package/dist/atomic/components/atomic-ipx-result-link.js.map +1 -1
  12. package/dist/atomic/components/atomic-result-children.js +2 -2
  13. package/dist/atomic/components/atomic-result-children.js.map +1 -1
  14. package/dist/atomic/components/atomic-result-link.js +1 -1
  15. package/dist/atomic/components/atomic-result-link.js.map +1 -1
  16. package/dist/atomic/components/atomic-result-list.js.map +1 -1
  17. package/dist/atomic/components/atomic-tab-manager.js +1 -1
  18. package/dist/atomic/components/atomic-tab-manager.js.map +1 -1
  19. package/dist/atomic/components/global/environment.js +1 -1
  20. package/dist/atomic/components/props-utils.js +3 -0
  21. package/dist/atomic/components/props-utils.js.map +1 -1
  22. package/dist/atomic/components/stencil-item-decorators.js.map +1 -1
  23. package/dist/atomic/components/stencil-item-list-common.js.map +1 -1
  24. package/dist/atomic/components/{item.js → unfolded-item.js} +1 -1
  25. package/dist/atomic/components/unfolded-item.js.map +1 -0
  26. package/dist/atomic/components/utils/props-utils.js +3 -0
  27. package/dist/atomic/{p-b8beb062.entry.js → p-0007beed.entry.js} +2 -2
  28. package/dist/atomic/{p-9c091b29.entry.js → p-0077ba58.entry.js} +2 -2
  29. package/dist/atomic/p-0077ba58.entry.js.map +1 -0
  30. package/dist/atomic/{p-07d19b22.entry.js → p-01e9f7b0.entry.js} +2 -2
  31. package/dist/atomic/p-01e9f7b0.entry.js.map +1 -0
  32. package/dist/atomic/{p-446b788b.entry.js → p-0674783d.entry.js} +2 -2
  33. package/dist/atomic/p-0674783d.entry.js.map +1 -0
  34. package/dist/atomic/{p-1234c69e.js → p-0f046687.js} +1 -1
  35. package/dist/atomic/p-0f046687.js.map +1 -0
  36. package/dist/atomic/{p-a24a8702.entry.js → p-0f3df0e6.entry.js} +2 -2
  37. package/dist/atomic/{p-85749286.entry.js → p-11dd759c.entry.js} +2 -2
  38. package/dist/atomic/{p-d1d012bc.entry.js → p-16914fd4.entry.js} +2 -2
  39. package/dist/atomic/{p-10f25780.entry.js → p-1b491649.entry.js} +2 -2
  40. package/dist/atomic/p-1b491649.entry.js.map +1 -0
  41. package/dist/atomic/{p-7b6843d6.entry.js → p-2e00152f.entry.js} +2 -2
  42. package/dist/atomic/{p-7969276e.entry.js → p-2e028d26.entry.js} +2 -2
  43. package/dist/atomic/{p-bdfd2e76.entry.js → p-391c26ba.entry.js} +2 -2
  44. package/dist/atomic/p-391c26ba.entry.js.map +1 -0
  45. package/dist/atomic/p-3dc06261.js.map +1 -1
  46. package/dist/atomic/{p-28cea2b1.entry.js → p-494c57a0.entry.js} +2 -2
  47. package/dist/atomic/{p-64dc1a62.entry.js → p-4e77fe24.entry.js} +2 -2
  48. package/dist/atomic/p-61f9c3f7.js.map +1 -1
  49. package/dist/atomic/{p-9d3858df.entry.js → p-66eeb9f8.entry.js} +2 -2
  50. package/dist/atomic/p-66eeb9f8.entry.js.map +1 -0
  51. package/dist/atomic/{p-2069f807.entry.js → p-6cf521a3.entry.js} +2 -2
  52. package/dist/atomic/{p-5b938c6f.entry.js → p-76489bf6.entry.js} +2 -2
  53. package/dist/atomic/{p-be04b3b0.entry.js → p-7d2a47f5.entry.js} +2 -2
  54. package/dist/atomic/{p-d2db2d70.js → p-86428057.js} +1 -1
  55. package/dist/atomic/p-86428057.js.map +1 -0
  56. package/dist/atomic/{p-741cfe8d.entry.js → p-89fbc54c.entry.js} +2 -2
  57. package/dist/atomic/{p-e14019fd.entry.js → p-8bb323e8.entry.js} +2 -2
  58. package/dist/atomic/{p-8edfd289.entry.js → p-a0b3c6e2.entry.js} +2 -2
  59. package/dist/atomic/{p-4b1cf681.js → p-be5e8359.js} +2 -2
  60. package/dist/atomic/{p-4b1cf681.js.map → p-be5e8359.js.map} +1 -1
  61. package/dist/atomic/{p-f7ae7657.entry.js → p-c874a70b.entry.js} +2 -2
  62. package/dist/atomic/{p-174f6410.entry.js → p-c9fc93d7.entry.js} +2 -2
  63. package/dist/atomic/{p-84740eed.entry.js → p-cbaf262a.entry.js} +2 -2
  64. package/dist/atomic/{p-0ec46480.entry.js → p-d8953e30.entry.js} +2 -2
  65. package/dist/atomic/{p-5a1b0c43.entry.js → p-da185993.entry.js} +2 -2
  66. package/dist/atomic/{p-555a0408.entry.js → p-e0169a14.entry.js} +2 -2
  67. package/dist/atomic/{p-609d801e.entry.js → p-e215ba76.entry.js} +2 -2
  68. package/dist/atomic/{p-842bd0bc.entry.js → p-e2560da8.entry.js} +2 -2
  69. package/dist/atomic/p-e2560da8.entry.js.map +1 -0
  70. package/dist/atomic/{p-a4f1e397.entry.js → p-ebb8ae5b.entry.js} +2 -2
  71. package/dist/atomic/{p-c4b07e90.entry.js → p-efe9ef19.entry.js} +2 -2
  72. package/dist/atomic/p-efe9ef19.entry.js.map +1 -0
  73. package/dist/atomic/{p-538fa6a8.entry.js → p-fae68fde.entry.js} +2 -2
  74. package/dist/atomic/{p-c8f4a164.entry.js → p-fc73190d.entry.js} +2 -2
  75. package/dist/cjs/{analytics-config-19504c33.js → analytics-config-d10e762b.js} +2 -2
  76. package/dist/cjs/analytics-config-d10e762b.js.map +1 -0
  77. package/dist/cjs/atomic-category-facet.cjs.entry.js +1 -1
  78. package/dist/cjs/atomic-color-facet.cjs.entry.js +1 -1
  79. package/dist/cjs/atomic-facet.cjs.entry.js +1 -1
  80. package/dist/cjs/atomic-field-condition.cjs.entry.js +1 -1
  81. package/dist/cjs/atomic-folded-result-list.cjs.entry.js +3 -3
  82. package/dist/cjs/atomic-folded-result-list.cjs.entry.js.map +1 -1
  83. package/dist/cjs/atomic-generated-answer.cjs.entry.js +1 -1
  84. package/dist/cjs/atomic-insight-folded-result-list.cjs.entry.js +3 -3
  85. package/dist/cjs/atomic-insight-folded-result-list.cjs.entry.js.map +1 -1
  86. package/dist/cjs/atomic-insight-interface.cjs.entry.js +2 -2
  87. package/dist/cjs/atomic-insight-numeric-facet.cjs.entry.js +1 -1
  88. package/dist/cjs/atomic-insight-result-children-template.cjs.entry.js +1 -1
  89. package/dist/cjs/atomic-insight-result-children.cjs.entry.js +3 -3
  90. package/dist/cjs/atomic-insight-result-children.cjs.entry.js.map +1 -1
  91. package/dist/cjs/atomic-insight-result-template.cjs.entry.js +1 -1
  92. package/dist/cjs/atomic-insight-timeframe-facet.cjs.entry.js +1 -1
  93. package/dist/cjs/atomic-ipx-result-link.cjs.entry.js +1 -1
  94. package/dist/cjs/atomic-ipx-result-link.cjs.entry.js.map +1 -1
  95. package/dist/cjs/atomic-numeric-facet.cjs.entry.js +1 -1
  96. package/dist/cjs/atomic-product-field-condition.cjs.entry.js +1 -1
  97. package/dist/cjs/atomic-rating-facet.cjs.entry.js +1 -1
  98. package/dist/cjs/atomic-rating-range-facet.cjs.entry.js +1 -1
  99. package/dist/cjs/atomic-recs-interface.cjs.entry.js +2 -2
  100. package/dist/cjs/atomic-recs-result-template.cjs.entry.js +1 -1
  101. package/dist/cjs/atomic-result-children-template.cjs.entry.js +1 -1
  102. package/dist/cjs/atomic-result-children.cjs.entry.js +3 -3
  103. package/dist/cjs/atomic-result-children.cjs.entry.js.map +1 -1
  104. package/dist/cjs/atomic-result-link.cjs.entry.js +1 -1
  105. package/dist/cjs/atomic-result-link.cjs.entry.js.map +1 -1
  106. package/dist/cjs/atomic-result-list.cjs.entry.js +1 -1
  107. package/dist/cjs/atomic-result-list.cjs.entry.js.map +1 -1
  108. package/dist/cjs/atomic-result-localized-text.cjs.entry.js +1 -1
  109. package/dist/cjs/atomic-result-template.cjs.entry.js +1 -1
  110. package/dist/cjs/atomic-search-interface.cjs.entry.js +2 -2
  111. package/dist/cjs/atomic-segmented-facet.cjs.entry.js +1 -1
  112. package/dist/cjs/atomic-smart-snippet.cjs.entry.js +1 -1
  113. package/dist/cjs/atomic-sort-expression.cjs.entry.js +1 -1
  114. package/dist/cjs/atomic-tab-manager.cjs.entry.js +1 -1
  115. package/dist/cjs/atomic-tab-manager.cjs.entry.js.map +1 -1
  116. package/dist/cjs/atomic-timeframe-facet.cjs.entry.js +1 -1
  117. package/dist/cjs/{props-utils-dd638419.js → props-utils-1e4ba1b0.js} +4 -1
  118. package/dist/cjs/props-utils-1e4ba1b0.js.map +1 -0
  119. package/dist/cjs/stencil-item-decorators-43a96f33.js.map +1 -1
  120. package/dist/cjs/stencil-item-list-common-013ad9a0.js.map +1 -1
  121. package/dist/cjs/{item-c460c5a3.js → unfolded-item-148d21d6.js} +1 -1
  122. package/dist/cjs/unfolded-item-148d21d6.js.map +1 -0
  123. package/dist/cjs/version.cjs.js +2 -2
  124. package/dist/esm/{analytics-config-f3b2c9ea.js → analytics-config-e2c4641d.js} +2 -2
  125. package/dist/esm/analytics-config-e2c4641d.js.map +1 -0
  126. package/dist/esm/atomic-category-facet.entry.js +1 -1
  127. package/dist/esm/atomic-color-facet.entry.js +1 -1
  128. package/dist/esm/atomic-facet.entry.js +1 -1
  129. package/dist/esm/atomic-field-condition.entry.js +1 -1
  130. package/dist/esm/atomic-folded-result-list.entry.js +2 -2
  131. package/dist/esm/atomic-folded-result-list.entry.js.map +1 -1
  132. package/dist/esm/atomic-generated-answer.entry.js +1 -1
  133. package/dist/esm/atomic-insight-folded-result-list.entry.js +2 -2
  134. package/dist/esm/atomic-insight-folded-result-list.entry.js.map +1 -1
  135. package/dist/esm/atomic-insight-interface.entry.js +2 -2
  136. package/dist/esm/atomic-insight-numeric-facet.entry.js +1 -1
  137. package/dist/esm/atomic-insight-result-children-template.entry.js +1 -1
  138. package/dist/esm/atomic-insight-result-children.entry.js +2 -2
  139. package/dist/esm/atomic-insight-result-children.entry.js.map +1 -1
  140. package/dist/esm/atomic-insight-result-template.entry.js +1 -1
  141. package/dist/esm/atomic-insight-timeframe-facet.entry.js +1 -1
  142. package/dist/esm/atomic-ipx-result-link.entry.js +1 -1
  143. package/dist/esm/atomic-ipx-result-link.entry.js.map +1 -1
  144. package/dist/esm/atomic-numeric-facet.entry.js +1 -1
  145. package/dist/esm/atomic-product-field-condition.entry.js +1 -1
  146. package/dist/esm/atomic-rating-facet.entry.js +1 -1
  147. package/dist/esm/atomic-rating-range-facet.entry.js +1 -1
  148. package/dist/esm/atomic-recs-interface.entry.js +2 -2
  149. package/dist/esm/atomic-recs-result-template.entry.js +1 -1
  150. package/dist/esm/atomic-result-children-template.entry.js +1 -1
  151. package/dist/esm/atomic-result-children.entry.js +2 -2
  152. package/dist/esm/atomic-result-children.entry.js.map +1 -1
  153. package/dist/esm/atomic-result-link.entry.js +1 -1
  154. package/dist/esm/atomic-result-link.entry.js.map +1 -1
  155. package/dist/esm/atomic-result-list.entry.js +1 -1
  156. package/dist/esm/atomic-result-list.entry.js.map +1 -1
  157. package/dist/esm/atomic-result-localized-text.entry.js +1 -1
  158. package/dist/esm/atomic-result-template.entry.js +1 -1
  159. package/dist/esm/atomic-search-interface.entry.js +2 -2
  160. package/dist/esm/atomic-segmented-facet.entry.js +1 -1
  161. package/dist/esm/atomic-smart-snippet.entry.js +1 -1
  162. package/dist/esm/atomic-sort-expression.entry.js +1 -1
  163. package/dist/esm/atomic-tab-manager.entry.js +1 -1
  164. package/dist/esm/atomic-tab-manager.entry.js.map +1 -1
  165. package/dist/esm/atomic-timeframe-facet.entry.js +1 -1
  166. package/dist/esm/{props-utils-8e3d7f26.js → props-utils-e17fa18c.js} +4 -1
  167. package/dist/esm/props-utils-e17fa18c.js.map +1 -0
  168. package/dist/esm/stencil-item-decorators-6c453c11.js.map +1 -1
  169. package/dist/esm/stencil-item-list-common-ddc6fb51.js.map +1 -1
  170. package/dist/esm/{item-813944d1.js → unfolded-item-c5795c0f.js} +1 -1
  171. package/dist/esm/unfolded-item-c5795c0f.js.map +1 -0
  172. package/dist/esm/version.js +2 -2
  173. package/dist/types/components/common/item-list/item-list-common.d.ts +1 -1
  174. package/dist/types/components/common/item-list/stencil-display-table.d.ts +1 -1
  175. package/dist/types/components/common/item-list/stencil-item-list-common.d.ts +1 -1
  176. package/dist/types/components/common/item-list/table-layout.d.ts +1 -1
  177. package/dist/types/components/search/tabs/atomic-tab-manager/atomic-tab-manager.d.ts +6 -0
  178. package/dist/types/utils/props-utils.d.ts +3 -0
  179. package/docs/atomic-docs.json +49 -1
  180. package/package.json +5 -5
  181. package/dist/atomic/components/item.js.map +0 -1
  182. package/dist/atomic/p-07d19b22.entry.js.map +0 -1
  183. package/dist/atomic/p-10f25780.entry.js.map +0 -1
  184. package/dist/atomic/p-1234c69e.js.map +0 -1
  185. package/dist/atomic/p-446b788b.entry.js.map +0 -1
  186. package/dist/atomic/p-842bd0bc.entry.js.map +0 -1
  187. package/dist/atomic/p-9c091b29.entry.js.map +0 -1
  188. package/dist/atomic/p-9d3858df.entry.js.map +0 -1
  189. package/dist/atomic/p-bdfd2e76.entry.js.map +0 -1
  190. package/dist/atomic/p-c4b07e90.entry.js.map +0 -1
  191. package/dist/atomic/p-d2db2d70.js.map +0 -1
  192. package/dist/cjs/analytics-config-19504c33.js.map +0 -1
  193. package/dist/cjs/item-c460c5a3.js.map +0 -1
  194. package/dist/cjs/props-utils-dd638419.js.map +0 -1
  195. package/dist/esm/analytics-config-f3b2c9ea.js.map +0 -1
  196. package/dist/esm/item-813944d1.js.map +0 -1
  197. package/dist/esm/props-utils-8e3d7f26.js.map +0 -1
  198. /package/dist/atomic/components/components/common/{interface/item.js → item-list/unfolded-item.js} +0 -0
  199. /package/dist/atomic/{p-b8beb062.entry.js.map → p-0007beed.entry.js.map} +0 -0
  200. /package/dist/atomic/{p-a24a8702.entry.js.map → p-0f3df0e6.entry.js.map} +0 -0
  201. /package/dist/atomic/{p-85749286.entry.js.map → p-11dd759c.entry.js.map} +0 -0
  202. /package/dist/atomic/{p-d1d012bc.entry.js.map → p-16914fd4.entry.js.map} +0 -0
  203. /package/dist/atomic/{p-7b6843d6.entry.js.map → p-2e00152f.entry.js.map} +0 -0
  204. /package/dist/atomic/{p-7969276e.entry.js.map → p-2e028d26.entry.js.map} +0 -0
  205. /package/dist/atomic/{p-28cea2b1.entry.js.map → p-494c57a0.entry.js.map} +0 -0
  206. /package/dist/atomic/{p-64dc1a62.entry.js.map → p-4e77fe24.entry.js.map} +0 -0
  207. /package/dist/atomic/{p-2069f807.entry.js.map → p-6cf521a3.entry.js.map} +0 -0
  208. /package/dist/atomic/{p-5b938c6f.entry.js.map → p-76489bf6.entry.js.map} +0 -0
  209. /package/dist/atomic/{p-be04b3b0.entry.js.map → p-7d2a47f5.entry.js.map} +0 -0
  210. /package/dist/atomic/{p-741cfe8d.entry.js.map → p-89fbc54c.entry.js.map} +0 -0
  211. /package/dist/atomic/{p-e14019fd.entry.js.map → p-8bb323e8.entry.js.map} +0 -0
  212. /package/dist/atomic/{p-8edfd289.entry.js.map → p-a0b3c6e2.entry.js.map} +0 -0
  213. /package/dist/atomic/{p-f7ae7657.entry.js.map → p-c874a70b.entry.js.map} +0 -0
  214. /package/dist/atomic/{p-174f6410.entry.js.map → p-c9fc93d7.entry.js.map} +0 -0
  215. /package/dist/atomic/{p-84740eed.entry.js.map → p-cbaf262a.entry.js.map} +0 -0
  216. /package/dist/atomic/{p-0ec46480.entry.js.map → p-d8953e30.entry.js.map} +0 -0
  217. /package/dist/atomic/{p-5a1b0c43.entry.js.map → p-da185993.entry.js.map} +0 -0
  218. /package/dist/atomic/{p-555a0408.entry.js.map → p-e0169a14.entry.js.map} +0 -0
  219. /package/dist/atomic/{p-609d801e.entry.js.map → p-e215ba76.entry.js.map} +0 -0
  220. /package/dist/atomic/{p-a4f1e397.entry.js.map → p-ebb8ae5b.entry.js.map} +0 -0
  221. /package/dist/atomic/{p-538fa6a8.entry.js.map → p-fae68fde.entry.js.map} +0 -0
  222. /package/dist/atomic/{p-c8f4a164.entry.js.map → p-fc73190d.entry.js.map} +0 -0
  223. /package/dist/types/components/common/{interface/item.d.ts → item-list/unfolded-item.d.ts} +0 -0
@@ -2,7 +2,7 @@ import { r as registerInstance, h, F as Fragment, g as getElement } from './inde
2
2
  import { buildSearchStatus, buildTabManager, buildCategoryFacet, buildFacetConditionsManager } from '@coveo/headless';
3
3
  import { a as getFieldCaptions, g as getFieldValueCaption } from './field-utils-f0146383.js';
4
4
  import { I as InitializeBindings, B as BindStateToController } from './initialization-utils-ff3edf9a.js';
5
- import { A as ArrayProp, M as MapProp } from './props-utils-8e3d7f26.js';
5
+ import { A as ArrayProp, M as MapProp } from './props-utils-e17fa18c.js';
6
6
  import { A as AriaLiveRegion, F as FocusTargetController } from './stencil-accessibility-utils-bc273be5.js';
7
7
  import { C as CategoryFacetParentAsTreeContainer, a as CategoryFacetAllCategoryButton, b as CategoryFacetTreeValueContainer, c as CategoryFacetParentButton, d as CategoryFacetChildrenAsTreeContainer, e as CategoryFacetParentValueLink, f as CategoryFacetChildValueLink, g as CategoryFacetSearchValue, h as CategoryFacetSearchResultsContainer } from './value-as-tree-container-817faf3b.js';
8
8
  import { p as parseDependsOn } from './depends-on-d73b0ce3.js';
@@ -2,7 +2,7 @@ import { h, r as registerInstance, g as getElement } from './index-3f35faca.js';
2
2
  import { buildSearchStatus, buildFacet, buildTabManager, buildFacetConditionsManager } from '@coveo/headless';
3
3
  import { a as getFieldCaptions, g as getFieldValueCaption } from './field-utils-f0146383.js';
4
4
  import { I as InitializeBindings, B as BindStateToController, H as Hidden } from './initialization-utils-ff3edf9a.js';
5
- import { A as ArrayProp, M as MapProp } from './props-utils-8e3d7f26.js';
5
+ import { A as ArrayProp, M as MapProp } from './props-utils-e17fa18c.js';
6
6
  import { A as AriaLiveRegion, F as FocusTargetController } from './stencil-accessibility-utils-bc273be5.js';
7
7
  import { p as parseDependsOn } from './depends-on-d73b0ce3.js';
8
8
  import { F as FacetHeader, a as FacetContainer } from './stencil-facet-header-6a0bb1d4.js';
@@ -2,7 +2,7 @@ import { r as registerInstance, h, F as Fragment, g as getElement } from './inde
2
2
  import { buildFacet, buildSearchStatus, buildTabManager, buildFacetConditionsManager } from '@coveo/headless';
3
3
  import { a as getFieldCaptions } from './field-utils-f0146383.js';
4
4
  import { I as InitializeBindings, B as BindStateToController } from './initialization-utils-ff3edf9a.js';
5
- import { A as ArrayProp, M as MapProp } from './props-utils-8e3d7f26.js';
5
+ import { A as ArrayProp, M as MapProp } from './props-utils-e17fa18c.js';
6
6
  import { A as AriaLiveRegion, F as FocusTargetController } from './stencil-accessibility-utils-bc273be5.js';
7
7
  import { p as parseDependsOn } from './depends-on-d73b0ce3.js';
8
8
  import { a as FacetContainer, F as FacetHeader } from './stencil-facet-header-6a0bb1d4.js';
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, h, g as getElement } from './index-3f35faca.js';
2
2
  import { ResultTemplatesHelpers } from '@coveo/headless';
3
- import { M as MapProp } from './props-utils-8e3d7f26.js';
3
+ import { M as MapProp } from './props-utils-e17fa18c.js';
4
4
  import { m as makeMatchConditions } from './result-template-common-0eb26069.js';
5
5
  import { R as ResultContext } from './result-template-decorators-2ed76ea9.js';
6
6
  import '@coveo/bueno';
@@ -1,12 +1,12 @@
1
1
  import { r as registerInstance, h, g as getElement } from './index-3f35faca.js';
2
2
  import { buildResultsPerPage, buildTabManager, buildFoldedResultList, buildInteractiveResult } from '@coveo/headless';
3
3
  import { I as InitializeBindings, B as BindStateToController, H as Hidden } from './initialization-utils-ff3edf9a.js';
4
- import { A as ArrayProp } from './props-utils-8e3d7f26.js';
4
+ import { A as ArrayProp } from './props-utils-e17fa18c.js';
5
5
  import { F as FocusTargetController } from './stencil-accessibility-utils-bc273be5.js';
6
6
  import { s as shouldDisplayOnCurrentTab } from './tab-utils-35886d3e.js';
7
7
  import { r as randomID } from './utils-30b00491.js';
8
8
  import { R as ResultsPlaceholdersGuard } from './stencil-placeholders-58a0c818.js';
9
- import { e as extractUnfoldedItem } from './item-813944d1.js';
9
+ import { e as extractUnfoldedItem } from './unfolded-item-c5795c0f.js';
10
10
  import { c as createAppLoadedListener } from './store-5fcae420.js';
11
11
  import { D as DisplayWrapper, I as ItemDisplayGuard } from './stencil-display-wrapper-5b32e77c.js';
12
12
  import { I as ItemListGuard } from './item-list-guard-22b0711a.js';
@@ -1 +1 @@
1
- {"file":"atomic-folded-result-list.entry.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,yBAAyB,GAAG,k9wEAAk9wE,CAAC;AACr/wE,qCAAe,yBAAyB;;;;;;;;;;;;MCgE3B,sBAAsB;;;QAKzB,gBAAW,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC;QAI7C,YAAO,GAAsB,MAAM,CAAC;QAc3B,6BAAwB,GAAG,KAAK,CAAC;QAEjC,qBAAgB,GAAG,KAAK,CAAC;QACzB,gBAAW,GAAG,KAAK,CAAC;;;;QAKd,YAAO,GAAuB,QAAQ,CAAC;;;;QAIvC,cAAS,GAAyB,MAAM,CAAC;;;;;;;;;;QAYzD,iBAAY,GAAsB,IAAI,CAAC;;;;;;;;;;QAavC,iBAAY,GAAsB,IAAI,CAAC;;;;;;;;;;QA6BhB,0BAAqB,GAAG,CAAC,CAAC;;;;wCAlEZ,KAAK;;gCAEb,KAAK;2BACV,KAAK;uBAKiB,QAAQ;yBAIJ,MAAM;4BAYtB,IAAI;4BAaJ,IAAI;;;;qCA6BS,CAAC;;;;;;;;IAQtC,MAAM,iBAAiB,CACtC,uBAA8C;QAE9C,IAAI,CAAC,uBAAuB,GAAG,uBAAuB,CAAC;KACxD;IAGD,uBAAuB,CAAC,KAAsC;QAC5D,K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1C;IAFN,qBAAqB,CAAC,kBAAkB,CAAC;qEAEW;AAG9C;IAFN,qBAAqB,CAAC,gBAAgB,CAAC;mEAES;AAI1C;IAFN,qBAAqB,CAAC,YAAY,CAAC;+DAEK;AAyBlC;IAFN,SAAS,EAAE;4DAEkC;AAavC;IAFN,SAAS,EAAE;4DAEkC;;;;;","names":[],"sources":["src/components/search/result-lists/atomic-folded-result-list/atomic-folded-result-list.pcss?tag=atomic-folded-result-list&encapsulation=shadow","src/components/search/result-lists/atomic-folded-result-list/atomic-folded-result-list.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n@import '../../../common/item-list/styles/placeholders.pcss';\n@import '../../../common/item-list/styles/list-display.pcss';\natomic-result:not(.hydrated) {\n visibility: hidden;\n}\n","import {FoldedItemListStateContextEvent} from '@/src/components/common/item-list/item-list-decorators';\nimport {\n ResultsPerPageState,\n ResultsPerPage,\n buildFoldedResultList,\n FoldedResultList,\n FoldedResultListState,\n buildResultsPerPage,\n ResultListProps,\n FoldedCollection,\n buildInteractiveResult,\n TabManager,\n TabManagerState,\n buildTabManager,\n} from '@coveo/headless';\nimport {\n Component,\n Element,\n State,\n Prop,\n Listen,\n Method,\n h,\n Watch,\n} from '@stencil/core';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {ArrayProp} from '../../../../utils/props-utils';\nimport {FocusTargetController} from '../../../../utils/stencil-accessibility-utils';\nimport {shouldDisplayOnCurrentTab} from '../../../../utils/tab-utils';\nimport {randomID} from '../../../../utils/utils';\nimport {ResultsPlaceholdersGuard} from '../../../common/atomic-result-placeholder/stencil-placeholders';\nimport {extractUnfoldedItem} from '../../../common/interface/item';\nimport {createAppLoadedListener} from '../../../common/interface/store';\nimport {ItemDisplayGuard} from '../../../common/item-list/item-display-guard';\nimport {ItemListGuard} from '../../../common/item-list/item-list-guard';\nimport {ItemTemplateProvider} from '../../../common/item-list/item-template-provider';\nimport {DisplayWrapper} from '../../../common/item-list/stencil-display-wrapper';\nimport {\n ItemListCommon,\n ItemRenderingFunction,\n} from '../../../common/item-list/stencil-item-list-common';\nimport {\n ItemDisplayDensity,\n ItemDisplayImageSize,\n ItemDisplayLayout,\n getItemListDisplayClasses,\n} from '../../../common/layout/display-options';\nimport {Hidden} from '../../../common/stencil-hidden';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\n\n/**\n * The `atomic-folded-result-list` component is responsible for displaying folded query results, by applying one or more result templates for up to three layers (i.e., to the result, child and grandchild).\n * @slot default - The default slot where the result templates are inserted.\n * @part result-list - The element containing every result of a result list\n * @part outline - The element displaying an outline or a divider around a result\n */\n@Component({\n tag: 'atomic-folded-result-list',\n styleUrl: 'atomic-folded-result-list.pcss',\n shadow: true,\n})\nexport class AtomicFoldedResultList implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n public foldedResultList!: FoldedResultList;\n public resultsPerPage!: ResultsPerPage;\n private resultRenderingFunction: ItemRenderingFunction;\n private loadingFlag = randomID('firstResultLoaded-');\n private itemTemplateProvider!: ItemTemplateProvider;\n private nextNewResultTarget?: FocusTargetController;\n private itemListCommon!: ItemListCommon;\n private display: ItemDisplayLayout = 'list';\n\n @Element() public host!: HTMLDivElement;\n\n @BindStateToController('foldedResultList')\n @State()\n public foldedResultListState!: FoldedResultListState;\n @BindStateToController('resultsPerPage')\n @State()\n public resultsPerPageState!: ResultsPerPageState;\n public tabManager!: TabManager;\n @BindStateToController('tabManager')\n @State()\n public tabManagerState!: TabManagerState;\n @State() private resultTemplateRegistered = false;\n @State() public error!: Error;\n @State() private templateHasError = false;\n @State() private isAppLoaded = false;\n\n /**\n * The spacing of various elements in the result list, including the gap between results, the gap between parts of a result, and the font sizes of different parts in a result.\n */\n @Prop({reflect: true}) density: ItemDisplayDensity = 'normal';\n /**\n * The expected size of the image displayed in the results.\n */\n @Prop({reflect: true}) imageSize: ItemDisplayImageSize = 'icon';\n /**\n * The tabs on which the folded result list can be displayed. This property should not be used at the same time as `tabs-excluded`.\n *\n * Set this property as a stringified JSON array, e.g.,\n * ```html\n * <atomic-folded-result-list tabs-included='[\"tabIDA\", \"tabIDB\"]'></atomic-folded-result-list snippet>\n * ```\n * If you don't set this property, the folded result list can be displayed on any tab. Otherwise, the folded result list can only be displayed on the specified tabs.\n */\n @ArrayProp()\n @Prop({reflect: true, mutable: true})\n public tabsIncluded: string[] | string = '[]';\n\n /**\n * The tabs on which this folded result list must not be displayed. This property should not be used at the same time as `tabs-included`.\n *\n * Set this property as a stringified JSON array, e.g.,\n * ```html\n * <atomic-folded-result-list tabs-excluded='[\"tabIDA\", \"tabIDB\"]'></atomic-folded-result-list>\n * ```\n * If you don't set this property, the folded result list can be displayed on any tab. Otherwise, the folded result list won't be displayed on any of the specified tabs.\n */\n @ArrayProp()\n @Prop({reflect: true, mutable: true})\n public tabsExcluded: string[] | string = '[]';\n /**\n * The name of the field on which to do the folding. The folded result list component will use the values of this field to resolve the collections of result items.\n *\n * @defaultValue `foldingcollection`\n */\n @Prop({reflect: true}) public collectionField?: string;\n /**\n * The name of the field that determines whether a certain result is a top result containing other child results within a collection.\n *\n * @defaultValue `foldingparent`\n */\n @Prop({reflect: true}) public parentField?: string;\n /**\n * The name of the field that uniquely identifies a result within a collection.\n *\n * @defaultValue `foldingchild`\n */\n @Prop({reflect: true}) public childField?: string;\n\n /**\n * The initial number of child results to request for each folded collection, before expansion.\n *\n * @defaultValue `2`\n *\n * @example For an email thread with a total of 20 messages, using the default value of `2` will request the top two child messages, based on the current sort criteria and query, to be returned as children of the parent message.\n * The user can then click to expand the collection and see the remaining messages that match the current query (i.e., not necessarily all remaining 18 messages). Those messages will be sorted based on the current sort criteria (i.e., not necessarily by date).\n * For more info on Result Folding, see [Result Folding](https://docs.coveo.com/en/1884).\n **/\n @Prop({reflect: true}) public numberOfFoldedResults = 2;\n\n /**\n * Sets a rendering function to bypass the standard HTML template mechanism for rendering results.\n * You can use this function while working with web frameworks that don't use plain HTML syntax, e.g., React, Angular or Vue.\n *\n * Do not use this method if you integrate Atomic in a plain HTML deployment.\n */\n @Method() public async setRenderFunction(\n resultRenderingFunction: ItemRenderingFunction\n ) {\n this.resultRenderingFunction = resultRenderingFunction;\n }\n\n @Listen('atomic/resolveFoldedResultList')\n resolveFoldedResultList(event: FoldedItemListStateContextEvent) {\n event.preventDefault();\n event.stopPropagation();\n event.detail(this.foldedResultList);\n }\n\n @Listen('atomic/loadCollection')\n loadCollection(event: CustomEvent<FoldedCollection>) {\n event.preventDefault();\n event.stopPropagation();\n this.foldedResultList.loadCollection(event.detail);\n }\n\n public get focusTarget() {\n if (!this.nextNewResultTarget) {\n this.nextNewResultTarget = new FocusTargetController(this);\n }\n return this.nextNewResultTarget;\n }\n\n public initialize() {\n try {\n this.foldedResultList = this.initFolding();\n this.resultsPerPage = buildResultsPerPage(this.bindings.engine);\n } catch (e) {\n this.error = e as Error;\n }\n\n this.itemTemplateProvider = new ItemTemplateProvider({\n includeDefaultTemplate: true,\n templateElements: Array.from(\n this.host.querySelectorAll('atomic-result-template')\n ),\n getResultTemplateRegistered: () => this.resultTemplateRegistered,\n getTemplateHasError: () => this.templateHasError,\n setResultTemplateRegistered: (value: boolean) => {\n this.resultTemplateRegistered = value;\n },\n setTemplateHasError: (value: boolean) => {\n this.templateHasError = value;\n },\n bindings: this.bindings,\n });\n\n this.itemListCommon = new ItemListCommon({\n engineSubscribe: this.bindings.engine.subscribe,\n getCurrentNumberOfItems: () => this.foldedResultListState.results.length,\n getIsLoading: () => this.foldedResultListState.isLoading,\n host: this.host,\n loadingFlag: this.loadingFlag,\n nextNewItemTarget: this.focusTarget,\n store: this.bindings.store,\n });\n this.tabManager = buildTabManager(this.bindings.engine);\n\n createAppLoadedListener(this.bindings.store, (isAppLoaded) => {\n this.isAppLoaded = isAppLoaded;\n });\n }\n\n private initFolding(\n props: ResultListProps = {options: {}}\n ): FoldedResultList {\n return buildFoldedResultList(this.bindings.engine, {\n options: {\n ...props.options,\n folding: {\n collectionField: this.collectionField,\n parentField: this.parentField,\n childField: this.childField,\n numberOfFoldedResults: this.numberOfFoldedResults,\n },\n },\n });\n }\n\n @Watch('tabManagerState')\n watchTabManagerState(\n newValue: {activeTab: string},\n oldValue: {activeTab: string}\n ) {\n if (newValue?.activeTab !== oldValue?.activeTab) {\n this.bindings.store.unsetLoadingFlag(this.loadingFlag);\n }\n }\n\n public render() {\n if (\n !shouldDisplayOnCurrentTab(\n [...this.tabsIncluded],\n [...this.tabsExcluded],\n this.tabManagerState.activeTab\n )\n ) {\n return <Hidden></Hidden>;\n }\n this.itemListCommon.updateBreakpoints();\n const listClasses = this.computeListDisplayClasses();\n\n return (\n <ItemListGuard\n hasError={this.foldedResultListState.hasError}\n firstRequestExecuted={this.foldedResultListState.firstSearchExecuted}\n hasItems={this.foldedResultListState.hasResults}\n hasTemplate={this.resultTemplateRegistered}\n templateHasError={this.itemTemplateProvider.hasError}\n >\n <DisplayWrapper listClasses={listClasses} display={this.display}>\n <ResultsPlaceholdersGuard\n density={this.density}\n imageSize={this.imageSize}\n display={this.display}\n displayPlaceholders={!this.isAppLoaded}\n numberOfPlaceholders={this.resultsPerPageState.numberOfResults}\n ></ResultsPlaceholdersGuard>\n <ItemDisplayGuard\n firstRequestExecuted={\n this.foldedResultListState.firstSearchExecuted\n }\n hasItems={this.foldedResultListState.hasResults}\n >\n {this.foldedResultListState.results.map((collection, i) => {\n const propsForAtomicResult =\n this.getPropsForAtomicResult(collection);\n return (\n <atomic-result\n {...propsForAtomicResult}\n part=\"outline\"\n ref={(element) =>\n element && this.itemListCommon.setNewResultRef(element, i)\n }\n ></atomic-result>\n );\n })}\n </ItemDisplayGuard>\n </DisplayWrapper>\n </ItemListGuard>\n );\n }\n\n private computeListDisplayClasses() {\n const displayPlaceholders = !this.isAppLoaded;\n\n return getItemListDisplayClasses(\n this.display,\n this.density,\n this.imageSize,\n this.foldedResultListState.firstSearchExecuted &&\n this.foldedResultListState.isLoading,\n displayPlaceholders\n );\n }\n\n private getPropsForAtomicResult(collection: FoldedCollection) {\n const result = extractUnfoldedItem(collection);\n\n return {\n interactiveResult: buildInteractiveResult(this.bindings.engine, {\n options: {result},\n }),\n result: collection,\n renderingFunction: this.resultRenderingFunction,\n loadingFlag: this.loadingFlag,\n key: this.itemListCommon.getResultId(\n result.uniqueId,\n this.foldedResultListState.searchResponseId,\n this.density,\n this.imageSize\n ),\n content: this.itemTemplateProvider.getTemplateContent(result),\n store: this.bindings.store,\n density: this.density,\n imageSize: this.imageSize,\n display: this.display,\n };\n }\n}\n"],"version":3}
1
+ {"file":"atomic-folded-result-list.entry.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,yBAAyB,GAAG,k9wEAAk9wE,CAAC;AACr/wE,qCAAe,yBAAyB;;;;;;;;;;;;MCgE3B,sBAAsB;;;QAKzB,gBAAW,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC;QAI7C,YAAO,GAAsB,MAAM,CAAC;QAc3B,6BAAwB,GAAG,KAAK,CAAC;QAEjC,qBAAgB,GAAG,KAAK,CAAC;QACzB,gBAAW,GAAG,KAAK,CAAC;;;;QAKd,YAAO,GAAuB,QAAQ,CAAC;;;;QAIvC,cAAS,GAAyB,MAAM,CAAC;;;;;;;;;;QAYzD,iBAAY,GAAsB,IAAI,CAAC;;;;;;;;;;QAavC,iBAAY,GAAsB,IAAI,CAAC;;;;;;;;;;QA6BhB,0BAAqB,GAAG,CAAC,CAAC;;;;wCAlEZ,KAAK;;gCAEb,KAAK;2BACV,KAAK;uBAKiB,QAAQ;yBAIJ,MAAM;4BAYtB,IAAI;4BAaJ,IAAI;;;;qCA6BS,CAAC;;;;;;;;IAQtC,MAAM,iBAAiB,CACtC,uBAA8C;QAE9C,IAAI,CAAC,uBAAuB,GAAG,uBAAuB,CAAC;KACxD;IAGD,uBAAuB,CAAC,KAAsC;QAC5D,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,KAAK,CAAC,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AAC;mEAES;AAI1C;IAFN,qBAAqB,CAAC,YAAY,CAAC;+DAEK;AAyBlC;IAFN,SAAS,EAAE;4DAEkC;AAavC;IAFN,SAAS,EAAE;4DAEkC;;;;;","names":[],"sources":["src/components/search/result-lists/atomic-folded-result-list/atomic-folded-result-list.pcss?tag=atomic-folded-result-list&encapsulation=shadow","src/components/search/result-lists/atomic-folded-result-list/atomic-folded-result-list.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n@import '../../../common/item-list/styles/placeholders.pcss';\n@import '../../../common/item-list/styles/list-display.pcss';\natomic-result:not(.hydrated) {\n visibility: hidden;\n}\n","import {FoldedItemListStateContextEvent} from '@/src/components/common/item-list/item-list-decorators';\nimport {\n ResultsPerPageState,\n ResultsPerPage,\n buildFoldedResultList,\n FoldedResultList,\n FoldedResultListState,\n buildResultsPerPage,\n ResultListProps,\n FoldedCollection,\n buildInteractiveResult,\n TabManager,\n TabManagerState,\n buildTabManager,\n} from '@coveo/headless';\nimport {\n Component,\n Element,\n State,\n Prop,\n Listen,\n Method,\n h,\n Watch,\n} from '@stencil/core';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {ArrayProp} from '../../../../utils/props-utils';\nimport {FocusTargetController} from '../../../../utils/stencil-accessibility-utils';\nimport {shouldDisplayOnCurrentTab} from '../../../../utils/tab-utils';\nimport {randomID} from '../../../../utils/utils';\nimport {ResultsPlaceholdersGuard} from '../../../common/atomic-result-placeholder/stencil-placeholders';\nimport {extractUnfoldedItem} from '../../../common/item-list/unfolded-item';\nimport {createAppLoadedListener} from '../../../common/interface/store';\nimport {ItemDisplayGuard} from '../../../common/item-list/item-display-guard';\nimport {ItemListGuard} from '../../../common/item-list/item-list-guard';\nimport {ItemTemplateProvider} from '../../../common/item-list/item-template-provider';\nimport {DisplayWrapper} from '../../../common/item-list/stencil-display-wrapper';\nimport {\n ItemListCommon,\n ItemRenderingFunction,\n} from '../../../common/item-list/stencil-item-list-common';\nimport {\n ItemDisplayDensity,\n ItemDisplayImageSize,\n ItemDisplayLayout,\n getItemListDisplayClasses,\n} from '../../../common/layout/display-options';\nimport {Hidden} from '../../../common/stencil-hidden';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\n\n/**\n * The `atomic-folded-result-list` component is responsible for displaying folded query results, by applying one or more result templates for up to three layers (i.e., to the result, child and grandchild).\n * @slot default - The default slot where the result templates are inserted.\n * @part result-list - The element containing every result of a result list\n * @part outline - The element displaying an outline or a divider around a result\n */\n@Component({\n tag: 'atomic-folded-result-list',\n styleUrl: 'atomic-folded-result-list.pcss',\n shadow: true,\n})\nexport class AtomicFoldedResultList implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n public foldedResultList!: FoldedResultList;\n public resultsPerPage!: ResultsPerPage;\n private resultRenderingFunction: ItemRenderingFunction;\n private loadingFlag = randomID('firstResultLoaded-');\n private itemTemplateProvider!: ItemTemplateProvider;\n private nextNewResultTarget?: FocusTargetController;\n private itemListCommon!: ItemListCommon;\n private display: ItemDisplayLayout = 'list';\n\n @Element() public host!: HTMLDivElement;\n\n @BindStateToController('foldedResultList')\n @State()\n public foldedResultListState!: FoldedResultListState;\n @BindStateToController('resultsPerPage')\n @State()\n public resultsPerPageState!: ResultsPerPageState;\n public tabManager!: TabManager;\n @BindStateToController('tabManager')\n @State()\n public tabManagerState!: TabManagerState;\n @State() private resultTemplateRegistered = false;\n @State() public error!: Error;\n @State() private templateHasError = false;\n @State() private isAppLoaded = false;\n\n /**\n * The spacing of various elements in the result list, including the gap between results, the gap between parts of a result, and the font sizes of different parts in a result.\n */\n @Prop({reflect: true}) density: ItemDisplayDensity = 'normal';\n /**\n * The expected size of the image displayed in the results.\n */\n @Prop({reflect: true}) imageSize: ItemDisplayImageSize = 'icon';\n /**\n * The tabs on which the folded result list can be displayed. This property should not be used at the same time as `tabs-excluded`.\n *\n * Set this property as a stringified JSON array, e.g.,\n * ```html\n * <atomic-folded-result-list tabs-included='[\"tabIDA\", \"tabIDB\"]'></atomic-folded-result-list snippet>\n * ```\n * If you don't set this property, the folded result list can be displayed on any tab. Otherwise, the folded result list can only be displayed on the specified tabs.\n */\n @ArrayProp()\n @Prop({reflect: true, mutable: true})\n public tabsIncluded: string[] | string = '[]';\n\n /**\n * The tabs on which this folded result list must not be displayed. This property should not be used at the same time as `tabs-included`.\n *\n * Set this property as a stringified JSON array, e.g.,\n * ```html\n * <atomic-folded-result-list tabs-excluded='[\"tabIDA\", \"tabIDB\"]'></atomic-folded-result-list>\n * ```\n * If you don't set this property, the folded result list can be displayed on any tab. Otherwise, the folded result list won't be displayed on any of the specified tabs.\n */\n @ArrayProp()\n @Prop({reflect: true, mutable: true})\n public tabsExcluded: string[] | string = '[]';\n /**\n * The name of the field on which to do the folding. The folded result list component will use the values of this field to resolve the collections of result items.\n *\n * @defaultValue `foldingcollection`\n */\n @Prop({reflect: true}) public collectionField?: string;\n /**\n * The name of the field that determines whether a certain result is a top result containing other child results within a collection.\n *\n * @defaultValue `foldingparent`\n */\n @Prop({reflect: true}) public parentField?: string;\n /**\n * The name of the field that uniquely identifies a result within a collection.\n *\n * @defaultValue `foldingchild`\n */\n @Prop({reflect: true}) public childField?: string;\n\n /**\n * The initial number of child results to request for each folded collection, before expansion.\n *\n * @defaultValue `2`\n *\n * @example For an email thread with a total of 20 messages, using the default value of `2` will request the top two child messages, based on the current sort criteria and query, to be returned as children of the parent message.\n * The user can then click to expand the collection and see the remaining messages that match the current query (i.e., not necessarily all remaining 18 messages). Those messages will be sorted based on the current sort criteria (i.e., not necessarily by date).\n * For more info on Result Folding, see [Result Folding](https://docs.coveo.com/en/1884).\n **/\n @Prop({reflect: true}) public numberOfFoldedResults = 2;\n\n /**\n * Sets a rendering function to bypass the standard HTML template mechanism for rendering results.\n * You can use this function while working with web frameworks that don't use plain HTML syntax, e.g., React, Angular or Vue.\n *\n * Do not use this method if you integrate Atomic in a plain HTML deployment.\n */\n @Method() public async setRenderFunction(\n resultRenderingFunction: ItemRenderingFunction\n ) {\n this.resultRenderingFunction = resultRenderingFunction;\n }\n\n @Listen('atomic/resolveFoldedResultList')\n resolveFoldedResultList(event: FoldedItemListStateContextEvent) {\n event.preventDefault();\n event.stopPropagation();\n event.detail(this.foldedResultList);\n }\n\n @Listen('atomic/loadCollection')\n loadCollection(event: CustomEvent<FoldedCollection>) {\n event.preventDefault();\n event.stopPropagation();\n this.foldedResultList.loadCollection(event.detail);\n }\n\n public get focusTarget() {\n if (!this.nextNewResultTarget) {\n this.nextNewResultTarget = new FocusTargetController(this);\n }\n return this.nextNewResultTarget;\n }\n\n public initialize() {\n try {\n this.foldedResultList = this.initFolding();\n this.resultsPerPage = buildResultsPerPage(this.bindings.engine);\n } catch (e) {\n this.error = e as Error;\n }\n\n this.itemTemplateProvider = new ItemTemplateProvider({\n includeDefaultTemplate: true,\n templateElements: Array.from(\n this.host.querySelectorAll('atomic-result-template')\n ),\n getResultTemplateRegistered: () => this.resultTemplateRegistered,\n getTemplateHasError: () => this.templateHasError,\n setResultTemplateRegistered: (value: boolean) => {\n this.resultTemplateRegistered = value;\n },\n setTemplateHasError: (value: boolean) => {\n this.templateHasError = value;\n },\n bindings: this.bindings,\n });\n\n this.itemListCommon = new ItemListCommon({\n engineSubscribe: this.bindings.engine.subscribe,\n getCurrentNumberOfItems: () => this.foldedResultListState.results.length,\n getIsLoading: () => this.foldedResultListState.isLoading,\n host: this.host,\n loadingFlag: this.loadingFlag,\n nextNewItemTarget: this.focusTarget,\n store: this.bindings.store,\n });\n this.tabManager = buildTabManager(this.bindings.engine);\n\n createAppLoadedListener(this.bindings.store, (isAppLoaded) => {\n this.isAppLoaded = isAppLoaded;\n });\n }\n\n private initFolding(\n props: ResultListProps = {options: {}}\n ): FoldedResultList {\n return buildFoldedResultList(this.bindings.engine, {\n options: {\n ...props.options,\n folding: {\n collectionField: this.collectionField,\n parentField: this.parentField,\n childField: this.childField,\n numberOfFoldedResults: this.numberOfFoldedResults,\n },\n },\n });\n }\n\n @Watch('tabManagerState')\n watchTabManagerState(\n newValue: {activeTab: string},\n oldValue: {activeTab: string}\n ) {\n if (newValue?.activeTab !== oldValue?.activeTab) {\n this.bindings.store.unsetLoadingFlag(this.loadingFlag);\n }\n }\n\n public render() {\n if (\n !shouldDisplayOnCurrentTab(\n [...this.tabsIncluded],\n [...this.tabsExcluded],\n this.tabManagerState.activeTab\n )\n ) {\n return <Hidden></Hidden>;\n }\n this.itemListCommon.updateBreakpoints();\n const listClasses = this.computeListDisplayClasses();\n\n return (\n <ItemListGuard\n hasError={this.foldedResultListState.hasError}\n firstRequestExecuted={this.foldedResultListState.firstSearchExecuted}\n hasItems={this.foldedResultListState.hasResults}\n hasTemplate={this.resultTemplateRegistered}\n templateHasError={this.itemTemplateProvider.hasError}\n >\n <DisplayWrapper listClasses={listClasses} display={this.display}>\n <ResultsPlaceholdersGuard\n density={this.density}\n imageSize={this.imageSize}\n display={this.display}\n displayPlaceholders={!this.isAppLoaded}\n numberOfPlaceholders={this.resultsPerPageState.numberOfResults}\n ></ResultsPlaceholdersGuard>\n <ItemDisplayGuard\n firstRequestExecuted={\n this.foldedResultListState.firstSearchExecuted\n }\n hasItems={this.foldedResultListState.hasResults}\n >\n {this.foldedResultListState.results.map((collection, i) => {\n const propsForAtomicResult =\n this.getPropsForAtomicResult(collection);\n return (\n <atomic-result\n {...propsForAtomicResult}\n part=\"outline\"\n ref={(element) =>\n element && this.itemListCommon.setNewResultRef(element, i)\n }\n ></atomic-result>\n );\n })}\n </ItemDisplayGuard>\n </DisplayWrapper>\n </ItemListGuard>\n );\n }\n\n private computeListDisplayClasses() {\n const displayPlaceholders = !this.isAppLoaded;\n\n return getItemListDisplayClasses(\n this.display,\n this.density,\n this.imageSize,\n this.foldedResultListState.firstSearchExecuted &&\n this.foldedResultListState.isLoading,\n displayPlaceholders\n );\n }\n\n private getPropsForAtomicResult(collection: FoldedCollection) {\n const result = extractUnfoldedItem(collection);\n\n return {\n interactiveResult: buildInteractiveResult(this.bindings.engine, {\n options: {result},\n }),\n result: collection,\n renderingFunction: this.resultRenderingFunction,\n loadingFlag: this.loadingFlag,\n key: this.itemListCommon.getResultId(\n result.uniqueId,\n this.foldedResultListState.searchResponseId,\n this.density,\n this.imageSize\n ),\n content: this.itemTemplateProvider.getTemplateContent(result),\n store: this.bindings.store,\n density: this.density,\n imageSize: this.imageSize,\n display: this.display,\n };\n }\n}\n"],"version":3}
@@ -2,7 +2,7 @@ import { r as registerInstance, h, g as getElement } from './index-3f35faca.js';
2
2
  import { buildInteractiveCitation, buildGeneratedAnswer, buildSearchStatus, buildTabManager } from '@coveo/headless';
3
3
  import { d as debounce } from './debounce-utils-efa015c0.js';
4
4
  import { I as InitializeBindings, B as BindStateToController, H as Hidden } from './initialization-utils-ff3edf9a.js';
5
- import { A as ArrayProp } from './props-utils-8e3d7f26.js';
5
+ import { A as ArrayProp } from './props-utils-e17fa18c.js';
6
6
  import { A as AriaLiveRegion } from './stencil-accessibility-utils-bc273be5.js';
7
7
  import { s as shouldDisplayOnCurrentTab } from './tab-utils-35886d3e.js';
8
8
  import { G as GeneratedAnswerCommon } from './generated-answer-common-ee9bfc67.js';
@@ -4,7 +4,7 @@ import { I as InitializeBindings, B as BindStateToController } from './initializ
4
4
  import { F as FocusTargetController } from './stencil-accessibility-utils-bc273be5.js';
5
5
  import { r as randomID } from './utils-30b00491.js';
6
6
  import { R as ResultsPlaceholdersGuard } from './stencil-placeholders-58a0c818.js';
7
- import { e as extractUnfoldedItem } from './item-813944d1.js';
7
+ import { e as extractUnfoldedItem } from './unfolded-item-c5795c0f.js';
8
8
  import { c as createAppLoadedListener } from './store-5fcae420.js';
9
9
  import { D as DisplayWrapper, I as ItemDisplayGuard } from './stencil-display-wrapper-5b32e77c.js';
10
10
  import { I as ItemListGuard } from './item-list-guard-22b0711a.js';
@@ -136,7 +136,7 @@ const AtomicInsightFoldedResultList = class {
136
136
  render() {
137
137
  this.itemListCommon.updateBreakpoints();
138
138
  const listClasses = this.computeListDisplayClasses();
139
- return (h(ItemListGuard, { key: 'ed2f1f71a5277d75b1075ce2909bfe3ad15cd214', firstRequestExecuted: this.foldedResultListState.firstSearchExecuted, hasItems: this.foldedResultListState.hasResults, hasTemplate: this.resultTemplateRegistered, templateHasError: this.itemTemplateProvider.hasError, hasError: this.foldedResultListState.hasError }, h(DisplayWrapper, { key: '190df997367e030211c20b476b7560666c06fe4e', listClasses: listClasses, display: this.display }, h(ResultsPlaceholdersGuard, { key: '6e6f92048a281b3f7af1f5e3a12b131eb633ff51', displayPlaceholders: !this.isAppLoaded, numberOfPlaceholders: this.resultsPerPageState.numberOfResults, display: this.display, density: this.density, imageSize: this.imageSize }), h(ItemDisplayGuard, { key: '35c01f6c97b1350c046b1cd3b80e28dcee587ad0', firstRequestExecuted: this.foldedResultListState.firstSearchExecuted, hasItems: this.foldedResultListState.hasResults }, this.foldedResultListState.results.map((collection, i) => {
139
+ return (h(ItemListGuard, { key: 'ea7ceba580399e6b24e5d762e73b7e62d9e602b1', firstRequestExecuted: this.foldedResultListState.firstSearchExecuted, hasItems: this.foldedResultListState.hasResults, hasTemplate: this.resultTemplateRegistered, templateHasError: this.itemTemplateProvider.hasError, hasError: this.foldedResultListState.hasError }, h(DisplayWrapper, { key: 'e7160b0e0ca8fd43438ceab38c68ec7d5bca4110', listClasses: listClasses, display: this.display }, h(ResultsPlaceholdersGuard, { key: '7a30f3bad0c1c385c51ece26128423bfb02e02f9', displayPlaceholders: !this.isAppLoaded, numberOfPlaceholders: this.resultsPerPageState.numberOfResults, display: this.display, density: this.density, imageSize: this.imageSize }), h(ItemDisplayGuard, { key: 'd29341e0ebf7a541059168d247b53e7588418832', firstRequestExecuted: this.foldedResultListState.firstSearchExecuted, hasItems: this.foldedResultListState.hasResults }, this.foldedResultListState.results.map((collection, i) => {
140
140
  const atomicInsightResultProps = this.getPropsForAtomicInsightResult(collection);
141
141
  return (h("atomic-insight-result", { ...atomicInsightResultProps, part: "outline", ref: (element) => element && this.itemListCommon.setNewResultRef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rB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAC;KACH;;;AAtN4B;IAA5B,kBAAkB,EAAE;+DAAmC;AAcjD;IAFN,qBAAqB,CAAC,kBAAkB,CAAC;4EAEkB;AAGrD;IAFN,qBAAqB,CAAC,gBAAgB,CAAC;0EAEgB;;;;;","names":["buildInsightResultsPerPage","buildInsightFoldedResultList","buildInsightInteractiveResult"],"sources":["src/components/insight/result-lists/atomic-insight-folded-result-list/atomic-insight-folded-result-list.pcss?tag=atomic-insight-folded-result-list&encapsulation=shadow","src/components/insight/result-lists/atomic-insight-folded-result-list/atomic-insight-folded-result-list.tsx"],"sourcesContent":["@import '../../../common/item-list/styles/placeholders.pcss';\n@import '../styles/list-display.pcss';\natomic-result:not(.hydrated) {\n visibility: hidden;\n}\n","import {\n ResultsPerPageState as InsightResultsPerPageState,\n ResultsPerPage as InsightResultsPerPage,\n buildFoldedResultList as buildInsightFoldedResultList,\n FoldedResultList as InsightFoldedResultList,\n FoldedResultListState as InsightFoldedResultListState,\n buildResultsPerPage as buildInsightResultsPerPage,\n FoldedCollection as InsightFoldedCollection,\n buildInteractiveResult as buildInsightInteractiveResult,\n} from '@coveo/headless/insight';\nimport {\n Component,\n Element,\n State,\n Prop,\n Listen,\n Method,\n h,\n} from '@stencil/core';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {FocusTargetController} from '../../../../utils/stencil-accessibility-utils';\nimport {randomID} from '../../../../utils/utils';\nimport {ResultsPlaceholdersGuard} from '../../../common/atomic-result-placeholder/stencil-placeholders';\nimport {extractUnfoldedItem} from '../../../common/interface/item';\nimport {createAppLoadedListener} from '../../../common/interface/store';\nimport {ItemDisplayGuard} from '../../../common/item-list/item-display-guard';\nimport {FoldedItemListStateContextEvent} from '../../../common/item-list/item-list-decorators';\nimport {ItemListGuard} from '../../../common/item-list/item-list-guard';\nimport {ItemTemplateProvider} from '../../../common/item-list/item-template-provider';\nimport {DisplayWrapper} from '../../../common/item-list/stencil-display-wrapper';\nimport {\n ItemListCommon,\n ItemRenderingFunction,\n} from '../../../common/item-list/stencil-item-list-common';\nimport {\n ItemDisplayDensity,\n ItemDisplayImageSize,\n ItemDisplayLayout,\n getItemListDisplayClasses,\n} from '../../../common/layout/display-options';\nimport {InsightBindings} from '../../atomic-insight-interface/atomic-insight-interface';\n\n/**\n * @internal\n */\n@Component({\n tag: 'atomic-insight-folded-result-list',\n styleUrl: 'atomic-insight-folded-result-list.pcss',\n shadow: true,\n})\nexport class AtomicInsightFoldedResultList\n implements InitializableComponent<InsightBindings>\n{\n @InitializeBindings() public bindings!: InsightBindings;\n public foldedResultList!: InsightFoldedResultList;\n public resultsPerPage!: InsightResultsPerPage;\n private itemRenderingFunction: ItemRenderingFunction;\n private loadingFlag = randomID('firstResultLoaded-');\n private itemTemplateProvider!: ItemTemplateProvider;\n private nextNewResultTarget?: FocusTargetController;\n private display: ItemDisplayLayout = 'list';\n private itemListCommon!: ItemListCommon;\n\n @Element() public host!: HTMLDivElement;\n\n @BindStateToController('foldedResultList')\n @State()\n public foldedResultListState!: InsightFoldedResultListState;\n @BindStateToController('resultsPerPage')\n @State()\n public resultsPerPageState!: InsightResultsPerPageState;\n @State() private resultTemplateRegistered = false;\n @State() public error!: Error;\n @State() private isAppLoaded = false;\n @State() private templateHasError = false;\n\n /**\n * The spacing of various elements in the result list, including the gap between results, the gap between parts of a result, and the font sizes of different parts in a result.\n */\n @Prop({reflect: true}) density: ItemDisplayDensity = 'normal';\n /**\n * The expected size of the image displayed in the results.\n */\n @Prop({reflect: true}) imageSize: ItemDisplayImageSize = 'icon';\n /**\n * The name of the field on which to do the folding. The folded result list component will use the values of this field to resolve the collections of result items.\n *\n * @defaultValue `foldingcollection`\n */\n @Prop({reflect: true}) public collectionField?: string;\n /**\n * The name of the field that determines whether a certain result is a top result containing other child results within a collection.\n *\n * @defaultValue `foldingparent`\n */\n @Prop({reflect: true}) public parentField?: string;\n /**\n * The name of the field that uniquely identifies a result within a collection.\n *\n * @defaultValue `foldingchild`\n */\n @Prop({reflect: true}) public childField?: string;\n\n /**\n * Sets a rendering function to bypass the standard HTML template mechanism for rendering results.\n * You can use this function while working with web frameworks that don't use plain HTML syntax, e.g., React, Angular or Vue.\n *\n * Do not use this method if you integrate Atomic in a plain HTML deployment.\n */\n @Method() public async setRenderFunction(\n resultRenderingFunction: ItemRenderingFunction\n ) {\n this.itemRenderingFunction = resultRenderingFunction;\n }\n\n @Listen('atomic/resolveFoldedResultList')\n resolveFoldedResultList(event: FoldedItemListStateContextEvent) {\n event.preventDefault();\n event.stopPropagation();\n event.detail(this.foldedResultList);\n }\n\n @Listen('atomic/loadCollection')\n loadCollection(event: CustomEvent<InsightFoldedCollection>) {\n event.preventDefault();\n event.stopPropagation();\n this.foldedResultList.loadCollection(event.detail);\n }\n\n public initialize() {\n try {\n this.foldedResultList = this.initFolding();\n this.resultsPerPage = buildInsightResultsPerPage(this.bindings.engine);\n } catch (e) {\n this.error = e as Error;\n }\n\n this.itemTemplateProvider = new ItemTemplateProvider({\n includeDefaultTemplate: true,\n templateElements: Array.from(\n this.host.querySelectorAll('atomic-insight-result-template')\n ),\n getResultTemplateRegistered: () => this.resultTemplateRegistered,\n getTemplateHasError: () => this.templateHasError,\n setResultTemplateRegistered: (value: boolean) => {\n this.resultTemplateRegistered = value;\n },\n setTemplateHasError: (value: boolean) => {\n this.templateHasError = value;\n },\n bindings: this.bindings,\n });\n\n this.itemListCommon = new ItemListCommon({\n engineSubscribe: this.bindings.engine.subscribe,\n getCurrentNumberOfItems: () => this.foldedResultListState.results.length,\n getIsLoading: () => this.foldedResultListState.isLoading,\n host: this.host,\n loadingFlag: this.loadingFlag,\n nextNewItemTarget: this.focusTarget,\n store: this.bindings.store,\n });\n createAppLoadedListener(this.bindings.store, (isAppLoaded) => {\n this.isAppLoaded = isAppLoaded;\n });\n }\n\n private get focusTarget(): FocusTargetController {\n if (!this.nextNewResultTarget) {\n this.nextNewResultTarget = new FocusTargetController(this);\n }\n return this.nextNewResultTarget;\n }\n\n private initFolding(props = {options: {}}): InsightFoldedResultList {\n return buildInsightFoldedResultList(this.bindings.engine, {\n options: {\n ...props.options,\n folding: {\n collectionField: this.collectionField,\n parentField: this.parentField,\n childField: this.childField,\n },\n },\n });\n }\n\n public render() {\n this.itemListCommon.updateBreakpoints();\n const listClasses = this.computeListDisplayClasses();\n\n return (\n <ItemListGuard\n firstRequestExecuted={this.foldedResultListState.firstSearchExecuted}\n hasItems={this.foldedResultListState.hasResults}\n hasTemplate={this.resultTemplateRegistered}\n templateHasError={this.itemTemplateProvider.hasError}\n hasError={this.foldedResultListState.hasError}\n >\n <DisplayWrapper listClasses={listClasses} display={this.display}>\n <ResultsPlaceholdersGuard\n displayPlaceholders={!this.isAppLoaded}\n numberOfPlaceholders={this.resultsPerPageState.numberOfResults}\n display={this.display}\n density={this.density}\n imageSize={this.imageSize}\n ></ResultsPlaceholdersGuard>\n <ItemDisplayGuard\n firstRequestExecuted={\n this.foldedResultListState.firstSearchExecuted\n }\n hasItems={this.foldedResultListState.hasResults}\n >\n {this.foldedResultListState.results.map((collection, i) => {\n const atomicInsightResultProps =\n this.getPropsForAtomicInsightResult(collection);\n return (\n <atomic-insight-result\n {...atomicInsightResultProps}\n part=\"outline\"\n ref={(element) =>\n element && this.itemListCommon.setNewResultRef(element, i)\n }\n ></atomic-insight-result>\n );\n })}\n </ItemDisplayGuard>\n </DisplayWrapper>\n </ItemListGuard>\n );\n }\n\n private computeListDisplayClasses() {\n const displayPlaceholders = !this.isAppLoaded;\n\n return getItemListDisplayClasses(\n this.display,\n this.density,\n this.imageSize,\n this.foldedResultListState.firstSearchExecuted &&\n this.foldedResultListState.isLoading,\n displayPlaceholders\n );\n }\n\n private getPropsForAtomicInsightResult(collection: InsightFoldedCollection) {\n const result = extractUnfoldedItem(collection);\n\n return {\n interactiveResult: buildInsightInteractiveResult(this.bindings.engine, {\n options: {result},\n }),\n result,\n renderingFunction: this.itemRenderingFunction,\n loadingFlag: this.loadingFlag,\n key: this.itemListCommon.getResultId(\n result.uniqueId,\n this.foldedResultListState.searchResponseId,\n this.density,\n this.imageSize\n ),\n content: this.itemTemplateProvider.getTemplateContent(result),\n store: this.bindings.store,\n density: this.density,\n display: this.display,\n imageSize: this.imageSize,\n };\n }\n}\n"],"version":3}
1
+ {"file":"atomic-insight-folded-result-list.entry.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,gCAAgC,GAAG,8utEAA8utE,CAAC;AACxxtE,4CAAe,gCAAgC;;;;;;;;;;;;MCqDlC,6BAA6B;;;QAOhC,gBAAW,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC;QAG7C,YAAO,GAAsB,MAAM,CAAC;QAW3B,6BAAwB,GAAG,KAAK,CAAC;QAEjC,gBAAW,GAAG,KAAK,CAAC;QACpB,qBAAgB,GAAG,KAAK,CAAC;;;;QAKnB,YAAO,GAAuB,QAAQ,CAAC;;;;QAIvC,cAAS,GAAyB,MAAM,CAAC;;;wCAZpB,KAAK;;2BAElB,KAAK;gCACA,KAAK;uBAKY,QAAQ;yBAIJ,MAAM;;;;;;;;;;;IA0B9C,MAAM,iBAAiB,CACtC,uBAA8C;QAE9C,IAAI,CAAC,qBAAqB,GAAG,uBAAuB,CAAC;KACtD;IAGD,uBAAuB,CAAC,KAAsC;QAC5D,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;KACrC;IAGD,cAAc,CAAC,KAA2C;QACxD,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;KACpD;IAEM,UAAU;QACf,IAAI;YACF,IAAI,CAAC,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3C,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,SAAS,CACf;YACD,OAAO,EAAE,IAAI,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,MAAM,CAAC;YAC7D,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK;YAC1B,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAC;KACH;;;AAtN4B;IAA5B,kBAAkB,EAAE;+DAAmC;AAcjD;IAFN,qBAAqB,CAAC,kBAAkB,CAAC;4EAEkB;AAGrD;IAFN,qBAAqB,CAAC,gBAAgB,CAAC;0EAEgB;;;;;","names":["buildInsightResultsPerPage","buildInsightFoldedResultList","buildInsightInteractiveResult"],"sources":["src/components/insight/result-lists/atomic-insight-folded-result-list/atomic-insight-folded-result-list.pcss?tag=atomic-insight-folded-result-list&encapsulation=shadow","src/components/insight/result-lists/atomic-insight-folded-result-list/atomic-insight-folded-result-list.tsx"],"sourcesContent":["@import '../../../common/item-list/styles/placeholders.pcss';\n@import '../styles/list-display.pcss';\natomic-result:not(.hydrated) {\n visibility: hidden;\n}\n","import {\n ResultsPerPageState as InsightResultsPerPageState,\n ResultsPerPage as InsightResultsPerPage,\n buildFoldedResultList as buildInsightFoldedResultList,\n FoldedResultList as InsightFoldedResultList,\n FoldedResultListState as InsightFoldedResultListState,\n buildResultsPerPage as buildInsightResultsPerPage,\n FoldedCollection as InsightFoldedCollection,\n buildInteractiveResult as buildInsightInteractiveResult,\n} from '@coveo/headless/insight';\nimport {\n Component,\n Element,\n State,\n Prop,\n Listen,\n Method,\n h,\n} from '@stencil/core';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {FocusTargetController} from '../../../../utils/stencil-accessibility-utils';\nimport {randomID} from '../../../../utils/utils';\nimport {ResultsPlaceholdersGuard} from '../../../common/atomic-result-placeholder/stencil-placeholders';\nimport {extractUnfoldedItem} from '../../../common/item-list/unfolded-item';\nimport {createAppLoadedListener} from '../../../common/interface/store';\nimport {ItemDisplayGuard} from '../../../common/item-list/item-display-guard';\nimport {FoldedItemListStateContextEvent} from '../../../common/item-list/item-list-decorators';\nimport {ItemListGuard} from '../../../common/item-list/item-list-guard';\nimport {ItemTemplateProvider} from '../../../common/item-list/item-template-provider';\nimport {DisplayWrapper} from '../../../common/item-list/stencil-display-wrapper';\nimport {\n ItemListCommon,\n ItemRenderingFunction,\n} from '../../../common/item-list/stencil-item-list-common';\nimport {\n ItemDisplayDensity,\n ItemDisplayImageSize,\n ItemDisplayLayout,\n getItemListDisplayClasses,\n} from '../../../common/layout/display-options';\nimport {InsightBindings} from '../../atomic-insight-interface/atomic-insight-interface';\n\n/**\n * @internal\n */\n@Component({\n tag: 'atomic-insight-folded-result-list',\n styleUrl: 'atomic-insight-folded-result-list.pcss',\n shadow: true,\n})\nexport class AtomicInsightFoldedResultList\n implements InitializableComponent<InsightBindings>\n{\n @InitializeBindings() public bindings!: InsightBindings;\n public foldedResultList!: InsightFoldedResultList;\n public resultsPerPage!: InsightResultsPerPage;\n private itemRenderingFunction: ItemRenderingFunction;\n private loadingFlag = randomID('firstResultLoaded-');\n private itemTemplateProvider!: ItemTemplateProvider;\n private nextNewResultTarget?: FocusTargetController;\n private display: ItemDisplayLayout = 'list';\n private itemListCommon!: ItemListCommon;\n\n @Element() public host!: HTMLDivElement;\n\n @BindStateToController('foldedResultList')\n @State()\n public foldedResultListState!: InsightFoldedResultListState;\n @BindStateToController('resultsPerPage')\n @State()\n public resultsPerPageState!: InsightResultsPerPageState;\n @State() private resultTemplateRegistered = false;\n @State() public error!: Error;\n @State() private isAppLoaded = false;\n @State() private templateHasError = false;\n\n /**\n * The spacing of various elements in the result list, including the gap between results, the gap between parts of a result, and the font sizes of different parts in a result.\n */\n @Prop({reflect: true}) density: ItemDisplayDensity = 'normal';\n /**\n * The expected size of the image displayed in the results.\n */\n @Prop({reflect: true}) imageSize: ItemDisplayImageSize = 'icon';\n /**\n * The name of the field on which to do the folding. The folded result list component will use the values of this field to resolve the collections of result items.\n *\n * @defaultValue `foldingcollection`\n */\n @Prop({reflect: true}) public collectionField?: string;\n /**\n * The name of the field that determines whether a certain result is a top result containing other child results within a collection.\n *\n * @defaultValue `foldingparent`\n */\n @Prop({reflect: true}) public parentField?: string;\n /**\n * The name of the field that uniquely identifies a result within a collection.\n *\n * @defaultValue `foldingchild`\n */\n @Prop({reflect: true}) public childField?: string;\n\n /**\n * Sets a rendering function to bypass the standard HTML template mechanism for rendering results.\n * You can use this function while working with web frameworks that don't use plain HTML syntax, e.g., React, Angular or Vue.\n *\n * Do not use this method if you integrate Atomic in a plain HTML deployment.\n */\n @Method() public async setRenderFunction(\n resultRenderingFunction: ItemRenderingFunction\n ) {\n this.itemRenderingFunction = resultRenderingFunction;\n }\n\n @Listen('atomic/resolveFoldedResultList')\n resolveFoldedResultList(event: FoldedItemListStateContextEvent) {\n event.preventDefault();\n event.stopPropagation();\n event.detail(this.foldedResultList);\n }\n\n @Listen('atomic/loadCollection')\n loadCollection(event: CustomEvent<InsightFoldedCollection>) {\n event.preventDefault();\n event.stopPropagation();\n this.foldedResultList.loadCollection(event.detail);\n }\n\n public initialize() {\n try {\n this.foldedResultList = this.initFolding();\n this.resultsPerPage = buildInsightResultsPerPage(this.bindings.engine);\n } catch (e) {\n this.error = e as Error;\n }\n\n this.itemTemplateProvider = new ItemTemplateProvider({\n includeDefaultTemplate: true,\n templateElements: Array.from(\n this.host.querySelectorAll('atomic-insight-result-template')\n ),\n getResultTemplateRegistered: () => this.resultTemplateRegistered,\n getTemplateHasError: () => this.templateHasError,\n setResultTemplateRegistered: (value: boolean) => {\n this.resultTemplateRegistered = value;\n },\n setTemplateHasError: (value: boolean) => {\n this.templateHasError = value;\n },\n bindings: this.bindings,\n });\n\n this.itemListCommon = new ItemListCommon({\n engineSubscribe: this.bindings.engine.subscribe,\n getCurrentNumberOfItems: () => this.foldedResultListState.results.length,\n getIsLoading: () => this.foldedResultListState.isLoading,\n host: this.host,\n loadingFlag: this.loadingFlag,\n nextNewItemTarget: this.focusTarget,\n store: this.bindings.store,\n });\n createAppLoadedListener(this.bindings.store, (isAppLoaded) => {\n this.isAppLoaded = isAppLoaded;\n });\n }\n\n private get focusTarget(): FocusTargetController {\n if (!this.nextNewResultTarget) {\n this.nextNewResultTarget = new FocusTargetController(this);\n }\n return this.nextNewResultTarget;\n }\n\n private initFolding(props = {options: {}}): InsightFoldedResultList {\n return buildInsightFoldedResultList(this.bindings.engine, {\n options: {\n ...props.options,\n folding: {\n collectionField: this.collectionField,\n parentField: this.parentField,\n childField: this.childField,\n },\n },\n });\n }\n\n public render() {\n this.itemListCommon.updateBreakpoints();\n const listClasses = this.computeListDisplayClasses();\n\n return (\n <ItemListGuard\n firstRequestExecuted={this.foldedResultListState.firstSearchExecuted}\n hasItems={this.foldedResultListState.hasResults}\n hasTemplate={this.resultTemplateRegistered}\n templateHasError={this.itemTemplateProvider.hasError}\n hasError={this.foldedResultListState.hasError}\n >\n <DisplayWrapper listClasses={listClasses} display={this.display}>\n <ResultsPlaceholdersGuard\n displayPlaceholders={!this.isAppLoaded}\n numberOfPlaceholders={this.resultsPerPageState.numberOfResults}\n display={this.display}\n density={this.density}\n imageSize={this.imageSize}\n ></ResultsPlaceholdersGuard>\n <ItemDisplayGuard\n firstRequestExecuted={\n this.foldedResultListState.firstSearchExecuted\n }\n hasItems={this.foldedResultListState.hasResults}\n >\n {this.foldedResultListState.results.map((collection, i) => {\n const atomicInsightResultProps =\n this.getPropsForAtomicInsightResult(collection);\n return (\n <atomic-insight-result\n {...atomicInsightResultProps}\n part=\"outline\"\n ref={(element) =>\n element && this.itemListCommon.setNewResultRef(element, i)\n }\n ></atomic-insight-result>\n );\n })}\n </ItemDisplayGuard>\n </DisplayWrapper>\n </ItemListGuard>\n );\n }\n\n private computeListDisplayClasses() {\n const displayPlaceholders = !this.isAppLoaded;\n\n return getItemListDisplayClasses(\n this.display,\n this.density,\n this.imageSize,\n this.foldedResultListState.firstSearchExecuted &&\n this.foldedResultListState.isLoading,\n displayPlaceholders\n );\n }\n\n private getPropsForAtomicInsightResult(collection: InsightFoldedCollection) {\n const result = extractUnfoldedItem(collection);\n\n return {\n interactiveResult: buildInsightInteractiveResult(this.bindings.engine, {\n options: {result},\n }),\n result,\n renderingFunction: this.itemRenderingFunction,\n loadingFlag: this.loadingFlag,\n key: this.itemListCommon.getResultId(\n result.uniqueId,\n this.foldedResultListState.searchResponseId,\n this.density,\n this.imageSize\n ),\n content: this.itemTemplateProvider.getTemplateContent(result),\n store: this.bindings.store,\n density: this.density,\n display: this.display,\n imageSize: this.imageSize,\n };\n }\n}\n"],"version":3}
@@ -1,8 +1,8 @@
1
1
  import { r as registerInstance, s as setNonce, h, H as Host, g as getElement } from './index-3f35faca.js';
2
2
  import { m as markParentAsReady } from './init-queue-fbe942c3.js';
3
3
  import { buildResultsPerPage, loadFieldActions, buildInsightEngine } from '@coveo/headless/insight';
4
- import { g as getNextAnalyticsConfig, a as augmentWithExternalMiddleware, b as augmentAnalyticsWithAtomicVersion, C as CommonAtomicInterfaceHelper, i as instance } from './analytics-config-f3b2c9ea.js';
5
- import { A as ArrayProp } from './props-utils-8e3d7f26.js';
4
+ import { g as getNextAnalyticsConfig, a as augmentWithExternalMiddleware, b as augmentAnalyticsWithAtomicVersion, C as CommonAtomicInterfaceHelper, i as instance } from './analytics-config-e2c4641d.js';
5
+ import { A as ArrayProp } from './props-utils-e17fa18c.js';
6
6
  import { D as DEFAULT_MOBILE_BREAKPOINT } from './replace-breakpoint-213367f8.js';
7
7
  import { u as unsetLoadingFlag, s as setLoadingFlag, r as registerFacet, g as getFacetElements, w as waitUntilAppLoaded, a as createBaseStore } from './store-5fcae420.js';
8
8
  import { m as makeDesktopQuery } from './insight-layout-776b87f2.js';
@@ -2,7 +2,7 @@ import { r as registerInstance, h, g as getElement } from './index-3f35faca.js';
2
2
  import { Schema, StringValue } from '@coveo/bueno';
3
3
  import { buildNumericFacet, buildNumericRange, buildNumericFilter, buildFacetConditionsManager, buildSearchStatus, loadNumericFacetSetActions } from '@coveo/headless/insight';
4
4
  import { I as InitializeBindings, B as BindStateToController } from './initialization-utils-ff3edf9a.js';
5
- import { M as MapProp } from './props-utils-8e3d7f26.js';
5
+ import { M as MapProp } from './props-utils-e17fa18c.js';
6
6
  import { F as FocusTargetController } from './stencil-accessibility-utils-bc273be5.js';
7
7
  import { r as randomID } from './utils-30b00491.js';
8
8
  import { p as parseDependsOn } from './depends-on-d73b0ce3.js';
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, g as getElement } from './index-3f35faca.js';
2
- import { M as MapProp } from './props-utils-8e3d7f26.js';
2
+ import { M as MapProp } from './props-utils-e17fa18c.js';
3
3
  import { R as ResultTemplateCommon, a as makeDefinedConditions, m as makeMatchConditions } from './result-template-common-0eb26069.js';
4
4
  import '@coveo/bueno';
5
5
  import './utils-30b00491.js';
@@ -3,7 +3,7 @@ import { buildInteractiveResult } from '@coveo/headless/insight';
3
3
  import { b as buildCustomEvent } from './event-utils-8de63ec3.js';
4
4
  import { I as InitializeBindings } from './initialization-utils-ff3edf9a.js';
5
5
  import { g as elementHasAncestorTag } from './utils-30b00491.js';
6
- import { e as extractUnfoldedItem } from './item-813944d1.js';
6
+ import { e as extractUnfoldedItem } from './unfolded-item-c5795c0f.js';
7
7
  import { F as FoldedItemListContext, a as FoldedItemListStateContext, C as ChildrenWrapper, S as ShowHideButton, b as CollectionGuard, R as ResultChildrenGuard } from './show-hide-button-caaec7b0.js';
8
8
  import { I as ItemTemplateProvider } from './item-template-provider-35bf0685.js';
9
9
  import { C as ChildTemplatesContext, I as ItemContext, b as ItemDisplayConfigContext } from './stencil-item-decorators-6c453c11.js';
@@ -129,7 +129,7 @@ const AtomicResultChildren = class {
129
129
  return (h(ChildrenWrapper, { hasChildren: children.length > 0 }, children.map((child, i) => this.renderChild(child, i === children.length - 1))));
130
130
  }
131
131
  render() {
132
- return (h(ResultChildrenGuard, { key: '5bcc40ab6680193a2f88ea58c8fd51329869893a', inheritTemplates: this.inheritTemplates, resultTemplateRegistered: this.resultTemplateRegistered, templateHasError: this.templateHasError }, this.collection ? this.renderCollection() : this.renderFoldedResult()));
132
+ return (h(ResultChildrenGuard, { key: '1190e3f9b1165a6e484f862147f328725ada0b8b', inheritTemplates: this.inheritTemplates, resultTemplateRegistered: this.resultTemplateRegistered, templateHasError: this.templateHasError }, this.collection ? this.renderCollection() : this.renderFoldedResult()));
133
133
  }
134
134
  get host() { return getElement(this); }
135
135
  };
@@ -1 +1 @@
1
- {"file":"atomic-insight-result-children.entry.js","mappings":";;;;;;;;;;;;;;;;;;;;AAAA,MAAM,8BAA8B,GAAG,+/2DAA+/2D,CAAC;AACvi3D,0CAAe,8BAA8B;;;;;;;;;;;;ACgC7C,MAAM,sBAAsB,GAAG,yCAAyC,CAAC;AACzE,MAAM,YAAY,GAAG,gCAAgC,CAAC;MAUzC,oBAAoB;;;QAgBd,6BAAwB,GAAG,KAAK,CAAC;QACjC,qBAAgB,GAAG,KAAK,CAAC;QAKlC,wBAAmB,GAAG,KAAK,CAAC;;;;QAK5B,qBAAgB,GAAG,KAAK,CAAC;;;;QAQlB,iBAAY,GAAG,sBAAsB,CAAC;QAsF7C,8BAAyB,GAAG;YAClC,IAAI,CAAC,mBAAmB;kBACpB,IAAI,CAAC,gBAAgB,CAAC,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;kBAClE,IAAI,CAAC,gBAAgB,CAAC,wBAAwB,EAAE,CAAC;YAErD,IAAI,CAAC,mBAAmB,GAAG,CAAC,IAAI,CAAC,mBAAmB,CAAC;SACtD,CAAC;;wCA/G0C,KAAK;gCACb,KAAK;;mCAKX,KAAK;gCAKR,KAAK;;4BAQF,sBAAsB;;IAG7C,qBAAqB,CAAC,KAAiC;QAC5D,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,KAAK,CAAC,MAAM,CA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MAAM,GAAG,CAAC,IAC9C,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,KACrB,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC,KAAK,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CACnD,CACe,EAClB;KACH;IAEM,MAAM;QACX,QACE,EAAC,mBAAmB,qDAClB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EACvC,wBAAwB,EAAE,IAAI,CAAC,wBAAwB,EACvD,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,IAEtC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,gBAAgB,EAAE,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAClD,EACtB;KACH;;;AAzL4B;IAA5B,kBAAkB,EAAE;sDAAmC;AAEjD;IADN,qBAAqB,EAAE;kEAC2B;AAE3C;IADP,qBAAqB,EAAE;8DAC2B;AAE3C;IADP,WAAW,CAAC,EAAC,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,uBAAuB,EAAC,CAAC;oDAC5B;AAE7B;IADP,wBAAwB,EAAE;2DACW;AAS9B;IAFP,0BAA0B,EAAE;mEAEgC;;;;;","names":["buildInsightInteractiveResult"],"sources":["src/components/insight/result-templates/atomic-insight-result-children/atomic-insight-result-children.pcss?tag=atomic-insight-result-children&encapsulation=shadow","src/components/insight/result-templates/atomic-insight-result-children/atomic-insight-result-children.tsx"],"sourcesContent":["@import '../../../../components/common/result-children/result-children.pcss';\n\n[part='children-root'] {\n @apply border-neutral border-l;\n padding-left: 1rem;\n margin-top: 1rem;\n}\n","import {\n buildInteractiveResult as buildInsightInteractiveResult,\n FoldedResultListState as InsightFoldedResultListState,\n FoldedResult as InsightFoldedResult,\n FoldedResultList as InsightFoldedResultList,\n} from '@coveo/headless/insight';\nimport {Component, Element, State, h, Listen, Prop} from '@stencil/core';\nimport {buildCustomEvent} from '../../../../utils/event-utils';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {elementHasAncestorTag} from '../../../../utils/utils';\nimport {extractUnfoldedItem} from '../../../common/interface/item';\nimport {\n FoldedItemListContext,\n FoldedItemListStateContext,\n} from '../../../common/item-list/item-list-decorators';\nimport {ItemTemplateProvider} from '../../../common/item-list/item-template-provider';\nimport {\n ChildTemplatesContext,\n ChildTemplatesContextEvent,\n DisplayConfig,\n ItemContext,\n ItemDisplayConfigContext,\n} from '../../../common/item-list/stencil-item-decorators';\nimport {ItemDisplayImageSize} from '../../../common/layout/display-options';\nimport {ChildrenWrapper} from '../../../common/result-children/children-wrapper';\nimport {CollectionGuard} from '../../../common/result-children/collection-guard';\nimport {ResultChildrenGuard} from '../../../common/result-children/guard';\nimport {ShowHideButton} from '../../../common/result-children/show-hide-button';\nimport {InsightBindings} from '../../atomic-insight-interface/atomic-insight-interface';\n\nconst childTemplateComponent = 'atomic-insight-result-children-template';\nconst componentTag = 'atomic-insight-result-children';\n\n/**\n * @internal\n */\n@Component({\n tag: 'atomic-insight-result-children',\n styleUrl: 'atomic-insight-result-children.pcss',\n shadow: true,\n})\nexport class AtomicResultChildren\n implements InitializableComponent<InsightBindings>\n{\n @InitializeBindings() public bindings!: InsightBindings;\n @ChildTemplatesContext()\n public itemTemplateProvider?: ItemTemplateProvider;\n @FoldedItemListContext()\n private foldedResultList!: InsightFoldedResultList;\n @ItemContext({folded: true, parentName: 'atomic-insight-result'})\n private result!: InsightFoldedResult;\n @ItemDisplayConfigContext()\n private displayConfig!: DisplayConfig;\n private initialChildren!: InsightFoldedResult[];\n\n @Element() public host!: HTMLDivElement;\n @State() public error!: Error;\n @State() private resultTemplateRegistered = false;\n @State() private templateHasError = false;\n @FoldedItemListStateContext()\n @State()\n private foldedResultListState!: InsightFoldedResultListState;\n @State()\n private showInitialChildren = false;\n\n /**\n * Whether to inherit templates defined in a parent atomic-result-children. Only works for the second level of child nesting.\n */\n @Prop() inheritTemplates = false;\n /**\n * The expected size of the image displayed in the children results.\n */\n @Prop({reflect: true}) imageSize?: ItemDisplayImageSize;\n /**\n * The non-localized copy for an empty result state. An empty string will result in the component being hidden.\n */\n @Prop() public noResultText = 'no-documents-related';\n\n @Listen('atomic/resolveChildTemplates')\n public resolveChildTemplates(event: ChildTemplatesContextEvent) {\n event.preventDefault();\n event.detail(this.itemTemplateProvider);\n }\n\n public initialize() {\n if (this.inheritTemplates) {\n return;\n }\n\n const childrenTemplates = Array.from(\n this.host.querySelectorAll(childTemplateComponent)\n ).filter(\n (template) => !elementHasAncestorTag(template, childTemplateComponent)\n );\n\n if (!childrenTemplates.length) {\n this.error = new Error(\n `The \"${componentTag}\" component requires at least one \"${childTemplateComponent}\" component.`\n );\n return;\n }\n\n this.itemTemplateProvider = new ItemTemplateProvider({\n includeDefaultTemplate: false,\n templateElements: childrenTemplates,\n getResultTemplateRegistered: () => this.resultTemplateRegistered,\n getTemplateHasError: () => this.templateHasError,\n setResultTemplateRegistered: (value: boolean) => {\n this.resultTemplateRegistered = value;\n },\n setTemplateHasError: (value: boolean) => {\n this.templateHasError = value;\n },\n bindings: this.bindings,\n });\n }\n\n private renderChild(child: InsightFoldedResult, isLast: boolean) {\n const content = this.itemTemplateProvider?.getTemplateContent(child.result);\n\n if (!content) {\n return;\n }\n\n const key =\n child.result.uniqueId +\n child.children.map((child) => child.result.uniqueId);\n return (\n <atomic-insight-result\n key={key}\n content={content}\n result={child}\n interactiveResult={buildInsightInteractiveResult(this.bindings.engine, {\n options: {result: extractUnfoldedItem(child)},\n })}\n store={this.bindings.store}\n density={this.displayConfig.density}\n imageSize={this.imageSize || this.displayConfig.imageSize}\n classes={`child-result ${isLast ? 'last-child' : ''}`.trim()}\n ></atomic-insight-result>\n );\n }\n\n public componentWillRender() {\n if (this.initialChildren || !this.collection) {\n return;\n }\n\n this.initialChildren = this.collection.children;\n }\n\n private get collection() {\n return this.foldedResultListState.results.find((r) => {\n return r.result.uniqueId === this.result.result.uniqueId;\n });\n }\n\n private loadFullCollection() {\n this.host.dispatchEvent(\n buildCustomEvent('atomic/loadCollection', this.collection)\n );\n }\n private toggleShowInitialChildren = () => {\n this.showInitialChildren\n ? this.foldedResultList.logShowMoreFoldedResults(this.result.result)\n : this.foldedResultList.logShowLessFoldedResults();\n\n this.showInitialChildren = !this.showInitialChildren;\n };\n private renderCollection() {\n const collection = this.collection!;\n\n const children = this.showInitialChildren\n ? this.initialChildren\n : collection.children;\n\n return (\n <CollectionGuard\n isLoadingMoreResults={collection.isLoadingMoreResults}\n moreResultsAvailable={collection.moreResultsAvailable}\n hasChildren={collection.children.length > 0}\n numberOfChildren={collection.children.length}\n density={this.displayConfig.density}\n imageSize={this.imageSize || this.displayConfig.imageSize}\n noResultText={this.bindings.i18n.t(this.noResultText)}\n >\n <ShowHideButton\n moreResultsAvailable={collection.moreResultsAvailable}\n loadFullCollection={() => this.loadFullCollection()}\n showInitialChildren={this.showInitialChildren}\n toggleShowInitialChildren={this.toggleShowInitialChildren}\n loadAllResults={this.bindings.i18n.t('load-all-results')}\n collapseResults={this.bindings.i18n.t('collapse-results')}\n ></ShowHideButton>\n <ChildrenWrapper hasChildren={collection.children.length > 0}>\n {children.map((child, i) =>\n this.renderChild(child, i === children.length - 1)\n )}\n </ChildrenWrapper>\n </CollectionGuard>\n );\n }\n\n private renderFoldedResult() {\n if (this.result.children.length === 0) {\n return;\n }\n\n const children = this.result.children;\n\n return (\n <ChildrenWrapper hasChildren={children.length > 0}>\n {children.map((child, i) =>\n this.renderChild(child, i === children.length - 1)\n )}\n </ChildrenWrapper>\n );\n }\n\n public render() {\n return (\n <ResultChildrenGuard\n inheritTemplates={this.inheritTemplates}\n resultTemplateRegistered={this.resultTemplateRegistered}\n templateHasError={this.templateHasError}\n >\n {this.collection ? this.renderCollection() : this.renderFoldedResult()}\n </ResultChildrenGuard>\n );\n }\n}\n"],"version":3}
1
+ {"file":"atomic-insight-result-children.entry.js","mappings":";;;;;;;;;;;;;;;;;;;;AAAA,MAAM,8BAA8B,GAAG,+/2DAA+/2D,CAAC;AACv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AmC;AAEjD;IADN,qBAAqB,EAAE;kEAC2B;AAE3C;IADP,qBAAqB,EAAE;8DAC2B;AAE3C;IADP,WAAW,CAAC,EAAC,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,uBAAuB,EAAC,CAAC;oDAC5B;AAE7B;IADP,wBAAwB,EAAE;2DACW;AAS9B;IAFP,0BAA0B,EAAE;mEAEgC;;;;;","names":["buildInsightInteractiveResult"],"sources":["src/components/insight/result-templates/atomic-insight-result-children/atomic-insight-result-children.pcss?tag=atomic-insight-result-children&encapsulation=shadow","src/components/insight/result-templates/atomic-insight-result-children/atomic-insight-result-children.tsx"],"sourcesContent":["@import '../../../../components/common/result-children/result-children.pcss';\n\n[part='children-root'] {\n @apply border-neutral border-l;\n padding-left: 1rem;\n margin-top: 1rem;\n}\n","import {\n buildInteractiveResult as buildInsightInteractiveResult,\n FoldedResultListState as InsightFoldedResultListState,\n FoldedResult as InsightFoldedResult,\n FoldedResultList as InsightFoldedResultList,\n} from '@coveo/headless/insight';\nimport {Component, Element, State, h, Listen, Prop} from '@stencil/core';\nimport {buildCustomEvent} from '../../../../utils/event-utils';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {elementHasAncestorTag} from '../../../../utils/utils';\nimport {extractUnfoldedItem} from '../../../common/item-list/unfolded-item';\nimport {\n FoldedItemListContext,\n FoldedItemListStateContext,\n} from '../../../common/item-list/item-list-decorators';\nimport {ItemTemplateProvider} from '../../../common/item-list/item-template-provider';\nimport {\n ChildTemplatesContext,\n ChildTemplatesContextEvent,\n DisplayConfig,\n ItemContext,\n ItemDisplayConfigContext,\n} from '../../../common/item-list/stencil-item-decorators';\nimport {ItemDisplayImageSize} from '../../../common/layout/display-options';\nimport {ChildrenWrapper} from '../../../common/result-children/children-wrapper';\nimport {CollectionGuard} from '../../../common/result-children/collection-guard';\nimport {ResultChildrenGuard} from '../../../common/result-children/guard';\nimport {ShowHideButton} from '../../../common/result-children/show-hide-button';\nimport {InsightBindings} from '../../atomic-insight-interface/atomic-insight-interface';\n\nconst childTemplateComponent = 'atomic-insight-result-children-template';\nconst componentTag = 'atomic-insight-result-children';\n\n/**\n * @internal\n */\n@Component({\n tag: 'atomic-insight-result-children',\n styleUrl: 'atomic-insight-result-children.pcss',\n shadow: true,\n})\nexport class AtomicResultChildren\n implements InitializableComponent<InsightBindings>\n{\n @InitializeBindings() public bindings!: InsightBindings;\n @ChildTemplatesContext()\n public itemTemplateProvider?: ItemTemplateProvider;\n @FoldedItemListContext()\n private foldedResultList!: InsightFoldedResultList;\n @ItemContext({folded: true, parentName: 'atomic-insight-result'})\n private result!: InsightFoldedResult;\n @ItemDisplayConfigContext()\n private displayConfig!: DisplayConfig;\n private initialChildren!: InsightFoldedResult[];\n\n @Element() public host!: HTMLDivElement;\n @State() public error!: Error;\n @State() private resultTemplateRegistered = false;\n @State() private templateHasError = false;\n @FoldedItemListStateContext()\n @State()\n private foldedResultListState!: InsightFoldedResultListState;\n @State()\n private showInitialChildren = false;\n\n /**\n * Whether to inherit templates defined in a parent atomic-result-children. Only works for the second level of child nesting.\n */\n @Prop() inheritTemplates = false;\n /**\n * The expected size of the image displayed in the children results.\n */\n @Prop({reflect: true}) imageSize?: ItemDisplayImageSize;\n /**\n * The non-localized copy for an empty result state. An empty string will result in the component being hidden.\n */\n @Prop() public noResultText = 'no-documents-related';\n\n @Listen('atomic/resolveChildTemplates')\n public resolveChildTemplates(event: ChildTemplatesContextEvent) {\n event.preventDefault();\n event.detail(this.itemTemplateProvider);\n }\n\n public initialize() {\n if (this.inheritTemplates) {\n return;\n }\n\n const childrenTemplates = Array.from(\n this.host.querySelectorAll(childTemplateComponent)\n ).filter(\n (template) => !elementHasAncestorTag(template, childTemplateComponent)\n );\n\n if (!childrenTemplates.length) {\n this.error = new Error(\n `The \"${componentTag}\" component requires at least one \"${childTemplateComponent}\" component.`\n );\n return;\n }\n\n this.itemTemplateProvider = new ItemTemplateProvider({\n includeDefaultTemplate: false,\n templateElements: childrenTemplates,\n getResultTemplateRegistered: () => this.resultTemplateRegistered,\n getTemplateHasError: () => this.templateHasError,\n setResultTemplateRegistered: (value: boolean) => {\n this.resultTemplateRegistered = value;\n },\n setTemplateHasError: (value: boolean) => {\n this.templateHasError = value;\n },\n bindings: this.bindings,\n });\n }\n\n private renderChild(child: InsightFoldedResult, isLast: boolean) {\n const content = this.itemTemplateProvider?.getTemplateContent(child.result);\n\n if (!content) {\n return;\n }\n\n const key =\n child.result.uniqueId +\n child.children.map((child) => child.result.uniqueId);\n return (\n <atomic-insight-result\n key={key}\n content={content}\n result={child}\n interactiveResult={buildInsightInteractiveResult(this.bindings.engine, {\n options: {result: extractUnfoldedItem(child)},\n })}\n store={this.bindings.store}\n density={this.displayConfig.density}\n imageSize={this.imageSize || this.displayConfig.imageSize}\n classes={`child-result ${isLast ? 'last-child' : ''}`.trim()}\n ></atomic-insight-result>\n );\n }\n\n public componentWillRender() {\n if (this.initialChildren || !this.collection) {\n return;\n }\n\n this.initialChildren = this.collection.children;\n }\n\n private get collection() {\n return this.foldedResultListState.results.find((r) => {\n return r.result.uniqueId === this.result.result.uniqueId;\n });\n }\n\n private loadFullCollection() {\n this.host.dispatchEvent(\n buildCustomEvent('atomic/loadCollection', this.collection)\n );\n }\n private toggleShowInitialChildren = () => {\n this.showInitialChildren\n ? this.foldedResultList.logShowMoreFoldedResults(this.result.result)\n : this.foldedResultList.logShowLessFoldedResults();\n\n this.showInitialChildren = !this.showInitialChildren;\n };\n private renderCollection() {\n const collection = this.collection!;\n\n const children = this.showInitialChildren\n ? this.initialChildren\n : collection.children;\n\n return (\n <CollectionGuard\n isLoadingMoreResults={collection.isLoadingMoreResults}\n moreResultsAvailable={collection.moreResultsAvailable}\n hasChildren={collection.children.length > 0}\n numberOfChildren={collection.children.length}\n density={this.displayConfig.density}\n imageSize={this.imageSize || this.displayConfig.imageSize}\n noResultText={this.bindings.i18n.t(this.noResultText)}\n >\n <ShowHideButton\n moreResultsAvailable={collection.moreResultsAvailable}\n loadFullCollection={() => this.loadFullCollection()}\n showInitialChildren={this.showInitialChildren}\n toggleShowInitialChildren={this.toggleShowInitialChildren}\n loadAllResults={this.bindings.i18n.t('load-all-results')}\n collapseResults={this.bindings.i18n.t('collapse-results')}\n ></ShowHideButton>\n <ChildrenWrapper hasChildren={collection.children.length > 0}>\n {children.map((child, i) =>\n this.renderChild(child, i === children.length - 1)\n )}\n </ChildrenWrapper>\n </CollectionGuard>\n );\n }\n\n private renderFoldedResult() {\n if (this.result.children.length === 0) {\n return;\n }\n\n const children = this.result.children;\n\n return (\n <ChildrenWrapper hasChildren={children.length > 0}>\n {children.map((child, i) =>\n this.renderChild(child, i === children.length - 1)\n )}\n </ChildrenWrapper>\n );\n }\n\n public render() {\n return (\n <ResultChildrenGuard\n inheritTemplates={this.inheritTemplates}\n resultTemplateRegistered={this.resultTemplateRegistered}\n templateHasError={this.templateHasError}\n >\n {this.collection ? this.renderCollection() : this.renderFoldedResult()}\n </ResultChildrenGuard>\n );\n }\n}\n"],"version":3}
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, g as getElement } from './index-3f35faca.js';
2
- import { M as MapProp } from './props-utils-8e3d7f26.js';
2
+ import { M as MapProp } from './props-utils-e17fa18c.js';
3
3
  import { R as ResultTemplateCommon, a as makeDefinedConditions, m as makeMatchConditions } from './result-template-common-0eb26069.js';
4
4
  import '@coveo/bueno';
5
5
  import './utils-30b00491.js';
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, h, g as getElement } from './index-3f35faca.js';
2
2
  import { buildFacetConditionsManager, buildDateRange, deserializeRelativeDate, buildSearchStatus, buildDateFacet, buildDateFilter, loadDateFacetSetActions } from '@coveo/headless/insight';
3
3
  import { I as InitializeBindings, B as BindStateToController } from './initialization-utils-ff3edf9a.js';
4
- import { M as MapProp } from './props-utils-8e3d7f26.js';
4
+ import { M as MapProp } from './props-utils-e17fa18c.js';
5
5
  import { F as FocusTargetController } from './stencil-accessibility-utils-bc273be5.js';
6
6
  import { p as parseDependsOn } from './depends-on-d73b0ce3.js';
7
7
  import { F as FacetPlaceholder } from './facet-placeholder-ecbe6e6f.js';
@@ -55,7 +55,7 @@ const AtomicIPXResultLink = class {
55
55
  const href = isUndefined(this.hrefTemplate)
56
56
  ? this.result.clickUri
57
57
  : buildStringTemplateFromResult(this.hrefTemplate, this.result, this.bindings);
58
- return (h(LinkWithItemAnalytics, { key: '90ec925d03c550bcf520e8d574a9ddaeda6ae74a', href: href, onSelect: () => this.onSelect(), onBeginDelayedSelect: () => this.interactiveResult.beginDelayedSelect(), onCancelPendingSelect: () => this.interactiveResult.cancelPendingSelect(), attributes: this.linkAttributes, stopPropagation: this.stopPropagation }, this.hasDefaultSlot ? (h("slot", null)) : (h("atomic-result-text", { field: "title", default: "no-title" }))));
58
+ return (h(LinkWithItemAnalytics, { key: 'c36a990dd66b1deda2d5c6a5ba5622e487013617', href: href, onSelect: () => this.onSelect(), onBeginDelayedSelect: () => this.interactiveResult.beginDelayedSelect(), onCancelPendingSelect: () => this.interactiveResult.cancelPendingSelect(), attributes: this.linkAttributes, stopPropagation: this.stopPropagation }, this.hasDefaultSlot ? (h("slot", null)) : (h("atomic-result-text", { field: "title", default: "no-title" }))));
59
59
  }
60
60
  get host() { return getElement(this); }
61
61
  };
@@ -1 +1 @@
1
- {"file":"atomic-ipx-result-link.entry.js","mappings":";;;;;;;;;;;;;;;;AAAA,MAAM,sBAAsB,GAAG,ui3DAAui3D,CAAC;AACvk3D,kCAAe,sBAAsB;;;;;;;;;;;;MCiCxB,mBAAmB;;;;;IA6BvB,UAAU;QACf,IAAI,CAAC,IAAI,CAAC,aAAa,CACrB,gBAAgB,CACd,+BAA+B,EAC/B,CAAC,eAAwB;YACvB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;SACxC,CACF,CACF,CAAC;QACF,IAAI,CAAC,qBAAqB,GAAG,4BAA4B,CACvD,IAAI,CAAC,QAAQ,CAAC,MAAM,CACrB,CAAC;KACH;IAEM,iBAA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F4B;IAA5B,kBAAkB,EAAE;qDAAgC;AAG5B;IAAxB,aAAa,EAAE;mDAAkC;AACd;IAAnC,wBAAwB,EAAE;8DAA+C;;;;;","names":[],"sources":["src/components/ipx/atomic-ipx-result-link/atomic-ipx-result-link.pcss?tag=atomic-ipx-result-link","src/components/ipx/atomic-ipx-result-link/atomic-ipx-result-link.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n@import '../../../utils/tailwind-utilities/link-style.tw.css';\n\natomic-ipx-result-link {\n a {\n @apply link-style;\n }\n}\n","import {isUndefined} from '@coveo/bueno';\nimport {\n IPXActionsHistoryActionCreators,\n InteractiveResult,\n loadIPXActionsHistoryActions,\n} from '@coveo/headless';\nimport {Component, h, Prop, Element} from '@stencil/core';\nimport {buildCustomEvent} from '../../../utils/event-utils';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {buildStringTemplateFromResult} from '../../../utils/result-utils';\nimport {getDefaultSlotFromHost} from '../../../utils/slot-utils';\nimport {AnyUnfoldedItem} from '../../common/interface/item';\nimport {getAttributesFromLinkSlot} from '../../common/item-link/attributes-slot';\nimport {LinkWithItemAnalytics} from '../../common/item-link/stencil-item-link';\nimport {RecsBindings} from '../../recommendations/atomic-recs-interface/atomic-recs-interface';\nimport {\n ResultContext,\n InteractiveResultContext,\n} from '../../search/result-template-components/result-template-decorators';\n\n/**\n * The `atomic-ipx-result-link` component automatically transforms a search result title into a clickable link that points to the original item. It is an experimental internal component not intended for general use.\n * @slot default - Lets you display alternative content inside the link\n * @slot attributes - Lets you pass [attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attributes) down to the link element, overriding other attributes, to be used exclusively with an \"a\" tag such as `<a slot=\"attributes\" target=\"_blank\" download></a>`.\n * @internal\n */\n@Component({\n tag: 'atomic-ipx-result-link',\n styleUrl: 'atomic-ipx-result-link.pcss',\n shadow: false,\n})\nexport class AtomicIPXResultLink\n implements InitializableComponent<RecsBindings>\n{\n @InitializeBindings() public bindings!: RecsBindings;\n public error!: Error;\n\n @ResultContext() private result!: AnyUnfoldedItem;\n @InteractiveResultContext() private interactiveResult!: InteractiveResult;\n\n @Element() private host!: HTMLElement;\n\n /**\n * Specifies a template literal from which to generate the `href` attribute value (see\n * [Template literals](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals)).\n *\n * The template literal can reference any number of result properties from the parent result. It can also reference the window object.\n *\n * For example, the following markup generates an `href` value such as `http://uri.com?id=itemTitle`, using the result's `clickUri` and `itemtitle` fields.\n * ```html\n * <atomic-ipx-result-link href-template='${clickUri}?id=${raw.itemtitle}'></atomic-ipx-result-link>\n * ```\n */\n @Prop({reflect: true}) hrefTemplate?: string;\n\n private hasDefaultSlot!: boolean;\n private linkAttributes?: Attr[];\n private stopPropagation?: boolean;\n private actionsHistoryActions?: IPXActionsHistoryActionCreators;\n\n public initialize() {\n this.host.dispatchEvent(\n buildCustomEvent(\n 'atomic/resolveStopPropagation',\n (stopPropagation: boolean) => {\n this.stopPropagation = stopPropagation;\n }\n )\n );\n this.actionsHistoryActions = loadIPXActionsHistoryActions(\n this.bindings.engine\n );\n }\n\n public connectedCallback() {\n const slotName = 'attributes';\n this.hasDefaultSlot = !!getDefaultSlotFromHost(this.host);\n this.linkAttributes = getAttributesFromLinkSlot(this.host, slotName);\n }\n\n public async onSelect() {\n const resultPermanentId = this.result.raw.permanentid;\n if (resultPermanentId && this.actionsHistoryActions) {\n const action =\n this.actionsHistoryActions.addPageViewEntryInActionsHistory(\n resultPermanentId\n );\n this.bindings.engine.dispatch(action);\n }\n this.interactiveResult.select();\n }\n\n public render() {\n const href = isUndefined(this.hrefTemplate)\n ? this.result.clickUri\n : buildStringTemplateFromResult(\n this.hrefTemplate,\n this.result,\n this.bindings\n );\n\n return (\n <LinkWithItemAnalytics\n href={href}\n onSelect={() => this.onSelect()}\n onBeginDelayedSelect={() => this.interactiveResult.beginDelayedSelect()}\n onCancelPendingSelect={() =>\n this.interactiveResult.cancelPendingSelect()\n }\n attributes={this.linkAttributes}\n stopPropagation={this.stopPropagation}\n >\n {this.hasDefaultSlot ? (\n <slot />\n ) : (\n <atomic-result-text\n field=\"title\"\n default=\"no-title\"\n ></atomic-result-text>\n )}\n </LinkWithItemAnalytics>\n );\n }\n}\n"],"version":3}
1
+ {"file":"atomic-ipx-result-link.entry.js","mappings":";;;;;;;;;;;;;;;;AAAA,MAAM,sBAAsB,GAAG,ui3DAAui3D,CAAC;AACvk3D,kCAAe,sBAAsB;;;;;;;;;;;;MCiCxB,mBAAmB;;;;;IA6BvB,UAAU;QACf,IAAI,CAAC,IAAI,CAAC,aAAa,CACrB,gBAAgB,CACd,+BAA+B,EAC/B,CAAC,eAAwB;YACvB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;SACxC,CACF,CACF,CAAC;QACF,IAAI,CAAC,qBAAqB,GAAG,4BAA4B,CACvD,IAAI,CAAC,QAAQ,CAAC,MAAM,CACrB,CAAC;KACH;IAEM,iBAAiB;QACtB,MAAM,QAAQ,GAAG,YAAY,CAAC;QAC9B,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1D,IAAI,CAAC,cAAc,GAAG,yBAAyB,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;KACtE;IAEM,MAAM,QAAQ;QACnB,MAAM,iBAAiB,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC;QACtD,IAAI,iBAAiB,IAAI,IAAI,CAAC,qBAAqB,EAAE;YACnD,MAAM,MAAM,GACV,IAAI,CAAC,qBAAqB,CAAC,gCAAgC,CACzD,iBAAiB,CAClB,CAAC;YACJ,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;SACvC;QACD,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC;KACjC;IAEM,MAAM;QACX,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC;cACvC,IAAI,CAAC,MAAM,CAAC,QAAQ;cACpB,6BAA6B,CAC3B,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,QAAQ,CACd,CAAC;QAEN,QACE,EAAC,qBAAqB,qDACpB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE,EAC/B,oBAAoB,EAAE,MAAM,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,EAAE,EACvE,qBAAqB,EAAE,MACrB,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,EAAE,EAE9C,UAAU,EAAE,IAAI,CAAC,cAAc,EAC/B,eAAe,EAAE,IAAI,CAAC,eAAe,IAEpC,IAAI,CAAC,cAAc,IAClB,eAAQ,KAER,0BACE,KAAK,EAAC,OAAO,EACb,OAAO,EAAC,UAAU,GACE,CACvB,CACqB,EACxB;KACH;;;AAxF4B;IAA5B,kBAAkB,EAAE;qDAAgC;AAG5B;IAAxB,aAAa,EAAE;mDAAkC;AACd;IAAnC,wBAAwB,EAAE;8DAA+C;;;;;","names":[],"sources":["src/components/ipx/atomic-ipx-result-link/atomic-ipx-result-link.pcss?tag=atomic-ipx-result-link","src/components/ipx/atomic-ipx-result-link/atomic-ipx-result-link.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n@import '../../../utils/tailwind-utilities/link-style.tw.css';\n\natomic-ipx-result-link {\n a {\n @apply link-style;\n }\n}\n","import {isUndefined} from '@coveo/bueno';\nimport {\n IPXActionsHistoryActionCreators,\n InteractiveResult,\n loadIPXActionsHistoryActions,\n} from '@coveo/headless';\nimport {Component, h, Prop, Element} from '@stencil/core';\nimport {buildCustomEvent} from '../../../utils/event-utils';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {buildStringTemplateFromResult} from '../../../utils/result-utils';\nimport {getDefaultSlotFromHost} from '../../../utils/slot-utils';\nimport {AnyUnfoldedItem} from '../../common/item-list/unfolded-item';\nimport {getAttributesFromLinkSlot} from '../../common/item-link/attributes-slot';\nimport {LinkWithItemAnalytics} from '../../common/item-link/stencil-item-link';\nimport {RecsBindings} from '../../recommendations/atomic-recs-interface/atomic-recs-interface';\nimport {\n ResultContext,\n InteractiveResultContext,\n} from '../../search/result-template-components/result-template-decorators';\n\n/**\n * The `atomic-ipx-result-link` component automatically transforms a search result title into a clickable link that points to the original item. It is an experimental internal component not intended for general use.\n * @slot default - Lets you display alternative content inside the link\n * @slot attributes - Lets you pass [attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attributes) down to the link element, overriding other attributes, to be used exclusively with an \"a\" tag such as `<a slot=\"attributes\" target=\"_blank\" download></a>`.\n * @internal\n */\n@Component({\n tag: 'atomic-ipx-result-link',\n styleUrl: 'atomic-ipx-result-link.pcss',\n shadow: false,\n})\nexport class AtomicIPXResultLink\n implements InitializableComponent<RecsBindings>\n{\n @InitializeBindings() public bindings!: RecsBindings;\n public error!: Error;\n\n @ResultContext() private result!: AnyUnfoldedItem;\n @InteractiveResultContext() private interactiveResult!: InteractiveResult;\n\n @Element() private host!: HTMLElement;\n\n /**\n * Specifies a template literal from which to generate the `href` attribute value (see\n * [Template literals](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals)).\n *\n * The template literal can reference any number of result properties from the parent result. It can also reference the window object.\n *\n * For example, the following markup generates an `href` value such as `http://uri.com?id=itemTitle`, using the result's `clickUri` and `itemtitle` fields.\n * ```html\n * <atomic-ipx-result-link href-template='${clickUri}?id=${raw.itemtitle}'></atomic-ipx-result-link>\n * ```\n */\n @Prop({reflect: true}) hrefTemplate?: string;\n\n private hasDefaultSlot!: boolean;\n private linkAttributes?: Attr[];\n private stopPropagation?: boolean;\n private actionsHistoryActions?: IPXActionsHistoryActionCreators;\n\n public initialize() {\n this.host.dispatchEvent(\n buildCustomEvent(\n 'atomic/resolveStopPropagation',\n (stopPropagation: boolean) => {\n this.stopPropagation = stopPropagation;\n }\n )\n );\n this.actionsHistoryActions = loadIPXActionsHistoryActions(\n this.bindings.engine\n );\n }\n\n public connectedCallback() {\n const slotName = 'attributes';\n this.hasDefaultSlot = !!getDefaultSlotFromHost(this.host);\n this.linkAttributes = getAttributesFromLinkSlot(this.host, slotName);\n }\n\n public async onSelect() {\n const resultPermanentId = this.result.raw.permanentid;\n if (resultPermanentId && this.actionsHistoryActions) {\n const action =\n this.actionsHistoryActions.addPageViewEntryInActionsHistory(\n resultPermanentId\n );\n this.bindings.engine.dispatch(action);\n }\n this.interactiveResult.select();\n }\n\n public render() {\n const href = isUndefined(this.hrefTemplate)\n ? this.result.clickUri\n : buildStringTemplateFromResult(\n this.hrefTemplate,\n this.result,\n this.bindings\n );\n\n return (\n <LinkWithItemAnalytics\n href={href}\n onSelect={() => this.onSelect()}\n onBeginDelayedSelect={() => this.interactiveResult.beginDelayedSelect()}\n onCancelPendingSelect={() =>\n this.interactiveResult.cancelPendingSelect()\n }\n attributes={this.linkAttributes}\n stopPropagation={this.stopPropagation}\n >\n {this.hasDefaultSlot ? (\n <slot />\n ) : (\n <atomic-result-text\n field=\"title\"\n default=\"no-title\"\n ></atomic-result-text>\n )}\n </LinkWithItemAnalytics>\n );\n }\n}\n"],"version":3}
@@ -2,7 +2,7 @@ import { r as registerInstance, h, g as getElement } from './index-3f35faca.js';
2
2
  import { Schema, StringValue } from '@coveo/bueno';
3
3
  import { buildSearchStatus, buildTabManager, buildNumericFacet, buildNumericRange, buildNumericFilter, buildFacetConditionsManager, loadNumericFacetSetActions } from '@coveo/headless';
4
4
  import { I as InitializeBindings, B as BindStateToController } from './initialization-utils-ff3edf9a.js';
5
- import { A as ArrayProp, M as MapProp } from './props-utils-8e3d7f26.js';
5
+ import { A as ArrayProp, M as MapProp } from './props-utils-e17fa18c.js';
6
6
  import { F as FocusTargetController } from './stencil-accessibility-utils-bc273be5.js';
7
7
  import { r as randomID } from './utils-30b00491.js';
8
8
  import { p as parseDependsOn } from './depends-on-d73b0ce3.js';
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h, g as getElement } from './index-3f35faca.js';
2
- import { M as MapProp } from './props-utils-8e3d7f26.js';
2
+ import { M as MapProp } from './props-utils-e17fa18c.js';
3
3
  import './purify-c7ebd240.js';
4
4
  import { ProductTemplatesHelpers } from '@coveo/headless/commerce';
5
5
  import { P as ProductContext } from './stencil-product-template-decorators-58cfc116.js';
@@ -3,7 +3,7 @@ import { Schema, StringValue } from '@coveo/bueno';
3
3
  import { buildSearchStatus, buildTabManager, buildNumericFacet, buildFacetConditionsManager, buildNumericRange } from '@coveo/headless';
4
4
  import { S as Star, R as Rating } from './atomic-rating-c16526af.js';
5
5
  import { I as InitializeBindings, B as BindStateToController, H as Hidden } from './initialization-utils-ff3edf9a.js';
6
- import { A as ArrayProp, M as MapProp } from './props-utils-8e3d7f26.js';
6
+ import { A as ArrayProp, M as MapProp } from './props-utils-e17fa18c.js';
7
7
  import { F as FocusTargetController } from './stencil-accessibility-utils-bc273be5.js';
8
8
  import { p as parseDependsOn } from './depends-on-d73b0ce3.js';
9
9
  import { F as FacetHeader, a as FacetContainer } from './stencil-facet-header-6a0bb1d4.js';
@@ -2,7 +2,7 @@ import { r as registerInstance, h, g as getElement } from './index-3f35faca.js';
2
2
  import { buildSearchStatus, buildTabManager, buildNumericFacet, buildFacetConditionsManager, buildNumericRange } from '@coveo/headless';
3
3
  import { S as Star, R as Rating } from './atomic-rating-c16526af.js';
4
4
  import { I as InitializeBindings, B as BindStateToController, H as Hidden } from './initialization-utils-ff3edf9a.js';
5
- import { A as ArrayProp, M as MapProp } from './props-utils-8e3d7f26.js';
5
+ import { A as ArrayProp, M as MapProp } from './props-utils-e17fa18c.js';
6
6
  import { F as FocusTargetController } from './stencil-accessibility-utils-bc273be5.js';
7
7
  import { p as parseDependsOn } from './depends-on-d73b0ce3.js';
8
8
  import { F as FacetHeader, a as FacetContainer } from './stencil-facet-header-6a0bb1d4.js';
@@ -1,8 +1,8 @@
1
1
  import { r as registerInstance, s as setNonce, h, g as getElement } from './index-3f35faca.js';
2
2
  import { m as markParentAsReady } from './init-queue-fbe942c3.js';
3
3
  import { loadRecommendationActions, loadSearchConfigurationActions, EcommerceDefaultFieldsToInclude, loadFieldActions, buildRecommendationEngine } from '@coveo/headless/recommendation';
4
- import { g as getNextAnalyticsConfig, c as augmentAnalyticsConfigWithDocument, d as augmentAnalyticsConfigWithAtomicVersion, a as augmentWithExternalMiddleware, b as augmentAnalyticsWithAtomicVersion, C as CommonAtomicInterfaceHelper, i as instance, m as mismatchedInterfaceAndEnginePropError } from './analytics-config-f3b2c9ea.js';
5
- import { A as ArrayProp } from './props-utils-8e3d7f26.js';
4
+ import { g as getNextAnalyticsConfig, c as augmentAnalyticsConfigWithDocument, d as augmentAnalyticsConfigWithAtomicVersion, a as augmentWithExternalMiddleware, b as augmentAnalyticsWithAtomicVersion, C as CommonAtomicInterfaceHelper, i as instance, m as mismatchedInterfaceAndEnginePropError } from './analytics-config-e2c4641d.js';
5
+ import { A as ArrayProp } from './props-utils-e17fa18c.js';
6
6
  import { u as unsetLoadingFlag, s as setLoadingFlag, a as createBaseStore } from './store-5fcae420.js';
7
7
  import './dayjs.min-d04628c6.js';
8
8
  import './_commonjsHelpers-1789f0cf.js';
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, g as getElement } from './index-3f35faca.js';
2
- import { M as MapProp } from './props-utils-8e3d7f26.js';
2
+ import { M as MapProp } from './props-utils-e17fa18c.js';
3
3
  import { R as ResultTemplateCommon, a as makeDefinedConditions, m as makeMatchConditions } from './result-template-common-0eb26069.js';
4
4
  import '@coveo/bueno';
5
5
  import './utils-30b00491.js';
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, g as getElement } from './index-3f35faca.js';
2
- import { M as MapProp } from './props-utils-8e3d7f26.js';
2
+ import { M as MapProp } from './props-utils-e17fa18c.js';
3
3
  import { R as ResultTemplateCommon, m as makeMatchConditions } from './result-template-common-0eb26069.js';
4
4
  import '@coveo/bueno';
5
5
  import './utils-30b00491.js';
@@ -3,7 +3,7 @@ import { buildInteractiveResult } from '@coveo/headless';
3
3
  import { b as buildCustomEvent } from './event-utils-8de63ec3.js';
4
4
  import { I as InitializeBindings } from './initialization-utils-ff3edf9a.js';
5
5
  import { g as elementHasAncestorTag } from './utils-30b00491.js';
6
- import { e as extractUnfoldedItem } from './item-813944d1.js';
6
+ import { e as extractUnfoldedItem } from './unfolded-item-c5795c0f.js';
7
7
  import { F as FoldedItemListContext, a as FoldedItemListStateContext, b as CollectionGuard, C as ChildrenWrapper, S as ShowHideButton, R as ResultChildrenGuard } from './show-hide-button-caaec7b0.js';
8
8
  import { I as ItemTemplateProvider } from './item-template-provider-35bf0685.js';
9
9
  import { C as ChildTemplatesContext, b as ItemDisplayConfigContext } from './stencil-item-decorators-6c453c11.js';
@@ -136,7 +136,7 @@ const AtomicResultChildren = class {
136
136
  return (h(ChildrenWrapper, { hasChildren: children.length > 0 }, children.map((child, i) => this.renderChild(child, i === children.length - 1))));
137
137
  }
138
138
  render() {
139
- return (h(ResultChildrenGuard, { key: '717045df4bd68be2f64d8c2d9091f05a763e55ed', inheritTemplates: this.inheritTemplates, resultTemplateRegistered: this.resultTemplateRegistered, templateHasError: this.templateHasError }, this.collection ? this.renderCollection() : this.renderFoldedResult()));
139
+ return (h(ResultChildrenGuard, { key: '5edced5861dc337703495a9bac6915cae2b4ed3d', inheritTemplates: this.inheritTemplates, resultTemplateRegistered: this.resultTemplateRegistered, templateHasError: this.templateHasError }, this.collection ? this.renderCollection() : this.renderFoldedResult()));
140
140
  }
141
141
  get host() { return getElement(this); }
142
142
  };