@coveo/atomic 3.33.9-pre.93c986e63b → 3.33.9-pre.99566f9dae

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 (290) hide show
  1. package/dist/atomic/_atomic.esm.js +1 -1
  2. package/dist/atomic/components/_index.js +19 -19
  3. package/dist/atomic/components/analytics-config.js +1 -1
  4. package/dist/atomic/components/atomic-field-condition.js +1 -1
  5. package/dist/atomic/components/atomic-field-condition.js.map +1 -1
  6. package/dist/atomic/components/atomic-insight-result-action.js +2 -2
  7. package/dist/atomic/components/atomic-insight-result-action.js.map +1 -1
  8. package/dist/atomic/components/atomic-insight-result-attach-to-case-action.js +2 -2
  9. package/dist/atomic/components/atomic-insight-result-attach-to-case-action.js.map +1 -1
  10. package/dist/atomic/components/atomic-insight-result-attach-to-case-indicator.js +2 -2
  11. package/dist/atomic/components/atomic-insight-result-attach-to-case-indicator.js.map +1 -1
  12. package/dist/atomic/components/atomic-insight-result-quickview-action.js +2 -2
  13. package/dist/atomic/components/atomic-insight-result-quickview-action.js.map +1 -1
  14. package/dist/atomic/components/atomic-ipx-result-link.js +2 -2
  15. package/dist/atomic/components/atomic-ipx-result-link.js.map +1 -1
  16. package/dist/atomic/components/atomic-quickview-modal2.js +1 -1
  17. package/dist/atomic/components/atomic-quickview.js +2 -2
  18. package/dist/atomic/components/atomic-quickview.js.map +1 -1
  19. package/dist/atomic/components/atomic-result-badge.js +1 -1
  20. package/dist/atomic/components/atomic-result-badge.js.map +1 -1
  21. package/dist/atomic/components/atomic-result-children.js +2 -2
  22. package/dist/atomic/components/atomic-result-children.js.map +1 -1
  23. package/dist/atomic/components/atomic-result-date.js +1 -1
  24. package/dist/atomic/components/atomic-result-date.js.map +1 -1
  25. package/dist/atomic/components/atomic-result-fields-list.js +2 -2
  26. package/dist/atomic/components/atomic-result-fields-list.js.map +1 -1
  27. package/dist/atomic/components/atomic-result-html.js +1 -1
  28. package/dist/atomic/components/atomic-result-html.js.map +1 -1
  29. package/dist/atomic/components/atomic-result-icon.js +1 -1
  30. package/dist/atomic/components/atomic-result-icon.js.map +1 -1
  31. package/dist/atomic/components/atomic-result-image.js +1 -1
  32. package/dist/atomic/components/atomic-result-image.js.map +1 -1
  33. package/dist/atomic/components/atomic-result-link.js +2 -2
  34. package/dist/atomic/components/atomic-result-link.js.map +1 -1
  35. package/dist/atomic/components/atomic-result-localized-text.js +1 -1
  36. package/dist/atomic/components/atomic-result-localized-text.js.map +1 -1
  37. package/dist/atomic/components/atomic-result-multi-value-text.js +1 -1
  38. package/dist/atomic/components/atomic-result-multi-value-text.js.map +1 -1
  39. package/dist/atomic/components/atomic-result-number.js +1 -1
  40. package/dist/atomic/components/atomic-result-number.js.map +1 -1
  41. package/dist/atomic/components/atomic-result-printable-uri.js +1 -1
  42. package/dist/atomic/components/atomic-result-printable-uri.js.map +1 -1
  43. package/dist/atomic/components/atomic-result-rating.js +1 -1
  44. package/dist/atomic/components/atomic-result-rating.js.map +1 -1
  45. package/dist/atomic/components/atomic-result-text2.js +1 -1
  46. package/dist/atomic/components/atomic-result-text2.js.map +1 -1
  47. package/dist/atomic/components/atomic-result-timespan.js +1 -1
  48. package/dist/atomic/components/atomic-result-timespan.js.map +1 -1
  49. package/dist/atomic/components/atomic-result2.js.map +1 -1
  50. package/dist/atomic/components/atomic-smart-snippet-source2.js +1 -1
  51. package/dist/atomic/components/atomic-smart-snippet-source2.js.map +1 -1
  52. package/dist/atomic/components/components/commerce/atomic-commerce-breadbox/atomic-commerce-breadbox.js +24 -12
  53. package/dist/atomic/components/components/commerce/atomic-product-children/atomic-product-children.js +1 -1
  54. package/dist/atomic/components/components/commerce/atomic-product-description/atomic-product-description.js +1 -1
  55. package/dist/atomic/components/components/commerce/atomic-product-excerpt/atomic-product-excerpt.js +1 -1
  56. package/dist/atomic/components/components/commerce/atomic-product-field-condition/atomic-product-field-condition.js +1 -1
  57. package/dist/atomic/components/components/commerce/atomic-product-image/atomic-product-image.js +1 -1
  58. package/dist/atomic/components/components/commerce/atomic-product-link/atomic-product-link.js +2 -1
  59. package/dist/atomic/components/components/commerce/atomic-product-multi-value-text/atomic-product-multi-value-text.js +1 -1
  60. package/dist/atomic/components/components/commerce/atomic-product-numeric-field-value/atomic-product-numeric-field-value.js +1 -1
  61. package/dist/atomic/components/components/commerce/atomic-product-price/atomic-product-price.js +1 -1
  62. package/dist/atomic/components/components/commerce/atomic-product-rating/atomic-product-rating.js +1 -1
  63. package/dist/atomic/components/components/commerce/atomic-product-text/atomic-product-text.js +1 -1
  64. package/dist/atomic/components/components/commerce/product-template-component-utils/context/interactive-product-context-controller.js +25 -0
  65. package/dist/atomic/components/components/commerce/product-template-component-utils/context/product-context-controller.js +29 -0
  66. package/dist/atomic/components/components/common/index.js +0 -1
  67. package/dist/atomic/components/components/common/lazy-index.js +0 -1
  68. package/dist/atomic/components/global/environment.js +1 -1
  69. package/dist/atomic/components/index.js.map +1 -1
  70. package/dist/atomic/components/{result-template-decorators.js → stencil-result-template-decorators.js} +6 -2
  71. package/dist/atomic/components/stencil-result-template-decorators.js.map +1 -0
  72. package/dist/atomic/index.esm.js +1 -1
  73. package/dist/atomic/index.esm.js.map +1 -1
  74. package/dist/atomic/{p-0c8e7d5f.entry.js → p-0112f957.entry.js} +2 -2
  75. package/dist/atomic/p-0112f957.entry.js.map +1 -0
  76. package/dist/atomic/{p-a4d277c7.entry.js → p-037de646.entry.js} +2 -2
  77. package/dist/atomic/p-037de646.entry.js.map +1 -0
  78. package/dist/atomic/{p-4069d801.entry.js → p-268ce7ca.entry.js} +2 -2
  79. package/dist/atomic/p-268ce7ca.entry.js.map +1 -0
  80. package/dist/atomic/{p-e9dc8e90.entry.js → p-3ec45f9c.entry.js} +2 -2
  81. package/dist/atomic/p-3ec45f9c.entry.js.map +1 -0
  82. package/dist/atomic/{p-18684d4c.js → p-4080f740.js} +1 -1
  83. package/dist/atomic/p-4080f740.js.map +1 -0
  84. package/dist/atomic/{p-62afcf79.entry.js → p-42617c90.entry.js} +2 -2
  85. package/dist/atomic/p-42617c90.entry.js.map +1 -0
  86. package/dist/atomic/{p-3e38aea6.entry.js → p-48d78fc6.entry.js} +2 -2
  87. package/dist/atomic/{p-190ddaca.entry.js → p-4cf97b0a.entry.js} +2 -2
  88. package/dist/atomic/p-4cf97b0a.entry.js.map +1 -0
  89. package/dist/atomic/{p-2e4628bb.entry.js → p-5894d6f6.entry.js} +2 -2
  90. package/dist/atomic/p-5894d6f6.entry.js.map +1 -0
  91. package/dist/atomic/{p-78427c6a.entry.js → p-5a9460ab.entry.js} +2 -2
  92. package/dist/atomic/p-5a9460ab.entry.js.map +1 -0
  93. package/dist/atomic/{p-fafd5042.entry.js → p-5f2abcb4.entry.js} +2 -2
  94. package/dist/atomic/p-5f2abcb4.entry.js.map +1 -0
  95. package/dist/atomic/{p-77166ea4.js → p-68896e7d.js} +2 -2
  96. package/dist/atomic/{p-1ff7a9da.entry.js → p-6a3b139f.entry.js} +2 -2
  97. package/dist/atomic/p-6a3b139f.entry.js.map +1 -0
  98. package/dist/atomic/{p-ee957926.entry.js → p-8ce6badd.entry.js} +2 -2
  99. package/dist/atomic/p-8ce6badd.entry.js.map +1 -0
  100. package/dist/atomic/{p-b3f6561d.entry.js → p-8e964890.entry.js} +2 -2
  101. package/dist/atomic/p-8e964890.entry.js.map +1 -0
  102. package/dist/atomic/p-93da1f4e.entry.js.map +1 -1
  103. package/dist/atomic/{p-dbf0c5a3.entry.js → p-9564d67d.entry.js} +2 -2
  104. package/dist/atomic/{p-dbf0c5a3.entry.js.map → p-9564d67d.entry.js.map} +1 -1
  105. package/dist/atomic/{p-20019654.entry.js → p-9c3cabca.entry.js} +2 -2
  106. package/dist/atomic/p-9c3cabca.entry.js.map +1 -0
  107. package/dist/atomic/{p-cccf9070.entry.js → p-a5355f5d.entry.js} +2 -2
  108. package/dist/atomic/{p-c9f1790d.entry.js → p-acb1704c.entry.js} +2 -2
  109. package/dist/atomic/p-acb1704c.entry.js.map +1 -0
  110. package/dist/atomic/{p-44ef70b6.entry.js → p-bc94258c.entry.js} +2 -2
  111. package/dist/atomic/p-bc94258c.entry.js.map +1 -0
  112. package/dist/atomic/{p-df1d50c8.entry.js → p-beee63e4.entry.js} +2 -2
  113. package/dist/atomic/p-beee63e4.entry.js.map +1 -0
  114. package/dist/atomic/{p-0f39889d.entry.js → p-c34f8190.entry.js} +2 -2
  115. package/dist/atomic/p-c34f8190.entry.js.map +1 -0
  116. package/dist/atomic/{p-c25f1437.entry.js → p-c41ab197.entry.js} +2 -2
  117. package/dist/atomic/p-c41ab197.entry.js.map +1 -0
  118. package/dist/atomic/{p-93f1d551.entry.js → p-c6e2939f.entry.js} +2 -2
  119. package/dist/atomic/p-c6e2939f.entry.js.map +1 -0
  120. package/dist/atomic/{p-723f76a1.entry.js → p-ca8c87ce.entry.js} +2 -2
  121. package/dist/atomic/{p-723f76a1.entry.js.map → p-ca8c87ce.entry.js.map} +1 -1
  122. package/dist/atomic/{p-852cc16d.entry.js → p-cacb7fd8.entry.js} +2 -2
  123. package/dist/atomic/p-cacb7fd8.entry.js.map +1 -0
  124. package/dist/atomic/{p-c9ce1b8b.entry.js → p-e1ab844f.entry.js} +2 -2
  125. package/dist/atomic/{p-945ddd53.entry.js → p-e1dbe31d.entry.js} +2 -2
  126. package/dist/atomic/p-e1dbe31d.entry.js.map +1 -0
  127. package/dist/cjs/_index.cjs.js +20 -20
  128. package/dist/cjs/{analytics-config-8907b0be.js → analytics-config-0af59f0d.js} +2 -2
  129. package/dist/cjs/{analytics-config-8907b0be.js.map → analytics-config-0af59f0d.js.map} +1 -1
  130. package/dist/cjs/atomic-field-condition.cjs.entry.js +2 -2
  131. package/dist/cjs/atomic-field-condition.cjs.entry.js.map +1 -1
  132. package/dist/cjs/atomic-insight-interface.cjs.entry.js +1 -1
  133. package/dist/cjs/atomic-insight-result-action.cjs.entry.js +3 -3
  134. package/dist/cjs/atomic-insight-result-action.cjs.entry.js.map +1 -1
  135. package/dist/cjs/atomic-insight-result-attach-to-case-action.cjs.entry.js +3 -3
  136. package/dist/cjs/atomic-insight-result-attach-to-case-action.cjs.entry.js.map +1 -1
  137. package/dist/cjs/atomic-insight-result-attach-to-case-indicator.cjs.entry.js +3 -3
  138. package/dist/cjs/atomic-insight-result-attach-to-case-indicator.cjs.entry.js.map +1 -1
  139. package/dist/cjs/atomic-insight-result-quickview-action.cjs.entry.js +3 -3
  140. package/dist/cjs/atomic-insight-result-quickview-action.cjs.entry.js.map +1 -1
  141. package/dist/cjs/atomic-ipx-result-link.cjs.entry.js +4 -4
  142. package/dist/cjs/atomic-ipx-result-link.cjs.entry.js.map +1 -1
  143. package/dist/cjs/atomic-quickview-modal.cjs.entry.js +1 -1
  144. package/dist/cjs/atomic-quickview.cjs.entry.js +3 -3
  145. package/dist/cjs/atomic-quickview.cjs.entry.js.map +1 -1
  146. package/dist/cjs/atomic-recs-interface.cjs.entry.js +1 -1
  147. package/dist/cjs/atomic-result-badge.cjs.entry.js +2 -2
  148. package/dist/cjs/atomic-result-badge.cjs.entry.js.map +1 -1
  149. package/dist/cjs/atomic-result-children.cjs.entry.js +3 -3
  150. package/dist/cjs/atomic-result-children.cjs.entry.js.map +1 -1
  151. package/dist/cjs/atomic-result-date.cjs.entry.js +2 -2
  152. package/dist/cjs/atomic-result-date.cjs.entry.js.map +1 -1
  153. package/dist/cjs/atomic-result-fields-list.cjs.entry.js +3 -3
  154. package/dist/cjs/atomic-result-fields-list.cjs.entry.js.map +1 -1
  155. package/dist/cjs/atomic-result-html.cjs.entry.js +2 -2
  156. package/dist/cjs/atomic-result-html.cjs.entry.js.map +1 -1
  157. package/dist/cjs/atomic-result-icon.cjs.entry.js +2 -2
  158. package/dist/cjs/atomic-result-icon.cjs.entry.js.map +1 -1
  159. package/dist/cjs/atomic-result-image.cjs.entry.js +2 -2
  160. package/dist/cjs/atomic-result-image.cjs.entry.js.map +1 -1
  161. package/dist/cjs/atomic-result-link.cjs.entry.js +4 -4
  162. package/dist/cjs/atomic-result-link.cjs.entry.js.map +1 -1
  163. package/dist/cjs/atomic-result-localized-text.cjs.entry.js +3 -3
  164. package/dist/cjs/atomic-result-localized-text.cjs.entry.js.map +1 -1
  165. package/dist/cjs/atomic-result-multi-value-text.cjs.entry.js +2 -2
  166. package/dist/cjs/atomic-result-multi-value-text.cjs.entry.js.map +1 -1
  167. package/dist/cjs/atomic-result-number.cjs.entry.js +2 -2
  168. package/dist/cjs/atomic-result-number.cjs.entry.js.map +1 -1
  169. package/dist/cjs/atomic-result-printable-uri.cjs.entry.js +2 -2
  170. package/dist/cjs/atomic-result-printable-uri.cjs.entry.js.map +1 -1
  171. package/dist/cjs/atomic-result-rating.cjs.entry.js +2 -2
  172. package/dist/cjs/atomic-result-rating.cjs.entry.js.map +1 -1
  173. package/dist/cjs/atomic-result-text_2.cjs.entry.js +2 -2
  174. package/dist/cjs/atomic-result-text_2.cjs.entry.js.map +1 -1
  175. package/dist/cjs/atomic-result-timespan.cjs.entry.js +2 -2
  176. package/dist/cjs/atomic-result-timespan.cjs.entry.js.map +1 -1
  177. package/dist/cjs/atomic-result.cjs.entry.js.map +1 -1
  178. package/dist/cjs/atomic-smart-snippet-answer_2.cjs.entry.js +1 -1
  179. package/dist/cjs/atomic-smart-snippet-answer_2.cjs.entry.js.map +1 -1
  180. package/dist/cjs/index.cjs.js.map +1 -1
  181. package/dist/cjs/{result-template-decorators-432d11a9.js → stencil-result-template-decorators-28b05aaf.js} +6 -2
  182. package/dist/cjs/stencil-result-template-decorators-28b05aaf.js.map +1 -0
  183. package/dist/cjs/version.cjs.js +1 -1
  184. package/dist/esm/_index.js +19 -19
  185. package/dist/esm/{analytics-config-c7b844df.js → analytics-config-67197f4c.js} +2 -2
  186. package/dist/esm/{analytics-config-c7b844df.js.map → analytics-config-67197f4c.js.map} +1 -1
  187. package/dist/esm/atomic-field-condition.entry.js +1 -1
  188. package/dist/esm/atomic-field-condition.entry.js.map +1 -1
  189. package/dist/esm/atomic-insight-interface.entry.js +1 -1
  190. package/dist/esm/atomic-insight-result-action.entry.js +2 -2
  191. package/dist/esm/atomic-insight-result-action.entry.js.map +1 -1
  192. package/dist/esm/atomic-insight-result-attach-to-case-action.entry.js +2 -2
  193. package/dist/esm/atomic-insight-result-attach-to-case-action.entry.js.map +1 -1
  194. package/dist/esm/atomic-insight-result-attach-to-case-indicator.entry.js +2 -2
  195. package/dist/esm/atomic-insight-result-attach-to-case-indicator.entry.js.map +1 -1
  196. package/dist/esm/atomic-insight-result-quickview-action.entry.js +2 -2
  197. package/dist/esm/atomic-insight-result-quickview-action.entry.js.map +1 -1
  198. package/dist/esm/atomic-ipx-result-link.entry.js +2 -2
  199. package/dist/esm/atomic-ipx-result-link.entry.js.map +1 -1
  200. package/dist/esm/atomic-quickview-modal.entry.js +1 -1
  201. package/dist/esm/atomic-quickview.entry.js +2 -2
  202. package/dist/esm/atomic-quickview.entry.js.map +1 -1
  203. package/dist/esm/atomic-recs-interface.entry.js +1 -1
  204. package/dist/esm/atomic-result-badge.entry.js +1 -1
  205. package/dist/esm/atomic-result-badge.entry.js.map +1 -1
  206. package/dist/esm/atomic-result-children.entry.js +2 -2
  207. package/dist/esm/atomic-result-children.entry.js.map +1 -1
  208. package/dist/esm/atomic-result-date.entry.js +1 -1
  209. package/dist/esm/atomic-result-date.entry.js.map +1 -1
  210. package/dist/esm/atomic-result-fields-list.entry.js +2 -2
  211. package/dist/esm/atomic-result-fields-list.entry.js.map +1 -1
  212. package/dist/esm/atomic-result-html.entry.js +1 -1
  213. package/dist/esm/atomic-result-html.entry.js.map +1 -1
  214. package/dist/esm/atomic-result-icon.entry.js +1 -1
  215. package/dist/esm/atomic-result-icon.entry.js.map +1 -1
  216. package/dist/esm/atomic-result-image.entry.js +1 -1
  217. package/dist/esm/atomic-result-image.entry.js.map +1 -1
  218. package/dist/esm/atomic-result-link.entry.js +2 -2
  219. package/dist/esm/atomic-result-link.entry.js.map +1 -1
  220. package/dist/esm/atomic-result-localized-text.entry.js +2 -2
  221. package/dist/esm/atomic-result-localized-text.entry.js.map +1 -1
  222. package/dist/esm/atomic-result-multi-value-text.entry.js +1 -1
  223. package/dist/esm/atomic-result-multi-value-text.entry.js.map +1 -1
  224. package/dist/esm/atomic-result-number.entry.js +1 -1
  225. package/dist/esm/atomic-result-number.entry.js.map +1 -1
  226. package/dist/esm/atomic-result-printable-uri.entry.js +1 -1
  227. package/dist/esm/atomic-result-printable-uri.entry.js.map +1 -1
  228. package/dist/esm/atomic-result-rating.entry.js +1 -1
  229. package/dist/esm/atomic-result-rating.entry.js.map +1 -1
  230. package/dist/esm/atomic-result-text_2.entry.js +1 -1
  231. package/dist/esm/atomic-result-text_2.entry.js.map +1 -1
  232. package/dist/esm/atomic-result-timespan.entry.js +1 -1
  233. package/dist/esm/atomic-result-timespan.entry.js.map +1 -1
  234. package/dist/esm/atomic-result.entry.js.map +1 -1
  235. package/dist/esm/atomic-smart-snippet-answer_2.entry.js +1 -1
  236. package/dist/esm/atomic-smart-snippet-answer_2.entry.js.map +1 -1
  237. package/dist/esm/index.js.map +1 -1
  238. package/dist/esm/{result-template-decorators-2ed76ea9.js → stencil-result-template-decorators-f989bc6b.js} +6 -2
  239. package/dist/esm/stencil-result-template-decorators-f989bc6b.js.map +1 -0
  240. package/dist/esm/version.js +1 -1
  241. package/dist/types/components/commerce/atomic-commerce-breadbox/atomic-commerce-breadbox.d.ts +2 -1
  242. package/dist/types/components/commerce/atomic-product/atomic-product.d.ts +1 -1
  243. package/dist/types/components/commerce/product-template-component-utils/context/fetch-product-context.d.ts +12 -0
  244. package/dist/types/components/commerce/product-template-component-utils/context/interactive-product-context-controller.d.ts +27 -0
  245. package/dist/types/components/commerce/product-template-component-utils/context/product-context-controller.d.ts +33 -0
  246. package/dist/types/components/commerce/product-template-component-utils/{stencil-product-template-decorators.d.ts → context/stencil-product-template-decorators.d.ts} +1 -1
  247. package/dist/types/components/common/index.d.ts +0 -1
  248. package/dist/types/components/common/smart-snippets/atomic-smart-snippet-source.d.ts +1 -1
  249. package/dist/types/components/search/atomic-result/atomic-result.d.ts +1 -1
  250. package/dist/types/components/search/result-template-component-utils/context/fetch-result-context.d.ts +8 -0
  251. package/dist/types/components/search/result-template-component-utils/context/interactive-result-context-controller.d.ts +12 -0
  252. package/dist/types/components/search/result-template-component-utils/context/result-context-controller.d.ts +18 -0
  253. package/dist/types/components/search/{result-template-components/result-template-decorators.d.ts → result-template-component-utils/context/stencil-result-template-decorators.d.ts} +6 -2
  254. package/dist/types/index.d.ts +3 -3
  255. package/docs/atomic-docs.json +1 -1
  256. package/package.json +1 -1
  257. package/dist/atomic/components/components/common/item-list/fetch-item-context.js +0 -15
  258. package/dist/atomic/components/components/common/validate-props-controller/validate-props-controller.js +0 -36
  259. package/dist/atomic/components/decorators/commerce/product-template-decorators.js +0 -68
  260. package/dist/atomic/components/result-template-decorators.js.map +0 -1
  261. package/dist/atomic/p-0c8e7d5f.entry.js.map +0 -1
  262. package/dist/atomic/p-0f39889d.entry.js.map +0 -1
  263. package/dist/atomic/p-18684d4c.js.map +0 -1
  264. package/dist/atomic/p-190ddaca.entry.js.map +0 -1
  265. package/dist/atomic/p-1ff7a9da.entry.js.map +0 -1
  266. package/dist/atomic/p-20019654.entry.js.map +0 -1
  267. package/dist/atomic/p-2e4628bb.entry.js.map +0 -1
  268. package/dist/atomic/p-4069d801.entry.js.map +0 -1
  269. package/dist/atomic/p-44ef70b6.entry.js.map +0 -1
  270. package/dist/atomic/p-62afcf79.entry.js.map +0 -1
  271. package/dist/atomic/p-78427c6a.entry.js.map +0 -1
  272. package/dist/atomic/p-852cc16d.entry.js.map +0 -1
  273. package/dist/atomic/p-93f1d551.entry.js.map +0 -1
  274. package/dist/atomic/p-945ddd53.entry.js.map +0 -1
  275. package/dist/atomic/p-a4d277c7.entry.js.map +0 -1
  276. package/dist/atomic/p-b3f6561d.entry.js.map +0 -1
  277. package/dist/atomic/p-c25f1437.entry.js.map +0 -1
  278. package/dist/atomic/p-c9f1790d.entry.js.map +0 -1
  279. package/dist/atomic/p-df1d50c8.entry.js.map +0 -1
  280. package/dist/atomic/p-e9dc8e90.entry.js.map +0 -1
  281. package/dist/atomic/p-ee957926.entry.js.map +0 -1
  282. package/dist/atomic/p-fafd5042.entry.js.map +0 -1
  283. package/dist/cjs/result-template-decorators-432d11a9.js.map +0 -1
  284. package/dist/esm/result-template-decorators-2ed76ea9.js.map +0 -1
  285. package/dist/types/components/common/validate-props-controller/validate-props-controller.d.ts +0 -17
  286. package/dist/types/decorators/commerce/product-template-decorators.d.ts +0 -68
  287. /package/dist/atomic/{p-3e38aea6.entry.js.map → p-48d78fc6.entry.js.map} +0 -0
  288. /package/dist/atomic/{p-77166ea4.js.map → p-68896e7d.js.map} +0 -0
  289. /package/dist/atomic/{p-cccf9070.entry.js.map → p-a5355f5d.entry.js.map} +0 -0
  290. /package/dist/atomic/{p-c9ce1b8b.entry.js.map → p-e1ab844f.entry.js.map} +0 -0
@@ -8,6 +8,8 @@ import { I as ItemContext, a as InteractiveItemContext, i as itemContext } from
8
8
  * @ResultContext() private result!: Result;
9
9
  *
10
10
  * For more information and examples, view the "Utilities" section of the readme.
11
+ *
12
+ * @deprecated should only be used for Stencil components. For Lit components, use `createResultContextController` from \@/src/components/search/result-template-component-utils/context/result-context-controller.ts
11
13
  */
12
14
  function ResultContext(opts = { folded: false }) {
13
15
  return ItemContext({ parentName: 'atomic-result', folded: opts.folded });
@@ -22,8 +24,10 @@ function InteractiveResultContext() {
22
24
  *
23
25
  * You should use the method in the [connectedCallback lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).
24
26
  *
25
- * @param element The element that the event is dispatched to, which must be the child of a rendered "atomic-result".
27
+ * @param element The element that the event is dispatched to, which must be the child of a rendered "atomic-result" element.
26
28
  * @returns A promise that resolves on initialization of the parent "atomic-result" element, or rejects when there is no parent "atomic-result" element.
29
+ *
30
+ * @deprecated should only be used for Stencil components. For Lit components, use `fetchResultContext` from \@/src/components/search/result-template-component-utils/context/fetch-result-context.ts
27
31
  */
28
32
  function resultContext(element) {
29
33
  return itemContext(element, 'atomic-result');
@@ -31,4 +35,4 @@ function resultContext(element) {
31
35
 
32
36
  export { InteractiveResultContext as I, ResultContext as R, resultContext as r };
33
37
 
34
- //# sourceMappingURL=result-template-decorators-2ed76ea9.js.map
38
+ //# sourceMappingURL=stencil-result-template-decorators-f989bc6b.js.map
@@ -0,0 +1 @@
1
+ {"file":"stencil-result-template-decorators-f989bc6b.js","mappings":";;AASA;;;;;;;;;;;SAWgB,aAAa,CAAC,OAA0B,EAAC,MAAM,EAAE,KAAK,EAAC;IACrE,OAAO,WAAW,CAAC,EAAC,UAAU,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC,CAAC,CAAC;AACzE,CAAC;SAEe,wBAAwB;IACtC,OAAO,sBAAsB,EAAE,CAAC;AAClC,CAAC;AAKD;;;;;;;;;;;;SAYgB,aAAa,CAC3B,OAAgB;IAEhB,OAAO,WAAW,CAAI,OAAO,EAAE,eAAe,CAAC,CAAC;AAClD;;;;","names":[],"sources":["src/components/search/result-template-component-utils/context/stencil-result-template-decorators.tsx"],"sourcesContent":["import {FoldedResult, Result} from '@coveo/headless';\nimport {\n InteractiveItemContext,\n InteractiveItemContextEvent,\n ItemContext,\n ItemContextEvent,\n itemContext,\n} from '@/src/components/common/item-list/stencil-item-decorators';\n\n/**\n * A [StencilJS property decorator](https://stenciljs.com/) to be used for result template components.\n * This allows the Stencil component to fetch the current result from its rendered parent, the `atomic-result` component.\n *\n * Example:\n * @ResultContext() private result!: Result;\n *\n * For more information and examples, view the \"Utilities\" section of the readme.\n * \n * @deprecated should only be used for Stencil components. For Lit components, use `createResultContextController` from \\@/src/components/search/result-template-component-utils/context/result-context-controller.ts\n */\nexport function ResultContext(opts: {folded: boolean} = {folded: false}) {\n return ItemContext({parentName: 'atomic-result', folded: opts.folded});\n}\n\nexport function InteractiveResultContext() {\n return InteractiveItemContext();\n}\n\nexport type ResultContextEvent<T = Result> = ItemContextEvent<T>;\nexport type InteractiveResultContextEvent = InteractiveItemContextEvent;\n\n/**\n * Retrieves `Result` on a rendered `atomic-result`.\n *\n * This method is useful for building custom result template elements, see [Create a Result List](https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components/native-components/#custom-result-template-component-example) for more information.\n *\n * You should use the method in the [connectedCallback lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).\n *\n * @param element The element that the event is dispatched to, which must be the child of a rendered \"atomic-result\" element.\n * @returns A promise that resolves on initialization of the parent \"atomic-result\" element, or rejects when there is no parent \"atomic-result\" element.\n * \n * @deprecated should only be used for Stencil components. For Lit components, use `fetchResultContext` from \\@/src/components/search/result-template-component-utils/context/fetch-result-context.ts\n */\nexport function resultContext<T extends Result | FoldedResult = Result>(\n element: Element\n) {\n return itemContext<T>(element, 'atomic-result');\n}\n"],"version":3}
@@ -1,2 +1,2 @@
1
1
  export const headlessVersion = '3.31.1';
2
- export const atomicVersion = '3.33.9-pre.93c986e63b';
2
+ export const atomicVersion = '3.33.9-pre.99566f9dae';
@@ -51,9 +51,10 @@ export declare class AtomicCommerceBreadbox extends LitElement implements Initia
51
51
  * @defaultValue `3`
52
52
  */
53
53
  pathLimit: number;
54
- constructor();
55
54
  initialize(): void;
55
+ willUpdate(changedProperties: Map<string, unknown>): void;
56
56
  updated(): void;
57
+ private validateProps;
57
58
  disconnectedCallback(): void;
58
59
  private get breadcrumbs();
59
60
  private get showMoreButton();
@@ -3,9 +3,9 @@ import { type CSSResultGroup, LitElement } from 'lit';
3
3
  import type { DisplayConfig } from "../../common/item-list/context/item-display-config-context-controller";
4
4
  import { type ItemRenderingFunction } from "../../common/item-list/item-list-common";
5
5
  import { type ItemDisplayDensity, type ItemDisplayImageSize, type ItemDisplayLayout } from "../../common/layout/display-options";
6
- import type { InteractiveProductContextEvent, ProductContextEvent } from "../../../decorators/commerce/product-template-decorators";
7
6
  import type { CommerceStore } from '../atomic-commerce-interface/store';
8
7
  import type { CommerceRecommendationStore } from '../atomic-commerce-recommendation-interface/store';
8
+ import type { InteractiveProductContextEvent, ProductContextEvent } from '../product-template-component-utils/context/product-context-controller';
9
9
  declare const AtomicProduct_base: typeof LitElement;
10
10
  /**
11
11
  * The `atomic-product` component is used internally by the `atomic-commerce-product-list` and `atomic-commerce-recommendation-list` components.
@@ -0,0 +1,12 @@
1
+ import type { Product } from '@coveo/headless/commerce';
2
+ /**
3
+ * Retrieves `Product` on a rendered `atomic-product`.
4
+ *
5
+ * This utility function is useful for building custom product template elements, see [Create a Product List](https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components/native-components/#custom-product-template-component-example) for more information.
6
+ *
7
+ * You should use the utility function in the [`connectedCallback` lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).
8
+ *
9
+ * @param element - The element that the event is dispatched to, which must be the child of a rendered `atomic-product`.
10
+ * @returns A promise that resolves on initialization of the parent `atomic-product` element, or rejects when there is no parent `atomic-product` element.
11
+ */
12
+ export declare function fetchProductContext<T extends Product>(element: Element): Promise<T>;
@@ -0,0 +1,27 @@
1
+ import type { InteractiveProduct } from '@coveo/headless/commerce';
2
+ import type { LitElement } from 'lit';
3
+ import { InteractiveItemContextController } from "../../../common/item-list/context/interactive-item-context-controller";
4
+ /**
5
+ * Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing interactive product context in product template components.
6
+ *
7
+ * @param host - The Lit component instance
8
+ * @returns InteractiveItemContextController instance
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * @customElement('my-interactive-product-component')
13
+ * export class MyInteractiveProductComponent extends LitElement {
14
+ * private interactiveProductController = createInteractiveProductContextController(this);
15
+ *
16
+ * @state() product!: Product;
17
+ *
18
+ * render() {
19
+ * this.product = this.interactiveProductController.interactiveItem;
20
+ * return html`<div>${this.product?.ec_name}</div>`;
21
+ * }
22
+ * }
23
+ * ```
24
+ */
25
+ export declare function createInteractiveProductContextController(host: LitElement & {
26
+ error: Error;
27
+ }): InteractiveItemContextController<InteractiveProduct>;
@@ -0,0 +1,33 @@
1
+ import type { InteractiveProduct, Product } from '@coveo/headless/commerce';
2
+ import type { LitElement } from 'lit';
3
+ import type { InteractiveItemContextEvent } from "../../../common/item-list/context/interactive-item-context-controller";
4
+ import { ItemContextController, type ItemContextEvent } from "../../../common/item-list/context/item-context-controller";
5
+ /**
6
+ * Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing product context in product template components.
7
+ *
8
+ * @param host - The Lit component instance
9
+ * @param options - Configuration options
10
+ * @returns ItemContextController instance configured for atomic-product
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * @customElement('my-product-component')
15
+ * export class MyProductComponent extends LitElement {
16
+ * private productController = createProductContextController(this);
17
+ *
18
+ * @state() product!: Product;
19
+ *
20
+ * render() {
21
+ * this.product = this.productController.item;
22
+ * return html`<div>${this.product?.ec_name}</div>`;
23
+ * }
24
+ * }
25
+ * ```
26
+ */
27
+ export declare function createProductContextController(host: LitElement & {
28
+ error: Error | null;
29
+ }, options?: {
30
+ folded?: boolean;
31
+ }): ItemContextController<Product>;
32
+ export type ProductContextEvent<T = Product> = ItemContextEvent<T>;
33
+ export type InteractiveProductContextEvent<T extends InteractiveProduct = InteractiveProduct> = InteractiveItemContextEvent<T>;
@@ -9,6 +9,6 @@ import { Product } from '@coveo/headless/commerce';
9
9
  * @param element - The element that the event is dispatched to, which must be the child of a rendered "atomic-product".
10
10
  * @returns A promise that resolves on initialization of the parent "atomic-product" element, or rejects when there is no parent "atomic-product" element.
11
11
  *
12
- * @deprecated should only be used for Stencil components. For Lit components, use `fetchProductContext` from \@/src/decorators/commerce/product-template-decorators.ts
12
+ * @deprecated should only be used for Stencil components. For Lit components, use `fetchProductContext` from \@/src/components/commerce/product-template-component-utils/context/fetch-product-context.ts
13
13
  */
14
14
  export declare function productContext<T extends Product>(element: Element): Promise<T>;
@@ -5,4 +5,3 @@ export { AtomicFacetPlaceholder } from './atomic-facet-placeholder/atomic-facet-
5
5
  export { AtomicIcon } from './atomic-icon/atomic-icon.js';
6
6
  export { AtomicLayoutSection } from './atomic-layout-section/atomic-layout-section.js';
7
7
  export { AtomicModal } from './atomic-modal/atomic-modal.js';
8
- export { ValidatePropsController } from './validate-props-controller/validate-props-controller.js';
@@ -1,8 +1,8 @@
1
1
  import { Result } from '@coveo/headless';
2
2
  import { EventEmitter } from '../../../stencil-public-runtime';
3
3
  import { InitializableComponent } from '../../../utils/initialization-utils';
4
- import { ResultContextEvent } from '../../search/result-template-components/result-template-decorators';
5
4
  import { AnyBindings } from '../interface/bindings';
5
+ import { ResultContextEvent } from "../../search/result-template-component-utils/context/stencil-result-template-decorators";
6
6
  /**
7
7
  * @part source-url
8
8
  * @part source-title
@@ -3,7 +3,7 @@ import { DisplayConfig } from '../../common/item-list/stencil-item-decorators';
3
3
  import { ItemRenderingFunction } from '../../common/item-list/stencil-item-list-common';
4
4
  import { ItemDisplayDensity, ItemDisplayImageSize, ItemDisplayLayout } from '../../common/layout/display-options';
5
5
  import { SearchStore } from '../atomic-search-interface/store';
6
- import { InteractiveResultContextEvent, ResultContextEvent } from '../result-template-components/result-template-decorators';
6
+ import { InteractiveResultContextEvent, ResultContextEvent } from "../result-template-component-utils/context/stencil-result-template-decorators";
7
7
  /**
8
8
  * The `atomic-result` component is used internally by the `atomic-result-list` component.
9
9
  */
@@ -0,0 +1,8 @@
1
+ import type { FoldedResult, Result } from '@coveo/headless';
2
+ /**
3
+ * Retrieves `Result` on a rendered `atomic-result`.
4
+ *
5
+ * @param element - The element that the event is dispatched to
6
+ * @returns A promise that resolves on initialization of the parent `atomic-result` element, or rejects if missing
7
+ */
8
+ export declare function fetchResultContext<T extends Result | FoldedResult = Result>(element: Element): Promise<T>;
@@ -0,0 +1,12 @@
1
+ import type { InteractiveResult } from '@coveo/headless';
2
+ import type { LitElement } from 'lit';
3
+ import { InteractiveItemContextController } from "../../../common/item-list/context/interactive-item-context-controller";
4
+ /**
5
+ * Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing interactive result context in result template components.
6
+ *
7
+ * @param host - The Lit component instance
8
+ * @returns InteractiveItemContextController instance
9
+ */
10
+ export declare function createInteractiveResultContextController(host: LitElement & {
11
+ error: Error;
12
+ }): InteractiveItemContextController<InteractiveResult>;
@@ -0,0 +1,18 @@
1
+ import type { FoldedResult, InteractiveResult, Result } from '@coveo/headless';
2
+ import type { LitElement } from 'lit';
3
+ import type { InteractiveItemContextEvent } from "../../../common/item-list/context/interactive-item-context-controller";
4
+ import { ItemContextController, type ItemContextEvent } from "../../../common/item-list/context/item-context-controller";
5
+ /**
6
+ * Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing result context in result template components.
7
+ *
8
+ * @param host - The Lit component instance
9
+ * @param options - Configuration options
10
+ * @returns ItemContextController instance configured for atomic-result
11
+ */
12
+ export declare function createResultContextController(host: LitElement & {
13
+ error: Error | null;
14
+ }, options?: {
15
+ folded?: boolean;
16
+ }): ItemContextController<Result | FoldedResult>;
17
+ export type ResultContextEvent<T = Result | FoldedResult> = ItemContextEvent<T>;
18
+ export type InteractiveResultContextEvent<T extends InteractiveResult = InteractiveResult> = InteractiveItemContextEvent<T>;
@@ -1,5 +1,5 @@
1
1
  import { FoldedResult, Result } from '@coveo/headless';
2
- import { InteractiveItemContextEvent, ItemContextEvent } from '../../common/item-list/stencil-item-decorators';
2
+ import { InteractiveItemContextEvent, ItemContextEvent } from "../../../common/item-list/stencil-item-decorators";
3
3
  /**
4
4
  * A [StencilJS property decorator](https://stenciljs.com/) to be used for result template components.
5
5
  * This allows the Stencil component to fetch the current result from its rendered parent, the `atomic-result` component.
@@ -8,6 +8,8 @@ import { InteractiveItemContextEvent, ItemContextEvent } from '../../common/item
8
8
  * @ResultContext() private result!: Result;
9
9
  *
10
10
  * For more information and examples, view the "Utilities" section of the readme.
11
+ *
12
+ * @deprecated should only be used for Stencil components. For Lit components, use `createResultContextController` from \@/src/components/search/result-template-component-utils/context/result-context-controller.ts
11
13
  */
12
14
  export declare function ResultContext(opts?: {
13
15
  folded: boolean;
@@ -22,7 +24,9 @@ export type InteractiveResultContextEvent = InteractiveItemContextEvent;
22
24
  *
23
25
  * You should use the method in the [connectedCallback lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).
24
26
  *
25
- * @param element The element that the event is dispatched to, which must be the child of a rendered "atomic-result".
27
+ * @param element The element that the event is dispatched to, which must be the child of a rendered "atomic-result" element.
26
28
  * @returns A promise that resolves on initialization of the parent "atomic-result" element, or rejects when there is no parent "atomic-result" element.
29
+ *
30
+ * @deprecated should only be used for Stencil components. For Lit components, use `fetchResultContext` from \@/src/components/search/result-template-component-utils/context/fetch-result-context.ts
27
31
  */
28
32
  export declare function resultContext<T extends Result | FoldedResult = Result>(element: Element): Promise<T>;
@@ -2,7 +2,8 @@ export type { i18n } from 'i18next';
2
2
  export { Components, JSX } from './components';
3
3
  export { CommerceBindings } from './components/commerce/atomic-commerce-interface/atomic-commerce-interface';
4
4
  export { SelectChildProductEventArgs } from './components/commerce/atomic-product-children/select-child-product-event';
5
- export { productContext } from './components/commerce/product-template-component-utils/stencil-product-template-decorators';
5
+ export { fetchProductContext } from './components/commerce/product-template-component-utils/context/fetch-product-context';
6
+ export { productContext } from './components/commerce/product-template-component-utils/context/stencil-product-template-decorators';
6
7
  export { PopoverChildFacet } from './components/common/facets/popover/popover-type';
7
8
  export { RedirectionPayload } from './components/common/search-box/redirection-payload';
8
9
  export { dispatchSearchBoxSuggestionsEvent } from './components/common/suggestions/suggestions-events';
@@ -10,7 +11,6 @@ export type { SearchBoxSuggestionElement, SearchBoxSuggestions, SearchBoxSuggest
10
11
  export { elementHasNoQuery, elementHasQuery, } from './components/common/suggestions/suggestions-utils';
11
12
  export { RecsBindings } from './components/recommendations/atomic-recs-interface/atomic-recs-interface';
12
13
  export { Bindings } from './components/search/atomic-search-interface/atomic-search-interface';
13
- export { resultContext } from './components/search/result-template-components/result-template-decorators';
14
- export { fetchProductContext } from './decorators/commerce/product-template-decorators';
14
+ export { resultContext } from './components/search/result-template-component-utils/context/stencil-result-template-decorators';
15
15
  export { initializeBindings, MissingInterfaceParentError, } from './utils/initialization-utils';
16
16
  export { bindLogDocumentOpenOnResult } from './utils/result-utils';
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2025-10-01T18:18:22",
2
+ "timestamp": "2025-10-01T20:06:32",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "4.20.0",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coveo/atomic",
3
3
  "type": "module",
4
- "version": "3.33.9-pre.93c986e63b",
4
+ "version": "3.33.9-pre.99566f9dae",
5
5
  "description": "A web-component library for building modern UIs interfacing with the Coveo platform",
6
6
  "homepage": "https://docs.coveo.com/en/atomic/latest/",
7
7
  "repository": {
@@ -1,15 +0,0 @@
1
- import { closest } from '../../../utils/dom-utils.js';
2
- import { buildCustomEvent } from '../../../utils/event-utils.js';
3
- import { MissingParentError } from './context/item-context-controller.js';
4
- const itemContextEventName = 'atomic/resolveResult';
5
- export function fetchItemContext(element, parentName) {
6
- return new Promise((resolve, reject) => {
7
- const event = buildCustomEvent(itemContextEventName, (item) => {
8
- return resolve(item);
9
- });
10
- element.dispatchEvent(event);
11
- if (!closest(element, parentName)) {
12
- reject(new MissingParentError(element.nodeName.toLowerCase(), parentName));
13
- }
14
- });
15
- }
@@ -1,36 +0,0 @@
1
- export class ValidatePropsController {
2
- constructor(host, options) {
3
- this.host = host;
4
- this.getProps = options.getProps;
5
- this.schema = options.schema;
6
- this.previousProps = {};
7
- host.addController(this);
8
- }
9
- hostConnected() {
10
- this._validateProps(this.getProps());
11
- }
12
- hostUpdate() {
13
- const props = this.getProps();
14
- if (this._propsHaveChanged(props)) {
15
- this._validateProps(props);
16
- }
17
- }
18
- _validateProps(props) {
19
- try {
20
- this.schema.validate(props);
21
- }
22
- catch (error) {
23
- this.host.error = error;
24
- }
25
- this.previousProps = props;
26
- }
27
- _propsHaveChanged(newProps) {
28
- const newKeys = Object.keys(newProps);
29
- const oldKeys = Object.keys(this.previousProps);
30
- if (newKeys.length !== oldKeys.length) {
31
- return true;
32
- }
33
- return newKeys.some((key) => newProps[key] !==
34
- this.previousProps[key]);
35
- }
36
- }
@@ -1,68 +0,0 @@
1
- import { InteractiveItemContextController, } from "../../components/common/item-list/context/interactive-item-context-controller";
2
- import { ItemContextController, } from "../../components/common/item-list/context/item-context-controller";
3
- import { fetchItemContext } from "../../components/common/item-list/fetch-item-context";
4
- /**
5
- * Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing product context in product template components.
6
- *
7
- * @param host - The Lit component instance
8
- * @param options - Configuration options
9
- * @returns ItemContextController instance configured for atomic-product
10
- *
11
- * @example
12
- * ```typescript
13
- * @customElement('my-product-component')
14
- * export class MyProductComponent extends LitElement {
15
- * private productController = createProductContextController(this);
16
- *
17
- * @state() product!: Product;
18
- *
19
- * render() {
20
- * this.product = this.productController.item;
21
- * return html`<div>${this.product?.ec_name}</div>`;
22
- * }
23
- * }
24
- * ```
25
- */
26
- export function createProductContextController(host, options = {}) {
27
- return new ItemContextController(host, {
28
- parentName: 'atomic-product',
29
- folded: options.folded ?? false,
30
- });
31
- }
32
- /**
33
- * Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing interactive product context in product template components.
34
- *
35
- * @param host - The Lit component instance
36
- * @returns InteractiveItemContextController instance
37
- *
38
- * @example
39
- * ```typescript
40
- * @customElement('my-interactive-product-component')
41
- * export class MyInteractiveProductComponent extends LitElement {
42
- * private interactiveProductController = createInteractiveProductContextController(this);
43
- *
44
- * @state() product!: Product;
45
- *
46
- * render() {
47
- * this.product = this.interactiveProductController.interactiveItem;
48
- * return html`<div>${this.product?.ec_name}</div>`;
49
- * }
50
- * }
51
- * ```
52
- */
53
- export function createInteractiveProductContextController(host) {
54
- return new InteractiveItemContextController(host);
55
- }
56
- /**
57
- * Retrieves `Product` on a rendered `atomic-product`.
58
- *
59
- * This utility function is useful for building custom product template elements, see [Create a Product List](https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components/native-components/#custom-product-template-component-example) for more information.
60
- *
61
- * You should use the utility function in the [`connectedCallback` lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).
62
- *
63
- * @param element - The element that the event is dispatched to, which must be the child of a rendered `atomic-product`.
64
- * @returns A promise that resolves on initialization of the parent `atomic-product` element, or rejects when there is no parent `atomic-product` element.
65
- */
66
- export function fetchProductContext(element) {
67
- return fetchItemContext(element, 'atomic-product');
68
- }
@@ -1 +0,0 @@
1
- {"file":"result-template-decorators.js","mappings":";;AASA;;;;;;;;;SASgB,aAAa,CAAC,OAA0B,EAAC,MAAM,EAAE,KAAK,EAAC;IACrE,OAAO,WAAW,CAAC,EAAC,UAAU,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC,CAAC,CAAC;AACzE,CAAC;SAEe,wBAAwB;IACtC,OAAO,sBAAsB,EAAE,CAAC;AAClC,CAAC;AAKD;;;;;;;;;;SAUgB,aAAa,CAC3B,OAAgB;IAEhB,OAAO,WAAW,CAAI,OAAO,EAAE,eAAe,CAAC,CAAC;AAClD;;;;","names":[],"sources":["src/components/search/result-template-components/result-template-decorators.tsx"],"sourcesContent":["import {FoldedResult, Result} from '@coveo/headless';\nimport {\n InteractiveItemContext,\n InteractiveItemContextEvent,\n ItemContext,\n ItemContextEvent,\n itemContext,\n} from '../../common/item-list/stencil-item-decorators';\n\n/**\n * A [StencilJS property decorator](https://stenciljs.com/) to be used for result template components.\n * This allows the Stencil component to fetch the current result from its rendered parent, the `atomic-result` component.\n *\n * Example:\n * @ResultContext() private result!: Result;\n *\n * For more information and examples, view the \"Utilities\" section of the readme.\n */\nexport function ResultContext(opts: {folded: boolean} = {folded: false}) {\n return ItemContext({parentName: 'atomic-result', folded: opts.folded});\n}\n\nexport function InteractiveResultContext() {\n return InteractiveItemContext();\n}\n\nexport type ResultContextEvent<T = Result> = ItemContextEvent<T>;\nexport type InteractiveResultContextEvent = InteractiveItemContextEvent;\n\n/**\n * Retrieves `Result` on a rendered `atomic-result`.\n *\n * This method is useful for building custom result template elements, see [Create a Result List](https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components/native-components/#custom-result-template-component-example) for more information.\n *\n * You should use the method in the [connectedCallback lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).\n *\n * @param element The element that the event is dispatched to, which must be the child of a rendered \"atomic-result\".\n * @returns A promise that resolves on initialization of the parent \"atomic-result\" element, or rejects when there is no parent \"atomic-result\" element.\n */\nexport function resultContext<T extends Result | FoldedResult = Result>(\n element: Element\n) {\n return itemContext<T>(element, 'atomic-result');\n}\n"],"version":3}
@@ -1 +0,0 @@
1
- {"version":3,"names":["atomicResultMultiValueTextCss","AtomicResultMultiValueTextStyle0","AtomicResultMultiValueText","this","maxValuesToDisplay","delimiter","sortedValues","initialize","breadcrumbManager","buildBreadcrumbManager","bindings","engine","resultValues","value","ResultTemplatesHelpers","getResultProperty","result","field","Array","isArray","map","v","trim","error","Error","split","facetSelectedValues","state","facetBreadcrumbs","filter","facet","reduce","values","updateSortedValues","allValues","allValuesSet","Set","firstValues","has","from","set","add","getShouldDisplayLabel","length","getNumberOfValuesToDisplay","Math","min","renderValue","label","getFieldValueCaption","i18n","kebabValue","titleToKebab","h","key","part","name","renderSeparator","beforeValue","afterValue","class","renderMoreLabel","t","renderListItems","numberOfValuesToDisplay","nodes","i","push","componentWillRender","render","host","remove","__decorate","InitializeBindings","ResultContext"],"sources":["src/components/search/result-template-components/atomic-result-multi-value-text/atomic-result-multi-value-text.pcss?tag=atomic-result-multi-value-text&encapsulation=shadow","src/components/search/result-template-components/atomic-result-multi-value-text/atomic-result-multi-value-text.tsx"],"sourcesContent":[":host {\n > ul {\n display: flex;\n list-style: none;\n margin: 0;\n padding: 0;\n\n li {\n display: inline-block;\n }\n }\n}\n\n.separator {\n &::before {\n display: inline;\n content: ',\\00a0';\n }\n}\n","import {\n BreadcrumbManager,\n buildBreadcrumbManager,\n Result,\n ResultTemplatesHelpers,\n} from '@coveo/headless';\nimport {Component, Element, Prop, h, State, VNode} from '@stencil/core';\nimport {getFieldValueCaption} from '../../../../utils/field-utils';\nimport {InitializeBindings} from '../../../../utils/initialization-utils';\nimport {titleToKebab} from '../../../../utils/utils';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '../result-template-decorators';\n\n/**\n * The `atomic-result-multi-value-text` component renders the values of a multi-value string field.\n * @part result-multi-value-text-list - The list of field values.\n * @part result-multi-value-text-separator - The separator to display between each of the field values.\n * @part result-multi-value-text-value - A field value.\n * @part result-multi-value-text-value-more - A label indicating some values were omitted.\n * @slot result-multi-value-text-value-* - A custom caption value that's specified for a given part of a multi-text field value. For example, if you want to use `Off-Campus Resident` as a caption value for `Off-campus apartment` in `Off-campus apartment;On-campus apartment`, you'd use `<span slot=\"result-multi-value-text-value-off-campus-apartment\">Off-Campus Resident</span>`). The suffix of this slot corresponds with the field value, written in kebab case.\n */\n@Component({\n tag: 'atomic-result-multi-value-text',\n styleUrl: 'atomic-result-multi-value-text.pcss',\n shadow: true,\n})\nexport class AtomicResultMultiValueText {\n public breadcrumbManager!: BreadcrumbManager;\n\n @InitializeBindings() public bindings!: Bindings;\n @ResultContext() private result!: Result;\n\n @Element() host!: HTMLElement;\n\n @State() public error!: Error;\n\n /**\n * The field that the component should use.\n * The component will try to find this field in the `Result.raw` object unless it finds it in the `Result` object first.\n * Make sure this field is present in the `fieldsToInclude` property of the `atomic-search-interface` component.\n */\n @Prop({reflect: true}) public field!: string;\n\n /**\n * The maximum number of field values to display.\n * If there are _n_ more values than the specified maximum, the last displayed value will be \"_n_ more...\".\n */\n @Prop({reflect: true}) public maxValuesToDisplay = 3;\n\n /**\n * The delimiter used to separate values when the field isn't indexed as a multi value field.\n */\n @Prop({reflect: true}) public delimiter: string | null = null;\n\n private sortedValues: string[] | null = null;\n\n public initialize() {\n this.breadcrumbManager = buildBreadcrumbManager(this.bindings.engine);\n }\n\n private get resultValues() {\n const value = ResultTemplatesHelpers.getResultProperty(\n this.result,\n this.field\n );\n\n if (value === null) {\n return null;\n }\n\n if (Array.isArray(value)) {\n return value.map((v) => `${v}`.trim());\n }\n\n if (typeof value !== 'string' || value.trim() === '') {\n this.error = new Error(\n `Could not parse \"${value}\" from field \"${this.field}\" as a string array.`\n );\n return null;\n }\n\n return this.delimiter\n ? value.split(this.delimiter).map((value) => value.trim())\n : [value];\n }\n\n private get facetSelectedValues() {\n return this.breadcrumbManager.state.facetBreadcrumbs\n .filter((facet) => facet.field === this.field)\n .reduce(\n (values, facet) => [\n ...values,\n ...facet.values.map(({value}) => value.value),\n ],\n [] as string[]\n );\n }\n\n private updateSortedValues() {\n const allValues = this.resultValues;\n if (allValues === null) {\n this.sortedValues = null;\n return;\n }\n const allValuesSet = new Set(allValues);\n const firstValues = this.facetSelectedValues.filter((value) =>\n allValuesSet.has(value)\n );\n this.sortedValues = Array.from(\n allValues.reduce((set, value) => set.add(value), new Set(firstValues))\n );\n }\n\n private getShouldDisplayLabel(values: string[]) {\n return (\n this.maxValuesToDisplay > 0 && values.length > this.maxValuesToDisplay\n );\n }\n\n private getNumberOfValuesToDisplay(values: string[]) {\n return Math.min(values.length, this.maxValuesToDisplay);\n }\n\n private renderValue(value: string) {\n const label = getFieldValueCaption(this.field, value, this.bindings.i18n);\n const kebabValue = titleToKebab(value);\n return (\n <li key={value} part=\"result-multi-value-text-value\">\n <slot name={`result-multi-value-text-value-${kebabValue}`}>\n {label}\n </slot>\n </li>\n );\n }\n\n private renderSeparator(beforeValue: string, afterValue: string) {\n return (\n <li\n aria-hidden=\"true\"\n part=\"result-multi-value-text-separator\"\n key={`${beforeValue}~${afterValue}`}\n class=\"separator\"\n ></li>\n );\n }\n\n private renderMoreLabel(value: number) {\n return (\n <li key=\"more-field-values\" part=\"result-multi-value-text-value-more\">\n {this.bindings.i18n.t('n-more', {value})}\n </li>\n );\n }\n\n private renderListItems(values: string[]) {\n const numberOfValuesToDisplay = this.getNumberOfValuesToDisplay(values);\n\n const nodes: VNode[] = [];\n for (let i = 0; i < numberOfValuesToDisplay; i++) {\n if (i > 0) {\n nodes.push(this.renderSeparator(values[i - 1], values[i]));\n }\n nodes.push(this.renderValue(values[i]));\n }\n if (this.getShouldDisplayLabel(values)) {\n nodes.push(\n this.renderSeparator(\n values[numberOfValuesToDisplay - 1],\n 'more-field-values'\n )\n );\n nodes.push(this.renderMoreLabel(values.length - numberOfValuesToDisplay));\n }\n return nodes;\n }\n\n public componentWillRender() {\n this.updateSortedValues();\n }\n\n public render() {\n if (this.sortedValues === null) {\n this.host.remove();\n return;\n }\n return (\n <ul part=\"result-multi-value-text-list\">\n {...this.renderListItems(this.sortedValues)}\n </ul>\n );\n }\n}\n"],"mappings":"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","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["atomicInsightResultActionCss","AtomicInsightResultActionStyle0","Actions","AtomicInsightResultAction","this","icon","tooltip","tooltipOnClick","action","initialize","actions","loadInsightAnalyticsActions","bindings","engine","onClick","originalTooltip","setTimeout","CopyToClipboard","dispatch","logCopyToClipboard","result","navigator","clipboard","writeText","clickUri","PostToFeed","logFeedItemTextPost","SendAsEmail","logCaseSendEmail","actionClicked","emit","getIcon","CopyIcon","AttachToCase","AttachIcon","Quickview","QuickviewIcon","FeedIcon","EmailIcon","render","h","IconButton","key","partPrefix","style","title","__decorate","InitializeBindings","ResultContext"],"sources":["src/components/insight/atomic-insight-result-action/atomic-insight-result-action.pcss?tag=atomic-insight-result-action","src/components/insight/atomic-insight-result-action/atomic-insight-result-action.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n\n:host {\n &::part(result-action-button) {\n @apply flex items-center justify-center;\n @apply h-8 w-8;\n }\n}\n","import {Result} from '@coveo/headless';\nimport {\n InsightAnalyticsActionCreators,\n loadInsightAnalyticsActions,\n} from '@coveo/headless/insight';\nimport {Component, Event, EventEmitter, Prop, State, h} from '@stencil/core';\nimport AttachIcon from '../../../images/attach.svg';\nimport CopyIcon from '../../../images/copy-dark.svg';\nimport EmailIcon from '../../../images/email.svg';\nimport QuickviewIcon from '../../../images/preview.svg';\nimport FeedIcon from '../../../images/share-post.svg';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {IconButton} from '../../common/stencil-iconButton';\nimport {ResultContext} from '../../search/result-template-components/result-template-decorators';\nimport {InsightBindings} from '../atomic-insight-interface/atomic-insight-interface';\n\nexport interface InsightResultActionClickedEvent {\n action: string;\n result: Result;\n}\n\nexport enum Actions {\n CopyToClipboard = 'copyToClipboard',\n AttachToCase = 'attachToCase',\n Quickview = 'quickview',\n PostToFeed = 'postToFeed',\n SendAsEmail = 'sendAsEmail',\n}\n\n/**\n * @internal\n */\n@Component({\n tag: 'atomic-insight-result-action',\n styleUrl: 'atomic-insight-result-action.pcss',\n})\nexport class AtomicInsightResultAction\n implements InitializableComponent<InsightBindings>\n{\n @InitializeBindings() public bindings!: InsightBindings;\n @ResultContext() private result!: Result;\n @State() public error!: Error;\n\n @Event({\n eventName: 'atomicInsightResultActionClicked',\n composed: true,\n cancelable: true,\n bubbles: true,\n })\n private actionClicked!: EventEmitter<InsightResultActionClickedEvent>;\n\n /**\n * Specify the result action icon to display.\n */\n @Prop({mutable: true}) public icon = '';\n\n /**\n * The text tooltip to show on the result action icon.\n */\n @Prop({mutable: true}) public tooltip = '';\n\n /**\n * The text tooltip to show on the result action icon for some time after clicking the button.\n */\n @Prop({mutable: true}) public tooltipOnClick = '';\n\n /**\n * The type of action to perform when the result action is clicked. This will be sent along the event fired when the button is clicked.\n */\n @Prop({mutable: true}) public action: Actions | string = '';\n\n private actions!: InsightAnalyticsActionCreators;\n\n public initialize() {\n this.actions = loadInsightAnalyticsActions(this.bindings.engine);\n }\n\n private onClick() {\n if (this.tooltipOnClick) {\n const originalTooltip = this.tooltip;\n this.tooltip = this.tooltipOnClick;\n setTimeout(() => {\n this.tooltip = originalTooltip;\n }, 1000);\n }\n\n switch (this.action) {\n case Actions.CopyToClipboard:\n this.bindings.engine.dispatch(\n this.actions.logCopyToClipboard(this.result)\n );\n navigator.clipboard.writeText(this.result?.clickUri);\n break;\n case Actions.PostToFeed:\n this.bindings.engine.dispatch(\n this.actions.logFeedItemTextPost(this.result)\n );\n break;\n case Actions.SendAsEmail:\n this.bindings.engine.dispatch(\n this.actions.logCaseSendEmail(this.result)\n );\n break;\n }\n\n this.actionClicked.emit({action: this.action, result: this.result});\n }\n\n private getIcon() {\n if (this.icon) {\n return this.icon;\n }\n\n switch (this.action) {\n case Actions.CopyToClipboard:\n return CopyIcon;\n case Actions.AttachToCase:\n return AttachIcon;\n case Actions.Quickview:\n return QuickviewIcon;\n case Actions.PostToFeed:\n return FeedIcon;\n case Actions.SendAsEmail:\n return EmailIcon;\n default:\n return QuickviewIcon;\n }\n }\n\n public render() {\n return (\n <IconButton\n partPrefix=\"result-action\"\n style=\"outline-neutral\"\n icon={this.getIcon()}\n title={this.tooltip}\n onClick={() => this.onClick()}\n />\n );\n }\n}\n"],"mappings":"+qEAAA,MAAMA,EAA+B,wnjEACrC,MAAAC,EAAeD,E,2WCuBf,IAAYE,GAAZ,SAAYA,GACVA,EAAA,qCACAA,EAAA,+BACAA,EAAA,yBACAA,EAAA,2BACAA,EAAA,4BACD,EAND,CAAYA,MAAO,K,MAeNC,EAAyB,M,yFAkBNC,KAAAC,KAAO,GAKPD,KAAAE,QAAU,GAKVF,KAAAG,eAAiB,GAKjBH,KAAAI,OAA2B,G,+BAfpB,G,aAKG,G,oBAKO,G,YAKU,E,CAIlD,UAAAC,GACLL,KAAKM,QAAUC,EAA4BP,KAAKQ,SAASC,O,CAGnD,OAAAC,GACN,GAAIV,KAAKG,eAAgB,CACvB,MAAMQ,EAAkBX,KAAKE,QAC7BF,KAAKE,QAAUF,KAAKG,eACpBS,YAAW,KACTZ,KAAKE,QAAUS,CAAe,GAC7B,I,CAGL,OAAQX,KAAKI,QACX,KAAKN,EAAQe,gBACXb,KAAKQ,SAASC,OAAOK,SACnBd,KAAKM,QAAQS,mBAAmBf,KAAKgB,SAEvCC,UAAUC,UAAUC,UAAUnB,KAAKgB,QAAQI,UAC3C,MACF,KAAKtB,EAAQuB,WACXrB,KAAKQ,SAASC,OAAOK,SACnBd,KAAKM,QAAQgB,oBAAoBtB,KAAKgB,SAExC,MACF,KAAKlB,EAAQyB,YACXvB,KAAKQ,SAASC,OAAOK,SACnBd,KAAKM,QAAQkB,iBAAiBxB,KAAKgB,SAErC,MAGJhB,KAAKyB,cAAcC,KAAK,CAACtB,OAAQJ,KAAKI,OAAQY,OAAQhB,KAAKgB,Q,CAGrD,OAAAW,GACN,GAAI3B,KAAKC,KAAM,CACb,OAAOD,KAAKC,I,CAGd,OAAQD,KAAKI,QACX,KAAKN,EAAQe,gBACX,OAAOe,EACT,KAAK9B,EAAQ+B,aACX,OAAOC,EACT,KAAKhC,EAAQiC,UACX,OAAOC,EACT,KAAKlC,EAAQuB,WACX,OAAOY,EACT,KAAKnC,EAAQyB,YACX,OAAOW,EACT,QACE,OAAOF,E,CAIN,MAAAG,GACL,OACEC,EAACC,EAAU,CAAAC,IAAA,2CACTC,WAAW,gBACXC,MAAM,kBACNvC,KAAMD,KAAK2B,UACXc,MAAOzC,KAAKE,QACZQ,QAAS,IAAMV,KAAKU,W,GAjGGgC,EAAA,CAA5BC,K,+BACwBD,EAAA,CAAxBE,K","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["ResultContext","opts","folded","ItemContext","parentName","InteractiveResultContext","InteractiveItemContext","resultContext","element","itemContext"],"sources":["src/components/search/result-template-components/result-template-decorators.tsx"],"sourcesContent":["import {FoldedResult, Result} from '@coveo/headless';\nimport {\n InteractiveItemContext,\n InteractiveItemContextEvent,\n ItemContext,\n ItemContextEvent,\n itemContext,\n} from '../../common/item-list/stencil-item-decorators';\n\n/**\n * A [StencilJS property decorator](https://stenciljs.com/) to be used for result template components.\n * This allows the Stencil component to fetch the current result from its rendered parent, the `atomic-result` component.\n *\n * Example:\n * @ResultContext() private result!: Result;\n *\n * For more information and examples, view the \"Utilities\" section of the readme.\n */\nexport function ResultContext(opts: {folded: boolean} = {folded: false}) {\n return ItemContext({parentName: 'atomic-result', folded: opts.folded});\n}\n\nexport function InteractiveResultContext() {\n return InteractiveItemContext();\n}\n\nexport type ResultContextEvent<T = Result> = ItemContextEvent<T>;\nexport type InteractiveResultContextEvent = InteractiveItemContextEvent;\n\n/**\n * Retrieves `Result` on a rendered `atomic-result`.\n *\n * This method is useful for building custom result template elements, see [Create a Result List](https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components/native-components/#custom-result-template-component-example) for more information.\n *\n * You should use the method in the [connectedCallback lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).\n *\n * @param element The element that the event is dispatched to, which must be the child of a rendered \"atomic-result\".\n * @returns A promise that resolves on initialization of the parent \"atomic-result\" element, or rejects when there is no parent \"atomic-result\" element.\n */\nexport function resultContext<T extends Result | FoldedResult = Result>(\n element: Element\n) {\n return itemContext<T>(element, 'atomic-result');\n}\n"],"mappings":"2DAkBgBA,EAAcC,EAA0B,CAACC,OAAQ,QAC/D,OAAOC,EAAY,CAACC,WAAY,gBAAiBF,OAAQD,EAAKC,QAChE,C,SAEgBG,IACd,OAAOC,GACT,C,SAegBC,EACdC,GAEA,OAAOC,EAAeD,EAAS,gBACjC,Q","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["possiblyWarnOnBadFieldType","field","itemValueRaw","host","logger","isArray","error","nodeName","toLowerCase","ItemTextFallback","defaultValue","item","getProperty","children","raw","isUndefined","remove","h","Fragment","renderWithHighlights","value","highlights","highlightString","openingDelimiter","closingDelimiter","highlightedValue","content","replace","RegExp","ItemTextHighlighted","highlightKeywords","onError","textValue","Host","innerHTML","AtomicResultText","this","shouldHighlight","render","resultValueAsString","getStringValueFromResultOrNull","result","bindings","engine","default","ResultTemplatesHelpers","getResultProperty","getFieldValueCaption","i18n","HighlightUtils","__decorate","InitializeBindings","ResultContext","AtomicText","strings","t","count","connectedCallback","Error"],"sources":["src/components/common/item-text/field-warning.ts","src/components/common/item-text/stencil-item-text-fallback.tsx","src/components/common/item-text/render-highlights.ts","src/components/common/item-text/stencil-item-text-highlighted.tsx","src/components/search/result-template-components/atomic-result-text/atomic-result-text.tsx","src/components/search/atomic-text/atomic-text.tsx"],"sourcesContent":["import {isArray} from '@coveo/bueno';\n\nexport function possiblyWarnOnBadFieldType(\n field: string,\n itemValueRaw: unknown,\n host: HTMLElement,\n logger: Pick<Console, 'error'>\n) {\n if (isArray(itemValueRaw)) {\n logger.error(\n `${host.nodeName.toLowerCase()} cannot be used with multi value field \"${field}\" with values \"${itemValueRaw}\".`,\n host\n );\n }\n}\n","import {isUndefined} from '@coveo/bueno';\nimport {Fragment, FunctionalComponent, VNode, h} from '@stencil/core';\nimport {possiblyWarnOnBadFieldType} from './field-warning';\n\nexport interface ItemTextProps<T> {\n logger: Pick<Console, 'error'>;\n host: HTMLElement;\n defaultValue: string | undefined;\n field: string;\n item: T;\n getProperty: (result: T, property: string) => unknown;\n}\n\nexport const ItemTextFallback = <T,>(\n {field, host, logger, defaultValue, item, getProperty}: ItemTextProps<T>,\n children: VNode[]\n): FunctionalComponent<ItemTextProps<T>> | null => {\n const raw = getProperty(item, field);\n possiblyWarnOnBadFieldType(field, raw, host, logger);\n\n if (isUndefined(defaultValue)) {\n host.remove();\n return null;\n } else {\n return <Fragment>{children}</Fragment>;\n }\n};\n","export type HighlightKeywords = {\n offset: number;\n length: number;\n};\n\nexport type HighlightString = (params: {\n content: string;\n openingDelimiter: string;\n closingDelimiter: string;\n highlights: HighlightKeywords[];\n}) => string;\n\nexport function renderWithHighlights(\n value: string,\n highlights: HighlightKeywords[],\n highlightString: HighlightString\n) {\n const openingDelimiter = '_openingDelimiter_';\n const closingDelimiter = '_closingDelimiter_';\n const highlightedValue = highlightString({\n content: value,\n openingDelimiter,\n closingDelimiter,\n highlights,\n });\n return highlightedValue\n .replace(new RegExp(openingDelimiter, 'g'), '<b>')\n .replace(new RegExp(closingDelimiter, 'g'), '</b>');\n}\n","import {FunctionalComponent, h, Host} from '@stencil/core';\nimport {\n HighlightKeywords,\n HighlightString,\n renderWithHighlights,\n} from './render-highlights';\n\nexport interface ItemTextHighlightedProps {\n textValue: string;\n highlightKeywords: HighlightKeywords[];\n onError: (error: Error) => void;\n highlightString: HighlightString;\n}\n\nexport const ItemTextHighlighted: FunctionalComponent<\n ItemTextHighlightedProps\n> = ({highlightKeywords, highlightString, onError, textValue}) => {\n try {\n const highlightedValue = renderWithHighlights(\n textValue,\n highlightKeywords,\n highlightString\n );\n\n // deepcode ignore ReactSetInnerHtml: This is not React code\n return <Host innerHTML={highlightedValue}></Host>;\n } catch (error) {\n onError(error as Error);\n }\n};\n","import {HighlightUtils, Result, ResultTemplatesHelpers} from '@coveo/headless';\nimport {Component, Prop, h, Element, State} from '@stencil/core';\nimport {getFieldValueCaption} from '../../../../utils/field-utils';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {getStringValueFromResultOrNull} from '../../../../utils/result-utils';\nimport {ItemTextFallback} from '../../../common/item-text/stencil-item-text-fallback';\nimport {ItemTextHighlighted} from '../../../common/item-text/stencil-item-text-highlighted';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '../result-template-decorators';\n\n/**\n * The `atomic-result-text` component renders the value of a string result field.\n */\n@Component({\n tag: 'atomic-result-text',\n shadow: false,\n})\nexport class AtomicResultText implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n @ResultContext() private result!: Result;\n\n @Element() private host!: HTMLElement;\n\n @State() public error!: Error;\n\n /**\n * The result field which the component should use.\n * This will look in the Result object first, and then in the Result.raw object for the fields.\n * It is important to include the necessary field in the `atomic-search-interface` component.\n */\n @Prop({reflect: true}) public field!: string;\n /**\n * When this is set to `true`, the component attempts to highlight text based on the highlighting properties provided by the search API response.\n */\n @Prop({reflect: true}) public shouldHighlight = true;\n\n /**\n * The locale key for the text to display when the configured field has no value.\n */\n @Prop({reflect: true}) public default?: string;\n\n public render() {\n const resultValueAsString = getStringValueFromResultOrNull(\n this.result,\n this.field\n );\n\n if (resultValueAsString === null) {\n return (\n <ItemTextFallback\n field={this.field}\n host={this.host}\n logger={this.bindings.engine.logger}\n defaultValue={this.default}\n item={this.result}\n getProperty={ResultTemplatesHelpers.getResultProperty}\n >\n <atomic-text\n value={getFieldValueCaption(\n this.field,\n this.default!,\n this.bindings.i18n\n )}\n ></atomic-text>\n </ItemTextFallback>\n );\n }\n\n const textValue = `${resultValueAsString}`;\n const highlightKeywords = ResultTemplatesHelpers.getResultProperty(\n this.result,\n `${this.field}Highlights`\n ) as HighlightUtils.HighlightKeyword[];\n\n return this.shouldHighlight && highlightKeywords ? (\n <ItemTextHighlighted\n textValue={textValue}\n highlightKeywords={highlightKeywords}\n highlightString={HighlightUtils.highlightString}\n onError={(error) => (this.error = error)}\n ></ItemTextHighlighted>\n ) : (\n getFieldValueCaption(this.field, textValue, this.bindings.i18n)\n );\n }\n}\n","import {Component, Prop, State} from '@stencil/core';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {Bindings} from '../atomic-search-interface/atomic-search-interface';\n\n/**\n * The `atomic-text` component leverages the I18n translation module through the atomic-search-interface.\n */\n@Component({\n tag: 'atomic-text',\n shadow: true,\n})\nexport class AtomicText implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n\n private strings = {\n value: () =>\n this.bindings.i18n.t(this.value, {\n count: this.count,\n }),\n };\n @State() public error!: Error;\n\n /**\n * The string key value.\n */\n @Prop({reflect: true}) public value!: string;\n /**\n * The count value used for plurals.\n */\n @Prop({reflect: true}) public count?: number;\n\n public connectedCallback() {\n if (!this.value) {\n this.error = new Error('The \"value\" attribute must be defined.');\n }\n }\n\n public render() {\n return this.strings.value();\n }\n}\n"],"mappings":"sdAEgBA,EACdC,EACAC,EACAC,EACAC,GAEA,GAAIC,EAAQH,GAAe,CACzBE,EAAOE,MACL,GAAGH,EAAKI,SAASC,wDAAwDP,mBAAuBC,MAChGC,E,CAGN,CCDO,MAAMM,EAAmB,EAC7BR,QAAOE,OAAMC,SAAQM,eAAcC,OAAMC,eAC1CC,KAEA,MAAMC,EAAMF,EAAYD,EAAMV,GAC9BD,EAA2BC,EAAOa,EAAKX,EAAMC,GAE7C,GAAIW,EAAYL,GAAe,CAC7BP,EAAKa,SACL,OAAO,I,KACF,CACL,OAAOC,EAACC,EAAQ,KAAEL,E,YCZNM,EACdC,EACAC,EACAC,GAEA,MAAMC,EAAmB,qBACzB,MAAMC,EAAmB,qBACzB,MAAMC,EAAmBH,EAAgB,CACvCI,QAASN,EACTG,mBACAC,mBACAH,eAEF,OAAOI,EACJE,QAAQ,IAAIC,OAAOL,EAAkB,KAAM,OAC3CI,QAAQ,IAAIC,OAAOJ,EAAkB,KAAM,OAChD,CCdO,MAAMK,EAET,EAAEC,oBAAmBR,kBAAiBS,UAASC,gBACjD,IACE,MAAMP,EAAmBN,EACvBa,EACAF,EACAR,GAIF,OAAOL,EAACgB,EAAI,CAACC,UAAWT,G,CACxB,MAAOnB,GACPyB,EAAQzB,E,oXCPC6B,EAAgB,M,yBAiBGC,KAAAC,gBAAkB,K,+DAAA,K,uBAOzC,MAAAC,GACL,MAAMC,EAAsBC,EAC1BJ,KAAKK,OACLL,KAAKnC,OAGP,GAAIsC,IAAwB,KAAM,CAChC,OACEtB,EAACR,EAAgB,CACfR,MAAOmC,KAAKnC,MACZE,KAAMiC,KAAKjC,KACXC,OAAQgC,KAAKM,SAASC,OAAOvC,OAC7BM,aAAc0B,KAAKQ,QACnBjC,KAAMyB,KAAKK,OACX7B,YAAaiC,EAAuBC,mBAEpC7B,EAAA,eACEG,MAAO2B,EACLX,KAAKnC,MACLmC,KAAKQ,QACLR,KAAKM,SAASM,Q,CAOxB,MAAMhB,EAAY,GAAGO,IACrB,MAAMT,EAAoBe,EAAuBC,kBAC/CV,KAAKK,OACL,GAAGL,KAAKnC,mBAGV,OAAOmC,KAAKC,iBAAmBP,EAC7Bb,EAACY,EAAmB,CAClBG,UAAWA,EACXF,kBAAmBA,EACnBR,gBAAiB2B,EAAe3B,gBAChCS,QAAUzB,GAAW8B,KAAK9B,MAAQA,IAGpCyC,EAAqBX,KAAKnC,MAAO+B,EAAWI,KAAKM,SAASM,K,6BAhEjCE,GAA5BC,K,+BACwBD,GAAxBE,K,8YCRUC,EAAU,M,yBAGbjB,KAAAkB,QAAU,CAChBlC,MAAO,IACLgB,KAAKM,SAASM,KAAKO,EAAEnB,KAAKhB,MAAO,CAC/BoC,MAAOpB,KAAKoB,S,+DAcX,iBAAAC,GACL,IAAKrB,KAAKhB,MAAO,CACfgB,KAAK9B,MAAQ,IAAIoD,MAAM,yC,EAIpB,MAAApB,GACL,OAAOF,KAAKkB,QAAQlC,O,GA1BO8B,EAAA,CAA5BC,K","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["atomicResultImageCss","AtomicResultImageStyle0","AtomicResultImage","this","useFallback","url","value","ResultTemplatesHelpers","getResultProperty","result","field","Array","isArray","altText","imageAltField","bindings","i18n","t","itemName","title","logWarning","message","engine","logger","warn","host","handleImageError","fallback","handleMissingFallback","remove","validateUrl","render","h","alt","src","filterProtocol","onError","loading","__decorate","InitializeBindings","ResultContext"],"sources":["src/components/search/result-template-components/atomic-result-image/atomic-result-image.pcss?tag=atomic-result-image","src/components/search/result-template-components/atomic-result-image/atomic-result-image.tsx"],"sourcesContent":["atomic-result-image {\n display: grid;\n place-items: center;\n grid-template-rows: 100%;\n width: 100%;\n height: 100%;\n\n img {\n width: 100%;\n height: 100%;\n object-fit: contain;\n }\n}\n","import {Result, ResultTemplatesHelpers} from '@coveo/headless';\nimport {Component, h, Prop, Element, State} from '@stencil/core';\nimport {\n InitializeBindings,\n InitializableComponent,\n} from '../../../../utils/initialization-utils';\nimport {filterProtocol} from '../../../../utils/xss-utils';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '../result-template-decorators';\n\n/**\n * The `atomic-result-image` component renders an image from a result field.\n */\n@Component({\n tag: 'atomic-result-image',\n styleUrl: 'atomic-result-image.pcss',\n shadow: false,\n})\nexport class AtomicResultImage implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n @ResultContext() private result!: Result;\n @Element() private host!: HTMLElement;\n @State() private useFallback = false;\n\n /**\n * The result field which the component should use. This will look for the field in the Result object first, then in the Result.raw object. It is important to include the necessary field in the `atomic-search-interface` component.\n */\n @Prop({reflect: true}) field!: string;\n\n /**\n * The result field that contains the alt text for the image. This will look for the field in the Result object first, then in the Result.raw object\n *\n * If the field is not specified, or does not contain a valid value, the alt text will be set to \"Image for {productName}\".\n */\n @Prop({reflect: true}) imageAltField?: string;\n\n /**\n * An optional fallback image URL that will be used in case the specified image field is not available or encounters an error.\n */\n @Prop({reflect: true}) fallback?: string;\n\n public error!: Error;\n\n public get url() {\n const value = ResultTemplatesHelpers.getResultProperty(\n this.result,\n this.field\n );\n return Array.isArray(value) ? value[0] : value;\n }\n\n private get altText(): string {\n if (this.imageAltField) {\n const value = ResultTemplatesHelpers.getResultProperty(\n this.result,\n this.imageAltField\n );\n\n if (Array.isArray(value) && typeof value[0] === 'string') {\n return value[0];\n }\n\n if (typeof value === 'string') {\n return value;\n }\n }\n\n return this.bindings.i18n.t('image-alt-fallback', {\n itemName: this.result.title,\n });\n }\n\n private logWarning(message: string) {\n this.bindings.engine.logger.warn(message, this.host);\n }\n\n private handleImageError() {\n const message = `The image url \"${this.url}\" is not valid or could not be loaded. You might want to add a \"fallback\" property.`;\n\n this.fallback ? (this.useFallback = true) : this.logWarning(message);\n }\n\n private handleMissingFallback(message: string) {\n if (!this.fallback) {\n this.logWarning(message);\n this.host.remove();\n return null;\n }\n return this.fallback;\n }\n\n private validateUrl(url: string) {\n if (!url) {\n const message = `\"${this.field}\" is missing. Please review your indexation. You might want to add a \"fallback\" property.`;\n return this.handleMissingFallback(message);\n }\n\n if (typeof url !== 'string') {\n const message = `Expected \"${this.field}\" to be a text field. Please review your indexation. You might want to add a \"fallback\" property.`;\n return this.handleMissingFallback(message);\n }\n\n return url;\n }\n\n public render() {\n let url = this.useFallback ? this.fallback : this.url;\n\n if (!this.useFallback) {\n url = this.validateUrl(url);\n if (!url) {\n return;\n }\n }\n\n return (\n <img\n alt={this.altText}\n src={filterProtocol(url)}\n onError={() => this.handleImageError()}\n loading=\"lazy\"\n />\n );\n }\n}\n"],"mappings":"+UAAA,MAAMA,EAAuB,wKAC7B,MAAAC,EAAeD,E,iXCiBFE,EAAiB,M,yBAIXC,KAAAC,YAAc,M,iBAAA,M,0EAqB/B,OAAWC,GACT,MAAMC,EAAQC,EAAuBC,kBACnCL,KAAKM,OACLN,KAAKO,OAEP,OAAOC,MAAMC,QAAQN,GAASA,EAAM,GAAKA,C,CAG3C,WAAYO,GACV,GAAIV,KAAKW,cAAe,CACtB,MAAMR,EAAQC,EAAuBC,kBACnCL,KAAKM,OACLN,KAAKW,eAGP,GAAIH,MAAMC,QAAQN,WAAiBA,EAAM,KAAO,SAAU,CACxD,OAAOA,EAAM,E,CAGf,UAAWA,IAAU,SAAU,CAC7B,OAAOA,C,EAIX,OAAOH,KAAKY,SAASC,KAAKC,EAAE,qBAAsB,CAChDC,SAAUf,KAAKM,OAAOU,O,CAIlB,UAAAC,CAAWC,GACjBlB,KAAKY,SAASO,OAAOC,OAAOC,KAAKH,EAASlB,KAAKsB,K,CAGzC,gBAAAC,GACN,MAAML,EAAU,kBAAkBlB,KAAKE,yFAEvCF,KAAKwB,SAAYxB,KAAKC,YAAc,KAAQD,KAAKiB,WAAWC,E,CAGtD,qBAAAO,CAAsBP,GAC5B,IAAKlB,KAAKwB,SAAU,CAClBxB,KAAKiB,WAAWC,GAChBlB,KAAKsB,KAAKI,SACV,OAAO,I,CAET,OAAO1B,KAAKwB,Q,CAGN,WAAAG,CAAYzB,GAClB,IAAKA,EAAK,CACR,MAAMgB,EAAU,IAAIlB,KAAKO,iGACzB,OAAOP,KAAKyB,sBAAsBP,E,CAGpC,UAAWhB,IAAQ,SAAU,CAC3B,MAAMgB,EAAU,aAAalB,KAAKO,yGAClC,OAAOP,KAAKyB,sBAAsBP,E,CAGpC,OAAOhB,C,CAGF,MAAA0B,GACL,IAAI1B,EAAMF,KAAKC,YAAcD,KAAKwB,SAAWxB,KAAKE,IAElD,IAAKF,KAAKC,YAAa,CACrBC,EAAMF,KAAK2B,YAAYzB,GACvB,IAAKA,EAAK,CACR,M,EAIJ,OACE2B,EAAA,OACEC,IAAK9B,KAAKU,QACVqB,IAAKC,EAAe9B,GACpB+B,QAAS,IAAMjC,KAAKuB,mBACpBW,QAAQ,Q,6BArGeC,EAAA,CAA5BC,K,+BACwBD,EAAA,CAAxBE,K","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["atomicResultChildrenCss","AtomicResultChildrenStyle0","childTemplateComponent","componentTag","AtomicResultChildren","this","resultTemplateRegistered","templateHasError","showInitialChildren","inheritTemplates","noResultText","toggleShowInitialChildren","foldedResultList","logShowMoreFoldedResults","result","logShowLessFoldedResults","loadedFullCollection","resolveChildTemplates","event","preventDefault","detail","itemTemplateProvider","initialize","childrenTemplates","Array","from","host","querySelectorAll","filter","template","elementHasAncestorTag","length","error","Error","ItemTemplateProvider","includeDefaultTemplate","templateElements","getResultTemplateRegistered","getTemplateHasError","setResultTemplateRegistered","value","setTemplateHasError","bindings","renderChild","child","isLast","content","getTemplateContent","key","uniqueId","children","map","h","interactiveResult","buildInteractiveResult","engine","options","extractUnfoldedItem","store","density","displayConfig","imageSize","classes","trim","componentWillRender","initialChildren","collection","foldedResultListState","results","find","r","loadFullCollection","dispatchEvent","buildCustomEvent","renderCollection","showShouldButtons","moreResultsAvailable","Fragment","ShowHideButton","loadAllResults","i18n","t","collapseResults","CollectionGuard","isLoadingMoreResults","hasChildren","numberOfChildren","ChildrenWrapper","i","renderFoldedResult","render","ResultChildrenGuard","__decorate","InitializeBindings","ChildTemplatesContext","FoldedItemListContext","ResultContext","folded","ItemDisplayConfigContext","FoldedItemListStateContext"],"sources":["src/components/search/result-lists/atomic-result-children/atomic-result-children.pcss?tag=atomic-result-children&encapsulation=shadow","src/components/search/result-lists/atomic-result-children/atomic-result-children.tsx"],"sourcesContent":["@import '../../../../components/common/result-children/result-children.pcss';\n","import {\n buildInteractiveResult,\n FoldedResult,\n FoldedResultList,\n FoldedResultListState,\n} from '@coveo/headless';\nimport {\n Component,\n Element,\n State,\n h,\n Listen,\n Prop,\n Fragment,\n} 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 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 {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '../../result-template-components/result-template-decorators';\n\nconst childTemplateComponent = 'atomic-result-children-template';\nconst componentTag = 'atomic-result-children';\n\n/**\n * The `atomic-result-children` component is responsible for displaying child results by applying one or more child result templates.\n * Includes two slots, \"before-children\" and \"after-children\", which allow for rendering content before and after the list of children,\n * only when children exist.\n * @part children-root - The wrapper for the message when there are child results\n * @part no-result-root - The wrapper for the message when there are no results.\n * @part show-hide-button - The button that allows to collapse or show all child results.\n * @slot before-children - Slot that allows rendering content before the list of children, only when children exist.\n * @slot after-children - Slot that allows rendering content after the list of children, only when children exist.\n */\n@Component({\n tag: 'atomic-result-children',\n styleUrl: 'atomic-result-children.pcss',\n shadow: true,\n})\nexport class AtomicResultChildren implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n @ChildTemplatesContext()\n public itemTemplateProvider?: ItemTemplateProvider;\n @FoldedItemListContext()\n private foldedResultList!: FoldedResultList;\n @ResultContext({folded: true})\n private result!: FoldedResult;\n @ItemDisplayConfigContext()\n private displayConfig!: DisplayConfig;\n private initialChildren!: FoldedResult[];\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!: FoldedResultListState;\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: FoldedResult, 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-result\n key={key}\n content={content}\n result={child}\n interactiveResult={buildInteractiveResult(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-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 private loadFullCollection() {\n this.loadedFullCollection = true;\n this.host.dispatchEvent(\n buildCustomEvent('atomic/loadCollection', this.collection)\n );\n }\n private toggleShowInitialChildren = () => {\n if (this.showInitialChildren) {\n this.foldedResultList.logShowMoreFoldedResults(this.result.result);\n } else {\n this.foldedResultList.logShowLessFoldedResults();\n }\n\n this.showInitialChildren = !this.showInitialChildren;\n };\n\n @State() private loadedFullCollection = false;\n\n private renderCollection() {\n const collection = this.collection!;\n\n const children = this.showInitialChildren\n ? this.initialChildren\n : collection.children;\n\n const showShouldButtons =\n this.loadedFullCollection || collection.moreResultsAvailable;\n\n return (\n <Fragment>\n {showShouldButtons && (\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 />\n )}\n\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 <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 </Fragment>\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"],"mappings":"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","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["atomicIpxResultLinkCss","AtomicIpxResultLinkStyle0","AtomicIPXResultLink","initialize","this","host","dispatchEvent","buildCustomEvent","stopPropagation","actionsHistoryActions","loadIPXActionsHistoryActions","bindings","engine","connectedCallback","slotName","hasDefaultSlot","getDefaultSlotFromHost","linkAttributes","getAttributesFromLinkSlot","onSelect","resultPermanentId","result","raw","permanentid","action","addPageViewEntryInActionsHistory","dispatch","interactiveResult","select","render","href","isUndefined","hrefTemplate","clickUri","buildStringTemplateFromResult","h","LinkWithItemAnalytics","key","onBeginDelayedSelect","beginDelayedSelect","onCancelPendingSelect","cancelPendingSelect","attributes","field","default","__decorate","InitializeBindings","ResultContext","InteractiveResultContext"],"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@reference '../../../utils/tailwind-utilities/link-style.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"],"mappings":"uhBAAA,MAAMA,EAAyB,yzkEAC/B,MAAAC,EAAeD,E,iXCiCFE,EAAmB,M,qDA6BvB,UAAAC,GACLC,KAAKC,KAAKC,cACRC,EACE,iCACCC,IACCJ,KAAKI,gBAAkBA,CAAe,KAI5CJ,KAAKK,sBAAwBC,EAC3BN,KAAKO,SAASC,O,CAIX,iBAAAC,GACL,MAAMC,EAAW,aACjBV,KAAKW,iBAAmBC,EAAuBZ,KAAKC,MACpDD,KAAKa,eAAiBC,EAA0Bd,KAAKC,KAAMS,E,CAGtD,cAAMK,GACX,MAAMC,EAAoBhB,KAAKiB,OAAOC,IAAIC,YAC1C,GAAIH,GAAqBhB,KAAKK,sBAAuB,CACnD,MAAMe,EACJpB,KAAKK,sBAAsBgB,iCACzBL,GAEJhB,KAAKO,SAASC,OAAOc,SAASF,E,CAEhCpB,KAAKuB,kBAAkBC,Q,CAGlB,MAAAC,GACL,MAAMC,EAAOC,EAAY3B,KAAK4B,cAC1B5B,KAAKiB,OAAOY,SACZC,EACE9B,KAAK4B,aACL5B,KAAKiB,OACLjB,KAAKO,UAGX,OACEwB,EAACC,EAAqB,CAAAC,IAAA,2CACpBP,KAAMA,EACNX,SAAU,IAAMf,KAAKe,WACrBmB,qBAAsB,IAAMlC,KAAKuB,kBAAkBY,qBACnDC,sBAAuB,IACrBpC,KAAKuB,kBAAkBc,sBAEzBC,WAAYtC,KAAKa,eACjBT,gBAAiBJ,KAAKI,iBAErBJ,KAAKW,eACJoB,EAAA,aAEAA,EAAA,sBACEQ,MAAM,QACNC,QAAQ,a,6BAnFWC,EAAA,CAA5BC,K,+BAGwBD,EAAA,CAAxBE,K,6BACmCF,EAAA,CAAnCG,K","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["atomicResultBadgeCss","AtomicResultBadgeStyle0","AtomicResultBadge","renderIcon","h","part","icon","this","class","getTextContent","field","undefined","label","value","renderText","renderBadge","componentWillRender","hasValue","ResultTemplatesHelpers","getResultProperty","result","host","remove","render","__decorate","ResultContext"],"sources":["src/components/search/result-template-components/atomic-result-badge/atomic-result-badge.pcss?tag=atomic-result-badge&encapsulation=shadow","src/components/search/result-template-components/atomic-result-badge/atomic-result-badge.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n\n:host {\n display: inline-flex;\n place-items: center;\n height: var(--row-height, auto);\n word-break: break-word;\n}\n","import {Result, ResultTemplatesHelpers} from '@coveo/headless';\nimport {Component, Element, Prop, h} from '@stencil/core';\nimport {ResultContext} from '../result-template-decorators';\n\n/**\n * The `atomic-result-badge` element renders a badge to highlight special features of a result.\n *\n * A badge can either display:\n * * Text:\n * ```html\n * <atomic-result-badge label=\"trending\"></atomic-result-badge>\n * ```\n * * The contents of a single-value field:\n * ```html\n * <atomic-result-badge field=\"objecttype\"></atomic-result-badge>\n * ```\n * * An icon:\n * ```html\n * <atomic-result-badge icon=\"https://my-website.fake/star.svg\"></atomic-result-badge>\n * ```\n * * Slotted elements:\n * ```html\n * <atomic-result-badge icon=\"https://my-website.fake/stopwatch.svg\">\n * Deal ends in <my-dynamic-countdown></my-dynamic-countdown>\n * </atomic-result-badge>\n * ```\n *\n * The contents of a multi-value field can be displayed as in the following example:\n * ```html\n * <atomic-result-badge icon=\"https://my-website.fake/language.svg\">\n * <atomic-result-multi-value-text field=\"language\"></atomic-result-multi-value-text>\n * </atomic-result-badge>\n * ```\n *\n * @part result-badge-element - The decorative outer-most element with the background color and text color.\n * @part result-badge-icon - The icon displayed at the left-end of the badge, if present.\n * @part result-badge-label - The wrapper around the contents at the right-end of the badge. This may be text, a field or slotted elements depending on which was configured.\n * @slot default - The element(s) to display inside the badge, instead of a field or label.\n */\n@Component({\n tag: 'atomic-result-badge',\n styleUrl: 'atomic-result-badge.pcss',\n shadow: true,\n})\nexport class AtomicResultBadge {\n @ResultContext() private result!: Result;\n @Element() host!: HTMLElement;\n /**\n * The field to display in the badge.\n *\n * Not compatible with `label`, slotted elements nor multi-value fields.\n */\n @Prop({reflect: true}) public field?: string;\n\n /**\n * The text to display in the badge.\n *\n * Not compatible with `field` nor slotted elements.\n */\n @Prop({reflect: true}) public label?: string;\n\n /**\n * Specifies an icon to display at the left-end of the badge.\n * This can be used in conjunction with `field`, `label` or slotted elements.\n *\n * - Use a value that starts with `http://`, `https://`, `./`, or `../`, to fetch and display an icon from a given location.\n * - Use a value that starts with `assets://`, to display an icon from the Atomic package.\n * - Use a stringified SVG to display it directly\n */\n @Prop({reflect: true}) public icon?: string;\n\n private renderIcon() {\n return (\n <atomic-icon\n part=\"result-badge-icon\"\n icon={this.icon!}\n class=\"h-3 w-3 fill-current\"\n ></atomic-icon>\n );\n }\n\n private getTextContent() {\n if (this.field !== undefined) {\n return <atomic-result-text field={this.field}></atomic-result-text>;\n }\n if (this.label !== undefined) {\n return <atomic-text value={this.label}></atomic-text>;\n }\n return <slot></slot>;\n }\n\n private renderText() {\n return <span part=\"result-badge-label\">{this.getTextContent()}</span>;\n }\n\n private renderBadge() {\n return (\n <div\n part=\"result-badge-element\"\n class=\"bg-neutral-light text-neutral-dark inline-flex h-full place-items-center space-x-1.5 rounded-full px-3\"\n >\n {this.icon && this.renderIcon()}\n {this.renderText()}\n </div>\n );\n }\n\n componentWillRender() {\n if (this.field) {\n const hasValue =\n ResultTemplatesHelpers.getResultProperty(this.result, this.field) !==\n null;\n if (!hasValue) {\n this.host.remove();\n }\n }\n }\n\n render() {\n return this.renderBadge();\n }\n}\n"],"mappings":"uNAAA,MAAMA,EAAuB,2kjEAC7B,MAAAC,EAAeD,E,iXC2CFE,EAAiB,M,uFA2BpB,UAAAC,GACN,OACEC,EAAA,eACEC,KAAK,oBACLC,KAAMC,KAAKD,KACXE,MAAM,wB,CAKJ,cAAAC,GACN,GAAIF,KAAKG,QAAUC,UAAW,CAC5B,OAAOP,EAAA,sBAAoBM,MAAOH,KAAKG,O,CAEzC,GAAIH,KAAKK,QAAUD,UAAW,CAC5B,OAAOP,EAAA,eAAaS,MAAON,KAAKK,O,CAElC,OAAOR,EAAA,Y,CAGD,UAAAU,GACN,OAAOV,EAAA,QAAMC,KAAK,sBAAsBE,KAAKE,iB,CAGvC,WAAAM,GACN,OACEX,EAAA,OACEC,KAAK,uBACLG,MAAM,0GAELD,KAAKD,MAAQC,KAAKJ,aAClBI,KAAKO,a,CAKZ,mBAAAE,GACE,GAAIT,KAAKG,MAAO,CACd,MAAMO,EACJC,EAAuBC,kBAAkBZ,KAAKa,OAAQb,KAAKG,SAC3D,KACF,IAAKO,EAAU,CACbV,KAAKc,KAAKC,Q,GAKhB,MAAAC,GACE,OAAOhB,KAAKQ,a,6BA1EWS,EAAA,CAAxBC,K","ignoreList":[]}