@coveo/atomic 3.35.0-pre.e38c46e295 → 3.35.0-pre.e9982a2757

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 (335) 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/atomic-field-condition.js +1 -1
  4. package/dist/atomic/components/atomic-field-condition.js.map +1 -1
  5. package/dist/atomic/components/atomic-insight-result-action.js +2 -2
  6. package/dist/atomic/components/atomic-insight-result-action.js.map +1 -1
  7. package/dist/atomic/components/atomic-insight-result-attach-to-case-action.js +2 -2
  8. package/dist/atomic/components/atomic-insight-result-attach-to-case-action.js.map +1 -1
  9. package/dist/atomic/components/atomic-insight-result-attach-to-case-indicator.js +2 -2
  10. package/dist/atomic/components/atomic-insight-result-attach-to-case-indicator.js.map +1 -1
  11. package/dist/atomic/components/atomic-insight-result-quickview-action.js +2 -2
  12. package/dist/atomic/components/atomic-insight-result-quickview-action.js.map +1 -1
  13. package/dist/atomic/components/atomic-ipx-result-link.js +2 -2
  14. package/dist/atomic/components/atomic-ipx-result-link.js.map +1 -1
  15. package/dist/atomic/components/atomic-quickview-modal2.js +1 -1
  16. package/dist/atomic/components/atomic-quickview.js +2 -2
  17. package/dist/atomic/components/atomic-quickview.js.map +1 -1
  18. package/dist/atomic/components/atomic-recs-interface.js +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-search-box.js +3 -7
  51. package/dist/atomic/components/atomic-search-box.js.map +1 -1
  52. package/dist/atomic/components/atomic-smart-snippet-source2.js +1 -1
  53. package/dist/atomic/components/atomic-smart-snippet-source2.js.map +1 -1
  54. package/dist/atomic/components/components/commerce/atomic-commerce-breadbox/atomic-commerce-breadbox.js +1 -3
  55. package/dist/atomic/components/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.js +0 -5
  56. package/dist/atomic/components/components/commerce/atomic-commerce-search-box-recent-queries/atomic-commerce-search-box-recent-queries.js +0 -3
  57. package/dist/atomic/components/components/commerce/atomic-product-children/atomic-product-children.js +1 -1
  58. package/dist/atomic/components/components/commerce/atomic-product-description/atomic-product-description.js +1 -1
  59. package/dist/atomic/components/components/commerce/atomic-product-excerpt/atomic-product-excerpt.js +1 -1
  60. package/dist/atomic/components/components/commerce/atomic-product-field-condition/atomic-product-field-condition.js +1 -1
  61. package/dist/atomic/components/components/commerce/atomic-product-image/atomic-product-image.js +1 -1
  62. package/dist/atomic/components/components/commerce/atomic-product-link/atomic-product-link.js +2 -1
  63. package/dist/atomic/components/components/commerce/atomic-product-multi-value-text/atomic-product-multi-value-text.js +1 -1
  64. package/dist/atomic/components/components/commerce/atomic-product-numeric-field-value/atomic-product-numeric-field-value.js +1 -1
  65. package/dist/atomic/components/components/commerce/atomic-product-price/atomic-product-price.js +1 -1
  66. package/dist/atomic/components/components/commerce/atomic-product-rating/atomic-product-rating.js +1 -1
  67. package/dist/atomic/components/components/commerce/atomic-product-text/atomic-product-text.js +1 -1
  68. package/dist/atomic/components/components/commerce/product-template-component-utils/context/interactive-product-context-controller.js +25 -0
  69. package/dist/atomic/components/components/commerce/product-template-component-utils/context/product-context-controller.js +29 -0
  70. package/dist/atomic/components/components/common/breadbox/breadcrumb-button.js +1 -6
  71. package/dist/atomic/components/components/common/search-box/text-area-clear-button.js +1 -1
  72. package/dist/atomic/components/global/environment.js +1 -1
  73. package/dist/atomic/components/index.js.map +1 -1
  74. package/dist/atomic/components/{result-template-decorators.js → stencil-result-template-decorators.js} +6 -2
  75. package/dist/atomic/components/stencil-result-template-decorators.js.map +1 -0
  76. package/dist/atomic/components/stencil-suggestion-manager.js +1 -1
  77. package/dist/atomic/components/stencil-suggestion-manager.js.map +1 -1
  78. package/dist/atomic/index.esm.js +1 -1
  79. package/dist/atomic/index.esm.js.map +1 -1
  80. package/dist/atomic/lang/cs.json +1 -1
  81. package/dist/atomic/lang/da.json +1 -1
  82. package/dist/atomic/lang/de.json +1 -1
  83. package/dist/atomic/lang/dev.json +1 -1
  84. package/dist/atomic/lang/el.json +1 -1
  85. package/dist/atomic/lang/en.json +1 -1
  86. package/dist/atomic/lang/es.json +1 -1
  87. package/dist/atomic/lang/fi.json +1 -1
  88. package/dist/atomic/lang/fr.json +1 -1
  89. package/dist/atomic/lang/hu.json +1 -1
  90. package/dist/atomic/lang/id.json +1 -1
  91. package/dist/atomic/lang/it.json +1 -1
  92. package/dist/atomic/lang/ja.json +1 -1
  93. package/dist/atomic/lang/ko.json +1 -1
  94. package/dist/atomic/lang/nl.json +1 -1
  95. package/dist/atomic/lang/no.json +1 -1
  96. package/dist/atomic/lang/pl.json +1 -1
  97. package/dist/atomic/lang/pt-BR.json +1 -1
  98. package/dist/atomic/lang/pt.json +1 -1
  99. package/dist/atomic/lang/ru.json +1 -1
  100. package/dist/atomic/lang/sv.json +1 -1
  101. package/dist/atomic/lang/th.json +1 -1
  102. package/dist/atomic/lang/tr.json +1 -1
  103. package/dist/atomic/lang/zh-CN.json +1 -1
  104. package/dist/atomic/lang/zh-TW.json +1 -1
  105. package/dist/atomic/lang/zh.json +1 -1
  106. package/dist/atomic/{p-955092ed.entry.js → p-01096d1c.entry.js} +2 -2
  107. package/dist/atomic/p-01096d1c.entry.js.map +1 -0
  108. package/dist/atomic/{p-82cd6398.entry.js → p-154cbbfe.entry.js} +2 -2
  109. package/dist/atomic/{p-82cd6398.entry.js.map → p-154cbbfe.entry.js.map} +1 -1
  110. package/dist/atomic/p-16f4ce98.js +2 -0
  111. package/dist/atomic/p-16f4ce98.js.map +1 -0
  112. package/dist/atomic/{p-db3b11ca.entry.js → p-2033533c.entry.js} +2 -2
  113. package/dist/atomic/{p-db3b11ca.entry.js.map → p-2033533c.entry.js.map} +1 -1
  114. package/dist/atomic/{p-4069d801.entry.js → p-268ce7ca.entry.js} +2 -2
  115. package/dist/atomic/p-268ce7ca.entry.js.map +1 -0
  116. package/dist/atomic/{p-9e6462cf.entry.js → p-36ff2bc3.entry.js} +2 -2
  117. package/dist/atomic/p-36ff2bc3.entry.js.map +1 -0
  118. package/dist/atomic/{p-e9dc8e90.entry.js → p-3ec45f9c.entry.js} +2 -2
  119. package/dist/atomic/p-3ec45f9c.entry.js.map +1 -0
  120. package/dist/atomic/{p-18684d4c.js → p-4080f740.js} +1 -1
  121. package/dist/atomic/p-4080f740.js.map +1 -0
  122. package/dist/atomic/{p-8d5228da.entry.js → p-42fffab2.entry.js} +2 -2
  123. package/dist/atomic/p-42fffab2.entry.js.map +1 -0
  124. package/dist/atomic/{p-190ddaca.entry.js → p-4cf97b0a.entry.js} +2 -2
  125. package/dist/atomic/p-4cf97b0a.entry.js.map +1 -0
  126. package/dist/atomic/{p-78427c6a.entry.js → p-5a9460ab.entry.js} +2 -2
  127. package/dist/atomic/p-5a9460ab.entry.js.map +1 -0
  128. package/dist/atomic/{p-15547bd5.entry.js → p-61b3f5ce.entry.js} +2 -2
  129. package/dist/atomic/p-61b3f5ce.entry.js.map +1 -0
  130. package/dist/atomic/{p-1ff7a9da.entry.js → p-6a3b139f.entry.js} +2 -2
  131. package/dist/atomic/p-6a3b139f.entry.js.map +1 -0
  132. package/dist/atomic/{p-df8d38ca.entry.js → p-7015679e.entry.js} +2 -2
  133. package/dist/atomic/p-7015679e.entry.js.map +1 -0
  134. package/dist/atomic/{p-dea22a8d.entry.js → p-886b184f.entry.js} +2 -2
  135. package/dist/atomic/p-886b184f.entry.js.map +1 -0
  136. package/dist/atomic/{p-b3f6561d.entry.js → p-8e964890.entry.js} +2 -2
  137. package/dist/atomic/p-8e964890.entry.js.map +1 -0
  138. package/dist/atomic/{p-182f9112.entry.js → p-a413f820.entry.js} +2 -2
  139. package/dist/atomic/p-a413f820.entry.js.map +1 -0
  140. package/dist/atomic/{p-017aa785.entry.js → p-a7c39901.entry.js} +2 -2
  141. package/dist/atomic/{p-5cab535b.entry.js → p-c5bd7f8d.entry.js} +2 -2
  142. package/dist/atomic/p-c5bd7f8d.entry.js.map +1 -0
  143. package/dist/atomic/{p-567b2841.entry.js → p-ca1425cc.entry.js} +2 -2
  144. package/dist/atomic/{p-852cc16d.entry.js → p-cacb7fd8.entry.js} +2 -2
  145. package/dist/atomic/p-cacb7fd8.entry.js.map +1 -0
  146. package/dist/atomic/{p-c5164dbf.entry.js → p-cee86cff.entry.js} +2 -2
  147. package/dist/atomic/p-cee86cff.entry.js.map +1 -0
  148. package/dist/atomic/{p-4cb91ee7.entry.js → p-d5402772.entry.js} +2 -2
  149. package/dist/atomic/p-d5402772.entry.js.map +1 -0
  150. package/dist/atomic/{p-e6dc9de7.entry.js → p-da141605.entry.js} +2 -2
  151. package/dist/atomic/p-da141605.entry.js.map +1 -0
  152. package/dist/atomic/{p-a1798150.entry.js → p-dd258eaa.entry.js} +2 -2
  153. package/dist/atomic/p-dd258eaa.entry.js.map +1 -0
  154. package/dist/atomic/{p-945ddd53.entry.js → p-e1dbe31d.entry.js} +2 -2
  155. package/dist/atomic/p-e1dbe31d.entry.js.map +1 -0
  156. package/dist/atomic/{p-448091f7.entry.js → p-ecd3c0a9.entry.js} +2 -2
  157. package/dist/atomic/p-ecd3c0a9.entry.js.map +1 -0
  158. package/dist/atomic/{p-c2a5dac0.entry.js → p-f2c4209d.entry.js} +2 -2
  159. package/dist/atomic/{p-57049cd2.entry.js → p-f2c89d7c.entry.js} +2 -2
  160. package/dist/atomic/p-f2c89d7c.entry.js.map +1 -0
  161. package/dist/atomic/p-f800678c.entry.js.map +1 -1
  162. package/dist/cjs/_index.cjs.js +20 -20
  163. package/dist/cjs/atomic-field-condition.cjs.entry.js +2 -2
  164. package/dist/cjs/atomic-field-condition.cjs.entry.js.map +1 -1
  165. package/dist/cjs/atomic-insight-result-action.cjs.entry.js +3 -3
  166. package/dist/cjs/atomic-insight-result-action.cjs.entry.js.map +1 -1
  167. package/dist/cjs/atomic-insight-result-attach-to-case-action.cjs.entry.js +3 -3
  168. package/dist/cjs/atomic-insight-result-attach-to-case-action.cjs.entry.js.map +1 -1
  169. package/dist/cjs/atomic-insight-result-attach-to-case-indicator.cjs.entry.js +3 -3
  170. package/dist/cjs/atomic-insight-result-attach-to-case-indicator.cjs.entry.js.map +1 -1
  171. package/dist/cjs/atomic-insight-result-quickview-action.cjs.entry.js +3 -3
  172. package/dist/cjs/atomic-insight-result-quickview-action.cjs.entry.js.map +1 -1
  173. package/dist/cjs/atomic-insight-search-box.cjs.entry.js +1 -1
  174. package/dist/cjs/atomic-ipx-result-link.cjs.entry.js +4 -4
  175. package/dist/cjs/atomic-ipx-result-link.cjs.entry.js.map +1 -1
  176. package/dist/cjs/atomic-quickview-modal.cjs.entry.js +1 -1
  177. package/dist/cjs/atomic-quickview.cjs.entry.js +3 -3
  178. package/dist/cjs/atomic-quickview.cjs.entry.js.map +1 -1
  179. package/dist/cjs/atomic-recs-interface.cjs.entry.js +1 -1
  180. package/dist/cjs/atomic-result-badge.cjs.entry.js +2 -2
  181. package/dist/cjs/atomic-result-badge.cjs.entry.js.map +1 -1
  182. package/dist/cjs/atomic-result-children.cjs.entry.js +3 -3
  183. package/dist/cjs/atomic-result-children.cjs.entry.js.map +1 -1
  184. package/dist/cjs/atomic-result-date.cjs.entry.js +2 -2
  185. package/dist/cjs/atomic-result-date.cjs.entry.js.map +1 -1
  186. package/dist/cjs/atomic-result-fields-list.cjs.entry.js +3 -3
  187. package/dist/cjs/atomic-result-fields-list.cjs.entry.js.map +1 -1
  188. package/dist/cjs/atomic-result-html.cjs.entry.js +2 -2
  189. package/dist/cjs/atomic-result-html.cjs.entry.js.map +1 -1
  190. package/dist/cjs/atomic-result-icon.cjs.entry.js +2 -2
  191. package/dist/cjs/atomic-result-icon.cjs.entry.js.map +1 -1
  192. package/dist/cjs/atomic-result-image.cjs.entry.js +2 -2
  193. package/dist/cjs/atomic-result-image.cjs.entry.js.map +1 -1
  194. package/dist/cjs/atomic-result-link.cjs.entry.js +4 -4
  195. package/dist/cjs/atomic-result-link.cjs.entry.js.map +1 -1
  196. package/dist/cjs/atomic-result-localized-text.cjs.entry.js +3 -3
  197. package/dist/cjs/atomic-result-localized-text.cjs.entry.js.map +1 -1
  198. package/dist/cjs/atomic-result-multi-value-text.cjs.entry.js +2 -2
  199. package/dist/cjs/atomic-result-multi-value-text.cjs.entry.js.map +1 -1
  200. package/dist/cjs/atomic-result-number.cjs.entry.js +2 -2
  201. package/dist/cjs/atomic-result-number.cjs.entry.js.map +1 -1
  202. package/dist/cjs/atomic-result-printable-uri.cjs.entry.js +2 -2
  203. package/dist/cjs/atomic-result-printable-uri.cjs.entry.js.map +1 -1
  204. package/dist/cjs/atomic-result-rating.cjs.entry.js +2 -2
  205. package/dist/cjs/atomic-result-rating.cjs.entry.js.map +1 -1
  206. package/dist/cjs/atomic-result-text_2.cjs.entry.js +2 -2
  207. package/dist/cjs/atomic-result-text_2.cjs.entry.js.map +1 -1
  208. package/dist/cjs/atomic-result-timespan.cjs.entry.js +2 -2
  209. package/dist/cjs/atomic-result-timespan.cjs.entry.js.map +1 -1
  210. package/dist/cjs/atomic-result.cjs.entry.js.map +1 -1
  211. package/dist/cjs/atomic-search-box.cjs.entry.js +4 -8
  212. package/dist/cjs/atomic-search-box.cjs.entry.js.map +1 -1
  213. package/dist/cjs/atomic-smart-snippet-answer_2.cjs.entry.js +1 -1
  214. package/dist/cjs/atomic-smart-snippet-answer_2.cjs.entry.js.map +1 -1
  215. package/dist/cjs/index.cjs.js.map +1 -1
  216. package/dist/cjs/{result-template-decorators-432d11a9.js → stencil-result-template-decorators-28b05aaf.js} +6 -2
  217. package/dist/cjs/stencil-result-template-decorators-28b05aaf.js.map +1 -0
  218. package/dist/cjs/{stencil-suggestion-manager-88cb88f2.js → stencil-suggestion-manager-2cba6d69.js} +2 -2
  219. package/dist/cjs/stencil-suggestion-manager-2cba6d69.js.map +1 -0
  220. package/dist/cjs/version.cjs.js +1 -1
  221. package/dist/esm/_index.js +19 -19
  222. package/dist/esm/atomic-field-condition.entry.js +1 -1
  223. package/dist/esm/atomic-field-condition.entry.js.map +1 -1
  224. package/dist/esm/atomic-insight-result-action.entry.js +2 -2
  225. package/dist/esm/atomic-insight-result-action.entry.js.map +1 -1
  226. package/dist/esm/atomic-insight-result-attach-to-case-action.entry.js +2 -2
  227. package/dist/esm/atomic-insight-result-attach-to-case-action.entry.js.map +1 -1
  228. package/dist/esm/atomic-insight-result-attach-to-case-indicator.entry.js +2 -2
  229. package/dist/esm/atomic-insight-result-attach-to-case-indicator.entry.js.map +1 -1
  230. package/dist/esm/atomic-insight-result-quickview-action.entry.js +2 -2
  231. package/dist/esm/atomic-insight-result-quickview-action.entry.js.map +1 -1
  232. package/dist/esm/atomic-insight-search-box.entry.js +1 -1
  233. package/dist/esm/atomic-ipx-result-link.entry.js +2 -2
  234. package/dist/esm/atomic-ipx-result-link.entry.js.map +1 -1
  235. package/dist/esm/atomic-quickview-modal.entry.js +1 -1
  236. package/dist/esm/atomic-quickview.entry.js +2 -2
  237. package/dist/esm/atomic-quickview.entry.js.map +1 -1
  238. package/dist/esm/atomic-recs-interface.entry.js +1 -1
  239. package/dist/esm/atomic-result-badge.entry.js +1 -1
  240. package/dist/esm/atomic-result-badge.entry.js.map +1 -1
  241. package/dist/esm/atomic-result-children.entry.js +2 -2
  242. package/dist/esm/atomic-result-children.entry.js.map +1 -1
  243. package/dist/esm/atomic-result-date.entry.js +1 -1
  244. package/dist/esm/atomic-result-date.entry.js.map +1 -1
  245. package/dist/esm/atomic-result-fields-list.entry.js +2 -2
  246. package/dist/esm/atomic-result-fields-list.entry.js.map +1 -1
  247. package/dist/esm/atomic-result-html.entry.js +1 -1
  248. package/dist/esm/atomic-result-html.entry.js.map +1 -1
  249. package/dist/esm/atomic-result-icon.entry.js +1 -1
  250. package/dist/esm/atomic-result-icon.entry.js.map +1 -1
  251. package/dist/esm/atomic-result-image.entry.js +1 -1
  252. package/dist/esm/atomic-result-image.entry.js.map +1 -1
  253. package/dist/esm/atomic-result-link.entry.js +2 -2
  254. package/dist/esm/atomic-result-link.entry.js.map +1 -1
  255. package/dist/esm/atomic-result-localized-text.entry.js +2 -2
  256. package/dist/esm/atomic-result-localized-text.entry.js.map +1 -1
  257. package/dist/esm/atomic-result-multi-value-text.entry.js +1 -1
  258. package/dist/esm/atomic-result-multi-value-text.entry.js.map +1 -1
  259. package/dist/esm/atomic-result-number.entry.js +1 -1
  260. package/dist/esm/atomic-result-number.entry.js.map +1 -1
  261. package/dist/esm/atomic-result-printable-uri.entry.js +1 -1
  262. package/dist/esm/atomic-result-printable-uri.entry.js.map +1 -1
  263. package/dist/esm/atomic-result-rating.entry.js +1 -1
  264. package/dist/esm/atomic-result-rating.entry.js.map +1 -1
  265. package/dist/esm/atomic-result-text_2.entry.js +1 -1
  266. package/dist/esm/atomic-result-text_2.entry.js.map +1 -1
  267. package/dist/esm/atomic-result-timespan.entry.js +1 -1
  268. package/dist/esm/atomic-result-timespan.entry.js.map +1 -1
  269. package/dist/esm/atomic-result.entry.js.map +1 -1
  270. package/dist/esm/atomic-search-box.entry.js +4 -8
  271. package/dist/esm/atomic-search-box.entry.js.map +1 -1
  272. package/dist/esm/atomic-smart-snippet-answer_2.entry.js +1 -1
  273. package/dist/esm/atomic-smart-snippet-answer_2.entry.js.map +1 -1
  274. package/dist/esm/index.js.map +1 -1
  275. package/dist/esm/{result-template-decorators-2ed76ea9.js → stencil-result-template-decorators-f989bc6b.js} +6 -2
  276. package/dist/esm/stencil-result-template-decorators-f989bc6b.js.map +1 -0
  277. package/dist/esm/{stencil-suggestion-manager-1f4ed8d0.js → stencil-suggestion-manager-376f83e8.js} +2 -2
  278. package/dist/esm/stencil-suggestion-manager-376f83e8.js.map +1 -0
  279. package/dist/esm/version.js +1 -1
  280. package/dist/types/components/commerce/atomic-commerce-breadbox/atomic-commerce-breadbox.d.ts +0 -2
  281. package/dist/types/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.d.ts +0 -1
  282. package/dist/types/components/commerce/atomic-commerce-search-box-recent-queries/atomic-commerce-search-box-recent-queries.d.ts +0 -2
  283. package/dist/types/components/commerce/atomic-product/atomic-product.d.ts +1 -1
  284. package/dist/types/components/commerce/product-template-component-utils/context/fetch-product-context.d.ts +12 -0
  285. package/dist/types/components/commerce/product-template-component-utils/context/interactive-product-context-controller.d.ts +27 -0
  286. package/dist/types/components/commerce/product-template-component-utils/context/product-context-controller.d.ts +33 -0
  287. package/dist/types/components/commerce/product-template-component-utils/{stencil-product-template-decorators.d.ts → context/stencil-product-template-decorators.d.ts} +1 -1
  288. package/dist/types/components/common/breadbox/breadcrumb-button.d.ts +0 -2
  289. package/dist/types/components/common/smart-snippets/atomic-smart-snippet-source.d.ts +1 -1
  290. package/dist/types/components/search/atomic-result/atomic-result.d.ts +1 -1
  291. package/dist/types/components/search/atomic-search-box/atomic-search-box.d.ts +0 -1
  292. package/dist/types/components/search/result-template-component-utils/context/fetch-result-context.d.ts +8 -0
  293. package/dist/types/components/search/result-template-component-utils/context/interactive-result-context-controller.d.ts +12 -0
  294. package/dist/types/components/search/result-template-component-utils/context/result-context-controller.d.ts +18 -0
  295. 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
  296. package/dist/types/directives/hierarchical-path.d.ts +1 -1
  297. package/dist/types/index.d.ts +3 -3
  298. package/docs/atomic-docs.json +1 -1
  299. package/package.json +6 -3
  300. package/dist/atomic/components/components/common/item-list/fetch-item-context.js +0 -15
  301. package/dist/atomic/components/decorators/commerce/product-template-decorators.js +0 -68
  302. package/dist/atomic/components/result-template-decorators.js.map +0 -1
  303. package/dist/atomic/p-15547bd5.entry.js.map +0 -1
  304. package/dist/atomic/p-182f9112.entry.js.map +0 -1
  305. package/dist/atomic/p-18684d4c.js.map +0 -1
  306. package/dist/atomic/p-190ddaca.entry.js.map +0 -1
  307. package/dist/atomic/p-1ff7a9da.entry.js.map +0 -1
  308. package/dist/atomic/p-2559747d.js +0 -2
  309. package/dist/atomic/p-2559747d.js.map +0 -1
  310. package/dist/atomic/p-4069d801.entry.js.map +0 -1
  311. package/dist/atomic/p-448091f7.entry.js.map +0 -1
  312. package/dist/atomic/p-4cb91ee7.entry.js.map +0 -1
  313. package/dist/atomic/p-57049cd2.entry.js.map +0 -1
  314. package/dist/atomic/p-5cab535b.entry.js.map +0 -1
  315. package/dist/atomic/p-78427c6a.entry.js.map +0 -1
  316. package/dist/atomic/p-852cc16d.entry.js.map +0 -1
  317. package/dist/atomic/p-8d5228da.entry.js.map +0 -1
  318. package/dist/atomic/p-945ddd53.entry.js.map +0 -1
  319. package/dist/atomic/p-955092ed.entry.js.map +0 -1
  320. package/dist/atomic/p-9e6462cf.entry.js.map +0 -1
  321. package/dist/atomic/p-a1798150.entry.js.map +0 -1
  322. package/dist/atomic/p-b3f6561d.entry.js.map +0 -1
  323. package/dist/atomic/p-c5164dbf.entry.js.map +0 -1
  324. package/dist/atomic/p-dea22a8d.entry.js.map +0 -1
  325. package/dist/atomic/p-df8d38ca.entry.js.map +0 -1
  326. package/dist/atomic/p-e6dc9de7.entry.js.map +0 -1
  327. package/dist/atomic/p-e9dc8e90.entry.js.map +0 -1
  328. package/dist/cjs/result-template-decorators-432d11a9.js.map +0 -1
  329. package/dist/cjs/stencil-suggestion-manager-88cb88f2.js.map +0 -1
  330. package/dist/esm/result-template-decorators-2ed76ea9.js.map +0 -1
  331. package/dist/esm/stencil-suggestion-manager-1f4ed8d0.js.map +0 -1
  332. package/dist/types/decorators/commerce/product-template-decorators.d.ts +0 -68
  333. /package/dist/atomic/{p-017aa785.entry.js.map → p-a7c39901.entry.js.map} +0 -0
  334. /package/dist/atomic/{p-567b2841.entry.js.map → p-ca1425cc.entry.js.map} +0 -0
  335. /package/dist/atomic/{p-c2a5dac0.entry.js.map → p-f2c4209d.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"file":"atomic-search-box.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,MAAM,YAAY,GAA+B,CAAC,EACvD,QAAQ,EACR,QAAQ,EACR,OAAO,GACR,MACCA,iBACE,IAAI,EAAC,uBAAuB,EAC5B,KAAK,EAAC,4CAA4C;IAElDA,QAACC,oBAAM,IACL,KAAK,EAA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B,qDACf,QAAQ,EAAE,UAAU,EACpB,UAAU,EAAE,CAAC,KAAK;oBAChB,IAAI,CAACC,mBAAa,CAAC,KAAK,CAAC,EAAE;wBACzB,OAAO;qBACR;oBACD,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,EAAE,CAAC;oBAC1C,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;iBACzB,IAEA,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,EAChCrB,QAAC,YAAY,qDACX,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE;oBACP,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;oBACxB,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,EAAE,CAAC;iBAC3C,GACD,EACD,IAAI,CAAC,iBAAiB,EAAE,CACR;YACnB,IAAI,CAAC,iBAAiB,EAAE;SACzB,CACI,EACP;KACH;;;;;;AAtpB4B;IAA5BsB,sCAAkB,EAAE;iDAA4B;AAezC;IAFPC,yCAAqB,CAAC,WAAW,CAAC;uDAEgC;AAyFzD;IADTC,wCAAc,CAAC,YAAY,CAAC;6DACW;AAG9B;IADTA,wCAAc,CAAC,oBAAoB,EAAE,IAAI,CAAC;+DACD;;;;;","names":["h","Button","SearchSlimIcon","once","updateBreakpoints","SearchTextArea","randomID","buildStandaloneSearchBox","buildSearchBox","SafeStorage","StorageItems","SuggestionManager","spreadProperties","index","isNullOrUndefined","isMacOS","hasKeyboard","elementHasQuery","getDefaultSlotFromHost","Host","SearchBoxWrapper","isFocusingOut","InitializeBindings","BindStateToController","AriaLiveRegion"],"sources":["src/components/common/search-box/stencil-submit-button.tsx","src/components/search/atomic-search-box/atomic-search-box.pcss?tag=atomic-search-box&encapsulation=shadow","src/components/search/atomic-search-box/atomic-search-box.tsx"],"sourcesContent":["import {FunctionalComponent, h} from '@stencil/core';\nimport SearchSlimIcon from '../../../images/search-slim.svg';\nimport {AnyBindings} from '../interface/bindings';\nimport {Button} from '../stencil-button';\n\ninterface Props {\n bindings: AnyBindings;\n disabled: boolean;\n onClick: () => void;\n}\n\nexport const SubmitButton: FunctionalComponent<Props> = ({\n bindings,\n disabled,\n onClick,\n}) => (\n <div\n part=\"submit-button-wrapper\"\n class=\"mr-2 flex items-center justify-center py-2\"\n >\n <Button\n style=\"text-primary\"\n class=\"flex h-8 w-8 shrink-0 items-center justify-center rounded-full\"\n part=\"submit-button\"\n ariaLabel={bindings.i18n.t('search')}\n onClick={() => {\n onClick?.();\n }}\n disabled={disabled}\n >\n <atomic-icon\n part=\"submit-icon\"\n icon={SearchSlimIcon}\n class=\"h-4 w-4\"\n ></atomic-icon>\n </Button>\n </div>\n);\n","@import '../../../global/global.pcss';\n@import '../../common/search-box/search-box.pcss';\n\n[part~='instant-results-item'] {\n @apply p-3;\n}\n\n[part~='instant-results-show-all'] {\n @apply border-t-neutral justify-center border-t py-1;\n margin-top: auto;\n box-sizing: content-box;\n button {\n background-color: transparent;\n }\n}\n\n[part~='suggestions-left'] + [part~='suggestions-right'] {\n @apply border-l-neutral border-l;\n}\n\n[part~='suggestions-wrapper'] {\n flex-direction: column;\n @media (width >= theme(--breakpoint-desktop)) {\n flex-direction: row;\n }\n}\n\n:host {\n @apply relative z-10;\n}\n","import {isNullOrUndefined} from '@coveo/bueno';\nimport {\n SearchBox,\n SearchBoxState,\n buildSearchBox,\n StandaloneSearchBox,\n StandaloneSearchBoxState,\n buildStandaloneSearchBox,\n SearchBoxOptions,\n} from '@coveo/headless';\nimport {\n Component,\n h,\n State,\n Prop,\n Listen,\n Watch,\n Element,\n Event,\n EventEmitter,\n Host,\n} from '@stencil/core';\nimport {hasKeyboard, isMacOS} from '../../../utils/device-utils';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {\n SafeStorage,\n StandaloneSearchBoxData,\n StorageItems,\n} from '../../../utils/local-storage-utils';\nimport {updateBreakpoints} from '../../../utils/replace-breakpoint-utils';\nimport {AriaLiveRegion} from '../../../utils/stencil-accessibility-utils';\nimport {\n isFocusingOut,\n once,\n randomID,\n spreadProperties,\n} from '../../../utils/utils';\nimport {RedirectionPayload} from '../../common/search-box/redirection-payload';\nimport {SearchBoxWrapper} from '../../common/search-box/stencil-search-box-wrapper';\nimport {SearchTextArea} from '../../common/search-box/stencil-search-text-area';\nimport {SubmitButton} from '../../common/search-box/stencil-submit-button';\nimport {SuggestionManager} from '../../common/suggestions/stencil-suggestion-manager';\nimport {\n elementHasQuery,\n} from '../../common/suggestions/suggestions-utils';\nimport type {\n SearchBoxSuggestionElement,\n SearchBoxSuggestionsBindings,\n SearchBoxSuggestionsEvent,\n} from '../../common/suggestions/suggestions-types';\nimport {Bindings} from '../atomic-search-interface/atomic-search-interface';\nimport { getDefaultSlotFromHost } from '@/src/utils/slot-utils';\n\n/**\n * The `atomic-search-box` component creates a search box with built-in support for suggestions.\n *\n * @slot default - The default slot where you can add child components to the search box.\n *\n * @part wrapper - The search box wrapper.\n * @part input - The search box input.\n * @part loading - The search box loading animation.\n * @part clear-button - The button to clear the search box of input.\n * @part clear-icon - The clear button's icon.\n * @part submit-button - The search box submit button.\n * @part submit-icon - The search box submit button's icon.\n * @part suggestions - A list of suggested query corrections on each panel.\n * @part suggestions-left - A list of suggested query corrections on the left panel.\n * @part suggestions-right - A list of suggested query corrections on the right panel.\n * @part suggestions-wrapper - The wrapper that contains suggestion panels.\n * @part suggestions-single-list - The wrapper that contains 1 suggestion list.\n * @part suggestions-double-list - The wrapper that contains 2 suggestion lists.\n * @part suggestion - A suggested query correction.\n * @part active-suggestion - The currently active suggestion.\n * @part suggestion-divider - An item in the list that separates groups of suggestions.\n * @part suggestion-with-query - An item in the list that will update the search box query.\n *\n * @part query-suggestion-item - A suggestion from the `atomic-search-box-query-suggestions` component.\n * @part query-suggestion-content - The contents of a suggestion from the `atomic-search-box-query-suggestions` component.\n * @part query-suggestion-icon - The icon of a suggestion from the `atomic-search-box-query-suggestions` component.\n * @part query-suggestion-text - The text of a suggestion from the `atomic-search-box-query-suggestions` component.\n *\n * @part recent-query-item - A suggestion from the `atomic-search-box-recent-queries` component.\n * @part recent-query-content - The contents of a suggestion from the `atomic-search-box-recent-queries` component.\n * @part recent-query-icon - The icon of a suggestion from the `atomic-search-box-recent-queries` component.\n * @part recent-query-text - The text of a suggestion from the `atomic-search-box-recent-queries` component.\n * @part recent-query-text-highlight - The highlighted portion of the text of a suggestion from the `atomic-search-box-recent-queries` component.\n * @part recent-query-title-item - The clear button above suggestions from the `atomic-search-box-recent-queries` component.\n * @part recent-query-title-content - The contents of the clear button above suggestions from the `atomic-search-box-recent-queries` component.\n * @part recent-query-title - The \"recent searches\" text of the clear button above suggestions from the `atomic-search-box-recent-queries` component.\n * @part recent-query-clear - The \"clear\" text of the clear button above suggestions from the `atomic-search-box-recent-queries` component.\n *\n * @part instant-results-item - An instant result rendered by an `atomic-search-box-instant-results` component.\n * @part instant-results-show-all - The clickable suggestion to show all items for the current instant results search rendered by an `atomic-search-box-instant-results` component.\n * @part instant-results-show-all-button - The button inside the clickable suggestion from the `atomic-search-box-instant-results` component.\n */\n@Component({\n tag: 'atomic-search-box',\n styleUrl: 'atomic-search-box.pcss',\n shadow: true,\n})\nexport class AtomicSearchBox implements InitializableComponent<Bindings> {\n @InitializeBindings() public bindings!: Bindings;\n private searchBox!: SearchBox | StandaloneSearchBox;\n private searchBoxSuggestionEventsQueue: CustomEvent<\n SearchBoxSuggestionsEvent<SearchBox | StandaloneSearchBox>\n >[] = [];\n private id!: string;\n private textAreaRef!: HTMLTextAreaElement;\n private suggestionManager!: SuggestionManager<\n SearchBox | StandaloneSearchBox\n >;\n\n @Element() private host!: HTMLElement;\n\n @BindStateToController('searchBox')\n @State()\n private searchBoxState!: SearchBoxState | StandaloneSearchBoxState;\n @State() public error!: Error;\n @State() private isExpanded = false;\n\n /**\n * The amount of queries displayed when the user interacts with the search box.\n * By default, a mix of query suggestions and recent queries will be shown.\n * You can configure those settings using the following components as children:\n * - atomic-search-box-query-suggestions\n * - atomic-search-box-recent-queries\n */\n @Prop({reflect: true}) public numberOfQueries = 8;\n\n /**\n * Defining this option makes the search box standalone (see [Use a\n * Standalone Search Box](https://docs.coveo.com/en/atomic/latest/usage/ssb/)).\n *\n * This option defines the default URL the user should be redirected to, when a query is submitted.\n * If a query pipeline redirect is triggered, it will redirect to that URL instead\n * (see [query pipeline triggers](https://docs.coveo.com/en/1458)).\n */\n @Prop({reflect: true}) public redirectionUrl?: string;\n\n /**\n * The timeout for suggestion queries, in milliseconds.\n * If a suggestion query times out, the suggestions from that particular query won't be shown.\n */\n @Prop() public suggestionTimeout = 400;\n\n /**\n * The delay for suggestion queries on input, in milliseconds.\n *\n * The suggestion request will be delayed until the end user stops typing for at least the specified amount of time.\n *\n * This delay is used to avoid sending too many requests to the Coveo Platform when the user is typing, as well as reducing potential input lag on low end devices.\n * A higher delay will reduce input lag, at the cost of suggestions freshness.\n */\n @Prop() public suggestionDelay = 0;\n\n /**\n * Whether to prevent the user from triggering searches and query suggestions from the component.\n * Perfect for use cases where you need to disable the search conditionally.\n * For the specific case when you need to disable the search based on the length of the query, refer to {@link minimumQueryLength}.\n */\n @Prop({reflect: true}) public disableSearch = false;\n\n /**\n * The minimum query length required to enable search.\n * For example, to disable the search for empty queries, set this to `1`.\n */\n @Prop({reflect: true}) public minimumQueryLength = 0;\n\n /**\n * Whether to clear all active query filters when the end user submits a new query from the search box.\n * Setting this option to \"false\" is not recommended & can lead to an increasing number of queries returning no results.\n */\n @Prop({reflect: true}) public clearFilters = true;\n\n /**\n * Whether to interpret advanced [Coveo Cloud query syntax](https://docs.coveo.com/en/1814/) in the query.\n * You should only enable query syntax in the search box if you have good reasons to do so, as it\n * requires end users to be familiar with Coveo Cloud query syntax, otherwise they will likely be surprised\n * by the search box behaviour.\n *\n * When the `redirection-url` property is set and redirects to a page with more `atomic-search-box` components, all `atomic-search-box` components need to have the same `enable-query-syntax` value.\n */\n @Prop({reflect: true}) public enableQuerySyntax = false;\n\n /**\n * Event that is emitted when a standalone search box redirection is triggered. By default, the search box will directly change the URL and redirect accordingly, so if you want to handle the redirection differently, use this event.\n *\n * Example:\n * ```html\n * <script>\n * document.querySelector('atomic-search-box').addEventListener((e) => {\n * e.preventDefault();\n * // handle redirection\n * });\n * </script>\n * ...\n * <atomic-search-box redirection-url=\"/search\"></atomic-search-box>\n * ```\n */\n @Event({\n eventName: 'redirect',\n })\n public redirect!: EventEmitter<RedirectionPayload>;\n\n @AriaLiveRegion('search-box')\n protected searchBoxAriaMessage!: string;\n\n @AriaLiveRegion('search-suggestions', true)\n protected suggestionsAriaMessage!: string;\n\n private isStandaloneSearchBox(\n searchBox: SearchBox | StandaloneSearchBox\n ): searchBox is StandaloneSearchBox {\n return 'redirectTo' in searchBox;\n }\n\n public initialize() {\n this.id ||= randomID('atomic-search-box-');\n\n this.initializeSearchboxController();\n this.initializeSuggestionManager();\n }\n\n private updateRedirectionUrl() {\n if (this.isStandaloneSearchBox(this.searchBox) && this.redirectionUrl) {\n this.searchBox.updateRedirectUrl(this.redirectionUrl);\n } else {\n this.registerNewSearchBoxController();\n }\n }\n\n private registerNewSearchBoxController() {\n this.disconnectedCallback();\n this.initialize();\n }\n\n private initializeSearchboxController() {\n this.searchBox = this.redirectionUrl\n ? buildStandaloneSearchBox(this.bindings.engine, {\n options: {\n ...this.searchBoxOptions,\n redirectionUrl: this.redirectionUrl,\n overwrite: true,\n },\n })\n : buildSearchBox(this.bindings.engine, {\n options: this.searchBoxOptions,\n });\n }\n\n public componentWillUpdate() {\n if (\n !('redirectTo' in this.searchBoxState) ||\n !('afterRedirection' in this.searchBox)\n ) {\n return;\n }\n\n const {redirectTo, value, analytics} = this.searchBoxState;\n\n if (redirectTo === '') {\n return;\n }\n const data: StandaloneSearchBoxData = {\n value,\n enableQuerySyntax: this.enableQuerySyntax,\n analytics,\n };\n const storage = new SafeStorage();\n storage.setJSON(StorageItems.STANDALONE_SEARCH_BOX_DATA, data);\n\n this.searchBox.afterRedirection();\n const event = this.redirect.emit({redirectTo, value});\n if (!event.defaultPrevented) {\n window.location.href = redirectTo;\n }\n }\n\n public disconnectedCallback = () => {};\n\n @Listen('atomic/searchBoxSuggestion/register')\n public registerSuggestions(\n event: CustomEvent<\n SearchBoxSuggestionsEvent<SearchBox | StandaloneSearchBox>\n >\n ) {\n if (!this.bindings) {\n this.searchBoxSuggestionEventsQueue.push(event);\n } else {\n this.suggestionManager.registerSuggestionsFromEvent(\n event,\n this.suggestionBindings\n );\n }\n }\n\n private registerSearchboxSuggestionEvents() {\n this.searchBoxSuggestionEventsQueue.forEach((evt) => {\n this.suggestionManager.registerSuggestionsFromEvent(\n evt,\n this.suggestionBindings\n );\n });\n this.searchBoxSuggestionEventsQueue = [];\n }\n\n @Watch('redirectionUrl')\n watchRedirectionUrl() {\n this.updateRedirectionUrl();\n }\n\n private initializeSuggestionManager() {\n if (this.suggestionManager) {\n return;\n }\n\n this.suggestionManager = new SuggestionManager({\n getNumberOfSuggestionsToDisplay: () => this.numberOfQueries,\n updateQuery: (query) => this.searchBox.updateText(query),\n getSearchBoxValue: () => this.searchBoxState.value,\n getSuggestionTimeout: () => this.suggestionTimeout,\n getSuggestionDelay: () => this.suggestionDelay,\n getHost: () => this.host,\n getLogger: () => this.bindings.engine.logger,\n });\n this.suggestionManager.initializeSuggestions(this.suggestionBindings);\n }\n\n private get suggestionBindings(): SearchBoxSuggestionsBindings<\n SearchBox | StandaloneSearchBox\n > {\n return spreadProperties(\n this.bindings,\n this.suggestionManager.partialSuggestionBindings,\n this.partialSuggestionBindings\n );\n }\n\n private get partialSuggestionBindings(): Pick<\n SearchBoxSuggestionsBindings<SearchBox | StandaloneSearchBox>,\n | 'id'\n | 'isStandalone'\n | 'searchBoxController'\n | 'numberOfQueries'\n | 'clearFilters'\n > {\n return Object.defineProperties(\n {...this.bindings},\n {\n id: {\n get: () => this.id,\n enumerable: true,\n },\n searchBoxController: {\n get: () => this.searchBox,\n enumerable: true,\n },\n isStandalone: {\n get: () => !!this.redirectionUrl,\n enumerable: true,\n },\n numberOfQueries: {\n get: () => this.numberOfQueries,\n enumerable: true,\n },\n clearFilters: {\n get: () => this.clearFilters,\n enumerable: true,\n },\n }\n ) as unknown as Pick<\n SearchBoxSuggestionsBindings<SearchBox | StandaloneSearchBox>,\n | 'id'\n | 'isStandalone'\n | 'searchBoxController'\n | 'numberOfQueries'\n | 'clearFilters'\n >;\n }\n\n private get searchBoxOptions(): SearchBoxOptions {\n return {\n id: this.id,\n numberOfSuggestions: 0,\n highlightOptions: {\n notMatchDelimiters: {\n open: '<span class=\"font-bold\">',\n close: '</span>',\n },\n correctionDelimiters: {\n open: '<span class=\"font-normal\">',\n close: '</span>',\n },\n },\n clearFilters: this.clearFilters,\n enableQuerySyntax: this.enableQuerySyntax,\n };\n }\n\n private updateBreakpoints = once(() => updateBreakpoints(this.host));\n\n private async onInput(value: string) {\n this.searchBox.updateText(value);\n\n if (this.isSearchDisabledForEndUser(value)) {\n this.suggestionManager.clearSuggestions();\n return;\n }\n this.isExpanded = true;\n await this.suggestionManager.triggerSuggestions();\n this.announceNewSuggestionsToScreenReader();\n }\n\n private async onFocus() {\n if (this.isExpanded) {\n return;\n }\n this.isExpanded = true;\n await this.suggestionManager.triggerSuggestions();\n this.announceNewSuggestionsToScreenReader();\n }\n\n private onSubmit() {\n this.isExpanded = false;\n if (this.suggestionManager.keyboardActiveDescendant) {\n this.suggestionManager.onSubmit();\n return;\n }\n\n this.searchBox.submit();\n }\n\n private async onKeyDown(e: KeyboardEvent) {\n if (this.isSearchDisabledForEndUser(this.searchBoxState.value)) {\n return;\n }\n\n switch (e.key) {\n case 'Enter':\n this.onSubmit();\n break;\n case 'Escape':\n this.suggestionManager.clearSuggestions();\n break;\n case 'ArrowDown':\n e.preventDefault();\n await this.suggestionManager.focusNextValue();\n this.announceNewActiveSuggestionToScreenReader();\n break;\n case 'ArrowUp':\n e.preventDefault();\n await this.suggestionManager.focusPreviousValue();\n this.announceNewActiveSuggestionToScreenReader();\n break;\n case 'ArrowRight':\n if (\n this.suggestionManager.hasActiveDescendant ||\n !this.searchBox.state.value\n ) {\n e.preventDefault();\n this.suggestionManager.focusPanel('right');\n this.announceNewActiveSuggestionToScreenReader();\n }\n break;\n case 'ArrowLeft':\n if (\n this.suggestionManager.hasActiveDescendant ||\n !this.searchBox.state.value\n ) {\n e.preventDefault();\n this.suggestionManager.focusPanel('left');\n this.announceNewActiveSuggestionToScreenReader();\n }\n break;\n case 'Tab':\n this.suggestionManager.clearSuggestions();\n break;\n default:\n if (this.suggestionManager.keyboardActiveDescendant) {\n this.suggestionManager.updateKeyboardActiveDescendant();\n }\n break;\n }\n }\n\n private triggerTextAreaChange(value: string) {\n this.textAreaRef.value = value;\n this.textAreaRef.dispatchEvent(new window.Event('change'));\n }\n\n private renderSuggestion(\n item: SearchBoxSuggestionElement,\n index: number,\n lastIndex: number,\n side: 'left' | 'right'\n ) {\n const id = `${this.id}-${side}-suggestion-${item.key}`;\n\n const isSelected = id === this.suggestionManager.activeDescendant;\n\n if (index === lastIndex && item.hideIfLast) {\n return null;\n }\n\n return (\n <atomic-suggestion-renderer\n i18n={this.bindings.i18n}\n id={id}\n suggestion={item}\n isSelected={isSelected}\n side={side}\n index={index}\n lastIndex={lastIndex}\n isDoubleList={this.suggestionManager.isDoubleList}\n onClick={(e: Event) => {\n this.suggestionManager.onSuggestionClick(item, e);\n if (item.key === 'recent-query-clear') {\n return;\n }\n\n this.isExpanded = false;\n }}\n onMouseOver={() => {\n this.suggestionManager.onSuggestionMouseOver(item, side, id);\n }}\n ></atomic-suggestion-renderer>\n );\n }\n\n private renderPanel(\n side: 'left' | 'right',\n elements: SearchBoxSuggestionElement[],\n setRef: (el: HTMLElement | undefined) => void,\n getRef: () => HTMLElement | undefined\n ) {\n if (!elements.length) {\n return null;\n }\n\n return (\n <div\n part={`suggestions suggestions-${side}`}\n ref={setRef}\n class=\"flex grow basis-1/2 flex-col\"\n onMouseDown={(e) => {\n if (e.target === getRef()) {\n e.preventDefault();\n }\n }}\n >\n {elements.map((suggestion, index) =>\n this.renderSuggestion(suggestion, index, elements.length - 1, side)\n )}\n </div>\n );\n }\n\n private get shouldShowSuggestions() {\n return (\n this.suggestionManager.hasSuggestions &&\n this.isExpanded &&\n !this.isSearchDisabledForEndUser(this.searchBoxState.value)\n );\n }\n\n private renderSuggestions() {\n return (\n <div\n id={`${this.id}-popup`}\n part={`suggestions-wrapper ${\n this.suggestionManager.isDoubleList\n ? 'suggestions-double-list'\n : 'suggestions-single-list'\n }`}\n class={`bg-background border-neutral absolute top-full left-0 z-10 flex w-full rounded-md border ${\n this.shouldShowSuggestions ? '' : 'hidden'\n }`}\n role=\"application\"\n aria-label={this.bindings.i18n.t(\n this.suggestionManager.isDoubleList\n ? 'search-suggestions-double-list'\n : 'search-suggestions-single-list'\n )}\n {...(this.suggestionManager.activeDescendant && {\n 'aria-activedescendant': this.suggestionManager.activeDescendant,\n })}\n >\n {this.renderPanel(\n 'left',\n this.suggestionManager.leftSuggestionElements,\n (el) => (this.suggestionManager.leftPanel = el),\n () => this.suggestionManager.leftPanel\n )}\n {this.renderPanel(\n 'right',\n this.suggestionManager.rightSuggestionElements,\n (el) => (this.suggestionManager.rightPanel = el),\n () => this.suggestionManager.rightPanel\n )}\n </div>\n );\n }\n\n private renderTextBox = (searchLabel: string) => {\n const props = {\n loading: this.searchBoxState.isLoading,\n bindings: this.bindings,\n value: this.searchBoxState.value,\n title: searchLabel,\n ariaLabel: searchLabel,\n onFocus: () => this.onFocus(),\n onInput: (e: Event) =>\n this.onInput(\n (e.target as HTMLInputElement | HTMLTextAreaElement).value\n ),\n onKeyDown: (e: KeyboardEvent) => this.onKeyDown(e),\n onClear: () => {\n this.announceClearSearchBoxToScreenReader()\n this.searchBox.clear();\n this.suggestionManager.clearSuggestions();\n },\n popup: {\n id: `${this.id}-popup`,\n activeDescendant: this.suggestionManager.activeDescendant,\n expanded: this.isExpanded,\n hasSuggestions: this.suggestionManager.hasSuggestions,\n },\n };\n\n return (\n <SearchTextArea\n textAreaRef={this.textAreaRef}\n ref={(el) => (this.textAreaRef = el as HTMLTextAreaElement)}\n {...props}\n onClear={() => {\n props.onClear();\n this.triggerTextAreaChange('');\n }}\n />\n );\n };\n\n private renderAbsolutePositionSpacer() {\n return (\n <textarea\n aria-hidden\n part=\"textarea-spacer\"\n class=\"invisible w-full px-4 py-3.5 text-lg\"\n rows={1}\n ></textarea>\n );\n }\n\n private isSearchDisabledForEndUser(queryValue?: string) {\n if (isNullOrUndefined(queryValue)) {\n return this.disableSearch;\n }\n\n if (queryValue.trim().length < this.minimumQueryLength) {\n return true;\n }\n\n return this.disableSearch;\n }\n\n private getSearchInputLabel(minimumQueryLength = 0) {\n if (this.isSearchDisabledForEndUser(this.searchBoxState.value)) {\n return this.bindings.i18n.t('search-disabled', {\n length: minimumQueryLength,\n });\n }\n\n if (isMacOS()) {\n return this.bindings.i18n.t('search-box-with-suggestions-macos');\n }\n if (!hasKeyboard()) {\n return this.bindings.i18n.t('search-box-with-suggestions-keyboardless');\n }\n return this.bindings.i18n.t('search-box-with-suggestions');\n }\n\n private announceNewActiveSuggestionToScreenReader() {\n const ariaLabel = this.suggestionManager.activeDescendantElement?.ariaLabel;\n if (isMacOS() && ariaLabel) {\n this.suggestionsAriaMessage = ariaLabel;\n }\n }\n\n private announceClearSearchBoxToScreenReader() {\n this.suggestionsAriaMessage = this.bindings.i18n.t(\"search-box-cleared\")\n }\n\n private announceNewSuggestionsToScreenReader() {\n const elsLength =\n this.suggestionManager.allSuggestionElements.filter(\n elementHasQuery\n ).length;\n this.searchBoxAriaMessage = elsLength\n ? this.bindings.i18n.t(\n this.searchBoxState.value\n ? 'query-suggestions-available'\n : 'query-suggestions-available-no-query',\n {\n count: elsLength,\n query: this.searchBoxState.value,\n }\n )\n : this.bindings.i18n.t('query-suggestions-unavailable');\n }\n\n private renderSlotContent() {\n const hasDefaultSlot = !!getDefaultSlotFromHost(this.host);\n\n if (hasDefaultSlot) {\n return <slot></slot>;\n }\n\n return [\n <atomic-search-box-recent-queries></atomic-search-box-recent-queries>,\n <atomic-search-box-query-suggestions></atomic-search-box-query-suggestions>,\n ];\n }\n\n public render() {\n this.updateBreakpoints();\n\n const searchLabel = this.getSearchInputLabel(this.minimumQueryLength);\n const isDisabled = this.isSearchDisabledForEndUser(\n this.searchBoxState.value\n );\n if (!this.suggestionManager.suggestions.length) {\n this.registerSearchboxSuggestionEvents();\n }\n\n return (\n <Host>\n {this.renderAbsolutePositionSpacer()}\n {[\n <SearchBoxWrapper\n disabled={isDisabled}\n onFocusout={(event) => {\n if (!isFocusingOut(event)) {\n return;\n }\n this.suggestionManager.clearSuggestions();\n this.isExpanded = false;\n }}\n >\n {this.renderTextBox(searchLabel)}\n <SubmitButton\n bindings={this.bindings}\n disabled={isDisabled}\n onClick={() => {\n this.searchBox.submit();\n this.suggestionManager.clearSuggestions();\n }}\n />\n {this.renderSuggestions()}\n </SearchBoxWrapper>,\n this.renderSlotContent(),\n ]}\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"atomic-search-box.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,MAAM,YAAY,GAA+B,CAAC,EACvD,QAAQ,EACR,QAAQ,EACR,OAAO,GACR,MACCA,iBACE,IAAI,EAAC,uBAAuB,EAC5B,KAAK,EAAC,4CAA4C;IAElDA,QAACC,oBAAM,IACL,KAAK,EAAC,cAAc,EACpB,KAAK,EAAC,gEAAgE,EACtE,IAAI,EAAC,eAAe,EACpB,SAAS,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,EACpC,OAAO,EAAE;YACP,OAAO,IAAI,CAAC;SACb,EACD,QAAQ,EAAE,QAAQ;QAElBD,yBACE,IAAI,EAAC,aAAa,EAClB,IAAI,EAAEE,uCAAc,EACpB,KAAK,EAAC,SAAS,GACF,CACR,CACL,CACP;;ACrCD,MAAM,kBAAkB,GAAG,wioEAAwioE,CAAC;AACpk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B,EAAE,CACR;YACnB,IAAI,CAAC,iBAAiB,EAAE;SACzB,CACI,EACP;KACH;;;;;;AAjpB4B;IAA5BsB,sCAAkB,EAAE;iDAA4B;AAezC;IAFPC,yCAAqB,CAAC,WAAW,CAAC;uDAEgC;AAyFzD;IADTC,wCAAc,CAAC,YAAY,CAAC;6DACW;AAG9B;IADTA,wCAAc,CAAC,oBAAoB,EAAE,IAAI,CAAC;+DACD;;;;;","names":["h","Button","SearchSlimIcon","once","updateBreakpoints","SearchTextArea","randomID","buildStandaloneSearchBox","buildSearchBox","SafeStorage","StorageItems","SuggestionManager","spreadProperties","index","isNullOrUndefined","isMacOS","hasKeyboard","elementHasQuery","getDefaultSlotFromHost","Host","SearchBoxWrapper","isFocusingOut","InitializeBindings","BindStateToController","AriaLiveRegion"],"sources":["src/components/common/search-box/stencil-submit-button.tsx","src/components/search/atomic-search-box/atomic-search-box.pcss?tag=atomic-search-box&encapsulation=shadow","src/components/search/atomic-search-box/atomic-search-box.tsx"],"sourcesContent":["import {FunctionalComponent, h} from '@stencil/core';\nimport SearchSlimIcon from '../../../images/search-slim.svg';\nimport {AnyBindings} from '../interface/bindings';\nimport {Button} from '../stencil-button';\n\ninterface Props {\n bindings: AnyBindings;\n disabled: boolean;\n onClick: () => void;\n}\n\nexport const SubmitButton: FunctionalComponent<Props> = ({\n bindings,\n disabled,\n onClick,\n}) => (\n <div\n part=\"submit-button-wrapper\"\n class=\"mr-2 flex items-center justify-center py-2\"\n >\n <Button\n style=\"text-primary\"\n class=\"flex h-8 w-8 shrink-0 items-center justify-center rounded-full\"\n part=\"submit-button\"\n ariaLabel={bindings.i18n.t('search')}\n onClick={() => {\n onClick?.();\n }}\n disabled={disabled}\n >\n <atomic-icon\n part=\"submit-icon\"\n icon={SearchSlimIcon}\n class=\"h-4 w-4\"\n ></atomic-icon>\n </Button>\n </div>\n);\n","@import '../../../global/global.pcss';\n@import '../../common/search-box/search-box.pcss';\n\n[part~='instant-results-item'] {\n @apply p-3;\n}\n\n[part~='instant-results-show-all'] {\n @apply border-t-neutral justify-center border-t py-1;\n margin-top: auto;\n box-sizing: content-box;\n button {\n background-color: transparent;\n }\n}\n\n[part~='suggestions-left'] + [part~='suggestions-right'] {\n @apply border-l-neutral border-l;\n}\n\n[part~='suggestions-wrapper'] {\n flex-direction: column;\n @media (width >= theme(--breakpoint-desktop)) {\n flex-direction: row;\n }\n}\n\n:host {\n @apply relative z-10;\n}\n","import {isNullOrUndefined} from '@coveo/bueno';\nimport {\n SearchBox,\n SearchBoxState,\n buildSearchBox,\n StandaloneSearchBox,\n StandaloneSearchBoxState,\n buildStandaloneSearchBox,\n SearchBoxOptions,\n} from '@coveo/headless';\nimport {\n Component,\n h,\n State,\n Prop,\n Listen,\n Watch,\n Element,\n Event,\n EventEmitter,\n Host,\n} from '@stencil/core';\nimport {hasKeyboard, isMacOS} from '../../../utils/device-utils';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {\n SafeStorage,\n StandaloneSearchBoxData,\n StorageItems,\n} from '../../../utils/local-storage-utils';\nimport {updateBreakpoints} from '../../../utils/replace-breakpoint-utils';\nimport {AriaLiveRegion} from '../../../utils/stencil-accessibility-utils';\nimport {\n isFocusingOut,\n once,\n randomID,\n spreadProperties,\n} from '../../../utils/utils';\nimport {RedirectionPayload} from '../../common/search-box/redirection-payload';\nimport {SearchBoxWrapper} from '../../common/search-box/stencil-search-box-wrapper';\nimport {SearchTextArea} from '../../common/search-box/stencil-search-text-area';\nimport {SubmitButton} from '../../common/search-box/stencil-submit-button';\nimport {SuggestionManager} from '../../common/suggestions/stencil-suggestion-manager';\nimport {\n elementHasQuery,\n} from '../../common/suggestions/suggestions-utils';\nimport type {\n SearchBoxSuggestionElement,\n SearchBoxSuggestionsBindings,\n SearchBoxSuggestionsEvent,\n} from '../../common/suggestions/suggestions-types';\nimport {Bindings} from '../atomic-search-interface/atomic-search-interface';\nimport { getDefaultSlotFromHost } from '@/src/utils/slot-utils';\n\n/**\n * The `atomic-search-box` component creates a search box with built-in support for suggestions.\n *\n * @slot default - The default slot where you can add child components to the search box.\n *\n * @part wrapper - The search box wrapper.\n * @part input - The search box input.\n * @part loading - The search box loading animation.\n * @part clear-button - The button to clear the search box of input.\n * @part clear-icon - The clear button's icon.\n * @part submit-button - The search box submit button.\n * @part submit-icon - The search box submit button's icon.\n * @part suggestions - A list of suggested query corrections on each panel.\n * @part suggestions-left - A list of suggested query corrections on the left panel.\n * @part suggestions-right - A list of suggested query corrections on the right panel.\n * @part suggestions-wrapper - The wrapper that contains suggestion panels.\n * @part suggestions-single-list - The wrapper that contains 1 suggestion list.\n * @part suggestions-double-list - The wrapper that contains 2 suggestion lists.\n * @part suggestion - A suggested query correction.\n * @part active-suggestion - The currently active suggestion.\n * @part suggestion-divider - An item in the list that separates groups of suggestions.\n * @part suggestion-with-query - An item in the list that will update the search box query.\n *\n * @part query-suggestion-item - A suggestion from the `atomic-search-box-query-suggestions` component.\n * @part query-suggestion-content - The contents of a suggestion from the `atomic-search-box-query-suggestions` component.\n * @part query-suggestion-icon - The icon of a suggestion from the `atomic-search-box-query-suggestions` component.\n * @part query-suggestion-text - The text of a suggestion from the `atomic-search-box-query-suggestions` component.\n *\n * @part recent-query-item - A suggestion from the `atomic-search-box-recent-queries` component.\n * @part recent-query-content - The contents of a suggestion from the `atomic-search-box-recent-queries` component.\n * @part recent-query-icon - The icon of a suggestion from the `atomic-search-box-recent-queries` component.\n * @part recent-query-text - The text of a suggestion from the `atomic-search-box-recent-queries` component.\n * @part recent-query-text-highlight - The highlighted portion of the text of a suggestion from the `atomic-search-box-recent-queries` component.\n * @part recent-query-title-item - The clear button above suggestions from the `atomic-search-box-recent-queries` component.\n * @part recent-query-title-content - The contents of the clear button above suggestions from the `atomic-search-box-recent-queries` component.\n * @part recent-query-title - The \"recent searches\" text of the clear button above suggestions from the `atomic-search-box-recent-queries` component.\n * @part recent-query-clear - The \"clear\" text of the clear button above suggestions from the `atomic-search-box-recent-queries` component.\n *\n * @part instant-results-item - An instant result rendered by an `atomic-search-box-instant-results` component.\n * @part instant-results-show-all - The clickable suggestion to show all items for the current instant results search rendered by an `atomic-search-box-instant-results` component.\n * @part instant-results-show-all-button - The button inside the clickable suggestion from the `atomic-search-box-instant-results` component.\n */\n@Component({\n tag: 'atomic-search-box',\n styleUrl: 'atomic-search-box.pcss',\n shadow: true,\n})\nexport class AtomicSearchBox implements InitializableComponent<Bindings> {\n @InitializeBindings() public bindings!: Bindings;\n private searchBox!: SearchBox | StandaloneSearchBox;\n private searchBoxSuggestionEventsQueue: CustomEvent<\n SearchBoxSuggestionsEvent<SearchBox | StandaloneSearchBox>\n >[] = [];\n private id!: string;\n private textAreaRef!: HTMLTextAreaElement;\n private suggestionManager!: SuggestionManager<\n SearchBox | StandaloneSearchBox\n >;\n\n @Element() private host!: HTMLElement;\n\n @BindStateToController('searchBox')\n @State()\n private searchBoxState!: SearchBoxState | StandaloneSearchBoxState;\n @State() public error!: Error;\n @State() private isExpanded = false;\n\n /**\n * The amount of queries displayed when the user interacts with the search box.\n * By default, a mix of query suggestions and recent queries will be shown.\n * You can configure those settings using the following components as children:\n * - atomic-search-box-query-suggestions\n * - atomic-search-box-recent-queries\n */\n @Prop({reflect: true}) public numberOfQueries = 8;\n\n /**\n * Defining this option makes the search box standalone (see [Use a\n * Standalone Search Box](https://docs.coveo.com/en/atomic/latest/usage/ssb/)).\n *\n * This option defines the default URL the user should be redirected to, when a query is submitted.\n * If a query pipeline redirect is triggered, it will redirect to that URL instead\n * (see [query pipeline triggers](https://docs.coveo.com/en/1458)).\n */\n @Prop({reflect: true}) public redirectionUrl?: string;\n\n /**\n * The timeout for suggestion queries, in milliseconds.\n * If a suggestion query times out, the suggestions from that particular query won't be shown.\n */\n @Prop() public suggestionTimeout = 400;\n\n /**\n * The delay for suggestion queries on input, in milliseconds.\n *\n * The suggestion request will be delayed until the end user stops typing for at least the specified amount of time.\n *\n * This delay is used to avoid sending too many requests to the Coveo Platform when the user is typing, as well as reducing potential input lag on low end devices.\n * A higher delay will reduce input lag, at the cost of suggestions freshness.\n */\n @Prop() public suggestionDelay = 0;\n\n /**\n * Whether to prevent the user from triggering searches and query suggestions from the component.\n * Perfect for use cases where you need to disable the search conditionally.\n * For the specific case when you need to disable the search based on the length of the query, refer to {@link minimumQueryLength}.\n */\n @Prop({reflect: true}) public disableSearch = false;\n\n /**\n * The minimum query length required to enable search.\n * For example, to disable the search for empty queries, set this to `1`.\n */\n @Prop({reflect: true}) public minimumQueryLength = 0;\n\n /**\n * Whether to clear all active query filters when the end user submits a new query from the search box.\n * Setting this option to \"false\" is not recommended & can lead to an increasing number of queries returning no results.\n */\n @Prop({reflect: true}) public clearFilters = true;\n\n /**\n * Whether to interpret advanced [Coveo Cloud query syntax](https://docs.coveo.com/en/1814/) in the query.\n * You should only enable query syntax in the search box if you have good reasons to do so, as it\n * requires end users to be familiar with Coveo Cloud query syntax, otherwise they will likely be surprised\n * by the search box behaviour.\n *\n * When the `redirection-url` property is set and redirects to a page with more `atomic-search-box` components, all `atomic-search-box` components need to have the same `enable-query-syntax` value.\n */\n @Prop({reflect: true}) public enableQuerySyntax = false;\n\n /**\n * Event that is emitted when a standalone search box redirection is triggered. By default, the search box will directly change the URL and redirect accordingly, so if you want to handle the redirection differently, use this event.\n *\n * Example:\n * ```html\n * <script>\n * document.querySelector('atomic-search-box').addEventListener((e) => {\n * e.preventDefault();\n * // handle redirection\n * });\n * </script>\n * ...\n * <atomic-search-box redirection-url=\"/search\"></atomic-search-box>\n * ```\n */\n @Event({\n eventName: 'redirect',\n })\n public redirect!: EventEmitter<RedirectionPayload>;\n\n @AriaLiveRegion('search-box')\n protected searchBoxAriaMessage!: string;\n\n @AriaLiveRegion('search-suggestions', true)\n protected suggestionsAriaMessage!: string;\n\n private isStandaloneSearchBox(\n searchBox: SearchBox | StandaloneSearchBox\n ): searchBox is StandaloneSearchBox {\n return 'redirectTo' in searchBox;\n }\n\n public initialize() {\n this.id ||= randomID('atomic-search-box-');\n\n this.initializeSearchboxController();\n this.initializeSuggestionManager();\n }\n\n private updateRedirectionUrl() {\n if (this.isStandaloneSearchBox(this.searchBox) && this.redirectionUrl) {\n this.searchBox.updateRedirectUrl(this.redirectionUrl);\n } else {\n this.registerNewSearchBoxController();\n }\n }\n\n private registerNewSearchBoxController() {\n this.disconnectedCallback();\n this.initialize();\n }\n\n private initializeSearchboxController() {\n this.searchBox = this.redirectionUrl\n ? buildStandaloneSearchBox(this.bindings.engine, {\n options: {\n ...this.searchBoxOptions,\n redirectionUrl: this.redirectionUrl,\n overwrite: true,\n },\n })\n : buildSearchBox(this.bindings.engine, {\n options: this.searchBoxOptions,\n });\n }\n\n public componentWillUpdate() {\n if (\n !('redirectTo' in this.searchBoxState) ||\n !('afterRedirection' in this.searchBox)\n ) {\n return;\n }\n\n const {redirectTo, value, analytics} = this.searchBoxState;\n\n if (redirectTo === '') {\n return;\n }\n const data: StandaloneSearchBoxData = {\n value,\n enableQuerySyntax: this.enableQuerySyntax,\n analytics,\n };\n const storage = new SafeStorage();\n storage.setJSON(StorageItems.STANDALONE_SEARCH_BOX_DATA, data);\n\n this.searchBox.afterRedirection();\n const event = this.redirect.emit({redirectTo, value});\n if (!event.defaultPrevented) {\n window.location.href = redirectTo;\n }\n }\n\n public disconnectedCallback = () => {};\n\n @Listen('atomic/searchBoxSuggestion/register')\n public registerSuggestions(\n event: CustomEvent<\n SearchBoxSuggestionsEvent<SearchBox | StandaloneSearchBox>\n >\n ) {\n if (!this.bindings) {\n this.searchBoxSuggestionEventsQueue.push(event);\n } else {\n this.suggestionManager.registerSuggestionsFromEvent(\n event,\n this.suggestionBindings\n );\n }\n }\n\n private registerSearchboxSuggestionEvents() {\n this.searchBoxSuggestionEventsQueue.forEach((evt) => {\n this.suggestionManager.registerSuggestionsFromEvent(\n evt,\n this.suggestionBindings\n );\n });\n this.searchBoxSuggestionEventsQueue = [];\n }\n\n @Watch('redirectionUrl')\n watchRedirectionUrl() {\n this.updateRedirectionUrl();\n }\n\n private initializeSuggestionManager() {\n if (this.suggestionManager) {\n return;\n }\n\n this.suggestionManager = new SuggestionManager({\n getNumberOfSuggestionsToDisplay: () => this.numberOfQueries,\n updateQuery: (query) => this.searchBox.updateText(query),\n getSearchBoxValue: () => this.searchBoxState.value,\n getSuggestionTimeout: () => this.suggestionTimeout,\n getSuggestionDelay: () => this.suggestionDelay,\n getHost: () => this.host,\n getLogger: () => this.bindings.engine.logger,\n });\n this.suggestionManager.initializeSuggestions(this.suggestionBindings);\n }\n\n private get suggestionBindings(): SearchBoxSuggestionsBindings<\n SearchBox | StandaloneSearchBox\n > {\n return spreadProperties(\n this.bindings,\n this.suggestionManager.partialSuggestionBindings,\n this.partialSuggestionBindings\n );\n }\n\n private get partialSuggestionBindings(): Pick<\n SearchBoxSuggestionsBindings<SearchBox | StandaloneSearchBox>,\n | 'id'\n | 'isStandalone'\n | 'searchBoxController'\n | 'numberOfQueries'\n | 'clearFilters'\n > {\n return Object.defineProperties(\n {...this.bindings},\n {\n id: {\n get: () => this.id,\n enumerable: true,\n },\n searchBoxController: {\n get: () => this.searchBox,\n enumerable: true,\n },\n isStandalone: {\n get: () => !!this.redirectionUrl,\n enumerable: true,\n },\n numberOfQueries: {\n get: () => this.numberOfQueries,\n enumerable: true,\n },\n clearFilters: {\n get: () => this.clearFilters,\n enumerable: true,\n },\n }\n ) as unknown as Pick<\n SearchBoxSuggestionsBindings<SearchBox | StandaloneSearchBox>,\n | 'id'\n | 'isStandalone'\n | 'searchBoxController'\n | 'numberOfQueries'\n | 'clearFilters'\n >;\n }\n\n private get searchBoxOptions(): SearchBoxOptions {\n return {\n id: this.id,\n numberOfSuggestions: 0,\n highlightOptions: {\n notMatchDelimiters: {\n open: '<span class=\"font-bold\">',\n close: '</span>',\n },\n correctionDelimiters: {\n open: '<span class=\"font-normal\">',\n close: '</span>',\n },\n },\n clearFilters: this.clearFilters,\n enableQuerySyntax: this.enableQuerySyntax,\n };\n }\n\n private updateBreakpoints = once(() => updateBreakpoints(this.host));\n\n private async onInput(value: string) {\n this.searchBox.updateText(value);\n\n if (this.isSearchDisabledForEndUser(value)) {\n this.suggestionManager.clearSuggestions();\n return;\n }\n this.isExpanded = true;\n await this.suggestionManager.triggerSuggestions();\n this.announceNewSuggestionsToScreenReader();\n }\n\n private async onFocus() {\n if (this.isExpanded) {\n return;\n }\n this.isExpanded = true;\n await this.suggestionManager.triggerSuggestions();\n this.announceNewSuggestionsToScreenReader();\n }\n\n private onSubmit() {\n this.isExpanded = false;\n if (this.suggestionManager.keyboardActiveDescendant) {\n this.suggestionManager.onSubmit();\n return;\n }\n\n this.searchBox.submit();\n }\n\n private async onKeyDown(e: KeyboardEvent) {\n if (this.isSearchDisabledForEndUser(this.searchBoxState.value)) {\n return;\n }\n\n switch (e.key) {\n case 'Enter':\n this.onSubmit();\n break;\n case 'Escape':\n this.suggestionManager.clearSuggestions();\n break;\n case 'ArrowDown':\n e.preventDefault();\n await this.suggestionManager.focusNextValue();\n this.announceNewActiveSuggestionToScreenReader();\n break;\n case 'ArrowUp':\n e.preventDefault();\n await this.suggestionManager.focusPreviousValue();\n this.announceNewActiveSuggestionToScreenReader();\n break;\n case 'ArrowRight':\n if (\n this.suggestionManager.hasActiveDescendant ||\n !this.searchBox.state.value\n ) {\n e.preventDefault();\n this.suggestionManager.focusPanel('right');\n this.announceNewActiveSuggestionToScreenReader();\n }\n break;\n case 'ArrowLeft':\n if (\n this.suggestionManager.hasActiveDescendant ||\n !this.searchBox.state.value\n ) {\n e.preventDefault();\n this.suggestionManager.focusPanel('left');\n this.announceNewActiveSuggestionToScreenReader();\n }\n break;\n case 'Tab':\n this.suggestionManager.clearSuggestions();\n break;\n default:\n if (this.suggestionManager.keyboardActiveDescendant) {\n this.suggestionManager.updateKeyboardActiveDescendant();\n }\n break;\n }\n }\n\n private triggerTextAreaChange(value: string) {\n this.textAreaRef.value = value;\n this.textAreaRef.dispatchEvent(new window.Event('change'));\n }\n\n private renderSuggestion(\n item: SearchBoxSuggestionElement,\n index: number,\n lastIndex: number,\n side: 'left' | 'right'\n ) {\n const id = `${this.id}-${side}-suggestion-${item.key}`;\n\n const isSelected = id === this.suggestionManager.activeDescendant;\n\n if (index === lastIndex && item.hideIfLast) {\n return null;\n }\n\n return (\n <atomic-suggestion-renderer\n i18n={this.bindings.i18n}\n id={id}\n suggestion={item}\n isSelected={isSelected}\n side={side}\n index={index}\n lastIndex={lastIndex}\n isDoubleList={this.suggestionManager.isDoubleList}\n onClick={(e: Event) => {\n this.suggestionManager.onSuggestionClick(item, e);\n if (item.key === 'recent-query-clear') {\n return;\n }\n\n this.isExpanded = false;\n }}\n onMouseOver={() => {\n this.suggestionManager.onSuggestionMouseOver(item, side, id);\n }}\n ></atomic-suggestion-renderer>\n );\n }\n\n private renderPanel(\n side: 'left' | 'right',\n elements: SearchBoxSuggestionElement[],\n setRef: (el: HTMLElement | undefined) => void,\n getRef: () => HTMLElement | undefined\n ) {\n if (!elements.length) {\n return null;\n }\n\n return (\n <div\n part={`suggestions suggestions-${side}`}\n ref={setRef}\n class=\"flex grow basis-1/2 flex-col\"\n onMouseDown={(e) => {\n if (e.target === getRef()) {\n e.preventDefault();\n }\n }}\n >\n {elements.map((suggestion, index) =>\n this.renderSuggestion(suggestion, index, elements.length - 1, side)\n )}\n </div>\n );\n }\n\n private get shouldShowSuggestions() {\n return (\n this.suggestionManager.hasSuggestions &&\n this.isExpanded &&\n !this.isSearchDisabledForEndUser(this.searchBoxState.value)\n );\n }\n\n private renderSuggestions() {\n return (\n <div\n id={`${this.id}-popup`}\n part={`suggestions-wrapper ${\n this.suggestionManager.isDoubleList\n ? 'suggestions-double-list'\n : 'suggestions-single-list'\n }`}\n class={`bg-background border-neutral absolute top-full left-0 z-10 flex w-full rounded-md border ${\n this.shouldShowSuggestions ? '' : 'hidden'\n }`}\n role=\"application\"\n aria-label={this.bindings.i18n.t(\n this.suggestionManager.isDoubleList\n ? 'search-suggestions-double-list'\n : 'search-suggestions-single-list'\n )}\n {...(this.suggestionManager.activeDescendant && {\n 'aria-activedescendant': this.suggestionManager.activeDescendant,\n })}\n >\n {this.renderPanel(\n 'left',\n this.suggestionManager.leftSuggestionElements,\n (el) => (this.suggestionManager.leftPanel = el),\n () => this.suggestionManager.leftPanel\n )}\n {this.renderPanel(\n 'right',\n this.suggestionManager.rightSuggestionElements,\n (el) => (this.suggestionManager.rightPanel = el),\n () => this.suggestionManager.rightPanel\n )}\n </div>\n );\n }\n\n private renderTextBox = (searchLabel: string) => {\n const props = {\n loading: this.searchBoxState.isLoading,\n bindings: this.bindings,\n value: this.searchBoxState.value,\n title: searchLabel,\n ariaLabel: searchLabel,\n onFocus: () => this.onFocus(),\n onInput: (e: Event) =>\n this.onInput(\n (e.target as HTMLInputElement | HTMLTextAreaElement).value\n ),\n onKeyDown: (e: KeyboardEvent) => this.onKeyDown(e),\n onClear: () => {\n this.searchBox.clear();\n this.suggestionManager.clearSuggestions();\n },\n popup: {\n id: `${this.id}-popup`,\n activeDescendant: this.suggestionManager.activeDescendant,\n expanded: this.isExpanded,\n hasSuggestions: this.suggestionManager.hasSuggestions,\n },\n };\n\n return (\n <SearchTextArea\n textAreaRef={this.textAreaRef}\n ref={(el) => (this.textAreaRef = el as HTMLTextAreaElement)}\n {...props}\n onClear={() => {\n props.onClear();\n this.triggerTextAreaChange('');\n }}\n />\n );\n };\n\n private renderAbsolutePositionSpacer() {\n return (\n <textarea\n aria-hidden\n part=\"textarea-spacer\"\n class=\"invisible w-full px-4 py-3.5 text-lg\"\n rows={1}\n ></textarea>\n );\n }\n\n private isSearchDisabledForEndUser(queryValue?: string) {\n if (isNullOrUndefined(queryValue)) {\n return this.disableSearch;\n }\n\n if (queryValue.trim().length < this.minimumQueryLength) {\n return true;\n }\n\n return this.disableSearch;\n }\n\n private getSearchInputLabel(minimumQueryLength = 0) {\n if (this.isSearchDisabledForEndUser(this.searchBoxState.value)) {\n return this.bindings.i18n.t('search-disabled', {\n length: minimumQueryLength,\n });\n }\n\n if (isMacOS()) {\n return this.bindings.i18n.t('search-box-with-suggestions-macos');\n }\n if (!hasKeyboard()) {\n return this.bindings.i18n.t('search-box-with-suggestions-keyboardless');\n }\n return this.bindings.i18n.t('search-box-with-suggestions');\n }\n\n private announceNewActiveSuggestionToScreenReader() {\n const ariaLabel = this.suggestionManager.activeDescendantElement?.ariaLabel;\n if (isMacOS() && ariaLabel) {\n this.suggestionsAriaMessage = ariaLabel;\n }\n }\n\n private announceNewSuggestionsToScreenReader() {\n const elsLength =\n this.suggestionManager.allSuggestionElements.filter(\n elementHasQuery\n ).length;\n this.searchBoxAriaMessage = elsLength\n ? this.bindings.i18n.t(\n this.searchBoxState.value\n ? 'query-suggestions-available'\n : 'query-suggestions-available-no-query',\n {\n count: elsLength,\n query: this.searchBoxState.value,\n }\n )\n : this.bindings.i18n.t('query-suggestions-unavailable');\n }\n\n private renderSlotContent() {\n const hasDefaultSlot = !!getDefaultSlotFromHost(this.host);\n\n if (hasDefaultSlot) {\n return <slot></slot>;\n }\n\n return [\n <atomic-search-box-recent-queries></atomic-search-box-recent-queries>,\n <atomic-search-box-query-suggestions></atomic-search-box-query-suggestions>,\n ];\n }\n\n public render() {\n this.updateBreakpoints();\n\n const searchLabel = this.getSearchInputLabel(this.minimumQueryLength);\n const isDisabled = this.isSearchDisabledForEndUser(\n this.searchBoxState.value\n );\n if (!this.suggestionManager.suggestions.length) {\n this.registerSearchboxSuggestionEvents();\n }\n\n return (\n <Host>\n {this.renderAbsolutePositionSpacer()}\n {[\n <SearchBoxWrapper\n disabled={isDisabled}\n onFocusout={(event) => {\n if (!isFocusingOut(event)) {\n return;\n }\n this.suggestionManager.clearSuggestions();\n this.isExpanded = false;\n }}\n >\n {this.renderTextBox(searchLabel)}\n <SubmitButton\n bindings={this.bindings}\n disabled={isDisabled}\n onClick={() => {\n this.searchBox.submit();\n this.suggestionManager.clearSuggestions();\n }}\n />\n {this.renderSuggestions()}\n </SearchBoxWrapper>,\n this.renderSlotContent(),\n ]}\n </Host>\n );\n }\n}\n"],"version":3}
@@ -132,7 +132,7 @@ const AtomicSmartSnippetSource = class {
132
132
  }
133
133
  }
134
134
  render() {
135
- return (index.h(index.Host, { key: 'fde65011dc467182998507feed4f49c9142450b5' }, index.h(stencilItemLink.LinkWithItemAnalytics, { key: '9ae297e97efc52be7b904d3aaffbb0c8b47b83c9', title: this.source.clickUri, href: this.source.clickUri, className: "block truncate", part: "source-url", attributes: this.anchorAttributes, onSelect: () => this.selectSource.emit(), onBeginDelayedSelect: () => this.beginDelayedSelectSource.emit(), onCancelPendingSelect: () => this.cancelPendingSelectSource.emit() }, this.source.clickUri), index.h(stencilItemLink.LinkWithItemAnalytics, { key: 'ecfafbf8f8ec31572728d3f64d8139731d524c70', title: this.source.title, href: this.source.clickUri, attributes: this.anchorAttributes, className: "block", part: "source-title", onSelect: () => this.selectSource.emit(), onBeginDelayedSelect: () => this.beginDelayedSelectSource.emit(), onCancelPendingSelect: () => this.cancelPendingSelectSource.emit() }, index.h("atomic-result-text", { field: "title", default: "no-title", key: this.source.uniqueId }))));
135
+ return (index.h(index.Host, { key: '5a10a0706bf8e80386a0f8da5b879b09466f65cd' }, index.h(stencilItemLink.LinkWithItemAnalytics, { key: '9e829ba9801705e23ca04e971d5b16c8b143852d', title: this.source.clickUri, href: this.source.clickUri, className: "block truncate", part: "source-url", attributes: this.anchorAttributes, onSelect: () => this.selectSource.emit(), onBeginDelayedSelect: () => this.beginDelayedSelectSource.emit(), onCancelPendingSelect: () => this.cancelPendingSelectSource.emit() }, this.source.clickUri), index.h(stencilItemLink.LinkWithItemAnalytics, { key: 'e32f6c7a1c94f4baa3239e18c9d36796d5472827', title: this.source.title, href: this.source.clickUri, attributes: this.anchorAttributes, className: "block", part: "source-title", onSelect: () => this.selectSource.emit(), onBeginDelayedSelect: () => this.beginDelayedSelectSource.emit(), onCancelPendingSelect: () => this.cancelPendingSelectSource.emit() }, index.h("atomic-result-text", { field: "title", default: "no-title", key: this.source.uniqueId }))));
136
136
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OAAO,EACjB,IAAI,EAAC,cAAc,EACnB,QAAQ,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,EACxC,oBAAoB,EAAE,MAAM,IAAI,CAAC,wBAAwB,CAAC,IAAI,EAAE,EAChE,qBAAqB,EAAE,MAAM,IAAI,CAAC,yBAAyB,CAAC,IAAI,EAAE,IAElEH,gCACE,KAAK,EAAC,OAAO,EACb,OAAO,EAAC,UAAU,EAClB,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,GACL,CACA,CACnB,EACP;KACH;;AApD4B;IAA5BI,sCAAkB,EAAE;0DAA+B;;;;;","names":["sanitizeStyle","bindAnalyticsToLink","h","DOMPurify","Host","LinkWithItemAnalytics","InitializeBindings"],"sources":["src/components/common/smart-snippets/atomic-smart-snippet-answer/atomic-smart-snippet-answer.pcss?tag=atomic-smart-snippet-answer&encapsulation=shadow","src/components/common/smart-snippets/atomic-smart-snippet-answer/atomic-smart-snippet-answer.tsx","src/components/common/smart-snippets/atomic-smart-snippet-source.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n:host {\n @apply text-on-background text-lg;\n line-height: calc(var(--text-lg) * var(--atomic-line-height-ratio));\n\n .wrapper {\n display: flow-root;\n .margin {\n margin: 1rem 0;\n }\n }\n}\n\np {\n @apply mt-4 mb-4;\n}\n\nul,\nol {\n @apply mb-4 list-outside list-decimal pl-10;\n}\n\na {\n @apply text-primary underline;\n}\n","import {InlineLink} from '@coveo/headless';\nimport {\n Component,\n h,\n Prop,\n Event,\n EventEmitter,\n Host,\n Element,\n} from '@stencil/core';\nimport DOMPurify from 'dompurify';\nimport {sanitizeStyle} from '../../../../utils/utils';\nimport {bindAnalyticsToLink} from '../../item-link/bind-analytics-to-link';\n\n/**\n * @part answer - The container displaying the full document excerpt.\n * @internal\n */\n@Component({\n tag: 'atomic-smart-snippet-answer',\n styleUrl: 'atomic-smart-snippet-answer.pcss',\n shadow: true,\n})\nexport class AtomicSmartSnippetAnswer {\n @Prop() htmlContent!: string;\n @Prop() innerStyle?: string;\n\n @Element() public host!: HTMLElement;\n\n @Event({bubbles: false})\n private answerSizeUpdated!: EventEmitter<{height: number}>;\n @Event({bubbles: false})\n private selectInlineLink!: EventEmitter<InlineLink>;\n @Event({bubbles: false})\n private beginDelayedSelectInlineLink!: EventEmitter<InlineLink>;\n @Event({bubbles: false})\n private cancelPendingSelectInlineLink!: EventEmitter<InlineLink>;\n private wrapperElement?: HTMLElement;\n private isRendering = true;\n private resizeObserver: ResizeObserver | undefined;\n\n public componentWillRender() {\n this.isRendering = true;\n }\n\n public componentDidRender() {\n this.isRendering = false;\n this.emitCurrentHeight();\n }\n\n public componentDidLoad() {\n // Prevents initial transition\n setTimeout(() => {\n this.host.classList.add('loaded');\n }, 0);\n }\n\n public connectedCallback() {\n if (this.wrapperElement && this.resizeObserver) {\n this.resizeObserver.observe(this.wrapperElement);\n }\n }\n\n public disconnectedCallback() {\n this.resizeObserver?.disconnect();\n }\n\n public setWrapperElement(element: HTMLElement) {\n this.wrapperElement = element;\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n }\n this.resizeObserver = new ResizeObserver(() => this.emitCurrentHeight());\n this.resizeObserver.observe(element);\n }\n\n private get sanitizedStyle() {\n if (!this.innerStyle) {\n return undefined;\n }\n return sanitizeStyle(this.innerStyle);\n }\n\n private emitCurrentHeight() {\n if (this.isRendering) {\n return;\n }\n this.answerSizeUpdated.emit({height: this.wrapperElement!.scrollHeight});\n }\n\n private bindAnalyticsToLink(element: HTMLAnchorElement) {\n const link: InlineLink = {\n linkText: element.innerText,\n linkURL: element.href,\n };\n bindAnalyticsToLink(element, {\n stopPropagation: false,\n onSelect: () => this.selectInlineLink.emit(link),\n onBeginDelayedSelect: () => this.beginDelayedSelectInlineLink.emit(link),\n onCancelPendingSelect: () =>\n this.cancelPendingSelectInlineLink.emit(link),\n });\n }\n\n private bindAnalyticsToLinks(root: HTMLElement) {\n Array.from(root.querySelectorAll('a')).forEach((link) =>\n this.bindAnalyticsToLink(link)\n );\n }\n\n private renderStyle() {\n const style = this.sanitizedStyle;\n if (!style) {\n return;\n }\n // deepcode ignore ReactSetInnerHtml: Defined by implementer and sanitized by dompurify\n return <style innerHTML={style}></style>;\n }\n\n private renderContent() {\n return (\n <div\n class=\"wrapper\"\n ref={(element) => element && this.setWrapperElement(element)}\n >\n {/* deepcode ignore ReactSetInnerHtml: Sanitized by back-end + dompurify */}\n <div\n innerHTML={DOMPurify.sanitize(this.htmlContent, {\n USE_PROFILES: {html: true},\n })}\n ref={(element) => element && this.bindAnalyticsToLinks(element)}\n part=\"answer\"\n class=\"margin\"\n ></div>\n </div>\n );\n }\n\n public render() {\n return (\n <Host>\n {this.renderStyle()}\n {this.renderContent()}\n </Host>\n );\n }\n}\n","import {Result} from '@coveo/headless';\nimport {\n Component,\n Prop,\n h,\n Listen,\n State,\n EventEmitter,\n Event,\n Host,\n} from '@stencil/core';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {ResultContextEvent} from '../../search/result-template-components/result-template-decorators';\nimport {AnyBindings} from '../interface/bindings';\nimport {LinkWithItemAnalytics} from '../item-link/stencil-item-link';\n\n/**\n * @part source-url\n * @part source-title\n * @internal\n */\n@Component({\n tag: 'atomic-smart-snippet-source',\n shadow: false,\n})\nexport class AtomicSmartSnippetSource\n implements InitializableComponent<AnyBindings>\n{\n @InitializeBindings() public bindings!: AnyBindings;\n @Prop({reflect: true, mutable: true}) source!: Result;\n @Prop() anchorAttributes?: Attr[];\n\n @Event() selectSource!: EventEmitter;\n @Event() beginDelayedSelectSource!: EventEmitter;\n @Event() cancelPendingSelectSource!: EventEmitter;\n\n @State() public error!: Error;\n\n @Listen('atomic/resolveResult')\n public resolveResult(event: ResultContextEvent<Result>) {\n event.preventDefault();\n event.stopPropagation();\n if (this.source) {\n event.detail(this.source);\n }\n }\n\n render() {\n return (\n <Host>\n <LinkWithItemAnalytics\n title={this.source.clickUri}\n href={this.source.clickUri}\n className=\"block truncate\"\n part=\"source-url\"\n attributes={this.anchorAttributes}\n onSelect={() => this.selectSource.emit()}\n onBeginDelayedSelect={() => this.beginDelayedSelectSource.emit()}\n onCancelPendingSelect={() => this.cancelPendingSelectSource.emit()}\n >\n {this.source.clickUri}\n </LinkWithItemAnalytics>\n <LinkWithItemAnalytics\n title={this.source.title}\n href={this.source.clickUri}\n attributes={this.anchorAttributes}\n className=\"block\"\n part=\"source-title\"\n onSelect={() => this.selectSource.emit()}\n onBeginDelayedSelect={() => this.beginDelayedSelectSource.emit()}\n onCancelPendingSelect={() => this.cancelPendingSelectSource.emit()}\n >\n <atomic-result-text\n field=\"title\"\n default=\"no-title\"\n key={this.source.uniqueId}\n ></atomic-result-text>\n </LinkWithItemAnalytics>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"atomic-smart-snippet-answer.atomic-smart-snippet-source.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;AAAA,MAAM,2BAA2B,GAAG,+rkEAA+rkE,CAAC;AACpukE,uCAAe,2BAA2B;;MCsB7B,wBAAwB;;;;;;;QAe3B,gBAAW,GAAG,IAAI,CAAC;;;;IAGpB,mBAAmB;QACxB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;KACzB;IAEM,kBAAkB;QACvB,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,IAAI,CAAC,iBAAiB,EAAE,CAAC;KAC1B;IAEM,gBAAgB;;QAErB,UAAU,CAAC;YACT,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;SACnC,EAAE,CAAC,CAAC,CAAC;KACP;IAEM,iBAAiB;QACtB,IAAI,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,cAAc,EAAE;YAC9C,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;SAClD;KACF;IAEM,oBAAoB;QACzB,IAAI,CAAC,cAAc,EAAE,UAAU,EAAE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,EAAC,YAAY,EACjB,UAAU,EAAE,IAAI,CAAC,gBAAgB,EACjC,QAAQ,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,EACxC,oBAAoB,EAAE,MAAM,IAAI,CAAC,wBAAwB,CAAC,IAAI,EAAE,EAChE,qBAAqB,EAAE,MAAM,IAAI,CAAC,yBAAyB,CAAC,IAAI,EAAE,IAEjE,IAAI,CAAC,MAAM,CAAC,QAAQ,CACC,EACxBH,QAACG,qCAAqB,qDACpB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EACxB,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAC1B,UAAU,EAAE,IAAI,CAAC,gBAAgB,EACjC,SAAS,EAAC,OAAO,EACjB,IAAI,EAAC,cAAc,EACnB,QAAQ,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,EACxC,oBAAoB,EAAE,MAAM,IAAI,CAAC,wBAAwB,CAAC,IAAI,EAAE,EAChE,qBAAqB,EAAE,MAAM,IAAI,CAAC,yBAAyB,CAAC,IAAI,EAAE,IAElEH,gCACE,KAAK,EAAC,OAAO,EACb,OAAO,EAAC,UAAU,EAClB,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,GACL,CACA,CACnB,EACP;KACH;;AApD4B;IAA5BI,sCAAkB,EAAE;0DAA+B;;;;;","names":["sanitizeStyle","bindAnalyticsToLink","h","DOMPurify","Host","LinkWithItemAnalytics","InitializeBindings"],"sources":["src/components/common/smart-snippets/atomic-smart-snippet-answer/atomic-smart-snippet-answer.pcss?tag=atomic-smart-snippet-answer&encapsulation=shadow","src/components/common/smart-snippets/atomic-smart-snippet-answer/atomic-smart-snippet-answer.tsx","src/components/common/smart-snippets/atomic-smart-snippet-source.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n:host {\n @apply text-on-background text-lg;\n line-height: calc(var(--text-lg) * var(--atomic-line-height-ratio));\n\n .wrapper {\n display: flow-root;\n .margin {\n margin: 1rem 0;\n }\n }\n}\n\np {\n @apply mt-4 mb-4;\n}\n\nul,\nol {\n @apply mb-4 list-outside list-decimal pl-10;\n}\n\na {\n @apply text-primary underline;\n}\n","import {InlineLink} from '@coveo/headless';\nimport {\n Component,\n h,\n Prop,\n Event,\n EventEmitter,\n Host,\n Element,\n} from '@stencil/core';\nimport DOMPurify from 'dompurify';\nimport {sanitizeStyle} from '../../../../utils/utils';\nimport {bindAnalyticsToLink} from '../../item-link/bind-analytics-to-link';\n\n/**\n * @part answer - The container displaying the full document excerpt.\n * @internal\n */\n@Component({\n tag: 'atomic-smart-snippet-answer',\n styleUrl: 'atomic-smart-snippet-answer.pcss',\n shadow: true,\n})\nexport class AtomicSmartSnippetAnswer {\n @Prop() htmlContent!: string;\n @Prop() innerStyle?: string;\n\n @Element() public host!: HTMLElement;\n\n @Event({bubbles: false})\n private answerSizeUpdated!: EventEmitter<{height: number}>;\n @Event({bubbles: false})\n private selectInlineLink!: EventEmitter<InlineLink>;\n @Event({bubbles: false})\n private beginDelayedSelectInlineLink!: EventEmitter<InlineLink>;\n @Event({bubbles: false})\n private cancelPendingSelectInlineLink!: EventEmitter<InlineLink>;\n private wrapperElement?: HTMLElement;\n private isRendering = true;\n private resizeObserver: ResizeObserver | undefined;\n\n public componentWillRender() {\n this.isRendering = true;\n }\n\n public componentDidRender() {\n this.isRendering = false;\n this.emitCurrentHeight();\n }\n\n public componentDidLoad() {\n // Prevents initial transition\n setTimeout(() => {\n this.host.classList.add('loaded');\n }, 0);\n }\n\n public connectedCallback() {\n if (this.wrapperElement && this.resizeObserver) {\n this.resizeObserver.observe(this.wrapperElement);\n }\n }\n\n public disconnectedCallback() {\n this.resizeObserver?.disconnect();\n }\n\n public setWrapperElement(element: HTMLElement) {\n this.wrapperElement = element;\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n }\n this.resizeObserver = new ResizeObserver(() => this.emitCurrentHeight());\n this.resizeObserver.observe(element);\n }\n\n private get sanitizedStyle() {\n if (!this.innerStyle) {\n return undefined;\n }\n return sanitizeStyle(this.innerStyle);\n }\n\n private emitCurrentHeight() {\n if (this.isRendering) {\n return;\n }\n this.answerSizeUpdated.emit({height: this.wrapperElement!.scrollHeight});\n }\n\n private bindAnalyticsToLink(element: HTMLAnchorElement) {\n const link: InlineLink = {\n linkText: element.innerText,\n linkURL: element.href,\n };\n bindAnalyticsToLink(element, {\n stopPropagation: false,\n onSelect: () => this.selectInlineLink.emit(link),\n onBeginDelayedSelect: () => this.beginDelayedSelectInlineLink.emit(link),\n onCancelPendingSelect: () =>\n this.cancelPendingSelectInlineLink.emit(link),\n });\n }\n\n private bindAnalyticsToLinks(root: HTMLElement) {\n Array.from(root.querySelectorAll('a')).forEach((link) =>\n this.bindAnalyticsToLink(link)\n );\n }\n\n private renderStyle() {\n const style = this.sanitizedStyle;\n if (!style) {\n return;\n }\n // deepcode ignore ReactSetInnerHtml: Defined by implementer and sanitized by dompurify\n return <style innerHTML={style}></style>;\n }\n\n private renderContent() {\n return (\n <div\n class=\"wrapper\"\n ref={(element) => element && this.setWrapperElement(element)}\n >\n {/* deepcode ignore ReactSetInnerHtml: Sanitized by back-end + dompurify */}\n <div\n innerHTML={DOMPurify.sanitize(this.htmlContent, {\n USE_PROFILES: {html: true},\n })}\n ref={(element) => element && this.bindAnalyticsToLinks(element)}\n part=\"answer\"\n class=\"margin\"\n ></div>\n </div>\n );\n }\n\n public render() {\n return (\n <Host>\n {this.renderStyle()}\n {this.renderContent()}\n </Host>\n );\n }\n}\n","import {Result} from '@coveo/headless';\nimport {\n Component,\n Prop,\n h,\n Listen,\n State,\n EventEmitter,\n Event,\n Host,\n} from '@stencil/core';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {AnyBindings} from '../interface/bindings';\nimport {LinkWithItemAnalytics} from '../item-link/stencil-item-link';\nimport {ResultContextEvent} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\n\n/**\n * @part source-url\n * @part source-title\n * @internal\n */\n@Component({\n tag: 'atomic-smart-snippet-source',\n shadow: false,\n})\nexport class AtomicSmartSnippetSource\n implements InitializableComponent<AnyBindings>\n{\n @InitializeBindings() public bindings!: AnyBindings;\n @Prop({reflect: true, mutable: true}) source!: Result;\n @Prop() anchorAttributes?: Attr[];\n\n @Event() selectSource!: EventEmitter;\n @Event() beginDelayedSelectSource!: EventEmitter;\n @Event() cancelPendingSelectSource!: EventEmitter;\n\n @State() public error!: Error;\n\n @Listen('atomic/resolveResult')\n public resolveResult(event: ResultContextEvent<Result>) {\n event.preventDefault();\n event.stopPropagation();\n if (this.source) {\n event.detail(this.source);\n }\n }\n\n render() {\n return (\n <Host>\n <LinkWithItemAnalytics\n title={this.source.clickUri}\n href={this.source.clickUri}\n className=\"block truncate\"\n part=\"source-url\"\n attributes={this.anchorAttributes}\n onSelect={() => this.selectSource.emit()}\n onBeginDelayedSelect={() => this.beginDelayedSelectSource.emit()}\n onCancelPendingSelect={() => this.cancelPendingSelectSource.emit()}\n >\n {this.source.clickUri}\n </LinkWithItemAnalytics>\n <LinkWithItemAnalytics\n title={this.source.title}\n href={this.source.clickUri}\n attributes={this.anchorAttributes}\n className=\"block\"\n part=\"source-title\"\n onSelect={() => this.selectSource.emit()}\n onBeginDelayedSelect={() => this.beginDelayedSelectSource.emit()}\n onCancelPendingSelect={() => this.cancelPendingSelectSource.emit()}\n >\n <atomic-result-text\n field=\"title\"\n default=\"no-title\"\n key={this.source.uniqueId}\n ></atomic-result-text>\n </LinkWithItemAnalytics>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1 +1 @@
1
- {"file":"index.cjs.js","mappings":";;;;;;;;;;;;;;;;;AAGA;;;;;;;;;;;;SAYgB,cAAc,CAAoB,OAAgB;IAChE,OAAOA,iCAAW,CAAI,OAAO,EAAE,gBAAgB,CAAC,CAAC;AACnD;;MCHa,kBAAmB,SAAQ,KAAK;IAC3C,YAAY,WAAmB,EAAE,UAAkB;QACjD,KAAK,CACH,QAAQ,WAAW,sCAAsC,UAAU,YAAY,CAChF,CAAC;KACH;;;ACfH,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;SAIpC,gBAAgB,CAAI,OAAgB,EAAE,UAAkB;IACtE,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM;QACpC,MAAM,KAAK,GAAGC,2BAAgB,CAC5B,oBAAoB,EACpB,CAAC,IAAO;YACN,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;SACtB,CACF,CAAC;QACF,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAE7B,IAAI,CAACC,gBAAO,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE;YACjC,MAAM,CACJ,IAAI,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,UAAU,CAAC,CACnE,CAAC;SACH;KACF,CAAC,CAAC;AACL;;ACoDA;;;;;;;;;;SAUgB,mBAAmB,CAAoB,OAAgB;IACrE,OAAO,gBAAgB,CAAI,OAAO,EAAE,gBAAgB,CAAC,CAAC;AACxD;;;;;;;;;;;;","names":["itemContext","buildCustomEvent","closest"],"sources":["src/components/commerce/product-template-component-utils/stencil-product-template-decorators.tsx","src/components/common/item-list/context/item-context-controller.ts","src/components/common/item-list/fetch-item-context.ts","src/decorators/commerce/product-template-decorators.ts"],"sourcesContent":["import {Product} from '@coveo/headless/commerce';\nimport {itemContext} from '../../common/item-list/stencil-item-decorators';\n\n/**\n * Retrieves `Product` on a rendered `atomic-product`.\n *\n * This method 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.\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-product\".\n * @returns A promise that resolves on initialization of the parent \"atomic-product\" element, or rejects when there is no parent \"atomic-product\" element.\n *\n * @deprecated should only be used for Stencil components. For Lit components, use `fetchProductContext` from \\@/src/decorators/commerce/product-template-decorators.ts\n */\nexport function productContext<T extends Product>(element: Element) {\n return itemContext<T>(element, 'atomic-product');\n}\n","import type {LitElement, ReactiveController, ReactiveControllerHost} from 'lit';\nimport type {InitializableComponent} from '@/src/decorators/types.js';\nimport {buildCustomEvent} from '@/src/utils/event-utils';\n\ntype LitElementWithError = Omit<\n Pick<InitializableComponent, 'error'>,\n 'error'\n> &\n LitElement & {\n error: Error | null;\n };\n\nconst itemContextEventName = 'atomic/resolveResult';\n\nexport class MissingParentError extends Error {\n constructor(elementName: string, parentName: string) {\n super(\n `The \"${elementName}\" element must be the child of an \"${parentName}\" element.`\n );\n }\n}\n\nfunction extractFolded<T = Record<string, unknown>>(\n item: Record<string, unknown>,\n returnFolded: boolean\n): T {\n if (returnFolded) {\n if ('children' in item) {\n return item as T;\n } else {\n return {children: [], result: item} as T;\n }\n }\n\n if ('children' in item && 'result' in item) {\n return item.result as T;\n }\n return item as T;\n}\n\n/**\n * A reactive controller that manages item context data from parent components.\n * Handles fetching item data via custom events and manages error states.\n */\nexport class ItemContextController<T = Record<string, unknown>>\n implements ReactiveController\n{\n private host: ReactiveControllerHost & LitElementWithError;\n private parentName: string;\n private folded: boolean;\n private _item: T | null = null;\n private _error: MissingParentError | null = null;\n\n constructor(\n host: ReactiveControllerHost & LitElementWithError,\n options: {parentName?: string; folded?: boolean} = {}\n ) {\n this.host = host;\n this.parentName = options.parentName ?? 'atomic-result';\n this.folded = options.folded ?? false;\n host.addController(this);\n }\n\n get item(): T | null {\n return this._error ? null : this._item;\n }\n\n get error(): MissingParentError | null {\n return this._error;\n }\n\n get hasError(): boolean {\n return this._error !== null;\n }\n\n hostConnected(): void {\n this._resolveItemContext();\n }\n\n private _resolveItemContext(): void {\n const event = buildCustomEvent(\n itemContextEventName,\n (item: Record<string, unknown>) => {\n this._item = extractFolded<T>(item, this.folded);\n this._error = null;\n this.host.error = null;\n this.host.requestUpdate();\n }\n );\n\n const canceled = this.host.dispatchEvent(event);\n if (canceled) {\n const elementName = (this.host as Element).nodeName.toLowerCase();\n this._error = new MissingParentError(elementName, this.parentName);\n this._item = null;\n this.host.error = this._error;\n this.host.requestUpdate();\n }\n }\n}\n\ntype ItemContextEventHandler<T> = (item: T) => void;\nexport type ItemContextEvent<T> = CustomEvent<ItemContextEventHandler<T>>;\n","import {closest} from '../../../utils/dom-utils.js';\nimport {buildCustomEvent} from '../../../utils/event-utils.js';\nimport {MissingParentError} from './context/item-context-controller.js';\n\nconst itemContextEventName = 'atomic/resolveResult';\n\ntype ItemContextEventHandler<T> = (item: T) => void;\n\nexport function fetchItemContext<T>(element: Element, parentName: string) {\n return new Promise<T>((resolve, reject) => {\n const event = buildCustomEvent<ItemContextEventHandler<T>>(\n itemContextEventName,\n (item: T) => {\n return resolve(item);\n }\n );\n element.dispatchEvent(event);\n\n if (!closest(element, parentName)) {\n reject(\n new MissingParentError(element.nodeName.toLowerCase(), parentName)\n );\n }\n });\n}\n","import type {InteractiveProduct, Product} from '@coveo/headless/commerce';\nimport type {LitElement} from 'lit';\nimport {\n InteractiveItemContextController,\n type InteractiveItemContextEvent,\n} from '@/src/components/common/item-list/context/interactive-item-context-controller';\nimport {\n ItemContextController,\n type ItemContextEvent,\n} from '@/src/components/common/item-list/context/item-context-controller';\nimport {fetchItemContext} from '@/src/components/common/item-list/fetch-item-context';\n\n/**\n * Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing product context in product template components.\n *\n * @param host - The Lit component instance\n * @param options - Configuration options\n * @returns ItemContextController instance configured for atomic-product\n *\n * @example\n * ```typescript\n * @customElement('my-product-component')\n * export class MyProductComponent extends LitElement {\n * private productController = createProductContextController(this);\n *\n * @state() product!: Product;\n *\n * render() {\n * this.product = this.productController.item;\n * return html`<div>${this.product?.ec_name}</div>`;\n * }\n * }\n * ```\n */\nexport function createProductContextController(\n host: LitElement & {error: Error | null},\n options: {folded?: boolean} = {}\n): ItemContextController<Product> {\n return new ItemContextController<Product>(host, {\n parentName: 'atomic-product',\n folded: options.folded ?? false,\n });\n}\n\n/**\n * Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing interactive product context in product template components.\n *\n * @param host - The Lit component instance\n * @returns InteractiveItemContextController instance\n *\n * @example\n * ```typescript\n * @customElement('my-interactive-product-component')\n * export class MyInteractiveProductComponent extends LitElement {\n * private interactiveProductController = createInteractiveProductContextController(this);\n *\n * @state() product!: Product;\n *\n * render() {\n * this.product = this.interactiveProductController.interactiveItem;\n * return html`<div>${this.product?.ec_name}</div>`;\n * }\n * }\n * ```\n */\nexport function createInteractiveProductContextController(\n host: LitElement & {error: Error}\n): InteractiveItemContextController<InteractiveProduct> {\n return new InteractiveItemContextController<InteractiveProduct>(host);\n}\n\nexport type ProductContextEvent<T = Product> = ItemContextEvent<T>;\nexport type InteractiveProductContextEvent<\n T extends InteractiveProduct = InteractiveProduct,\n> = InteractiveItemContextEvent<T>;\n\n/**\n * Retrieves `Product` on a rendered `atomic-product`.\n *\n * 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.\n *\n * 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).\n *\n * @param element - The element that the event is dispatched to, which must be the child of a rendered `atomic-product`.\n * @returns A promise that resolves on initialization of the parent `atomic-product` element, or rejects when there is no parent `atomic-product` element.\n */\nexport function fetchProductContext<T extends Product>(element: Element) {\n return fetchItemContext<T>(element, 'atomic-product');\n}\n"],"version":3}
1
+ {"file":"index.cjs.js","mappings":";;;;;;;;;;;;;;;;;MAca,kBAAmB,SAAQ,KAAK;IAC3C,YAAY,WAAmB,EAAE,UAAkB;QACjD,KAAK,CACH,QAAQ,WAAW,sCAAsC,UAAU,YAAY,CAChF,CAAC;KACH;;;ACfH,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;SAIpC,gBAAgB,CAAI,OAAgB,EAAE,UAAkB;IACtE,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM;QACpC,MAAM,KAAK,GAAGA,2BAAgB,CAC5B,oBAAoB,EACpB,CAAC,IAAO;YACN,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;SACtB,CACF,CAAC;QACF,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAE7B,IAAI,CAACC,gBAAO,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE;YACjC,MAAM,CACJ,IAAI,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,UAAU,CAAC,CACnE,CAAC;SACH;KACF,CAAC,CAAC;AACL;;ACrBA;;;;;;;;;;SAUgB,mBAAmB,CAAoB,OAAgB;IACrE,OAAO,gBAAgB,CAAI,OAAO,EAAE,gBAAgB,CAAC,CAAC;AACxD;;ACZA;;;;;;;;;;;;SAYgB,cAAc,CAAoB,OAAgB;IAChE,OAAOC,iCAAW,CAAI,OAAO,EAAE,gBAAgB,CAAC,CAAC;AACnD;;;;;;;;;;;;","names":["buildCustomEvent","closest","itemContext"],"sources":["src/components/common/item-list/context/item-context-controller.ts","src/components/common/item-list/fetch-item-context.ts","src/components/commerce/product-template-component-utils/context/fetch-product-context.ts","src/components/commerce/product-template-component-utils/context/stencil-product-template-decorators.tsx"],"sourcesContent":["import type {LitElement, ReactiveController, ReactiveControllerHost} from 'lit';\nimport type {InitializableComponent} from '@/src/decorators/types.js';\nimport {buildCustomEvent} from '@/src/utils/event-utils';\n\ntype LitElementWithError = Omit<\n Pick<InitializableComponent, 'error'>,\n 'error'\n> &\n LitElement & {\n error: Error | null;\n };\n\nconst itemContextEventName = 'atomic/resolveResult';\n\nexport class MissingParentError extends Error {\n constructor(elementName: string, parentName: string) {\n super(\n `The \"${elementName}\" element must be the child of an \"${parentName}\" element.`\n );\n }\n}\n\nfunction extractFolded<T = Record<string, unknown>>(\n item: Record<string, unknown>,\n returnFolded: boolean\n): T {\n if (returnFolded) {\n if ('children' in item) {\n return item as T;\n } else {\n return {children: [], result: item} as T;\n }\n }\n\n if ('children' in item && 'result' in item) {\n return item.result as T;\n }\n return item as T;\n}\n\n/**\n * A reactive controller that manages item context data from parent components.\n * Handles fetching item data via custom events and manages error states.\n */\nexport class ItemContextController<T = Record<string, unknown>>\n implements ReactiveController\n{\n private host: ReactiveControllerHost & LitElementWithError;\n private parentName: string;\n private folded: boolean;\n private _item: T | null = null;\n private _error: MissingParentError | null = null;\n\n constructor(\n host: ReactiveControllerHost & LitElementWithError,\n options: {parentName?: string; folded?: boolean} = {}\n ) {\n this.host = host;\n this.parentName = options.parentName ?? 'atomic-result';\n this.folded = options.folded ?? false;\n host.addController(this);\n }\n\n get item(): T | null {\n return this._error ? null : this._item;\n }\n\n get error(): MissingParentError | null {\n return this._error;\n }\n\n get hasError(): boolean {\n return this._error !== null;\n }\n\n hostConnected(): void {\n this._resolveItemContext();\n }\n\n private _resolveItemContext(): void {\n const event = buildCustomEvent(\n itemContextEventName,\n (item: Record<string, unknown>) => {\n this._item = extractFolded<T>(item, this.folded);\n this._error = null;\n this.host.error = null;\n this.host.requestUpdate();\n }\n );\n\n const canceled = this.host.dispatchEvent(event);\n if (canceled) {\n const elementName = (this.host as Element).nodeName.toLowerCase();\n this._error = new MissingParentError(elementName, this.parentName);\n this._item = null;\n this.host.error = this._error;\n this.host.requestUpdate();\n }\n }\n}\n\ntype ItemContextEventHandler<T> = (item: T) => void;\nexport type ItemContextEvent<T> = CustomEvent<ItemContextEventHandler<T>>;\n","import {closest} from '../../../utils/dom-utils.js';\nimport {buildCustomEvent} from '../../../utils/event-utils.js';\nimport {MissingParentError} from './context/item-context-controller.js';\n\nconst itemContextEventName = 'atomic/resolveResult';\n\ntype ItemContextEventHandler<T> = (item: T) => void;\n\nexport function fetchItemContext<T>(element: Element, parentName: string) {\n return new Promise<T>((resolve, reject) => {\n const event = buildCustomEvent<ItemContextEventHandler<T>>(\n itemContextEventName,\n (item: T) => {\n return resolve(item);\n }\n );\n element.dispatchEvent(event);\n\n if (!closest(element, parentName)) {\n reject(\n new MissingParentError(element.nodeName.toLowerCase(), parentName)\n );\n }\n });\n}\n","import type {Product} from '@coveo/headless/commerce';\nimport {fetchItemContext} from '@/src/components/common/item-list/fetch-item-context';\n\n/**\n * Retrieves `Product` on a rendered `atomic-product`.\n *\n * 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.\n *\n * 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).\n *\n * @param element - The element that the event is dispatched to, which must be the child of a rendered `atomic-product`.\n * @returns A promise that resolves on initialization of the parent `atomic-product` element, or rejects when there is no parent `atomic-product` element.\n */\nexport function fetchProductContext<T extends Product>(element: Element) {\n return fetchItemContext<T>(element, 'atomic-product');\n}\n","import {Product} from '@coveo/headless/commerce';\nimport {itemContext} from '@/src/components/common/item-list/stencil-item-decorators';\n\n/**\n * Retrieves `Product` on a rendered `atomic-product`.\n *\n * This method 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.\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-product\".\n * @returns A promise that resolves on initialization of the parent \"atomic-product\" element, or rejects when there is no parent \"atomic-product\" element.\n *\n * @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\n */\nexport function productContext<T extends Product>(element: Element) {\n return itemContext<T>(element, 'atomic-product');\n}\n"],"version":3}
@@ -10,6 +10,8 @@ const stencilItemDecorators = require('./stencil-item-decorators-43a96f33.js');
10
10
  * @ResultContext() private result!: Result;
11
11
  *
12
12
  * For more information and examples, view the "Utilities" section of the readme.
13
+ *
14
+ * @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
13
15
  */
14
16
  function ResultContext(opts = { folded: false }) {
15
17
  return stencilItemDecorators.ItemContext({ parentName: 'atomic-result', folded: opts.folded });
@@ -24,8 +26,10 @@ function InteractiveResultContext() {
24
26
  *
25
27
  * 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).
26
28
  *
27
- * @param element The element that the event is dispatched to, which must be the child of a rendered "atomic-result".
29
+ * @param element The element that the event is dispatched to, which must be the child of a rendered "atomic-result" element.
28
30
  * @returns A promise that resolves on initialization of the parent "atomic-result" element, or rejects when there is no parent "atomic-result" element.
31
+ *
32
+ * @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
29
33
  */
30
34
  function resultContext(element) {
31
35
  return stencilItemDecorators.itemContext(element, 'atomic-result');
@@ -35,4 +39,4 @@ exports.InteractiveResultContext = InteractiveResultContext;
35
39
  exports.ResultContext = ResultContext;
36
40
  exports.resultContext = resultContext;
37
41
 
38
- //# sourceMappingURL=result-template-decorators-432d11a9.js.map
42
+ //# sourceMappingURL=stencil-result-template-decorators-28b05aaf.js.map
@@ -0,0 +1 @@
1
+ {"file":"stencil-result-template-decorators-28b05aaf.js","mappings":";;;;AASA;;;;;;;;;;;SAWgB,aAAa,CAAC,OAA0B,EAAC,MAAM,EAAE,KAAK,EAAC;IACrE,OAAOA,iCAAW,CAAC,EAAC,UAAU,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC,CAAC,CAAC;AACzE,CAAC;SAEe,wBAAwB;IACtC,OAAOC,4CAAsB,EAAE,CAAC;AAClC,CAAC;AAKD;;;;;;;;;;;;SAYgB,aAAa,CAC3B,OAAgB;IAEhB,OAAOC,iCAAW,CAAI,OAAO,EAAE,eAAe,CAAC,CAAC;AAClD;;;;;;","names":["ItemContext","InteractiveItemContext","itemContext"],"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}
@@ -34,7 +34,7 @@ const TextAreaClearButton = ({ inputRef, bindings, onClick, ...defaultButtonProp
34
34
  index.h(stencilButton.Button, { style: "text-transparent", part: "clear-button", class: "text-neutral-dark flex h-8 w-8 shrink-0 items-center justify-center", onClick: () => {
35
35
  onClick?.();
36
36
  inputRef?.focus();
37
- }, ariaLabel: bindings.i18n.t('clear-search'), ...defaultButtonProps },
37
+ }, ariaLabel: bindings.i18n.t('clear'), ...defaultButtonProps },
38
38
  index.h("atomic-icon", { part: "clear-icon", icon: ClearSlim, class: "h-4 w-4" }))));
39
39
 
40
40
  function getPopupAttributes(props) {
@@ -416,4 +416,4 @@ exports.SearchSlimIcon = SearchSlimIcon;
416
416
  exports.SearchTextArea = SearchTextArea;
417
417
  exports.SuggestionManager = SuggestionManager;
418
418
 
419
- //# sourceMappingURL=stencil-suggestion-manager-88cb88f2.js.map
419
+ //# sourceMappingURL=stencil-suggestion-manager-2cba6d69.js.map
@@ -0,0 +1 @@
1
+ {"file":"stencil-suggestion-manager-2cba6d69.js","mappings":";;;;;;;;;;;;;;;MAOa,gBAAgB,GAA+B,CAC1D,KAAK,EACL,QAAQ;IAER,MAAM,UAAU,GAAG;QACjB,MAAM,WAAW,GACf,sGAAsG,CAAC;QACzG,MAAM,YAAY,GAAG,KAAK,CAAC,QAAQ;cAC/B,wDAAwD;cACxD,4DAA4D,CAAC;QAEjE,OAAO,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAC9C,CAAC;IAEF,QACEA,iBAAK,IAAI,EAAC,SAAS,EAAC,KAAK,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,IAClE,QAAQ,CACL,EACN;AACJ;;;;;;;;AChBO,MAAM,mBAAmB,GAA+B,CAAC,EAC9D,QAAQ,EACR,QAAQ,E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AAC,CAAC;QAC5E,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAE,CAAC;QAEpC,MAAM,GAAG,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC,iBAAiB;YACtD,IAAIF,uBAAiB,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE;gBAC9C,OAAO,IAAI,CAAC;aACb;YACD,IAAI,iBAAiB,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE;gBAClD,OAAO,KAAK,CAAC;aACd;iBAAM;gBACL,iBAAiB,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;gBAC/C,OAAO,IAAI,CAAC;aACb;SACF,CAAC,CAAC;QAEH,OAAO,GAAG,CAAC;KACZ;IAEO,qBAAqB,CAAC,WAAmC;QAC/D,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,KAC9C,UAAU,CAAC,WAAW,EAAE,CACzB,CAAC;QAEF,MAAM,GAAG,GACP,IAAI,CAAC,mBAAmB,CAAC,+BAA+B,EAAE;YAC1D,QAAQ,CAAC,MAAM,CAACG,kCAAiB,CAAC,CAAC,MAAM,CAAC;QAE5C,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;KAC/B;IAEO,iBAAiB,CAAC,gBAAgB,GAAG,EAAE;QAC7C,MAAM,wBAAwB,GAAG,IAAI,CAAC,uBAAuB,CAAC;QAC9D,IAAI,CAAC,+BAA+B,GAAG,wBAAwB,CAAC;QAChE,IAAI,CAAC,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;KAC/C;IAEO,uBAAuB;QAC7B,IAAI,CAAC,sBAAsB,GAAG,EAAE,CAAC;QACjC,IAAI,CAAC,uBAAuB,GAAG,EAAE,CAAC;KACnC;;;;;;;;","names":["h","Button","debounce","forceUpdate","isNullOrUndefined","elementHasQuery","DOMPurify","elementHasNoQuery"],"sources":["src/components/common/search-box/stencil-search-box-wrapper.tsx","src/components/common/search-box/stencil-text-area-clear-button.tsx","src/components/common/search-box/stencil-search-text-area.tsx","src/utils/promise-utils.ts","src/components/common/suggestions/stencil-suggestion-manager.ts"],"sourcesContent":["import {FunctionalComponent, h} from '@stencil/core';\n\ninterface Props {\n disabled: boolean;\n onFocusout?: (event: FocusEvent) => void;\n}\n\nexport const SearchBoxWrapper: FunctionalComponent<Props> = (\n props,\n children\n) => {\n const getClasses = () => {\n const baseClasses =\n 'flex bg-background w-full border border-neutral rounded-md focus-within:ring-3 absolute top-0 left-0';\n const focusClasses = props.disabled\n ? 'focus-within:border-disabled focus-within:ring-neutral'\n : 'focus-within:border-primary focus-within:ring-ring-primary';\n\n return [baseClasses, focusClasses].join(' ');\n };\n\n return (\n <div part=\"wrapper\" class={getClasses()} onFocusout={props.onFocusout}>\n {children}\n </div>\n );\n};\n","import {FunctionalComponent, h} from '@stencil/core';\nimport ClearSlim from '../../../images/clear-slim.svg';\nimport {AnyBindings} from '../interface/bindings';\nimport {Button, StencilButtonProps} from '../stencil-button';\n\ninterface Props extends Partial<StencilButtonProps> {\n bindings: AnyBindings;\n inputRef: HTMLInputElement | HTMLTextAreaElement | null;\n}\n\nexport const TextAreaClearButton: FunctionalComponent<Props> = ({\n inputRef,\n bindings,\n onClick,\n ...defaultButtonProps\n}) => (\n <div\n part=\"clear-button-wrapper\"\n class=\"ml-2 flex items-center justify-center py-2\"\n >\n <Button\n style=\"text-transparent\"\n part=\"clear-button\"\n class=\"text-neutral-dark flex h-8 w-8 shrink-0 items-center justify-center\"\n onClick={() => {\n onClick?.();\n inputRef?.focus();\n }}\n ariaLabel={bindings.i18n.t('clear')}\n {...defaultButtonProps}\n >\n <atomic-icon\n part=\"clear-icon\"\n icon={ClearSlim}\n class=\"h-4 w-4\"\n ></atomic-icon>\n </Button>\n </div>\n);\n","import {FunctionalComponent, h} from '@stencil/core';\nimport {JSXBase} from '@stencil/core/internal';\nimport {AnyBindings} from '../interface/bindings';\nimport {TextAreaClearButton} from './stencil-text-area-clear-button';\n\ninterface Props extends JSXBase.TextareaHTMLAttributes<HTMLTextAreaElement> {\n textAreaRef: HTMLTextAreaElement;\n loading: boolean;\n bindings: AnyBindings;\n value: string;\n ariaLabel: string;\n onClear(): void;\n popup?: {\n id: string;\n activeDescendant: string;\n expanded: boolean;\n hasSuggestions: boolean;\n };\n}\n\nfunction getPopupAttributes(props: Required<Props>['popup']) {\n return {\n autocomplete: 'off',\n autocapitalize: 'off',\n autocorrect: 'off',\n ...(props.activeDescendant && {\n 'aria-activedescendant': props.activeDescendant,\n }),\n 'aria-autocomplete': 'both',\n 'aria-haspopup': 'true',\n 'aria-controls': props.id,\n };\n}\n\nfunction syncTextWithReplica(elem: HTMLTextAreaElement, value?: string) {\n const parent = elem?.parentNode as HTMLElement;\n if (!parent) {\n return;\n }\n if (elem.value === '\\n') {\n return;\n }\n parent.dataset.replicatedValue = value ?? elem.value;\n}\n\nfunction resetReplicaText(elem: HTMLTextAreaElement) {\n const parent = elem?.parentNode as HTMLElement;\n if (parent) {\n delete parent.dataset.replicatedValue;\n }\n}\n\nfunction collapseTextArea(elem: HTMLTextAreaElement) {\n const parent = elem?.parentNode as HTMLElement;\n if (parent) {\n parent.classList.remove('expanded');\n }\n}\n\nfunction expandTextArea(elem: HTMLTextAreaElement) {\n const parent = elem?.parentNode as HTMLElement;\n if (parent) {\n parent.classList.add('expanded');\n }\n}\n\nexport const SearchTextArea: FunctionalComponent<Props> = ({\n textAreaRef,\n loading,\n bindings,\n onInput,\n onFocus,\n onBlur,\n onChange,\n onKeyDown,\n onKeyUp,\n value,\n ariaLabel,\n onClear,\n popup,\n ...defaultInputProps\n}) => (\n <div class=\"flex grow overflow-hidden\">\n <div part=\"textarea-expander\" class=\"grid grow overflow-hidden\">\n <textarea\n part=\"textarea\"\n aria-label={ariaLabel}\n placeholder={bindings.i18n.t('search')}\n class=\"placeholder-neutral-dark\"\n rows={1}\n onInput={(e) => {\n onInput?.(e);\n syncTextWithReplica(textAreaRef);\n }}\n onKeyDown={(e) => {\n syncTextWithReplica(textAreaRef);\n if (e.key === 'Enter') {\n if (e.shiftKey) {\n return;\n }\n e.preventDefault();\n }\n onKeyDown?.(e);\n }}\n onKeyUp={(e) => {\n onKeyUp?.(e);\n if (e.key === 'Enter') {\n e.preventDefault();\n return;\n }\n syncTextWithReplica(textAreaRef);\n }}\n onBlur={(e) => {\n onBlur?.(e);\n collapseTextArea(textAreaRef);\n syncTextWithReplica(textAreaRef);\n }}\n onChange={(e) => {\n onChange?.(e);\n syncTextWithReplica(textAreaRef);\n }}\n onFocus={(e) => {\n onFocus?.(e);\n const target = e.target as HTMLTextAreaElement;\n syncTextWithReplica(textAreaRef ?? target);\n expandTextArea(textAreaRef ?? target);\n }}\n autocomplete=\"off\"\n {...(popup && getPopupAttributes(popup))}\n {...defaultInputProps}\n value={value}\n />\n </div>\n\n {loading && (\n <div class=\"searchbox-button-wrapper ml-2 flex items-center justify-center\">\n <span\n part=\"loading\"\n class=\"loading mr-2 grid h-5 w-5 animate-spin place-items-center rounded-full bg-linear-to-r\"\n ></span>\n </div>\n )}\n {!loading && value && (\n <TextAreaClearButton\n inputRef={textAreaRef}\n bindings={bindings}\n onClick={() => {\n onClear();\n resetReplicaText(textAreaRef);\n }}\n />\n )}\n </div>\n);\n","export function promiseTimeout<T>(prom: T | Promise<T>, ms: number) {\n let id: NodeJS.Timeout;\n const timeout = new Promise((_, reject) => {\n id = setTimeout(() => {\n reject(new Error('Promise timed out.'));\n }, ms);\n });\n return Promise.race([prom, timeout]).then(() => {\n clearTimeout(id);\n });\n}\n","import {isNullOrUndefined} from '@coveo/bueno';\nimport {forceUpdate} from '@stencil/core';\nimport DOMPurify from 'dompurify';\nimport {debounce} from '../../../utils/debounce-utils';\nimport {promiseTimeout} from '../../../utils/promise-utils';\nimport type {\n SearchBoxSuggestionElement,\n SearchBoxSuggestionsBindings,\n SearchBoxSuggestionsEvent,\n} from './suggestions-types';\nimport {elementHasNoQuery, elementHasQuery} from './suggestions-utils';\n\n/**\n * List of suggestions that will be displayed along other lists (e.g recent queries) when the search box's input is selected.\n */\nexport interface SearchBoxSuggestions {\n /**\n * The search box will sort the position of suggestions using this value, the lowest value being first.\n * By default, the DOM position will be used.\n */\n position: number;\n /**\n * Whether the suggestions should be listed in the right or left panel. By default, the suggestions are listed in the right panel.\n */\n panel?: 'left' | 'right';\n /**\n * Method that returns the list of elements which will be rendered in the list of suggestions.\n */\n renderItems(): SearchBoxSuggestionElement[];\n /**\n * Hook called when the user changes the search box's input value. This can lead to all the query suggestions being updated.\n */\n onInput?(): Promise<unknown>;\n /**\n * Hook called when the current suggested query changes as the user navigates the list of suggestions.\n * This is used for instant results, which are rendered based on the current suggested query.\n * @param q The new current suggested query.\n */\n onSuggestedQueryChange?(q: string): Promise<unknown>;\n}\n\ninterface SearchBoxProps {\n getSearchBoxValue: () => string;\n updateQuery: (suggestedQuery: string) => void;\n getSuggestionTimeout: () => number;\n getNumberOfSuggestionsToDisplay: () => number;\n getSuggestionDelay: () => number;\n getLogger: () => Pick<typeof console, 'warn'>;\n getHost: () => HTMLElement;\n}\n\nexport class SuggestionManager<SearchBoxController> {\n public suggestions: SearchBoxSuggestions[] = [];\n public leftSuggestionElements: SearchBoxSuggestionElement[] = [];\n public rightSuggestionElements: SearchBoxSuggestionElement[] = [];\n public leftPanel: HTMLElement | undefined = undefined;\n public rightPanel: HTMLElement | undefined = undefined;\n public triggerSuggestions: () => Promise<void>;\n public activeDescendant = '';\n public suggestedQuery = '';\n public keyboardActiveDescendant = '';\n\n private queryDataAttribute = 'data-query';\n private suggestionEvents: SearchBoxSuggestionsEvent<SearchBoxController>[] =\n [];\n\n private previousActiveDescendantElement: HTMLElement | null = null;\n private leftSuggestions: SearchBoxSuggestions[] = [];\n private rightSuggestions: SearchBoxSuggestions[] = [];\n\n constructor(private ownerSearchBoxProps: SearchBoxProps) {\n this.triggerSuggestions = debounce(\n () => this.executeQuerySuggestion(),\n this.ownerSearchBoxProps.getSuggestionDelay()\n );\n }\n\n public get partialSuggestionBindings(): Pick<\n SearchBoxSuggestionsBindings<SearchBoxController>,\n | 'suggestedQuery'\n | 'clearSuggestions'\n | 'triggerSuggestions'\n | 'getSuggestions'\n | 'getSuggestionElements'\n > {\n return {\n suggestedQuery: () => this.suggestedQuery,\n clearSuggestions: () => this.clearSuggestions(),\n triggerSuggestions: () => this.triggerSuggestions(),\n getSuggestions: () => this.suggestions,\n getSuggestionElements: () => this.allSuggestionElements,\n };\n }\n\n public get activeDescendantElement(): HTMLElement | null {\n if (!this.hasActiveDescendant) {\n return null;\n }\n\n return (\n this.leftPanel?.querySelector(`#${this.activeDescendant}`) ||\n this.rightPanel?.querySelector(`#${this.activeDescendant}`) ||\n null\n );\n }\n\n public onSubmit() {\n this.clickOnActiveElement();\n this.clearSuggestions();\n }\n\n public updateActiveDescendant(id = '') {\n this.activeDescendant = id;\n forceUpdate(this.ownerSearchBoxProps.getHost());\n }\n\n public updateKeyboardActiveDescendant(id = '') {\n this.keyboardActiveDescendant = id;\n }\n\n public clickOnActiveElement() {\n this.activeDescendantElement?.click();\n this.updateActiveDescendant();\n }\n\n public isRightPanelInFocus() {\n if (\n isNullOrUndefined(this.panelInFocus) ||\n isNullOrUndefined(this.rightPanel)\n ) {\n return false;\n }\n\n return this.panelInFocus === this.rightPanel;\n }\n\n public initializeSuggestions(\n bindings: SearchBoxSuggestionsBindings<SearchBoxController>\n ) {\n this.suggestions = this.suggestionEvents.map((event) => event(bindings));\n }\n\n public registerSuggestionsFromEvent(\n event: CustomEvent<SearchBoxSuggestionsEvent<SearchBoxController>>,\n bindings: SearchBoxSuggestionsBindings<SearchBoxController>\n ) {\n event.preventDefault();\n event.stopPropagation();\n this.suggestionEvents.push(event.detail);\n this.suggestions.push(event.detail(bindings));\n }\n\n public registerSuggestions(suggestions: SearchBoxSuggestions) {\n this.suggestions.push(suggestions);\n }\n\n public get isDoubleList() {\n return Boolean(\n this.leftSuggestionElements.length && this.rightSuggestionElements.length\n );\n }\n\n public focusPanel(side: 'left' | 'right') {\n const panel = side === 'left' ? this.leftPanel : this.rightPanel;\n\n if (this.panelInFocus === panel) {\n return;\n }\n if (panel?.firstElementChild) {\n const panelHasActiveDescendant =\n this.previousActiveDescendantElement &&\n panel.contains(this.previousActiveDescendantElement);\n const newValue = panelHasActiveDescendant\n ? this.previousActiveDescendantElement!\n : (panel.firstElementChild as HTMLElement);\n this.updateDescendants(newValue.id);\n }\n }\n\n public clearSuggestions() {\n this.clearSuggestionElements();\n this.updateActiveDescendant();\n }\n\n public async focusNextValue() {\n if (!this.hasSuggestions || !this.nextOrFirstValue) {\n return;\n }\n\n await this.focusValue(this.nextOrFirstValue as HTMLElement);\n }\n\n public async focusValue(value: HTMLElement) {\n this.updateKeyboardActiveDescendant(value.id);\n this.updateActiveDescendant(value.id);\n this.scrollActiveDescendantIntoView();\n await this.updateQueryFromSuggestion();\n }\n\n public async onSuggestionMouseOver(\n item: SearchBoxSuggestionElement,\n side: 'left' | 'right',\n id: string\n ) {\n const thisPanel = side === 'left' ? this.leftPanel : this.rightPanel;\n // When hovering, always reset the keyboard active descendant\n this.updateKeyboardActiveDescendant();\n if (this.panelInFocus === thisPanel) {\n this.updateActiveDescendant(id);\n } else {\n this.updateDescendants(id);\n }\n if (item.query) {\n await this.updateSuggestedQuery(item.query);\n }\n }\n\n public async onSuggestionClick(item: SearchBoxSuggestionElement, e: Event) {\n if (item.query) {\n this.clearSuggestions();\n await this.updateOwnerSearchboxQuery(item.query);\n }\n item.onSelect?.(e);\n }\n\n public get hasSuggestions() {\n return !!this.allSuggestionElements.length;\n }\n\n public get allSuggestionElements() {\n return [...this.leftSuggestionElements, ...this.rightSuggestionElements];\n }\n\n public async focusPreviousValue() {\n if (this.firstValue === this.activeDescendantElement) {\n this.updateKeyboardActiveDescendant();\n this.updateActiveDescendant();\n return;\n }\n\n if (!this.hasSuggestions || !this.previousOrLastValue) {\n return;\n }\n\n await this.focusValue(this.previousOrLastValue as HTMLElement);\n }\n\n public get hasActiveDescendant() {\n return this.activeDescendant !== '';\n }\n\n private async executeQuerySuggestion() {\n this.updateActiveDescendant();\n const settled = await Promise.allSettled(\n this.suggestions.map((suggestion) =>\n promiseTimeout(\n suggestion.onInput ? suggestion.onInput() : Promise.resolve(),\n this.ownerSearchBoxProps.getSuggestionTimeout()\n )\n )\n );\n\n const fulfilledSuggestions: SearchBoxSuggestions[] = [];\n\n settled.forEach((prom, j) => {\n if (prom.status === 'fulfilled') {\n fulfilledSuggestions.push(this.suggestions[j]);\n } else {\n this.ownerSearchBoxProps\n .getLogger()\n .warn(\n 'Some query suggestions are not being shown because the promise timed out.'\n );\n }\n });\n\n const splitSuggestions = (side: 'left' | 'right', isDefault = false) =>\n fulfilledSuggestions\n .filter(\n (suggestion) =>\n suggestion.panel === side || (!suggestion.panel && isDefault)\n )\n .sort(this.sortSuggestions);\n\n this.leftSuggestions = splitSuggestions('left', true);\n this.leftSuggestionElements = this.getAndFilterLeftSuggestionElements();\n\n this.rightSuggestions = splitSuggestions('right');\n this.rightSuggestionElements = this.getSuggestionElements(\n this.rightSuggestions\n );\n\n const defaultSuggestedQuery =\n this.allSuggestionElements.find(elementHasQuery)?.query || '';\n\n await this.updateSuggestedQuery(defaultSuggestedQuery);\n }\n\n private get lastValue() {\n return this.panelInFocus?.lastElementChild;\n }\n\n private get previousOrLastValue() {\n if (!this.hasActiveDescendant) {\n return this.lastValue?.firstChild;\n }\n\n const parentOfActiveDescendant =\n this.activeDescendantElement?.parentElement;\n return (\n parentOfActiveDescendant?.previousElementSibling?.firstChild ||\n this.firstValue?.firstChild\n );\n }\n\n private sortSuggestions(a: SearchBoxSuggestions, b: SearchBoxSuggestions) {\n return a.position - b.position;\n }\n\n private get nextOrFirstValue() {\n if (!this.hasActiveDescendant) {\n return this.firstValue?.firstChild;\n }\n\n const parentOfActiveDescendant =\n this.activeDescendantElement?.parentElement;\n return (\n parentOfActiveDescendant?.nextElementSibling?.firstChild ||\n this.firstValue?.firstChild\n );\n }\n\n private get firstValue() {\n return this.panelInFocus?.firstElementChild;\n }\n\n private get panelInFocus() {\n if (this.leftPanel?.contains(this.activeDescendantElement)) {\n return this.leftPanel;\n }\n if (this.rightPanel?.contains(this.activeDescendantElement)) {\n return this.rightPanel;\n }\n return this.leftPanel || this.rightPanel;\n }\n\n private scrollActiveDescendantIntoView() {\n this.activeDescendantElement?.scrollIntoView({\n block: 'nearest',\n });\n }\n\n private async updateQueryFromSuggestion() {\n const suggestedQuery = this.activeDescendantElement?.getAttribute(\n this.queryDataAttribute\n );\n await this.updateOwnerSearchboxQuery(suggestedQuery || '');\n }\n\n private async updateOwnerSearchboxQuery(query: string) {\n if (query && this.ownerSearchBoxProps.getSearchBoxValue() !== query) {\n this.ownerSearchBoxProps.updateQuery(query);\n await this.updateSuggestedQuery(query);\n }\n }\n\n private async updateSuggestedQuery(suggestedQuery: string) {\n await Promise.allSettled(\n this.suggestions.map((suggestion) =>\n promiseTimeout(\n suggestion.onSuggestedQueryChange\n ? suggestion.onSuggestedQueryChange(suggestedQuery)\n : Promise.resolve(),\n this.ownerSearchBoxProps.getSuggestionTimeout()\n )\n )\n );\n this.suggestedQuery = suggestedQuery;\n this.updateSuggestionElements(suggestedQuery);\n forceUpdate(this.ownerSearchBoxProps.getHost());\n }\n\n private updateSuggestionElements(query: string) {\n if (!this.isPanelInFocus(this.leftPanel, query)) {\n this.leftSuggestionElements = this.getAndFilterLeftSuggestionElements();\n }\n\n if (!this.isPanelInFocus(this.rightPanel, query)) {\n this.rightSuggestionElements = this.getSuggestionElements(\n this.rightSuggestions\n );\n }\n }\n\n public forceUpdate() {\n this.updateSuggestionElements(this.suggestedQuery);\n forceUpdate(this.ownerSearchBoxProps.getHost());\n }\n\n private isPanelInFocus(\n panel: HTMLElement | undefined,\n query: string\n ): boolean {\n if (!this.activeDescendantElement) {\n return false;\n }\n\n if (query) {\n const escaped = DOMPurify.sanitize(query);\n return !!panel?.querySelector(\n `[${this.queryDataAttribute}=\"${CSS.escape(escaped)}\"]`\n );\n }\n\n return this.activeDescendantElement?.closest('ul') === panel;\n }\n\n private getAndFilterLeftSuggestionElements() {\n const suggestionElements = this.getSuggestionElements(this.leftSuggestions);\n const filterOnDuplicate = new Set();\n\n const out = suggestionElements.filter((suggestionElement) => {\n if (isNullOrUndefined(suggestionElement.query)) {\n return true;\n }\n if (filterOnDuplicate.has(suggestionElement.query)) {\n return false;\n } else {\n filterOnDuplicate.add(suggestionElement.query);\n return true;\n }\n });\n\n return out;\n }\n\n private getSuggestionElements(suggestions: SearchBoxSuggestions[]) {\n const elements = suggestions.flatMap((suggestion) =>\n suggestion.renderItems()\n );\n\n const max =\n this.ownerSearchBoxProps.getNumberOfSuggestionsToDisplay() +\n elements.filter(elementHasNoQuery).length;\n\n return elements.slice(0, max);\n }\n\n private updateDescendants(activeDescendant = '') {\n const newPrevDescendantElement = this.activeDescendantElement;\n this.previousActiveDescendantElement = newPrevDescendantElement;\n this.updateActiveDescendant(activeDescendant);\n }\n\n private clearSuggestionElements() {\n this.leftSuggestionElements = [];\n this.rightSuggestionElements = [];\n }\n}\n"],"version":3}
@@ -1,2 +1,2 @@
1
1
  module.exports.headlessVersion = '3.31.2';
2
- module.exports.atomicVersion = '3.35.0-pre.e38c46e295';
2
+ module.exports.atomicVersion = '3.35.0-pre.e9982a2757';
@@ -1,9 +1,9 @@
1
+ import { c as closest } from './dom-utils-f6086cd3.js';
2
+ import { b as buildCustomEvent } from './event-utils-8de63ec3.js';
1
3
  import { i as itemContext } from './stencil-item-decorators-6c453c11.js';
2
4
  export { d as dispatchSearchBoxSuggestionsEvent } from './suggestions-events-b7a6f007.js';
3
5
  export { e as elementHasNoQuery, a as elementHasQuery } from './suggestions-utils-591559a0.js';
4
- export { r as resultContext } from './result-template-decorators-2ed76ea9.js';
5
- import { c as closest } from './dom-utils-f6086cd3.js';
6
- import { b as buildCustomEvent } from './event-utils-8de63ec3.js';
6
+ export { r as resultContext } from './stencil-result-template-decorators-f989bc6b.js';
7
7
  export { i as initializeBindings } from './initialization-utils-ffbc4136.js';
8
8
  export { b as bindLogDocumentOpenOnResult } from './result-utils-7e9b6b5c.js';
9
9
  export { M as MissingInterfaceParentError } from './initialization-lit-stencil-common-utils-804fe146.js';
@@ -11,22 +11,6 @@ import './index-3f35faca.js';
11
11
  import './init-queue-fbe942c3.js';
12
12
  import '@coveo/headless';
13
13
 
14
- /**
15
- * Retrieves `Product` on a rendered `atomic-product`.
16
- *
17
- * This method 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.
18
- *
19
- * 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).
20
- *
21
- * @param element - The element that the event is dispatched to, which must be the child of a rendered "atomic-product".
22
- * @returns A promise that resolves on initialization of the parent "atomic-product" element, or rejects when there is no parent "atomic-product" element.
23
- *
24
- * @deprecated should only be used for Stencil components. For Lit components, use `fetchProductContext` from \@/src/decorators/commerce/product-template-decorators.ts
25
- */
26
- function productContext(element) {
27
- return itemContext(element, 'atomic-product');
28
- }
29
-
30
14
  class MissingParentError extends Error {
31
15
  constructor(elementName, parentName) {
32
16
  super(`The "${elementName}" element must be the child of an "${parentName}" element.`);
@@ -60,6 +44,22 @@ function fetchProductContext(element) {
60
44
  return fetchItemContext(element, 'atomic-product');
61
45
  }
62
46
 
47
+ /**
48
+ * Retrieves `Product` on a rendered `atomic-product`.
49
+ *
50
+ * This method 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.
51
+ *
52
+ * 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).
53
+ *
54
+ * @param element - The element that the event is dispatched to, which must be the child of a rendered "atomic-product".
55
+ * @returns A promise that resolves on initialization of the parent "atomic-product" element, or rejects when there is no parent "atomic-product" element.
56
+ *
57
+ * @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
58
+ */
59
+ function productContext(element) {
60
+ return itemContext(element, 'atomic-product');
61
+ }
62
+
63
63
  export { fetchProductContext, productContext };
64
64
 
65
65
  //# sourceMappingURL=index.js.map
@@ -2,7 +2,7 @@ import { r as registerInstance, h, g as getElement } from './index-3f35faca.js';
2
2
  import { ResultTemplatesHelpers } from '@coveo/headless';
3
3
  import { M as MapProp } from './props-utils-6040b5d2.js';
4
4
  import { m as makeMatchConditions } from './result-template-common-47799c7c.js';
5
- import { R as ResultContext } from './result-template-decorators-2ed76ea9.js';
5
+ import { R as ResultContext } from './stencil-result-template-decorators-f989bc6b.js';
6
6
  import '@coveo/bueno';
7
7
  import './utils-6400ebde.js';
8
8
  import './purify-c7ebd240.js';
@@ -1 +1 @@
1
- {"file":"atomic-field-condition.entry.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,uBAAuB,GAAG,wCAAwC,CAAC;AACzE,mCAAe,uBAAuB;;;;;;;;;;;;MCuBzB,oBAAoB;;;;;;;QAgBO,cAAS,GAC7C,EAAE,CAAC;;;;;QAMiC,iBAAY,GAChD,EAAE,CAAC;QAEG,eAAU,GAA8B,EAAE,CAAC;QAC3C,oBAAe,GAAG,KAAK,CAAC;;;yBAV9B,EAAE;4BAOF,EAAE;;IAOG,iBAAiB;QACtB,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC7C,IAAI,CAAC,UAAU,CAAC,IAAI,CAClB,sBAAsB,CAAC,mBAAmB,CAAC,UAAU,CAAC,CACvD,CAAC;SACH;QAED,IAAI,IAAI,CAAC,YAAY,EAAE;YACrB,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAChD,IAAI,CAAC,UAAU,CAAC,IAAI,CAClB,sBAAsB,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAC1D,CAAC;SACH;QAED,IAAI,CAAC,UAAU,CAAC,IAAI,CAClB,GAAG,mBAAmB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAC1D,CAAC;KACH;IAEM,MAAM;QACX,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE;YACjE,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;YAC5B,OAAO,EAAE,CAAC;SACX;QAED,OAAO,eAAQ,CAAC;KACjB;IAEM,gBAAgB;QACrB,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;KAC5C;;;AA9CqC;IAA7B,OAAO,CAAC,EAAC,WAAW,EAAE,IAAI,EAAC,CAAC;uDAChC;AAMiC;IAA7B,OAAO,CAAC,EAAC,WAAW,EAAE,IAAI,EAAC,CAAC;0DAChC;AAKoB;IAAxB,aAAa,EAAE;oDAAyB;;;;;","names":[],"sources":["src/components/search/result-template-components/atomic-field-condition/atomic-field-condition.pcss?tag=atomic-field-condition","src/components/search/result-template-components/atomic-field-condition/atomic-field-condition.tsx"],"sourcesContent":["atomic-field-condition {\n max-width: 100%;\n}\n","import {\n Result,\n ResultTemplateCondition,\n ResultTemplatesHelpers,\n} from '@coveo/headless';\nimport {Component, Prop, h, Element} from '@stencil/core';\nimport {MapProp} from '../../../../utils/props-utils';\nimport {makeMatchConditions} from '../../../common/result-templates/result-template-common';\nimport {ResultContext} from '../result-template-decorators';\n\n/**\n * The `atomic-field-condition` component takes a list of conditions that, if fulfilled, apply the template in which it's defined.\n * The condition properties can be based on any top-level result property of the `result` object, not restricted to fields (e.g., `isRecommendation`).\n *\n * @slot default - The content to display if the conditions are met.\n *\n * @MapProp name: mustMatch;attr: must-match;docs: The field and values that define which result items the condition must be applied to. For example, a template with the following attribute only applies to result items whose `filetype` is `lithiummessage` or `YouTubePlaylist`: `must-match-filetype=\"lithiummessage,YouTubePlaylist\"`;type: Record<string, string[]> ;default: {}\n * @MapProp name: mustNotMatch;attr: must-not-match;docs: The field and values that define which result items the condition must not be applied to. For example, a template with the following attribute only applies to result items whose `filetype` is not `lithiummessage`: `must-not-match-filetype=\"lithiummessage\";type: Record<string, string[]> ;default: {}\n */\n@Component({\n tag: 'atomic-field-condition',\n styleUrl: 'atomic-field-condition.pcss',\n shadow: false,\n})\nexport class AtomicFieldCondition {\n @Element() host!: HTMLElement;\n\n /**\n * Verifies whether the specified fields are defined.\n */\n @Prop({reflect: true}) ifDefined?: string;\n /**\n * Verifies whether the specified fields are not defined.\n */\n @Prop({reflect: true}) ifNotDefined?: string;\n\n /**\n * Verifies whether the specified fields match the specified values.\n * @type {Record<string, string[]>}\n */\n @Prop() @MapProp({splitValues: true}) mustMatch: Record<string, string[]> =\n {};\n\n /**\n * Verifies whether the specified fields do not match the specified values.\n * @type {Record<string, string[]>}\n */\n @Prop() @MapProp({splitValues: true}) mustNotMatch: Record<string, string[]> =\n {};\n\n private conditions: ResultTemplateCondition[] = [];\n private shouldBeRemoved = false;\n\n @ResultContext() private result!: Result;\n\n public componentWillLoad() {\n if (this.ifDefined) {\n const fieldNames = this.ifDefined.split(',');\n this.conditions.push(\n ResultTemplatesHelpers.fieldsMustBeDefined(fieldNames)\n );\n }\n\n if (this.ifNotDefined) {\n const fieldNames = this.ifNotDefined.split(',');\n this.conditions.push(\n ResultTemplatesHelpers.fieldsMustNotBeDefined(fieldNames)\n );\n }\n\n this.conditions.push(\n ...makeMatchConditions(this.mustMatch, this.mustNotMatch)\n );\n }\n\n public render() {\n if (!this.conditions.every((condition) => condition(this.result))) {\n this.shouldBeRemoved = true;\n return '';\n }\n\n return <slot />;\n }\n\n public componentDidLoad() {\n this.shouldBeRemoved && this.host.remove();\n }\n}\n"],"version":3}
1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AAO,CAAC,EAAC,WAAW,EAAE,IAAI,EAAC,CAAC;uDAChC;AAMiC;IAA7B,OAAO,CAAC,EAAC,WAAW,EAAE,IAAI,EAAC,CAAC;0DAChC;AAKoB;IAAxB,aAAa,EAAE;oDAAyB;;;;;","names":[],"sources":["src/components/search/result-template-components/atomic-field-condition/atomic-field-condition.pcss?tag=atomic-field-condition","src/components/search/result-template-components/atomic-field-condition/atomic-field-condition.tsx"],"sourcesContent":["atomic-field-condition {\n max-width: 100%;\n}\n","import {\n Result,\n ResultTemplateCondition,\n ResultTemplatesHelpers,\n} from '@coveo/headless';\nimport {Component, Prop, h, Element} from '@stencil/core';\nimport {MapProp} from '../../../../utils/props-utils';\nimport {makeMatchConditions} from '../../../common/result-templates/result-template-common';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\n\n/**\n * The `atomic-field-condition` component takes a list of conditions that, if fulfilled, apply the template in which it's defined.\n * The condition properties can be based on any top-level result property of the `result` object, not restricted to fields (e.g., `isRecommendation`).\n *\n * @slot default - The content to display if the conditions are met.\n *\n * @MapProp name: mustMatch;attr: must-match;docs: The field and values that define which result items the condition must be applied to. For example, a template with the following attribute only applies to result items whose `filetype` is `lithiummessage` or `YouTubePlaylist`: `must-match-filetype=\"lithiummessage,YouTubePlaylist\"`;type: Record<string, string[]> ;default: {}\n * @MapProp name: mustNotMatch;attr: must-not-match;docs: The field and values that define which result items the condition must not be applied to. For example, a template with the following attribute only applies to result items whose `filetype` is not `lithiummessage`: `must-not-match-filetype=\"lithiummessage\";type: Record<string, string[]> ;default: {}\n */\n@Component({\n tag: 'atomic-field-condition',\n styleUrl: 'atomic-field-condition.pcss',\n shadow: false,\n})\nexport class AtomicFieldCondition {\n @Element() host!: HTMLElement;\n\n /**\n * Verifies whether the specified fields are defined.\n */\n @Prop({reflect: true}) ifDefined?: string;\n /**\n * Verifies whether the specified fields are not defined.\n */\n @Prop({reflect: true}) ifNotDefined?: string;\n\n /**\n * Verifies whether the specified fields match the specified values.\n * @type {Record<string, string[]>}\n */\n @Prop() @MapProp({splitValues: true}) mustMatch: Record<string, string[]> =\n {};\n\n /**\n * Verifies whether the specified fields do not match the specified values.\n * @type {Record<string, string[]>}\n */\n @Prop() @MapProp({splitValues: true}) mustNotMatch: Record<string, string[]> =\n {};\n\n private conditions: ResultTemplateCondition[] = [];\n private shouldBeRemoved = false;\n\n @ResultContext() private result!: Result;\n\n public componentWillLoad() {\n if (this.ifDefined) {\n const fieldNames = this.ifDefined.split(',');\n this.conditions.push(\n ResultTemplatesHelpers.fieldsMustBeDefined(fieldNames)\n );\n }\n\n if (this.ifNotDefined) {\n const fieldNames = this.ifNotDefined.split(',');\n this.conditions.push(\n ResultTemplatesHelpers.fieldsMustNotBeDefined(fieldNames)\n );\n }\n\n this.conditions.push(\n ...makeMatchConditions(this.mustMatch, this.mustNotMatch)\n );\n }\n\n public render() {\n if (!this.conditions.every((condition) => condition(this.result))) {\n this.shouldBeRemoved = true;\n return '';\n }\n\n return <slot />;\n }\n\n public componentDidLoad() {\n this.shouldBeRemoved && this.host.remove();\n }\n}\n"],"version":3}
@@ -4,7 +4,7 @@ import { A as AttachIcon } from './attach-81bb8872.js';
4
4
  import { Q as QuickviewIcon } from './preview-bb7e7a89.js';
5
5
  import { I as InitializeBindings } from './initialization-utils-ffbc4136.js';
6
6
  import { I as IconButton } from './stencil-iconButton-ba40899c.js';
7
- import { R as ResultContext } from './result-template-decorators-2ed76ea9.js';
7
+ import { R as ResultContext } from './stencil-result-template-decorators-f989bc6b.js';
8
8
  import './dom-utils-f6086cd3.js';
9
9
  import './event-utils-8de63ec3.js';
10
10
  import './init-queue-fbe942c3.js';
@@ -120,7 +120,7 @@ const AtomicInsightResultAction = class {
120
120
  }
121
121
  }
122
122
  render() {
123
- return (h(IconButton, { key: '22e8405ba913fe6785627fec9f047f9fcbdf7cf3', partPrefix: "result-action", style: "outline-neutral", icon: this.getIcon(), title: this.tooltip, onClick: () => this.onClick() }));
123
+ return (h(IconButton, { key: 'd5c5574abd87823727ec04b21d30068c6e5440f7', partPrefix: "result-action", style: "outline-neutral", icon: this.getIcon(), title: this.tooltip, onClick: () => this.onClick() }));
124
124
  }
125
125
  };
126
126
  __decorate([