@coveo/atomic 3.35.0-pre.25e9237b66 → 3.35.0-pre.2a8da8ee82

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 (389) hide show
  1. package/dist/atomic/_atomic.esm.js +1 -1
  2. package/dist/atomic/atomic.esm.js.map +1 -1
  3. package/dist/atomic/components/_index.d.ts +0 -2
  4. package/dist/atomic/components/_index.js +20 -22
  5. package/dist/atomic/components/atomic-field-condition.js +1 -1
  6. package/dist/atomic/components/atomic-field-condition.js.map +1 -1
  7. package/dist/atomic/components/atomic-insight-result-action.js +2 -2
  8. package/dist/atomic/components/atomic-insight-result-action.js.map +1 -1
  9. package/dist/atomic/components/atomic-insight-result-attach-to-case-action.js +2 -2
  10. package/dist/atomic/components/atomic-insight-result-attach-to-case-action.js.map +1 -1
  11. package/dist/atomic/components/atomic-insight-result-attach-to-case-indicator.js +2 -2
  12. package/dist/atomic/components/atomic-insight-result-attach-to-case-indicator.js.map +1 -1
  13. package/dist/atomic/components/atomic-insight-result-quickview-action.js +2 -2
  14. package/dist/atomic/components/atomic-insight-result-quickview-action.js.map +1 -1
  15. package/dist/atomic/components/atomic-insight-search-box.js +29 -2
  16. package/dist/atomic/components/atomic-insight-search-box.js.map +1 -1
  17. package/dist/atomic/components/atomic-ipx-result-link.js +2 -2
  18. package/dist/atomic/components/atomic-ipx-result-link.js.map +1 -1
  19. package/dist/atomic/components/atomic-quickview-modal2.js +1 -1
  20. package/dist/atomic/components/atomic-quickview.js +2 -2
  21. package/dist/atomic/components/atomic-quickview.js.map +1 -1
  22. package/dist/atomic/components/atomic-recs-interface.js +1 -1
  23. package/dist/atomic/components/atomic-result-badge.js +1 -1
  24. package/dist/atomic/components/atomic-result-badge.js.map +1 -1
  25. package/dist/atomic/components/atomic-result-children.js +2 -2
  26. package/dist/atomic/components/atomic-result-children.js.map +1 -1
  27. package/dist/atomic/components/atomic-result-date.js +1 -1
  28. package/dist/atomic/components/atomic-result-date.js.map +1 -1
  29. package/dist/atomic/components/atomic-result-fields-list.js +2 -2
  30. package/dist/atomic/components/atomic-result-fields-list.js.map +1 -1
  31. package/dist/atomic/components/atomic-result-html.js +1 -1
  32. package/dist/atomic/components/atomic-result-html.js.map +1 -1
  33. package/dist/atomic/components/atomic-result-icon.js +1 -1
  34. package/dist/atomic/components/atomic-result-icon.js.map +1 -1
  35. package/dist/atomic/components/atomic-result-image.js +1 -1
  36. package/dist/atomic/components/atomic-result-image.js.map +1 -1
  37. package/dist/atomic/components/atomic-result-link.js +2 -2
  38. package/dist/atomic/components/atomic-result-link.js.map +1 -1
  39. package/dist/atomic/components/atomic-result-localized-text.js +1 -1
  40. package/dist/atomic/components/atomic-result-localized-text.js.map +1 -1
  41. package/dist/atomic/components/atomic-result-multi-value-text.js +1 -1
  42. package/dist/atomic/components/atomic-result-multi-value-text.js.map +1 -1
  43. package/dist/atomic/components/atomic-result-number.js +1 -1
  44. package/dist/atomic/components/atomic-result-number.js.map +1 -1
  45. package/dist/atomic/components/atomic-result-printable-uri.js +1 -1
  46. package/dist/atomic/components/atomic-result-printable-uri.js.map +1 -1
  47. package/dist/atomic/components/atomic-result-rating.js +1 -1
  48. package/dist/atomic/components/atomic-result-rating.js.map +1 -1
  49. package/dist/atomic/components/atomic-result-text2.js +1 -1
  50. package/dist/atomic/components/atomic-result-text2.js.map +1 -1
  51. package/dist/atomic/components/atomic-result-timespan.js +1 -1
  52. package/dist/atomic/components/atomic-result-timespan.js.map +1 -1
  53. package/dist/atomic/components/atomic-result2.js.map +1 -1
  54. package/dist/atomic/components/atomic-search-box-instant-results.js +37 -2
  55. package/dist/atomic/components/atomic-search-box-instant-results.js.map +1 -1
  56. package/dist/atomic/components/atomic-search-box.js +4 -14
  57. package/dist/atomic/components/atomic-search-box.js.map +1 -1
  58. package/dist/atomic/components/atomic-smart-snippet-feedback-modal2.js +2 -2
  59. package/dist/atomic/components/atomic-smart-snippet-source2.js +1 -1
  60. package/dist/atomic/components/atomic-smart-snippet-source2.js.map +1 -1
  61. package/dist/atomic/components/atomic-tab-manager.js +1 -1
  62. package/dist/atomic/components/components/commerce/atomic-commerce-breadbox/atomic-commerce-breadbox.js +1 -3
  63. package/dist/atomic/components/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.js +0 -5
  64. package/dist/atomic/components/components/commerce/atomic-commerce-search-box-recent-queries/atomic-commerce-search-box-recent-queries.js +0 -3
  65. package/dist/atomic/components/components/commerce/atomic-product-children/atomic-product-children.js +1 -1
  66. package/dist/atomic/components/components/commerce/atomic-product-description/atomic-product-description.js +1 -1
  67. package/dist/atomic/components/components/commerce/atomic-product-excerpt/atomic-product-excerpt.js +1 -1
  68. package/dist/atomic/components/components/commerce/atomic-product-field-condition/atomic-product-field-condition.js +1 -1
  69. package/dist/atomic/components/components/commerce/atomic-product-image/atomic-product-image.js +1 -1
  70. package/dist/atomic/components/components/commerce/atomic-product-link/atomic-product-link.js +2 -1
  71. package/dist/atomic/components/components/commerce/atomic-product-multi-value-text/atomic-product-multi-value-text.js +1 -1
  72. package/dist/atomic/components/components/commerce/atomic-product-numeric-field-value/atomic-product-numeric-field-value.js +1 -1
  73. package/dist/atomic/components/components/commerce/atomic-product-price/atomic-product-price.js +1 -1
  74. package/dist/atomic/components/components/commerce/atomic-product-rating/atomic-product-rating.js +1 -1
  75. package/dist/atomic/components/components/commerce/atomic-product-text/atomic-product-text.js +1 -1
  76. package/dist/atomic/components/components/commerce/product-template-component-utils/context/interactive-product-context-controller.js +25 -0
  77. package/dist/atomic/components/components/commerce/product-template-component-utils/context/product-context-controller.js +29 -0
  78. package/dist/atomic/components/components/common/breadbox/breadcrumb-button.js +1 -6
  79. package/dist/atomic/components/components/common/search-box/text-area-clear-button.js +1 -1
  80. package/dist/atomic/components/components/common/suggestions/query-suggestions.js +11 -16
  81. package/dist/atomic/components/components/search/atomic-search-box-query-suggestions/atomic-search-box-query-suggestions.js +105 -0
  82. package/dist/atomic/components/components/search/index.js +1 -0
  83. package/dist/atomic/components/components/search/lazy-index.js +1 -0
  84. package/dist/atomic/components/global/environment.js +1 -1
  85. package/dist/atomic/components/index.js.map +1 -1
  86. package/dist/atomic/components/{result-template-decorators.js → stencil-result-template-decorators.js} +6 -2
  87. package/dist/atomic/components/stencil-result-template-decorators.js.map +1 -0
  88. package/dist/atomic/components/stencil-suggestion-manager.js +1 -1
  89. package/dist/atomic/components/stencil-suggestion-manager.js.map +1 -1
  90. package/dist/atomic/index.esm.js +1 -1
  91. package/dist/atomic/index.esm.js.map +1 -1
  92. package/dist/atomic/lang/cs.json +1 -1
  93. package/dist/atomic/lang/da.json +1 -1
  94. package/dist/atomic/lang/de.json +1 -1
  95. package/dist/atomic/lang/dev.json +1 -1
  96. package/dist/atomic/lang/el.json +1 -1
  97. package/dist/atomic/lang/en.json +1 -1
  98. package/dist/atomic/lang/es.json +1 -1
  99. package/dist/atomic/lang/fi.json +1 -1
  100. package/dist/atomic/lang/fr.json +1 -1
  101. package/dist/atomic/lang/hu.json +1 -1
  102. package/dist/atomic/lang/id.json +1 -1
  103. package/dist/atomic/lang/it.json +1 -1
  104. package/dist/atomic/lang/ja.json +1 -1
  105. package/dist/atomic/lang/ko.json +1 -1
  106. package/dist/atomic/lang/nl.json +1 -1
  107. package/dist/atomic/lang/no.json +1 -1
  108. package/dist/atomic/lang/pl.json +1 -1
  109. package/dist/atomic/lang/pt-BR.json +1 -1
  110. package/dist/atomic/lang/pt.json +1 -1
  111. package/dist/atomic/lang/ru.json +1 -1
  112. package/dist/atomic/lang/sv.json +1 -1
  113. package/dist/atomic/lang/th.json +1 -1
  114. package/dist/atomic/lang/tr.json +1 -1
  115. package/dist/atomic/lang/zh-CN.json +1 -1
  116. package/dist/atomic/lang/zh-TW.json +1 -1
  117. package/dist/atomic/lang/zh.json +1 -1
  118. package/dist/atomic/{p-955092ed.entry.js → p-01096d1c.entry.js} +2 -2
  119. package/dist/atomic/p-01096d1c.entry.js.map +1 -0
  120. package/dist/atomic/{p-874f0a4c.entry.js → p-060b94d2.entry.js} +2 -2
  121. package/dist/atomic/{p-82cd6398.entry.js → p-154cbbfe.entry.js} +2 -2
  122. package/dist/atomic/{p-82cd6398.entry.js.map → p-154cbbfe.entry.js.map} +1 -1
  123. package/dist/atomic/p-16f4ce98.js +2 -0
  124. package/dist/atomic/p-16f4ce98.js.map +1 -0
  125. package/dist/atomic/{p-db3b11ca.entry.js → p-2033533c.entry.js} +2 -2
  126. package/dist/atomic/{p-db3b11ca.entry.js.map → p-2033533c.entry.js.map} +1 -1
  127. package/dist/atomic/{p-4069d801.entry.js → p-268ce7ca.entry.js} +2 -2
  128. package/dist/atomic/p-268ce7ca.entry.js.map +1 -0
  129. package/dist/atomic/{p-9e6462cf.entry.js → p-36ff2bc3.entry.js} +2 -2
  130. package/dist/atomic/p-36ff2bc3.entry.js.map +1 -0
  131. package/dist/atomic/{p-e9dc8e90.entry.js → p-3ec45f9c.entry.js} +2 -2
  132. package/dist/atomic/p-3ec45f9c.entry.js.map +1 -0
  133. package/dist/atomic/{p-18684d4c.js → p-4080f740.js} +1 -1
  134. package/dist/atomic/p-4080f740.js.map +1 -0
  135. package/dist/atomic/{p-8d5228da.entry.js → p-42fffab2.entry.js} +2 -2
  136. package/dist/atomic/p-42fffab2.entry.js.map +1 -0
  137. package/dist/atomic/{p-190ddaca.entry.js → p-4cf97b0a.entry.js} +2 -2
  138. package/dist/atomic/p-4cf97b0a.entry.js.map +1 -0
  139. package/dist/atomic/{p-78427c6a.entry.js → p-5a9460ab.entry.js} +2 -2
  140. package/dist/atomic/p-5a9460ab.entry.js.map +1 -0
  141. package/dist/atomic/{p-15547bd5.entry.js → p-61b3f5ce.entry.js} +2 -2
  142. package/dist/atomic/p-61b3f5ce.entry.js.map +1 -0
  143. package/dist/atomic/{p-1ff7a9da.entry.js → p-6a3b139f.entry.js} +2 -2
  144. package/dist/atomic/p-6a3b139f.entry.js.map +1 -0
  145. package/dist/atomic/{p-df8d38ca.entry.js → p-7015679e.entry.js} +2 -2
  146. package/dist/atomic/p-7015679e.entry.js.map +1 -0
  147. package/dist/atomic/{p-dea22a8d.entry.js → p-886b184f.entry.js} +2 -2
  148. package/dist/atomic/p-886b184f.entry.js.map +1 -0
  149. package/dist/atomic/{p-ed413091.entry.js → p-8a30d1e9.entry.js} +2 -2
  150. package/dist/atomic/{p-b3f6561d.entry.js → p-8e964890.entry.js} +2 -2
  151. package/dist/atomic/p-8e964890.entry.js.map +1 -0
  152. package/dist/atomic/{p-182f9112.entry.js → p-a413f820.entry.js} +2 -2
  153. package/dist/atomic/p-a413f820.entry.js.map +1 -0
  154. package/dist/atomic/{p-5cab535b.entry.js → p-c5bd7f8d.entry.js} +2 -2
  155. package/dist/atomic/p-c5bd7f8d.entry.js.map +1 -0
  156. package/dist/atomic/{p-852cc16d.entry.js → p-cacb7fd8.entry.js} +2 -2
  157. package/dist/atomic/p-cacb7fd8.entry.js.map +1 -0
  158. package/dist/atomic/{p-df592625.entry.js → p-ce6e5989.entry.js} +2 -2
  159. package/dist/atomic/{p-c5164dbf.entry.js → p-cee86cff.entry.js} +2 -2
  160. package/dist/atomic/p-cee86cff.entry.js.map +1 -0
  161. package/dist/atomic/{p-4cb91ee7.entry.js → p-d5402772.entry.js} +2 -2
  162. package/dist/atomic/p-d5402772.entry.js.map +1 -0
  163. package/dist/atomic/p-d55668a3.entry.js +2 -0
  164. package/dist/atomic/p-d55668a3.entry.js.map +1 -0
  165. package/dist/atomic/{p-e6dc9de7.entry.js → p-da141605.entry.js} +2 -2
  166. package/dist/atomic/p-da141605.entry.js.map +1 -0
  167. package/dist/atomic/{p-a1798150.entry.js → p-dd258eaa.entry.js} +2 -2
  168. package/dist/atomic/p-dd258eaa.entry.js.map +1 -0
  169. package/dist/atomic/{p-945ddd53.entry.js → p-e1dbe31d.entry.js} +2 -2
  170. package/dist/atomic/p-e1dbe31d.entry.js.map +1 -0
  171. package/dist/atomic/{p-448091f7.entry.js → p-ecd3c0a9.entry.js} +2 -2
  172. package/dist/atomic/p-ecd3c0a9.entry.js.map +1 -0
  173. package/dist/atomic/{p-c2a5dac0.entry.js → p-f2c4209d.entry.js} +2 -2
  174. package/dist/atomic/{p-57049cd2.entry.js → p-f2c89d7c.entry.js} +2 -2
  175. package/dist/atomic/p-f2c89d7c.entry.js.map +1 -0
  176. package/dist/atomic/p-f800678c.entry.js.map +1 -1
  177. package/dist/cjs/_index.cjs.js +20 -20
  178. package/dist/cjs/_loader.cjs.js +1 -1
  179. package/dist/cjs/atomic-field-condition.cjs.entry.js +2 -2
  180. package/dist/cjs/atomic-field-condition.cjs.entry.js.map +1 -1
  181. package/dist/cjs/atomic-insight-result-action.cjs.entry.js +3 -3
  182. package/dist/cjs/atomic-insight-result-action.cjs.entry.js.map +1 -1
  183. package/dist/cjs/atomic-insight-result-attach-to-case-action.cjs.entry.js +3 -3
  184. package/dist/cjs/atomic-insight-result-attach-to-case-action.cjs.entry.js.map +1 -1
  185. package/dist/cjs/atomic-insight-result-attach-to-case-indicator.cjs.entry.js +3 -3
  186. package/dist/cjs/atomic-insight-result-attach-to-case-indicator.cjs.entry.js.map +1 -1
  187. package/dist/cjs/atomic-insight-result-quickview-action.cjs.entry.js +3 -3
  188. package/dist/cjs/atomic-insight-result-quickview-action.cjs.entry.js.map +1 -1
  189. package/dist/cjs/atomic-insight-search-box.cjs.entry.js +31 -5
  190. package/dist/cjs/atomic-insight-search-box.cjs.entry.js.map +1 -1
  191. package/dist/cjs/atomic-ipx-result-link.cjs.entry.js +4 -4
  192. package/dist/cjs/atomic-ipx-result-link.cjs.entry.js.map +1 -1
  193. package/dist/cjs/atomic-quickview-modal.cjs.entry.js +1 -1
  194. package/dist/cjs/atomic-quickview.cjs.entry.js +3 -3
  195. package/dist/cjs/atomic-quickview.cjs.entry.js.map +1 -1
  196. package/dist/cjs/atomic-recs-interface.cjs.entry.js +1 -1
  197. package/dist/cjs/atomic-result-badge.cjs.entry.js +2 -2
  198. package/dist/cjs/atomic-result-badge.cjs.entry.js.map +1 -1
  199. package/dist/cjs/atomic-result-children.cjs.entry.js +3 -3
  200. package/dist/cjs/atomic-result-children.cjs.entry.js.map +1 -1
  201. package/dist/cjs/atomic-result-date.cjs.entry.js +2 -2
  202. package/dist/cjs/atomic-result-date.cjs.entry.js.map +1 -1
  203. package/dist/cjs/atomic-result-fields-list.cjs.entry.js +3 -3
  204. package/dist/cjs/atomic-result-fields-list.cjs.entry.js.map +1 -1
  205. package/dist/cjs/atomic-result-html.cjs.entry.js +2 -2
  206. package/dist/cjs/atomic-result-html.cjs.entry.js.map +1 -1
  207. package/dist/cjs/atomic-result-icon.cjs.entry.js +2 -2
  208. package/dist/cjs/atomic-result-icon.cjs.entry.js.map +1 -1
  209. package/dist/cjs/atomic-result-image.cjs.entry.js +2 -2
  210. package/dist/cjs/atomic-result-image.cjs.entry.js.map +1 -1
  211. package/dist/cjs/atomic-result-link.cjs.entry.js +4 -4
  212. package/dist/cjs/atomic-result-link.cjs.entry.js.map +1 -1
  213. package/dist/cjs/atomic-result-localized-text.cjs.entry.js +3 -3
  214. package/dist/cjs/atomic-result-localized-text.cjs.entry.js.map +1 -1
  215. package/dist/cjs/atomic-result-multi-value-text.cjs.entry.js +2 -2
  216. package/dist/cjs/atomic-result-multi-value-text.cjs.entry.js.map +1 -1
  217. package/dist/cjs/atomic-result-number.cjs.entry.js +2 -2
  218. package/dist/cjs/atomic-result-number.cjs.entry.js.map +1 -1
  219. package/dist/cjs/atomic-result-printable-uri.cjs.entry.js +2 -2
  220. package/dist/cjs/atomic-result-printable-uri.cjs.entry.js.map +1 -1
  221. package/dist/cjs/atomic-result-rating.cjs.entry.js +2 -2
  222. package/dist/cjs/atomic-result-rating.cjs.entry.js.map +1 -1
  223. package/dist/cjs/atomic-result-text_2.cjs.entry.js +2 -2
  224. package/dist/cjs/atomic-result-text_2.cjs.entry.js.map +1 -1
  225. package/dist/cjs/atomic-result-timespan.cjs.entry.js +2 -2
  226. package/dist/cjs/atomic-result-timespan.cjs.entry.js.map +1 -1
  227. package/dist/cjs/atomic-result.cjs.entry.js.map +1 -1
  228. package/dist/cjs/atomic-search-box.cjs.entry.js +4 -8
  229. package/dist/cjs/atomic-search-box.cjs.entry.js.map +1 -1
  230. package/dist/cjs/atomic-smart-snippet-answer_2.cjs.entry.js +1 -1
  231. package/dist/cjs/atomic-smart-snippet-answer_2.cjs.entry.js.map +1 -1
  232. package/dist/cjs/atomic-smart-snippet-feedback-modal.cjs.entry.js +2 -2
  233. package/dist/cjs/atomic-tab-manager.cjs.entry.js +1 -1
  234. package/dist/cjs/atomic.cjs.js +1 -1
  235. package/dist/cjs/index-757bc886.js +0 -4
  236. package/dist/cjs/index.cjs.js.map +1 -1
  237. package/dist/cjs/{result-template-decorators-432d11a9.js → stencil-result-template-decorators-28b05aaf.js} +6 -2
  238. package/dist/cjs/stencil-result-template-decorators-28b05aaf.js.map +1 -0
  239. package/dist/cjs/{stencil-suggestion-manager-88cb88f2.js → stencil-suggestion-manager-2cba6d69.js} +2 -2
  240. package/dist/cjs/stencil-suggestion-manager-2cba6d69.js.map +1 -0
  241. package/dist/cjs/version.cjs.js +1 -1
  242. package/dist/esm/_index.js +19 -19
  243. package/dist/esm/_loader.js +1 -1
  244. package/dist/esm/atomic-field-condition.entry.js +1 -1
  245. package/dist/esm/atomic-field-condition.entry.js.map +1 -1
  246. package/dist/esm/atomic-insight-result-action.entry.js +2 -2
  247. package/dist/esm/atomic-insight-result-action.entry.js.map +1 -1
  248. package/dist/esm/atomic-insight-result-attach-to-case-action.entry.js +2 -2
  249. package/dist/esm/atomic-insight-result-attach-to-case-action.entry.js.map +1 -1
  250. package/dist/esm/atomic-insight-result-attach-to-case-indicator.entry.js +2 -2
  251. package/dist/esm/atomic-insight-result-attach-to-case-indicator.entry.js.map +1 -1
  252. package/dist/esm/atomic-insight-result-quickview-action.entry.js +2 -2
  253. package/dist/esm/atomic-insight-result-quickview-action.entry.js.map +1 -1
  254. package/dist/esm/atomic-insight-search-box.entry.js +30 -4
  255. package/dist/esm/atomic-insight-search-box.entry.js.map +1 -1
  256. package/dist/esm/atomic-ipx-result-link.entry.js +2 -2
  257. package/dist/esm/atomic-ipx-result-link.entry.js.map +1 -1
  258. package/dist/esm/atomic-quickview-modal.entry.js +1 -1
  259. package/dist/esm/atomic-quickview.entry.js +2 -2
  260. package/dist/esm/atomic-quickview.entry.js.map +1 -1
  261. package/dist/esm/atomic-recs-interface.entry.js +1 -1
  262. package/dist/esm/atomic-result-badge.entry.js +1 -1
  263. package/dist/esm/atomic-result-badge.entry.js.map +1 -1
  264. package/dist/esm/atomic-result-children.entry.js +2 -2
  265. package/dist/esm/atomic-result-children.entry.js.map +1 -1
  266. package/dist/esm/atomic-result-date.entry.js +1 -1
  267. package/dist/esm/atomic-result-date.entry.js.map +1 -1
  268. package/dist/esm/atomic-result-fields-list.entry.js +2 -2
  269. package/dist/esm/atomic-result-fields-list.entry.js.map +1 -1
  270. package/dist/esm/atomic-result-html.entry.js +1 -1
  271. package/dist/esm/atomic-result-html.entry.js.map +1 -1
  272. package/dist/esm/atomic-result-icon.entry.js +1 -1
  273. package/dist/esm/atomic-result-icon.entry.js.map +1 -1
  274. package/dist/esm/atomic-result-image.entry.js +1 -1
  275. package/dist/esm/atomic-result-image.entry.js.map +1 -1
  276. package/dist/esm/atomic-result-link.entry.js +2 -2
  277. package/dist/esm/atomic-result-link.entry.js.map +1 -1
  278. package/dist/esm/atomic-result-localized-text.entry.js +2 -2
  279. package/dist/esm/atomic-result-localized-text.entry.js.map +1 -1
  280. package/dist/esm/atomic-result-multi-value-text.entry.js +1 -1
  281. package/dist/esm/atomic-result-multi-value-text.entry.js.map +1 -1
  282. package/dist/esm/atomic-result-number.entry.js +1 -1
  283. package/dist/esm/atomic-result-number.entry.js.map +1 -1
  284. package/dist/esm/atomic-result-printable-uri.entry.js +1 -1
  285. package/dist/esm/atomic-result-printable-uri.entry.js.map +1 -1
  286. package/dist/esm/atomic-result-rating.entry.js +1 -1
  287. package/dist/esm/atomic-result-rating.entry.js.map +1 -1
  288. package/dist/esm/atomic-result-text_2.entry.js +1 -1
  289. package/dist/esm/atomic-result-text_2.entry.js.map +1 -1
  290. package/dist/esm/atomic-result-timespan.entry.js +1 -1
  291. package/dist/esm/atomic-result-timespan.entry.js.map +1 -1
  292. package/dist/esm/atomic-result.entry.js.map +1 -1
  293. package/dist/esm/atomic-search-box.entry.js +4 -8
  294. package/dist/esm/atomic-search-box.entry.js.map +1 -1
  295. package/dist/esm/atomic-smart-snippet-answer_2.entry.js +1 -1
  296. package/dist/esm/atomic-smart-snippet-answer_2.entry.js.map +1 -1
  297. package/dist/esm/atomic-smart-snippet-feedback-modal.entry.js +2 -2
  298. package/dist/esm/atomic-tab-manager.entry.js +1 -1
  299. package/dist/esm/atomic.js +1 -1
  300. package/dist/esm/index-3f35faca.js +0 -4
  301. package/dist/esm/index.js.map +1 -1
  302. package/dist/esm/{result-template-decorators-2ed76ea9.js → stencil-result-template-decorators-f989bc6b.js} +6 -2
  303. package/dist/esm/stencil-result-template-decorators-f989bc6b.js.map +1 -0
  304. package/dist/esm/{stencil-suggestion-manager-1f4ed8d0.js → stencil-suggestion-manager-376f83e8.js} +2 -2
  305. package/dist/esm/stencil-suggestion-manager-376f83e8.js.map +1 -0
  306. package/dist/esm/version.js +1 -1
  307. package/dist/types/components/commerce/atomic-commerce-breadbox/atomic-commerce-breadbox.d.ts +0 -2
  308. package/dist/types/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.d.ts +0 -1
  309. package/dist/types/components/commerce/atomic-commerce-search-box-recent-queries/atomic-commerce-search-box-recent-queries.d.ts +0 -2
  310. package/dist/types/components/commerce/atomic-product/atomic-product.d.ts +1 -1
  311. package/dist/types/components/commerce/product-template-component-utils/context/fetch-product-context.d.ts +12 -0
  312. package/dist/types/components/commerce/product-template-component-utils/context/interactive-product-context-controller.d.ts +27 -0
  313. package/dist/types/components/commerce/product-template-component-utils/context/product-context-controller.d.ts +33 -0
  314. package/dist/types/components/commerce/product-template-component-utils/{stencil-product-template-decorators.d.ts → context/stencil-product-template-decorators.d.ts} +1 -1
  315. package/dist/types/components/common/breadbox/breadcrumb-button.d.ts +0 -2
  316. package/dist/types/components/common/smart-snippets/atomic-smart-snippet-source.d.ts +1 -1
  317. package/dist/types/components/search/atomic-result/atomic-result.d.ts +1 -1
  318. package/dist/types/components/search/atomic-search-box/atomic-search-box.d.ts +0 -1
  319. package/dist/types/components/search/{search-box-suggestions/atomic-search-box-query-suggestions → atomic-search-box-query-suggestions}/atomic-search-box-query-suggestions.d.ts +16 -7
  320. package/dist/types/components/search/index.d.ts +1 -0
  321. package/dist/types/components/search/result-template-component-utils/context/fetch-result-context.d.ts +8 -0
  322. package/dist/types/components/search/result-template-component-utils/context/interactive-result-context-controller.d.ts +12 -0
  323. package/dist/types/components/search/result-template-component-utils/context/result-context-controller.d.ts +18 -0
  324. 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
  325. package/dist/types/components.d.ts +0 -49
  326. package/dist/types/directives/hierarchical-path.d.ts +1 -1
  327. package/dist/types/index.d.ts +3 -3
  328. package/docs/atomic-docs.json +3 -102
  329. package/package.json +1 -1
  330. package/dist/atomic/components/atomic-search-box-query-suggestions.d.ts +0 -11
  331. package/dist/atomic/components/atomic-search-box-query-suggestions.js +0 -8
  332. package/dist/atomic/components/atomic-search-box-query-suggestions.js.map +0 -1
  333. package/dist/atomic/components/atomic-search-box-query-suggestions2.js +0 -89
  334. package/dist/atomic/components/atomic-search-box-query-suggestions2.js.map +0 -1
  335. package/dist/atomic/components/components/common/item-list/fetch-item-context.js +0 -15
  336. package/dist/atomic/components/decorators/commerce/product-template-decorators.js +0 -68
  337. package/dist/atomic/components/result-template-decorators.js.map +0 -1
  338. package/dist/atomic/components/stencil-query-suggestions.js +0 -33
  339. package/dist/atomic/components/stencil-query-suggestions.js.map +0 -1
  340. package/dist/atomic/components/suggestions-events.js +0 -40
  341. package/dist/atomic/components/suggestions-events.js.map +0 -1
  342. package/dist/atomic/p-15547bd5.entry.js.map +0 -1
  343. package/dist/atomic/p-182f9112.entry.js.map +0 -1
  344. package/dist/atomic/p-18684d4c.js.map +0 -1
  345. package/dist/atomic/p-190ddaca.entry.js.map +0 -1
  346. package/dist/atomic/p-1ff7a9da.entry.js.map +0 -1
  347. package/dist/atomic/p-2559747d.js +0 -2
  348. package/dist/atomic/p-2559747d.js.map +0 -1
  349. package/dist/atomic/p-4069d801.entry.js.map +0 -1
  350. package/dist/atomic/p-448091f7.entry.js.map +0 -1
  351. package/dist/atomic/p-4cb91ee7.entry.js.map +0 -1
  352. package/dist/atomic/p-567b2841.entry.js +0 -2
  353. package/dist/atomic/p-567b2841.entry.js.map +0 -1
  354. package/dist/atomic/p-57049cd2.entry.js.map +0 -1
  355. package/dist/atomic/p-5cab535b.entry.js.map +0 -1
  356. package/dist/atomic/p-78427c6a.entry.js.map +0 -1
  357. package/dist/atomic/p-852cc16d.entry.js.map +0 -1
  358. package/dist/atomic/p-8d5228da.entry.js.map +0 -1
  359. package/dist/atomic/p-945ddd53.entry.js.map +0 -1
  360. package/dist/atomic/p-955092ed.entry.js.map +0 -1
  361. package/dist/atomic/p-9e6462cf.entry.js.map +0 -1
  362. package/dist/atomic/p-a1798150.entry.js.map +0 -1
  363. package/dist/atomic/p-af93b44c.js +0 -2
  364. package/dist/atomic/p-af93b44c.js.map +0 -1
  365. package/dist/atomic/p-b3f6561d.entry.js.map +0 -1
  366. package/dist/atomic/p-c5164dbf.entry.js.map +0 -1
  367. package/dist/atomic/p-dea22a8d.entry.js.map +0 -1
  368. package/dist/atomic/p-df8d38ca.entry.js.map +0 -1
  369. package/dist/atomic/p-e6dc9de7.entry.js.map +0 -1
  370. package/dist/atomic/p-e8176ac8.entry.js +0 -2
  371. package/dist/atomic/p-e8176ac8.entry.js.map +0 -1
  372. package/dist/atomic/p-e9dc8e90.entry.js.map +0 -1
  373. package/dist/cjs/atomic-search-box-query-suggestions.cjs.entry.js +0 -76
  374. package/dist/cjs/atomic-search-box-query-suggestions.cjs.entry.js.map +0 -1
  375. package/dist/cjs/result-template-decorators-432d11a9.js.map +0 -1
  376. package/dist/cjs/stencil-query-suggestions-03268ecc.js +0 -38
  377. package/dist/cjs/stencil-query-suggestions-03268ecc.js.map +0 -1
  378. package/dist/cjs/stencil-suggestion-manager-88cb88f2.js.map +0 -1
  379. package/dist/esm/atomic-search-box-query-suggestions.entry.js +0 -72
  380. package/dist/esm/atomic-search-box-query-suggestions.entry.js.map +0 -1
  381. package/dist/esm/result-template-decorators-2ed76ea9.js.map +0 -1
  382. package/dist/esm/stencil-query-suggestions-5d6a46d7.js +0 -33
  383. package/dist/esm/stencil-query-suggestions-5d6a46d7.js.map +0 -1
  384. package/dist/esm/stencil-suggestion-manager-1f4ed8d0.js.map +0 -1
  385. package/dist/types/decorators/commerce/product-template-decorators.d.ts +0 -68
  386. /package/dist/atomic/{p-874f0a4c.entry.js.map → p-060b94d2.entry.js.map} +0 -0
  387. /package/dist/atomic/{p-ed413091.entry.js.map → p-8a30d1e9.entry.js.map} +0 -0
  388. /package/dist/atomic/{p-df592625.entry.js.map → p-ce6e5989.entry.js.map} +0 -0
  389. /package/dist/atomic/{p-c2a5dac0.entry.js.map → p-f2c4209d.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"file":"atomic-search-box-instant-results.js","mappings":";;;;;;;;AAMO,MAAM,4BAA4B,GAAG,CAC1C,IAAU,EACV,SAAiB,EACjB,YAAoB;IAEpB,OAAO;QACL,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,kCAAkC,EAAE;YACpD,KAAK,EAAE,SAAS;YAChB,aAAa,EAAE,EAAC,WAAW,EAAE,KAAK,EAAC;SACpC,CAAC;QACF,GAAG,EAAE,kBAAkB,qBAAqB,CAAC,YAAY,CAAC,EAAE;QAC5D,IAAI,EAAE,sBAAsB;KAC7B,CAAC;AACJ,CAAC,CAAC;AAEK,MAAM,mCAAmC,GAAG,CACjD,IAAU;IAEV,OAAO;QACL,GAAG,E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AK,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC;gBACxC,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE;oBACpB,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE;wBACxB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;qBAC9B;oBACD,WAAW,EAAE,CAAC;oBACd,OAAO,EAAE,CAAC;iBACX;aACF,CAAC,CAAC;SACJ,CAAC,CAAC;KACJ;IAEM,MAAM;QACX,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,QACE,+EACE,OAAO,EAAE,IAAI,CAAC,IAAI,EAClB,KAAK,EAAE,IAAI,CAAC,KAAK,GACO,EAC1B;SACH;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["AtomicSearchBoxInstantResults"],"sources":["src/components/common/suggestions/stencil-instant-item.tsx","src/components/search/search-box-suggestions/atomic-search-box-instant-results/atomic-search-box-instant-results.tsx"],"sourcesContent":["import {FunctionalComponent, h} from '@stencil/core';\nimport {i18n} from 'i18next';\nimport {encodeForDomAttribute} from '../../../utils/string-utils';\nimport {getClassNameForButtonStyle} from '../stencil-button-style';\nimport {SearchBoxSuggestionElement} from './suggestions-types';\n\nexport const getPartialInstantItemElement = (\n i18n: i18n,\n itemTitle: string,\n itemUniqueId: string\n): Pick<SearchBoxSuggestionElement, 'ariaLabel' | 'key' | 'part'> => {\n return {\n ariaLabel: i18n.t('instant-results-suggestion-label', {\n title: itemTitle,\n interpolation: {escapeValue: false},\n }),\n key: `instant-result-${encodeForDomAttribute(itemUniqueId)}`,\n part: 'instant-results-item',\n };\n};\n\nexport const getPartialInstantItemShowAllElement = (\n i18n: i18n\n): Pick<SearchBoxSuggestionElement, 'key' | 'part' | 'ariaLabel'> => {\n return {\n key: 'instant-results-show-all-button',\n part: 'instant-results-show-all',\n ariaLabel: i18n.t('show-all-results'),\n };\n};\n\ninterface InstantItemShowAllButtonProps {\n i18n: i18n;\n}\nexport const InstantItemShowAllButton: FunctionalComponent<\n InstantItemShowAllButtonProps\n> = ({i18n}) => {\n return (\n <div\n part=\"instant-results-show-all-button\"\n class={getClassNameForButtonStyle('text-primary')}\n >\n {i18n.t('show-all-results')}\n </div>\n );\n};\n","import {\n buildInstantResults,\n buildInteractiveInstantResult,\n InstantResults,\n Result,\n SearchBox,\n} from '@coveo/headless';\nimport {Component, Element, State, h, Prop, Method} from '@stencil/core';\nimport {InitializableComponent} from '../../../../utils/initialization-utils';\nimport {encodeForDomAttribute} from '../../../../utils/string-utils';\nimport {ItemTemplateProvider} from '../../../common/item-list/item-template-provider';\nimport {ItemRenderingFunction} from '../../../common/item-list/stencil-item-list-common';\nimport {\n ItemDisplayDensity,\n ItemDisplayImageSize,\n ItemDisplayLayout,\n} from '../../../common/layout/display-options';\nimport {\n getPartialInstantItemElement,\n getPartialInstantItemShowAllElement,\n InstantItemShowAllButton,\n} from '../../../common/suggestions/stencil-instant-item';\nimport {\n dispatchSearchBoxSuggestionsEvent,\n} from '../../../common/suggestions/suggestions-events';\nimport type {\n SearchBoxSuggestionElement,\n SearchBoxSuggestions,\n SearchBoxSuggestionsBindings,\n} from '../../../common/suggestions/suggestions-types';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\n\nexport type AriaLabelGenerator = (\n bindings: Bindings,\n result: Result\n) => string | undefined;\n\n/**\n * The `atomic-search-box-instant-results` component can be added as a child of an `atomic-search-box` component, allowing for the configuration of instant results behavior.\n *\n * This component does not support accessibility out-of-the-box. To do so, see [Instant Results Accessibility](https://docs.coveo.com/en/atomic/latest/usage/accessibility/#instant-results-accessibility).\n *\n * This component is not supported on mobile.\n *\n * @slot default - The default slot where the instant results are rendered.\n */\n@Component({\n tag: 'atomic-search-box-instant-results',\n shadow: true,\n})\nexport class AtomicSearchBoxInstantResults implements InitializableComponent {\n public bindings!: SearchBoxSuggestionsBindings<SearchBox, Bindings>;\n private itemRenderingFunction: ItemRenderingFunction;\n private results: Result[] = [];\n private itemTemplateProvider!: ItemTemplateProvider;\n private instantResults!: InstantResults;\n private display: ItemDisplayLayout = 'list';\n\n @Element() public host!: HTMLElement;\n\n @State() public error!: Error;\n @State() private templateHasError = false;\n\n /**\n * Sets a rendering function to bypass the standard HTML template mechanism for rendering results.\n * You can use this function while working with web frameworks that don't use plain HTML syntax, e.g., React, Angular or Vue.\n *\n * Do not use this method if you integrate Atomic in a plain HTML deployment.\n *\n * @param resultRenderingFunction\n */\n @Method() public async setRenderFunction(\n resultRenderingFunction: ItemRenderingFunction\n ) {\n this.itemRenderingFunction = resultRenderingFunction;\n }\n /**\n * The maximum number of results to show.\n */\n @Prop({reflect: true}) public maxResultsPerQuery = 4;\n /**\n * The spacing of various elements in the result list, including the gap between results, the gap between parts of a result, and the font sizes of different parts in a result.\n */\n @Prop({reflect: true}) public density: ItemDisplayDensity = 'normal';\n /**\n * The expected size of the image displayed in the results.\n */\n @Prop({reflect: true}) public imageSize: ItemDisplayImageSize = 'icon';\n /**\n * The callback to generate an [`aria-label`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label) for a given result so that accessibility tools can fully describe what's visually rendered by a result.\n *\n * By default, or if an empty string is returned, `result.title` is used.\n */\n @Prop() public ariaLabelGenerator?: AriaLabelGenerator;\n\n public componentWillLoad() {\n try {\n dispatchSearchBoxSuggestionsEvent<SearchBox, Bindings>(\n (bindings) => {\n this.bindings = bindings;\n return this.initialize();\n },\n this.host,\n ['atomic-search-box']\n );\n } catch (error) {\n this.error = error as Error;\n }\n }\n\n private getLink(el: HTMLElement): HTMLElement | null {\n const atomicResult =\n el.tagName === 'ATOMIC-RESULT' ? el : el?.querySelector('atomic-result');\n\n return (\n atomicResult?.shadowRoot?.querySelector(\n 'atomic-result-link a:not([slot])'\n ) || null\n );\n }\n\n private handleLinkClick(el: HTMLElement, hasModifier: boolean) {\n const setTarget = (value: string) => el.setAttribute('target', value);\n const initialTarget = el.getAttribute('target');\n\n hasModifier && setTarget('_blank');\n el.click();\n hasModifier && setTarget(initialTarget || '');\n\n return true;\n }\n\n private renderItems(): SearchBoxSuggestionElement[] {\n if (!this.bindings.suggestedQuery() || this.bindings.store.isMobile()) {\n return [];\n }\n const results = this.instantResults.state.results.length\n ? this.instantResults.state.results\n : this.results;\n\n const elements: SearchBoxSuggestionElement[] = results.map(\n (result: Result) => {\n const partialItem = getPartialInstantItemElement(\n this.bindings.i18n,\n this.ariaLabelGenerator?.(this.bindings, result) || result.title,\n result.uniqueId\n );\n return {\n ...partialItem,\n content: (\n <atomic-result\n key={`instant-result-${encodeForDomAttribute(result.uniqueId)}`}\n part=\"outline\"\n result={result}\n interactiveResult={buildInteractiveInstantResult(\n this.bindings.engine,\n {\n options: {result},\n }\n )}\n display={this.display}\n density={this.density}\n imageSize={this.imageSize}\n content={this.itemTemplateProvider.getTemplateContent(result)}\n stopPropagation={false}\n renderingFunction={this.itemRenderingFunction}\n ></atomic-result>\n ),\n onSelect: (e: MouseEvent) => {\n const link = this.getLink(e.target as HTMLElement);\n\n if (!link) {\n return;\n }\n this.handleLinkClick(link, e.ctrlKey || e.metaKey);\n },\n };\n }\n );\n if (elements.length) {\n const partialItem = getPartialInstantItemShowAllElement(\n this.bindings.i18n\n );\n elements.push({\n ...partialItem,\n content: <InstantItemShowAllButton i18n={this.bindings.i18n} />,\n onSelect: () => {\n this.bindings.clearSuggestions();\n this.bindings.searchBoxController.updateText(\n this.instantResults.state.q\n );\n this.bindings.searchBoxController.submit();\n },\n });\n }\n return elements;\n }\n\n public initialize(): SearchBoxSuggestions {\n this.instantResults = buildInstantResults(this.bindings.engine, {\n options: {\n maxResultsPerQuery: this.maxResultsPerQuery,\n },\n });\n\n this.itemTemplateProvider = new ItemTemplateProvider({\n includeDefaultTemplate: true,\n templateElements: Array.from(\n this.host.querySelectorAll('atomic-result-template')\n ),\n getResultTemplateRegistered: () => true,\n setResultTemplateRegistered: () => {},\n getTemplateHasError: () => this.templateHasError,\n setTemplateHasError: (value: boolean) => {\n this.templateHasError = value;\n },\n bindings: this.bindings,\n });\n\n return {\n position: Array.from(this.host.parentNode!.children).indexOf(this.host),\n panel: 'right',\n onSuggestedQueryChange: (q) => {\n this.instantResults.updateQuery(q);\n return this.onSuggestedQueryChange();\n },\n renderItems: () => this.renderItems(),\n };\n }\n\n private onSuggestedQueryChange() {\n if (\n !this.bindings.getSuggestionElements().length &&\n !this.bindings.searchBoxController.state.value\n ) {\n console.warn(\n \"There doesn't seem to be any query suggestions configured. Make sure to include either an atomic-search-box-query-suggestions or atomic-search-box-recent-queries in your search box in order to see some instant results.\"\n );\n }\n\n return new Promise<void>((resolve) => {\n const unsubscribe = this.instantResults.subscribe(() => {\n const state = this.instantResults.state;\n if (!state.isLoading) {\n if (state.results.length) {\n this.results = state.results;\n }\n unsubscribe();\n resolve();\n }\n });\n });\n }\n\n public render() {\n if (this.error) {\n return (\n <atomic-component-error\n element={this.host}\n error={this.error}\n ></atomic-component-error>\n );\n }\n }\n}\n"],"version":3}
1
+ {"file":"atomic-search-box-instant-results.js","mappings":";;;;;;;;;AAOA;;;;;;;;;MASa,iCAAiC,GAAG,CAI/C,KAA+D,EAC/D,OAAoB,EACpB,2BAA0E,iBAAiB;IAE3F,MAAM,gBAAgB,GAAG,OAAO,CAAC,OAAO,EAAE,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACxE,IAAI,CAAC,gBAAgB,EAAE;QACrB,MAAM,IAAI,KAAK,CACb,QAAQ,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,gFAAgF,wBAAwB,CAAC,IAAI,CACjJ,IAAI,CACL,EAAE,CACJ,CAAC;KACH;IACD,KAAK,2CAA2C,CAC9C,gBAAgB,EAChB,OAAO,EACP,KAAK,CACN,CAAC;AACJ,EAAE;AAEF,MAAM,iBAAiB,GAAG;IACxB,mBAAmB;IACnB,2BAA2B;IAC3B,4BAA4B;CACpB,CAAC;AAEX,MAAM,mBAAmB,GAAG,CAAC,SAAkB,KAC7C,gBAAgB,IA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,EAAE;YACd,QACE,+EACE,OAAO,EAAE,IAAI,CAAC,IAAI,EAClB,KAAK,EAAE,IAAI,CAAC,KAAK,GACO,EAC1B;SACH;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["AtomicSearchBoxInstantResults"],"sources":["src/components/common/suggestions/suggestions-events.ts","src/components/common/suggestions/stencil-instant-item.tsx","src/components/search/search-box-suggestions/atomic-search-box-instant-results/atomic-search-box-instant-results.tsx"],"sourcesContent":["import type {HTMLStencilElement} from '@stencil/core/internal';\nimport type {LitElement} from 'lit';\nimport {closest} from '../../../utils/dom-utils';\nimport {buildCustomEvent} from '../../../utils/event-utils';\nimport type {AnyBindings} from '../interface/bindings';\nimport type {SearchBoxSuggestionsEvent} from './suggestions-types';\n\n/**\n * Dispatches an event which retrieves the `SearchBoxSuggestionsBindings` on a configured parent search box.\n *\n * @param event Event sent from the registered query suggestions to the parent search box\n * @param element Element on which to dispatch the event, which must be the child of a configured search box\n * @param allowedSearchBoxElements Optional array of allowed search box element selectors\n *\n * @throws Error if the element is not a child of an allowed search box element\n */\nexport const dispatchSearchBoxSuggestionsEvent = <\n SearchBoxController,\n Bindings = AnyBindings,\n>(\n event: SearchBoxSuggestionsEvent<SearchBoxController, Bindings>,\n element: HTMLElement,\n allowedSearchBoxElements: readonly (typeof searchBoxElements)[number][] = searchBoxElements\n) => {\n const interfaceElement = closest(element, searchBoxElements.join(', '));\n if (!interfaceElement) {\n throw new Error(\n `The \"${element.nodeName.toLowerCase()}\" component was not handled, as it is not a child of the following elements: ${allowedSearchBoxElements.join(\n ', '\n )}`\n );\n }\n void dispatchSearchBoxSuggestionsEventEventually(\n interfaceElement,\n element,\n event\n );\n};\n\nconst searchBoxElements = [\n 'atomic-search-box',\n 'atomic-insight-search-box',\n 'atomic-commerce-search-box',\n] as const;\n\nconst isLitElementLoosely = (candidate: unknown): candidate is LitElement =>\n 'updateComplete' in (candidate as LitElement) &&\n (candidate as LitElement).updateComplete instanceof Promise;\n\nconst dispatchSearchBoxSuggestionsEventEventually = async <\n SearchBoxController,\n Bindings = AnyBindings,\n>(\n interfaceElement: Element,\n element: HTMLElement,\n event: SearchBoxSuggestionsEvent<SearchBoxController, Bindings>\n) => {\n await customElements.whenDefined(interfaceElement.nodeName.toLowerCase());\n if (isLitElementLoosely(interfaceElement)) {\n await interfaceElement.updateComplete;\n } else if ('componentOnReady' in interfaceElement) {\n await (interfaceElement as HTMLStencilElement).componentOnReady();\n }\n element.dispatchEvent(\n buildCustomEvent('atomic/searchBoxSuggestion/register', event)\n );\n};\n","import {FunctionalComponent, h} from '@stencil/core';\nimport {i18n} from 'i18next';\nimport {encodeForDomAttribute} from '../../../utils/string-utils';\nimport {getClassNameForButtonStyle} from '../stencil-button-style';\nimport {SearchBoxSuggestionElement} from './suggestions-types';\n\nexport const getPartialInstantItemElement = (\n i18n: i18n,\n itemTitle: string,\n itemUniqueId: string\n): Pick<SearchBoxSuggestionElement, 'ariaLabel' | 'key' | 'part'> => {\n return {\n ariaLabel: i18n.t('instant-results-suggestion-label', {\n title: itemTitle,\n interpolation: {escapeValue: false},\n }),\n key: `instant-result-${encodeForDomAttribute(itemUniqueId)}`,\n part: 'instant-results-item',\n };\n};\n\nexport const getPartialInstantItemShowAllElement = (\n i18n: i18n\n): Pick<SearchBoxSuggestionElement, 'key' | 'part' | 'ariaLabel'> => {\n return {\n key: 'instant-results-show-all-button',\n part: 'instant-results-show-all',\n ariaLabel: i18n.t('show-all-results'),\n };\n};\n\ninterface InstantItemShowAllButtonProps {\n i18n: i18n;\n}\nexport const InstantItemShowAllButton: FunctionalComponent<\n InstantItemShowAllButtonProps\n> = ({i18n}) => {\n return (\n <div\n part=\"instant-results-show-all-button\"\n class={getClassNameForButtonStyle('text-primary')}\n >\n {i18n.t('show-all-results')}\n </div>\n );\n};\n","import {\n buildInstantResults,\n buildInteractiveInstantResult,\n InstantResults,\n Result,\n SearchBox,\n} from '@coveo/headless';\nimport {Component, Element, State, h, Prop, Method} from '@stencil/core';\nimport {InitializableComponent} from '../../../../utils/initialization-utils';\nimport {encodeForDomAttribute} from '../../../../utils/string-utils';\nimport {ItemTemplateProvider} from '../../../common/item-list/item-template-provider';\nimport {ItemRenderingFunction} from '../../../common/item-list/stencil-item-list-common';\nimport {\n ItemDisplayDensity,\n ItemDisplayImageSize,\n ItemDisplayLayout,\n} from '../../../common/layout/display-options';\nimport {\n getPartialInstantItemElement,\n getPartialInstantItemShowAllElement,\n InstantItemShowAllButton,\n} from '../../../common/suggestions/stencil-instant-item';\nimport {\n dispatchSearchBoxSuggestionsEvent,\n} from '../../../common/suggestions/suggestions-events';\nimport type {\n SearchBoxSuggestionElement,\n SearchBoxSuggestions,\n SearchBoxSuggestionsBindings,\n} from '../../../common/suggestions/suggestions-types';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\n\nexport type AriaLabelGenerator = (\n bindings: Bindings,\n result: Result\n) => string | undefined;\n\n/**\n * The `atomic-search-box-instant-results` component can be added as a child of an `atomic-search-box` component, allowing for the configuration of instant results behavior.\n *\n * This component does not support accessibility out-of-the-box. To do so, see [Instant Results Accessibility](https://docs.coveo.com/en/atomic/latest/usage/accessibility/#instant-results-accessibility).\n *\n * This component is not supported on mobile.\n *\n * @slot default - The default slot where the instant results are rendered.\n */\n@Component({\n tag: 'atomic-search-box-instant-results',\n shadow: true,\n})\nexport class AtomicSearchBoxInstantResults implements InitializableComponent {\n public bindings!: SearchBoxSuggestionsBindings<SearchBox, Bindings>;\n private itemRenderingFunction: ItemRenderingFunction;\n private results: Result[] = [];\n private itemTemplateProvider!: ItemTemplateProvider;\n private instantResults!: InstantResults;\n private display: ItemDisplayLayout = 'list';\n\n @Element() public host!: HTMLElement;\n\n @State() public error!: Error;\n @State() private templateHasError = false;\n\n /**\n * Sets a rendering function to bypass the standard HTML template mechanism for rendering results.\n * You can use this function while working with web frameworks that don't use plain HTML syntax, e.g., React, Angular or Vue.\n *\n * Do not use this method if you integrate Atomic in a plain HTML deployment.\n *\n * @param resultRenderingFunction\n */\n @Method() public async setRenderFunction(\n resultRenderingFunction: ItemRenderingFunction\n ) {\n this.itemRenderingFunction = resultRenderingFunction;\n }\n /**\n * The maximum number of results to show.\n */\n @Prop({reflect: true}) public maxResultsPerQuery = 4;\n /**\n * The spacing of various elements in the result list, including the gap between results, the gap between parts of a result, and the font sizes of different parts in a result.\n */\n @Prop({reflect: true}) public density: ItemDisplayDensity = 'normal';\n /**\n * The expected size of the image displayed in the results.\n */\n @Prop({reflect: true}) public imageSize: ItemDisplayImageSize = 'icon';\n /**\n * The callback to generate an [`aria-label`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label) for a given result so that accessibility tools can fully describe what's visually rendered by a result.\n *\n * By default, or if an empty string is returned, `result.title` is used.\n */\n @Prop() public ariaLabelGenerator?: AriaLabelGenerator;\n\n public componentWillLoad() {\n try {\n dispatchSearchBoxSuggestionsEvent<SearchBox, Bindings>(\n (bindings) => {\n this.bindings = bindings;\n return this.initialize();\n },\n this.host,\n ['atomic-search-box']\n );\n } catch (error) {\n this.error = error as Error;\n }\n }\n\n private getLink(el: HTMLElement): HTMLElement | null {\n const atomicResult =\n el.tagName === 'ATOMIC-RESULT' ? el : el?.querySelector('atomic-result');\n\n return (\n atomicResult?.shadowRoot?.querySelector(\n 'atomic-result-link a:not([slot])'\n ) || null\n );\n }\n\n private handleLinkClick(el: HTMLElement, hasModifier: boolean) {\n const setTarget = (value: string) => el.setAttribute('target', value);\n const initialTarget = el.getAttribute('target');\n\n hasModifier && setTarget('_blank');\n el.click();\n hasModifier && setTarget(initialTarget || '');\n\n return true;\n }\n\n private renderItems(): SearchBoxSuggestionElement[] {\n if (!this.bindings.suggestedQuery() || this.bindings.store.isMobile()) {\n return [];\n }\n const results = this.instantResults.state.results.length\n ? this.instantResults.state.results\n : this.results;\n\n const elements: SearchBoxSuggestionElement[] = results.map(\n (result: Result) => {\n const partialItem = getPartialInstantItemElement(\n this.bindings.i18n,\n this.ariaLabelGenerator?.(this.bindings, result) || result.title,\n result.uniqueId\n );\n return {\n ...partialItem,\n content: (\n <atomic-result\n key={`instant-result-${encodeForDomAttribute(result.uniqueId)}`}\n part=\"outline\"\n result={result}\n interactiveResult={buildInteractiveInstantResult(\n this.bindings.engine,\n {\n options: {result},\n }\n )}\n display={this.display}\n density={this.density}\n imageSize={this.imageSize}\n content={this.itemTemplateProvider.getTemplateContent(result)}\n stopPropagation={false}\n renderingFunction={this.itemRenderingFunction}\n ></atomic-result>\n ),\n onSelect: (e: MouseEvent) => {\n const link = this.getLink(e.target as HTMLElement);\n\n if (!link) {\n return;\n }\n this.handleLinkClick(link, e.ctrlKey || e.metaKey);\n },\n };\n }\n );\n if (elements.length) {\n const partialItem = getPartialInstantItemShowAllElement(\n this.bindings.i18n\n );\n elements.push({\n ...partialItem,\n content: <InstantItemShowAllButton i18n={this.bindings.i18n} />,\n onSelect: () => {\n this.bindings.clearSuggestions();\n this.bindings.searchBoxController.updateText(\n this.instantResults.state.q\n );\n this.bindings.searchBoxController.submit();\n },\n });\n }\n return elements;\n }\n\n public initialize(): SearchBoxSuggestions {\n this.instantResults = buildInstantResults(this.bindings.engine, {\n options: {\n maxResultsPerQuery: this.maxResultsPerQuery,\n },\n });\n\n this.itemTemplateProvider = new ItemTemplateProvider({\n includeDefaultTemplate: true,\n templateElements: Array.from(\n this.host.querySelectorAll('atomic-result-template')\n ),\n getResultTemplateRegistered: () => true,\n setResultTemplateRegistered: () => {},\n getTemplateHasError: () => this.templateHasError,\n setTemplateHasError: (value: boolean) => {\n this.templateHasError = value;\n },\n bindings: this.bindings,\n });\n\n return {\n position: Array.from(this.host.parentNode!.children).indexOf(this.host),\n panel: 'right',\n onSuggestedQueryChange: (q) => {\n this.instantResults.updateQuery(q);\n return this.onSuggestedQueryChange();\n },\n renderItems: () => this.renderItems(),\n };\n }\n\n private onSuggestedQueryChange() {\n if (\n !this.bindings.getSuggestionElements().length &&\n !this.bindings.searchBoxController.state.value\n ) {\n console.warn(\n \"There doesn't seem to be any query suggestions configured. Make sure to include either an atomic-search-box-query-suggestions or atomic-search-box-recent-queries in your search box in order to see some instant results.\"\n );\n }\n\n return new Promise<void>((resolve) => {\n const unsubscribe = this.instantResults.subscribe(() => {\n const state = this.instantResults.state;\n if (!state.isLoading) {\n if (state.results.length) {\n this.results = state.results;\n }\n unsubscribe();\n resolve();\n }\n });\n });\n }\n\n public render() {\n if (this.error) {\n return (\n <atomic-component-error\n element={this.host}\n error={this.error}\n ></atomic-component-error>\n );\n }\n }\n}\n"],"version":3}
@@ -10,7 +10,6 @@ import { o as once, r as randomID, a as spreadProperties, i as isFocusingOut } f
10
10
  import { b as SearchSlimIcon, d as SearchTextArea, S as SuggestionManager, a as elementHasQuery, c as SearchBoxWrapper } from './stencil-suggestion-manager.js';
11
11
  import { B as Button } from './stencil-button.js';
12
12
  import { g as getDefaultSlotFromHost } from './slot-utils.js';
13
- import { d as defineCustomElement$3 } from './atomic-search-box-query-suggestions2.js';
14
13
 
15
14
  const SubmitButton = ({ bindings, disabled, onClick, }) => (h("div", { part: "submit-button-wrapper", class: "mr-2 flex items-center justify-center py-2" },
16
15
  h(Button, { style: "text-primary", class: "flex h-8 w-8 shrink-0 items-center justify-center rounded-full", part: "submit-button", ariaLabel: bindings.i18n.t('search'), onClick: () => {
@@ -99,7 +98,6 @@ const AtomicSearchBox$1 = /*@__PURE__*/ proxyCustomElement(class AtomicSearchBox
99
98
  onInput: (e) => this.onInput(e.target.value),
100
99
  onKeyDown: (e) => this.onKeyDown(e),
101
100
  onClear: () => {
102
- this.announceClearSearchBoxToScreenReader();
103
101
  this.searchBox.clear();
104
102
  this.suggestionManager.clearSuggestions();
105
103
  },
@@ -408,9 +406,6 @@ const AtomicSearchBox$1 = /*@__PURE__*/ proxyCustomElement(class AtomicSearchBox
408
406
  this.suggestionsAriaMessage = ariaLabel;
409
407
  }
410
408
  }
411
- announceClearSearchBoxToScreenReader() {
412
- this.suggestionsAriaMessage = this.bindings.i18n.t("search-box-cleared");
413
- }
414
409
  announceNewSuggestionsToScreenReader() {
415
410
  const elsLength = this.suggestionManager.allSuggestionElements.filter(elementHasQuery).length;
416
411
  this.searchBoxAriaMessage = elsLength
@@ -439,14 +434,14 @@ const AtomicSearchBox$1 = /*@__PURE__*/ proxyCustomElement(class AtomicSearchBox
439
434
  if (!this.suggestionManager.suggestions.length) {
440
435
  this.registerSearchboxSuggestionEvents();
441
436
  }
442
- return (h(Host, { key: 'd2c0e6203b317f022e1bdd2880fc5f98fc58cc74' }, this.renderAbsolutePositionSpacer(), [
443
- h(SearchBoxWrapper, { key: '57da951b8bfd7bbb8971e1bdc6cdca2316c171ec', disabled: isDisabled, onFocusout: (event) => {
437
+ return (h(Host, { key: '382012077ac5fe02ac08358a3629073748aafbaf' }, this.renderAbsolutePositionSpacer(), [
438
+ h(SearchBoxWrapper, { key: '5e41ae93494bc4e9d72fe6a4868433112db215c3', disabled: isDisabled, onFocusout: (event) => {
444
439
  if (!isFocusingOut(event)) {
445
440
  return;
446
441
  }
447
442
  this.suggestionManager.clearSuggestions();
448
443
  this.isExpanded = false;
449
- } }, this.renderTextBox(searchLabel), h(SubmitButton, { key: 'e0e7e57a1d43bcf7badd78427bf6bc1e779a5f98', bindings: this.bindings, disabled: isDisabled, onClick: () => {
444
+ } }, this.renderTextBox(searchLabel), h(SubmitButton, { key: 'b9a7ad00f3e531993b3d70960b59ff49aeabb7ee', bindings: this.bindings, disabled: isDisabled, onClick: () => {
450
445
  this.searchBox.submit();
451
446
  this.suggestionManager.clearSuggestions();
452
447
  } }), this.renderSuggestions()),
@@ -489,18 +484,13 @@ function defineCustomElement$1() {
489
484
  if (typeof customElements === "undefined") {
490
485
  return;
491
486
  }
492
- const components = ["atomic-search-box", "atomic-search-box-query-suggestions", "atomic-suggestion-renderer"];
487
+ const components = ["atomic-search-box", "atomic-suggestion-renderer"];
493
488
  components.forEach(tagName => { switch (tagName) {
494
489
  case "atomic-search-box":
495
490
  if (!customElements.get(tagName)) {
496
491
  customElements.define(tagName, AtomicSearchBox$1);
497
492
  }
498
493
  break;
499
- case "atomic-search-box-query-suggestions":
500
- if (!customElements.get(tagName)) {
501
- defineCustomElement$3();
502
- }
503
- break;
504
494
  case "atomic-suggestion-renderer":
505
495
  if (!customElements.get(tagName)) {
506
496
  defineCustomElement$2();
@@ -1 +1 @@
1
- {"file":"atomic-search-box.js","mappings":";;;;;;;;;;;;;;AAWO,MAAM,YAAY,GAA+B,CAAC,EACvD,QAAQ,EACR,QAAQ,EACR,OAAO,GACR,MACC,WACE,IAAI,EAAC,uBAAuB,EAC5B,KAAK,EAAC,4CAA4C;IAElD,EAAC,MAAM,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;QAElB,mBACE,IAAI,EAAC,aAAa,EAClB,IAAI,EAAE,cAAc,EACpB,KAAK,EAAC,SAAS,GACF,CACR,CACL,CACP;;ACrCD,MAAM,kBAAkB,GAAG,wioEAAwioE,CAAC;AACpkoE,8BAAe,kBAAkB;;;;;;;;;;;;MCuGpBA,iBAAe;;;;;;QAGlB,mCAA8B,GAEhC,EAAE,CAAC;QAaQ,eAAU,GAAG,KAAK,CAAC;;;;;;;;QASN,oBAAe,GAAG,CAAC,CAAC;;;;;QAgBnC,sBAAiB,GAAG,GAAG,CAAC;;;;;;;;;QAUxB,oBAAe,GAAG,CAAC,CAAC;;;;;;QAOL,kBAAa,GAAG,KAAK,CAAC;;;;;QAMtB,uBAAkB,GAAG,CAAC,CAAC;;;;;QAMvB,iBAAY,GAAG,IAAI,CAAC;;;;;;;;;QAUpB,sBAAiB,GAAG,KAAK,CAAC;QAgGjD,yBAAoB,GAAG,SAAQ,CAAC;QAyH/B,sBAAiB,GAAG,IAAI,CAAC,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-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.js","mappings":";;;;;;;;;;;;;AAWO,MAAM,YAAY,GAA+B,CAAC,EACvD,QAAQ,EACR,QAAQ,EACR,OAAO,GACR,MACC,WACE,IAAI,EAAC,uBAAuB,EAC5B,KAAK,EAAC,4CAA4C;IAElD,EAAC,MAAM,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,Q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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;;;;;;;;;;;;;;;;;;;;;AAjpB4B;IAA5B,kBAAkB,EAAE;mDAA4B;AAezC;IAFP,qBAAqB,CAAC,WAAW,CAAC;yDAEgC;AAyFzD;IADT,cAAc,CAAC,YAAY,CAAC;+DACW;AAG9B;IADT,cAAc,CAAC,oBAAoB,EAAE,IAAI,CAAC;iEACD;;;;;;;;;;;;;;;;;;;;;;;;;","names":["AtomicSearchBox"],"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}
@@ -43,9 +43,9 @@ const AtomicSmartSnippetFeedbackModal = /*@__PURE__*/ proxyCustomElement(class A
43
43
  }
44
44
  render() {
45
45
  updateBreakpoints(this.host);
46
- return (h("atomic-modal", { key: '7873f12c4d080d167e19c74e3e3d24e989084fbb', fullscreen: false, source: this.source, container: this.host, isOpen: this.isOpen, close: () => this.close(), exportparts: ATOMIC_MODAL_EXPORT_PARTS }, h(SmartSnippetFeedbackModalHeader, { key: 'edf6c6e1462f60f000f4d008d02d59b4f1b50da6', i18n: this.bindings.i18n }), h(SmartSnippetFeedbackModalBody, { key: '4060681aecb0f2ad490c0cd7556bfd599161343d', formId: this.formId, onSubmit: (e) => this.sendFeedback(e) }, h(SmartSnippetFeebackModalOptions, { key: '3c57663d59c5978fbee4d2b24866d43ead6c1497', i18n: this.bindings.i18n }, smartSnippetFeedbackOptions.map(({ id, localeKey, correspondingAnswer }) => (h(SmartSnippetFeedbackModalOption, { correspondingAnswer: correspondingAnswer, currentAnswer: this.currentAnswer, i18n: this.bindings.i18n, id: id, localeKey: localeKey, onChange: () => {
46
+ return (h("atomic-modal", { key: '0ff06e629ecde723679117ea736d20e81acf4d79', fullscreen: false, source: this.source, container: this.host, isOpen: this.isOpen, close: () => this.close(), exportparts: ATOMIC_MODAL_EXPORT_PARTS }, h(SmartSnippetFeedbackModalHeader, { key: '8edd7c00f5c17294da616e054fda8026388b411e', i18n: this.bindings.i18n }), h(SmartSnippetFeedbackModalBody, { key: '48b08a1c1bb62763f4b00a4c0eb61bcb9fd24ba6', formId: this.formId, onSubmit: (e) => this.sendFeedback(e) }, h(SmartSnippetFeebackModalOptions, { key: '89f7bc92f38b53cdf7243e547f17fc933b052ab0', i18n: this.bindings.i18n }, smartSnippetFeedbackOptions.map(({ id, localeKey, correspondingAnswer }) => (h(SmartSnippetFeedbackModalOption, { correspondingAnswer: correspondingAnswer, currentAnswer: this.currentAnswer, i18n: this.bindings.i18n, id: id, localeKey: localeKey, onChange: () => {
47
47
  this.currentAnswer = correspondingAnswer;
48
- } })))), h(SmartSnippetFeedbackModalDetails, { key: 'b01ff181e25692d9a174e9cbf374e4aba8a38df7', currentAnswer: this.currentAnswer, i18n: this.bindings.i18n, setDetailsInputRef: (ref) => (this.detailsInputRef = ref) })), h(SmartSnippetFeedbackModalFooter, { key: 'e8168c3f2f45687cadec47c6fdf3b89de5c086dc', formId: this.formId, i18n: this.bindings.i18n, onClick: () => this.close() })));
48
+ } })))), h(SmartSnippetFeedbackModalDetails, { key: '52590220abd5d03b776ef56deb5b85add0adee6b', currentAnswer: this.currentAnswer, i18n: this.bindings.i18n, setDetailsInputRef: (ref) => (this.detailsInputRef = ref) })), h(SmartSnippetFeedbackModalFooter, { key: '92c8766bf0fd0becd4bce8256e7cf379b1f1c075', formId: this.formId, i18n: this.bindings.i18n, onClick: () => this.close() })));
49
49
  }
50
50
  close() {
51
51
  this.isOpen = false;
@@ -33,7 +33,7 @@ const AtomicSmartSnippetSource = /*@__PURE__*/ proxyCustomElement(class AtomicSm
33
33
  }
34
34
  }
35
35
  render() {
36
- return (h(Host, { key: 'fde65011dc467182998507feed4f49c9142450b5' }, h(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), h(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() }, h("atomic-result-text", { field: "title", default: "no-title", key: this.source.uniqueId }))));
36
+ return (h(Host, { key: '5a10a0706bf8e80386a0f8da5b879b09466f65cd' }, h(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), h(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() }, h("atomic-result-text", { field: "title", default: "no-title", key: this.source.uniqueId }))));
37
37
  }
38
38
  }, [0, "atomic-smart-snippet-source", {
39
39
  "source": [1040],
@@ -1 +1 @@
1
- {"file":"atomic-smart-snippet-source2.js","mappings":";;;;;;;;;;;;;;;;MA4Ba,wBAAwB;;;;;;;;;;;IAc5B,aAAa,CAAC,KAAiC;QACpD,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SAC3B;KACF;IAED,MAAM;QACJ,QACE,EAAC,IAAI,uDACH,EAAC,qBAAqB,qDACpB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAC3B,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAC1B,SAAS,EAAC,gBAAgB,EAC1B,IAAI,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,EACxB,EAAC,qBAAqB,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,IAElE,0BACE,KAAK,EAAC,OAAO,EACb,OAAO,EAAC,UAAU,EAClB,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,GACL,CACA,CACnB,EACP;KACH;;;;;;AApD4B;IAA5B,kBAAkB,EAAE;0DAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/common/smart-snippets/atomic-smart-snippet-source.tsx"],"sourcesContent":["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-source2.js","mappings":";;;;;;;;;;;;;;;;MA4Ba,wBAAwB;;;;;;;;;;;IAc5B,aAAa,CAAC,KAAiC;QACpD,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SAC3B;KACF;IAED,MAAM;QACJ,QACE,EAAC,IAAI,uDACH,EAAC,qBAAqB,qDACpB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAC3B,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAC1B,SAAS,EAAC,gBAAgB,EAC1B,IAAI,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,EACxB,EAAC,qBAAqB,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,IAElE,0BACE,KAAK,EAAC,OAAO,EACb,OAAO,EAAC,UAAU,EAClB,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,GACL,CACA,CACnB,EACP;KACH;;;;;;AApD4B;IAA5B,kBAAkB,EAAE;0DAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/common/smart-snippets/atomic-smart-snippet-source.tsx"],"sourcesContent":["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}
@@ -59,7 +59,7 @@ const AtomicTabManager$1 = /*@__PURE__*/ proxyCustomElement(class AtomicTabManag
59
59
  });
60
60
  }
61
61
  render() {
62
- return (h(Host, { key: '57779e4e975815db10015e7c436b487634faa840' }, h("atomic-tab-bar", { key: 'f589269687a6baa6acbfaada3c33fc302c5d692d' }, h("div", { key: '565fd20d06b9942645a39ea132baa4d3a4610fb0', role: "list", "aria-label": "tab-area", part: "tab-area", class: "border-neutral mb-2 flex w-full flex-row border-b" }, this.tabs.map((tab) => (h("atomic-tab-button", { active: this.tabManagerState.activeTab === tab.name, label: this.bindings.i18n.t(tab.label, {
62
+ return (h(Host, { key: 'a0a958d225cab71e38fed9d5495a492c73b7e398' }, h("atomic-tab-bar", { key: '204cde2063d088de318d99e9c0f5bc36d81c3380' }, h("div", { key: '756467f629c22ee87c046abf0ed3354bb35f8144', role: "list", "aria-label": "tab-area", part: "tab-area", class: "border-neutral mb-2 flex w-full flex-row border-b" }, this.tabs.map((tab) => (h("atomic-tab-button", { active: this.tabManagerState.activeTab === tab.name, label: this.bindings.i18n.t(tab.label, {
63
63
  defaultValue: tab.label,
64
64
  }), select: () => {
65
65
  if (!tab.tabController.state.isActive) {
@@ -22,7 +22,7 @@ import { bindingGuard } from "../../../decorators/binding-guard";
22
22
  import { bindings } from "../../../decorators/bindings";
23
23
  import { errorGuard } from "../../../decorators/error-guard";
24
24
  import { withTailwindStyles } from "../../../decorators/with-tailwind-styles.js";
25
- import { AriaLiveRegionController, FocusTargetController, } from "../../../utils/accessibility-utils";
25
+ import { FocusTargetController } from "../../../utils/accessibility-utils";
26
26
  import { parseDate } from "../../../utils/date-utils";
27
27
  import { getFieldValueCaption } from "../../../utils/field-utils";
28
28
  import styles from './atomic-commerce-breadbox.tw.css';
@@ -49,7 +49,6 @@ let AtomicCommerceBreadbox = class AtomicCommerceBreadbox extends LitElement {
49
49
  this.numberOfCollapsedBreadcrumbs = 0;
50
50
  this.isCollapsed = true;
51
51
  this.showMoreText = '';
52
- this.breadboxAriaMessage = new AriaLiveRegionController(this, 'breadbox', true);
53
52
  /**
54
53
  * This prop allows you to control the display depth
55
54
  * of the path by specifying the number of parent or ancestor
@@ -231,7 +230,6 @@ let AtomicCommerceBreadbox = class AtomicCommerceBreadbox extends LitElement {
231
230
  await this.breadcrumbShowMoreFocus.setTarget(ref);
232
231
  }
233
232
  },
234
- ariaController: this.breadboxAriaMessage,
235
233
  },
236
234
  })(html `${renderBreadcrumbContent({
237
235
  props: {
@@ -405,7 +405,6 @@ let AtomicCommerceSearchBox = class AtomicCommerceSearchBox extends LitElement {
405
405
  this.searchBox.clear();
406
406
  this.suggestionManager.clearSuggestions();
407
407
  this.triggerTextAreaChange('');
408
- this.announceClearSearchBoxToScreenReader();
409
408
  },
410
409
  popup: {
411
410
  id: `${this.id}-popup`,
@@ -532,10 +531,6 @@ let AtomicCommerceSearchBox = class AtomicCommerceSearchBox extends LitElement {
532
531
  ${this.renderSlotContent()}
533
532
  `;
534
533
  }
535
- announceClearSearchBoxToScreenReader() {
536
- this.searchBoxAriaMessage.message =
537
- this.bindings.i18n.t('search-box-cleared');
538
- }
539
534
  };
540
535
  AtomicCommerceSearchBox.styles = css`/*! tailwindcss v4.1.13 | MIT License | https://tailwindcss.com */@layer properties;@layer properties{*,::backdrop,:after,:before{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-x-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:""}}@layer theme, base, components, utilities;@layer theme;@layer base{*,::backdrop,::file-selector-button,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:var(--default-font-family,var(--atomic-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"));font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);tab-size:4;-webkit-tap-highlight-color:transparent}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-size:1em;font-variation-settings:var(--default-mono-font-variation-settings,normal)}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}menu,ol,ul{list-style:none}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}::file-selector-button,button,input,optgroup,select,textarea{background-color:transparent;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not (-webkit-appearance:-apple-pay-button)) or (contain-intrinsic-size:1px){::placeholder{color:currentcolor;@supports (color:color-mix(in lab,red,red)){color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}::file-selector-button,button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{.\\@container{container-type:inline-size}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{border-width:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;white-space:nowrap;width:1px}.absolute,.sr-only{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.-top-2{top:-.5rem}.-top-4{top:-1rem}.top-0{top:0}.top-1\\/2{top:50%}.top-6{top:1.5rem}.top-\\[4px\\]{top:4px}.top-full{top:100%}.top-px{top:1px}.-right-2{right:-.5rem}.right-0{right:0}.right-2{right:.5rem}.right-6{right:1.5rem}.right-12{right:3rem}.right-20{right:5rem}.right-px{right:1px}.bottom-0{bottom:0}.bottom-1{bottom:.25rem}.bottom-2{bottom:.5rem}.bottom-px{bottom:1px}.left-0{left:0}.left-1{left:.25rem}.left-2{left:.5rem}.left-\\[15px\\]{left:15px}.isolate{isolation:isolate}.z-0{z-index:0}.z-1{z-index:1}.z-10{z-index:10}.z-9998{z-index:9998}.z-9999{z-index:9999}.order-last{order:9999}.col-span-2{grid-column:span 2/span 2}.container{width:100%;@media (width >= 1024px){max-width:1024px}@media (width >= 40rem){max-width:40rem}@media (width >= 48rem){max-width:48rem}@media (width >= 64rem){max-width:64rem}@media (width >= 80rem){max-width:80rem}@media (width >= 96rem){max-width:96rem}}.m-0{margin:0}.m-2{margin:.5rem}.mx-0{margin-inline:0}.mx-0\\.5{margin-inline:.125rem}.mx-1{margin-inline:.25rem}.mx-6{margin-inline:1.5rem}.mx-16{margin-inline:4rem}.mx-auto{margin-inline:auto}.my-2{margin-block:.5rem}.my-3{margin-block:.75rem}.my-4{margin-block:1rem}.my-6{margin-block:1.5rem}.my-auto{margin-block:auto}.mt-0{margin-top:0}.mt-1{margin-top:.25rem}.mt-1\\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-2\\.5{margin-top:.625rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-7{margin-top:1.75rem}.mt-8{margin-top:2rem}.mt-10{margin-top:2.5rem}.mt-px{margin-top:1px}.mr-0{margin-right:0}.mr-0\\.5{margin-right:.125rem}.mr-1{margin-right:.25rem}.mr-1\\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-6{margin-right:1.5rem}.mb-0{margin-bottom:0}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.ml-0\\.5{margin-left:.125rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.box-border{box-sizing:border-box}.box-content{box-sizing:content-box}.line-clamp-1{-webkit-line-clamp:1}.line-clamp-1,.line-clamp-2{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical}.line-clamp-2{-webkit-line-clamp:2}.line-clamp-3{-webkit-line-clamp:3}.line-clamp-3,.line-clamp-4{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical}.line-clamp-4{-webkit-line-clamp:4}.line-clamp-none{display:block;overflow:visible;-webkit-box-orient:horizontal;-webkit-line-clamp:unset}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.aspect-square-\\[auto\\]{@supports not (aspect-ratio:1/1){height:auto}}.aspect-square-\\[auto\\]{aspect-ratio:1/1;height:auto;@supports not (aspect-ratio:1/1){height:auto}}.aspect-square{aspect-ratio:1/1}.size-\\[27px\\]{height:27px;width:27px}.h-1{height:.25rem}.h-2{height:.5rem}.h-2\\.5{height:.625rem}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-5\\/6{height:83.33333%}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-\\[2\\.6rem\\]{height:2.6rem}.h-\\[9px\\]{height:9px}.h-auto{height:auto}.h-full{height:100%}.max-h-96{max-height:24rem}.min-h-10{min-height:2.5rem}.min-lines-2{min-height:calc(var(--line-height)*2)}.min-lines-3{min-height:calc(var(--line-height)*3)}.w-0\\.5{width:.125rem}.w-1{width:.25rem}.w-1\\/2{width:50%}.w-2{width:.5rem}.w-2\\.5{width:.625rem}.w-3{width:.75rem}.w-3\\.5{width:.875rem}.w-3\\/5{width:60%}.w-4{width:1rem}.w-5{width:1.25rem}.w-5\\/6{width:83.33333%}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-20{width:5rem}.w-26{width:6.5rem}.w-28{width:7rem}.w-32{width:8rem}.w-36{width:9rem}.w-44{width:11rem}.w-48{width:12rem}.w-60{width:15rem}.w-64{width:16rem}.w-72{width:18rem}.w-100{width:25rem}.w-\\[2\\.6rem\\]{width:2.6rem}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-max{width:max-content}.max-w-4\\/5{max-width:80%}.max-w-60{max-width:15rem}.max-w-\\[30ch\\]{max-width:30ch}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-max{max-width:max-content}.min-w-0{min-width:0}.min-w-10{min-width:2.5rem}.min-w-20{min-width:5rem}.min-w-24{min-width:6rem}.min-w-full{min-width:100%}.flex-1{flex:1}.flex-none{flex:none}.flex-shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.basis-1\\/2{flex-basis:50%}.basis-8{flex-basis:2rem}.border-collapse{border-collapse:collapse}.-translate-x-1\\/2{--tw-translate-x:-50%}.-translate-x-1\\/2,.translate-x-1\\/2{translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-1\\/2{--tw-translate-x:50%}.-translate-y-1\\/2{--tw-translate-y:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.scale-75{--tw-scale-x:75%;--tw-scale-y:75%;--tw-scale-z:75%}.scale-100,.scale-75{scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.animate-spin{animation:spin 1s linear infinite}.cursor-\\[inherit\\]{cursor:inherit}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.list-outside{list-style-position:outside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.appearance-none{appearance:none}.grid-cols-\\[min-content_1fr\\]{grid-template-columns:min-content 1fr}.grid-cols-\\[min-content_auto\\]{grid-template-columns:min-content auto}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-nowrap{flex-wrap:nowrap}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.content-center{align-content:center}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-8{gap:2rem}.space-y-1{:where(&>:not(:last-child)){--tw-space-y-reverse:0;margin-block-end:calc(.25rem*(1 - var(--tw-space-y-reverse)));margin-block-start:calc(.25rem*var(--tw-space-y-reverse))}}.gap-x-1\\.5{column-gap:.375rem}.gap-x-2{column-gap:.5rem}.gap-x-4{column-gap:1rem}.space-x-1\\.5{:where(&>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-end:calc(.375rem*(1 - var(--tw-space-x-reverse)));margin-inline-start:calc(.375rem*var(--tw-space-x-reverse))}}.gap-y-0\\.5{row-gap:.125rem}.divide-y{:where(&>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-bottom-width:calc(1px*(1 - var(--tw-divide-y-reverse)));border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse))}}.divide-neutral{:where(&>:not(:last-child)){border-color:var(--atomic-neutral)}}.self-center{align-self:center}.self-start{align-self:flex-start}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-clip{overflow-x:clip}.overflow-x-scroll{overflow-x:scroll}.overflow-y-auto{overflow-y:auto}.overflow-y-visible{overflow-y:visible}.scroll-smooth{scroll-behavior:smooth}.rounded{border-radius:var(--atomic-border-radius)}.rounded-3xl{border-radius:1.5rem}.rounded-full{border-radius:calc(infinity*1px)}.rounded-lg{border-radius:var(--atomic-border-radius-lg)}.rounded-md{border-radius:var(--atomic-border-radius-md)}.rounded-none{border-radius:0}.rounded-sm{border-radius:var(--atomic-border-radius)}.rounded-xl{border-radius:var(--atomic-border-radius-xl)}.rounded-tl-none{border-top-left-radius:0}.rounded-r-none{border-bottom-right-radius:0;border-top-right-radius:0}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-solid{--tw-border-style:solid;border-style:solid}.border-gray-200{border-color:oklch(.928 .006 264.531)}.border-neutral{border-color:var(--atomic-neutral)}.border-neutral-dark{border-color:var(--atomic-neutral-dark)}.border-neutral-dim{border-color:var(--atomic-neutral-dim)}.border-primary{border-color:var(--atomic-primary)}.border-primary-light{border-color:var(--atomic-primary-light)}.border-t-neutral{border-top-color:var(--atomic-neutral)}.border-b-neutral{border-bottom-color:var(--atomic-neutral)}.border-b-neutral-dim{border-bottom-color:var(--atomic-neutral-dim)}.border-l-neutral{border-left-color:var(--atomic-neutral)}.border-l-neutral-dim{border-left-color:var(--atomic-neutral-dim)}.bg-\\[\\#F1F2FF\\]{background-color:#f1f2ff}.bg-\\[rgba\\(40\\,40\\,40\\,0\\.8\\)\\]{background-color:rgba(40,40,40,.8)}.bg-background{background-color:var(--atomic-background)}.bg-error{background-color:var(--atomic-error)}.bg-gray-50{background-color:oklch(.985 .002 247.839)}.bg-neutral{background-color:var(--atomic-neutral)}.bg-neutral-dark{background-color:var(--atomic-neutral-dark)}.bg-neutral-light{background-color:var(--atomic-neutral-light)}.bg-primary{background-color:var(--atomic-primary)}.bg-primary-background{background-color:var(--atomic-primary-background)}.bg-transparent{background-color:transparent}.bg-white{background-color:#fff}.bg-linear-to-l{--tw-gradient-position:to left;@supports (background-image:linear-gradient(in lab,red,red)){--tw-gradient-position:to left in oklab}background-image:linear-gradient(var(--tw-gradient-stops))}.bg-linear-to-r{--tw-gradient-position:to right;@supports (background-image:linear-gradient(in lab,red,red)){--tw-gradient-position:to right in oklab}background-image:linear-gradient(var(--tw-gradient-stops))}.from-background\\/60{--tw-gradient-from:color-mix(in srgb,#fff 60%,transparent);@supports (color:color-mix(in lab,red,red)){--tw-gradient-from:color-mix(in oklab,var(--atomic-background) 60%,transparent)}--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from) var(--tw-gradient-from-position),var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-more-results-progress-bar-color-from{--tw-gradient-from:var(
541
536
  --atomic-more-results-progress-bar-color-from,var(--atomic-primary-dark)
@@ -8,7 +8,6 @@ import { buildRecentQueriesList, } from '@coveo/headless/commerce';
8
8
  import { html, LitElement, nothing } from 'lit';
9
9
  import { customElement, property, state } from 'lit/decorators.js';
10
10
  import { errorGuard } from "../../../decorators/error-guard";
11
- import { AriaLiveRegionController } from "../../../utils/accessibility-utils";
12
11
  import { SafeStorage, StorageItems } from "../../../utils/local-storage-utils";
13
12
  import { once } from "../../../utils/utils";
14
13
  const Clock = "<svg fill=\"none\" stroke=\"currentColor\" stroke-linejoin=\"round\" stroke-linecap=\"round\" viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\"><circle cx=\"8\" cy=\"8\" r=\"7.5\"/><path d=\"m8.5 4.5v4\"/><path d=\"m10.3066 10.1387-1.80932-1.5768\"/></svg>";
@@ -24,7 +23,6 @@ let AtomicCommerceSearchBoxRecentQueries = class AtomicCommerceSearchBoxRecentQu
24
23
  * The maximum number of suggestions to display when the user types in the input field.
25
24
  */
26
25
  this.maxWithQuery = 3;
27
- this.searchBoxAriaMessage = new AriaLiveRegionController(this, 'recent-search-cleared', true);
28
26
  this.warnUser = once(() => this.bindings.engine.logger.warn('The recent queries feature is deactivated because analytics are disabled.'));
29
27
  }
30
28
  connectedCallback() {
@@ -88,7 +86,6 @@ let AtomicCommerceSearchBoxRecentQueries = class AtomicCommerceSearchBoxRecentQu
88
86
  onSelect: () => {
89
87
  this.recentQueriesList.clear();
90
88
  this.bindings.triggerSuggestions();
91
- this.searchBoxAriaMessage.message = this.bindings.i18n.t('recent-search-cleared');
92
89
  },
93
90
  };
94
91
  }
@@ -7,8 +7,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { ProductTemplatesHelpers } from '@coveo/headless/commerce';
8
8
  import { html, LitElement, nothing } from 'lit';
9
9
  import { customElement, property, state } from 'lit/decorators.js';
10
+ import { createProductContextController } from "../product-template-component-utils/context/product-context-controller";
10
11
  import { bindings } from "../../../decorators/bindings";
11
- import { createProductContextController } from "../../../decorators/commerce/product-template-decorators";
12
12
  import { errorGuard } from "../../../decorators/error-guard";
13
13
  import { filterProtocol } from '../../../utils/xss-utils';
14
14
  import { renderButton } from '../../common/button';
@@ -11,10 +11,10 @@ import { createRef } from 'lit/directives/ref.js';
11
11
  import { booleanConverter } from "../../../converters/boolean-converter.js";
12
12
  import { bindingGuard } from "../../../decorators/binding-guard.js";
13
13
  import { bindings } from "../../../decorators/bindings.js";
14
- import { createProductContextController } from "../../../decorators/commerce/product-template-decorators.js";
15
14
  import { errorGuard } from "../../../decorators/error-guard.js";
16
15
  import { renderExpandableText, } from '../../common/expandable-text/expandable-text.js';
17
16
  import '../atomic-product-text/atomic-product-text.js';
17
+ import { createProductContextController } from "../product-template-component-utils/context/product-context-controller.js";
18
18
  import { LightDomMixin } from "../../../mixins/light-dom.js";
19
19
  /**
20
20
  * The `atomic-product-description` component renders the description of a product.
@@ -8,10 +8,10 @@ import { Schema, StringValue } from '@coveo/bueno';
8
8
  import { html, LitElement, nothing } from 'lit';
9
9
  import { customElement, property, state } from 'lit/decorators.js';
10
10
  import { createRef } from 'lit/directives/ref.js';
11
+ import { createProductContextController } from "../product-template-component-utils/context/product-context-controller";
11
12
  import { booleanConverter } from "../../../converters/boolean-converter";
12
13
  import { bindingGuard } from "../../../decorators/binding-guard";
13
14
  import { bindings } from "../../../decorators/bindings";
14
- import { createProductContextController } from "../../../decorators/commerce/product-template-decorators";
15
15
  import { errorGuard } from "../../../decorators/error-guard";
16
16
  import { renderExpandableText, } from '../../common/expandable-text/expandable-text';
17
17
  import '../atomic-product-text/atomic-product-text.js';
@@ -6,8 +6,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { html, LitElement } from 'lit';
8
8
  import { customElement, property, state } from 'lit/decorators.js';
9
+ import { createProductContextController } from "../product-template-component-utils/context/product-context-controller";
9
10
  import { bindings } from "../../../decorators/bindings";
10
- import { createProductContextController } from "../../../decorators/commerce/product-template-decorators";
11
11
  import { errorGuard } from "../../../decorators/error-guard";
12
12
  import { LightDomMixin } from "../../../mixins/light-dom";
13
13
  import { mapProperty } from "../../../utils/props-utils";
@@ -9,10 +9,10 @@ import { ProductTemplatesHelpers } from '@coveo/headless/commerce';
9
9
  import { html, LitElement, nothing } from 'lit';
10
10
  import { customElement, property, state } from 'lit/decorators.js';
11
11
  import { when } from 'lit/directives/when.js';
12
+ import { createProductContextController } from "../product-template-component-utils/context/product-context-controller";
12
13
  import { renderImageCarousel } from "../../common/image-carousel/image-carousel";
13
14
  import { bindingGuard } from "../../../decorators/binding-guard";
14
15
  import { bindings } from "../../../decorators/bindings";
15
- import { createProductContextController } from "../../../decorators/commerce/product-template-decorators";
16
16
  import { errorGuard } from "../../../decorators/error-guard";
17
17
  import { withTailwindStyles } from "../../../decorators/with-tailwind-styles.js";
18
18
  import { filterProtocol } from "../../../utils/xss-utils";