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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (335) hide show
  1. package/dist/atomic/_atomic.esm.js +1 -1
  2. package/dist/atomic/components/_index.js +19 -19
  3. package/dist/atomic/components/atomic-field-condition.js +1 -1
  4. package/dist/atomic/components/atomic-field-condition.js.map +1 -1
  5. package/dist/atomic/components/atomic-insight-result-action.js +2 -2
  6. package/dist/atomic/components/atomic-insight-result-action.js.map +1 -1
  7. package/dist/atomic/components/atomic-insight-result-attach-to-case-action.js +2 -2
  8. package/dist/atomic/components/atomic-insight-result-attach-to-case-action.js.map +1 -1
  9. package/dist/atomic/components/atomic-insight-result-attach-to-case-indicator.js +2 -2
  10. package/dist/atomic/components/atomic-insight-result-attach-to-case-indicator.js.map +1 -1
  11. package/dist/atomic/components/atomic-insight-result-quickview-action.js +2 -2
  12. package/dist/atomic/components/atomic-insight-result-quickview-action.js.map +1 -1
  13. package/dist/atomic/components/atomic-ipx-result-link.js +2 -2
  14. package/dist/atomic/components/atomic-ipx-result-link.js.map +1 -1
  15. package/dist/atomic/components/atomic-quickview-modal2.js +1 -1
  16. package/dist/atomic/components/atomic-quickview.js +2 -2
  17. package/dist/atomic/components/atomic-quickview.js.map +1 -1
  18. package/dist/atomic/components/atomic-recs-interface.js +1 -1
  19. package/dist/atomic/components/atomic-result-badge.js +1 -1
  20. package/dist/atomic/components/atomic-result-badge.js.map +1 -1
  21. package/dist/atomic/components/atomic-result-children.js +2 -2
  22. package/dist/atomic/components/atomic-result-children.js.map +1 -1
  23. package/dist/atomic/components/atomic-result-date.js +1 -1
  24. package/dist/atomic/components/atomic-result-date.js.map +1 -1
  25. package/dist/atomic/components/atomic-result-fields-list.js +2 -2
  26. package/dist/atomic/components/atomic-result-fields-list.js.map +1 -1
  27. package/dist/atomic/components/atomic-result-html.js +1 -1
  28. package/dist/atomic/components/atomic-result-html.js.map +1 -1
  29. package/dist/atomic/components/atomic-result-icon.js +1 -1
  30. package/dist/atomic/components/atomic-result-icon.js.map +1 -1
  31. package/dist/atomic/components/atomic-result-image.js +1 -1
  32. package/dist/atomic/components/atomic-result-image.js.map +1 -1
  33. package/dist/atomic/components/atomic-result-link.js +2 -2
  34. package/dist/atomic/components/atomic-result-link.js.map +1 -1
  35. package/dist/atomic/components/atomic-result-localized-text.js +1 -1
  36. package/dist/atomic/components/atomic-result-localized-text.js.map +1 -1
  37. package/dist/atomic/components/atomic-result-multi-value-text.js +1 -1
  38. package/dist/atomic/components/atomic-result-multi-value-text.js.map +1 -1
  39. package/dist/atomic/components/atomic-result-number.js +1 -1
  40. package/dist/atomic/components/atomic-result-number.js.map +1 -1
  41. package/dist/atomic/components/atomic-result-printable-uri.js +1 -1
  42. package/dist/atomic/components/atomic-result-printable-uri.js.map +1 -1
  43. package/dist/atomic/components/atomic-result-rating.js +1 -1
  44. package/dist/atomic/components/atomic-result-rating.js.map +1 -1
  45. package/dist/atomic/components/atomic-result-text2.js +1 -1
  46. package/dist/atomic/components/atomic-result-text2.js.map +1 -1
  47. package/dist/atomic/components/atomic-result-timespan.js +1 -1
  48. package/dist/atomic/components/atomic-result-timespan.js.map +1 -1
  49. package/dist/atomic/components/atomic-result2.js.map +1 -1
  50. package/dist/atomic/components/atomic-search-box.js +3 -7
  51. package/dist/atomic/components/atomic-search-box.js.map +1 -1
  52. package/dist/atomic/components/atomic-smart-snippet-source2.js +1 -1
  53. package/dist/atomic/components/atomic-smart-snippet-source2.js.map +1 -1
  54. package/dist/atomic/components/components/commerce/atomic-commerce-breadbox/atomic-commerce-breadbox.js +1 -3
  55. package/dist/atomic/components/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.js +0 -5
  56. package/dist/atomic/components/components/commerce/atomic-commerce-search-box-recent-queries/atomic-commerce-search-box-recent-queries.js +0 -3
  57. package/dist/atomic/components/components/commerce/atomic-product-children/atomic-product-children.js +1 -1
  58. package/dist/atomic/components/components/commerce/atomic-product-description/atomic-product-description.js +1 -1
  59. package/dist/atomic/components/components/commerce/atomic-product-excerpt/atomic-product-excerpt.js +1 -1
  60. package/dist/atomic/components/components/commerce/atomic-product-field-condition/atomic-product-field-condition.js +1 -1
  61. package/dist/atomic/components/components/commerce/atomic-product-image/atomic-product-image.js +1 -1
  62. package/dist/atomic/components/components/commerce/atomic-product-link/atomic-product-link.js +2 -1
  63. package/dist/atomic/components/components/commerce/atomic-product-multi-value-text/atomic-product-multi-value-text.js +1 -1
  64. package/dist/atomic/components/components/commerce/atomic-product-numeric-field-value/atomic-product-numeric-field-value.js +1 -1
  65. package/dist/atomic/components/components/commerce/atomic-product-price/atomic-product-price.js +1 -1
  66. package/dist/atomic/components/components/commerce/atomic-product-rating/atomic-product-rating.js +1 -1
  67. package/dist/atomic/components/components/commerce/atomic-product-text/atomic-product-text.js +1 -1
  68. package/dist/atomic/components/components/commerce/product-template-component-utils/context/interactive-product-context-controller.js +25 -0
  69. package/dist/atomic/components/components/commerce/product-template-component-utils/context/product-context-controller.js +29 -0
  70. package/dist/atomic/components/components/common/breadbox/breadcrumb-button.js +1 -6
  71. package/dist/atomic/components/components/common/search-box/text-area-clear-button.js +1 -1
  72. package/dist/atomic/components/global/environment.js +1 -1
  73. package/dist/atomic/components/index.js.map +1 -1
  74. package/dist/atomic/components/{result-template-decorators.js → stencil-result-template-decorators.js} +6 -2
  75. package/dist/atomic/components/stencil-result-template-decorators.js.map +1 -0
  76. package/dist/atomic/components/stencil-suggestion-manager.js +1 -1
  77. package/dist/atomic/components/stencil-suggestion-manager.js.map +1 -1
  78. package/dist/atomic/index.esm.js +1 -1
  79. package/dist/atomic/index.esm.js.map +1 -1
  80. package/dist/atomic/lang/cs.json +1 -1
  81. package/dist/atomic/lang/da.json +1 -1
  82. package/dist/atomic/lang/de.json +1 -1
  83. package/dist/atomic/lang/dev.json +1 -1
  84. package/dist/atomic/lang/el.json +1 -1
  85. package/dist/atomic/lang/en.json +1 -1
  86. package/dist/atomic/lang/es.json +1 -1
  87. package/dist/atomic/lang/fi.json +1 -1
  88. package/dist/atomic/lang/fr.json +1 -1
  89. package/dist/atomic/lang/hu.json +1 -1
  90. package/dist/atomic/lang/id.json +1 -1
  91. package/dist/atomic/lang/it.json +1 -1
  92. package/dist/atomic/lang/ja.json +1 -1
  93. package/dist/atomic/lang/ko.json +1 -1
  94. package/dist/atomic/lang/nl.json +1 -1
  95. package/dist/atomic/lang/no.json +1 -1
  96. package/dist/atomic/lang/pl.json +1 -1
  97. package/dist/atomic/lang/pt-BR.json +1 -1
  98. package/dist/atomic/lang/pt.json +1 -1
  99. package/dist/atomic/lang/ru.json +1 -1
  100. package/dist/atomic/lang/sv.json +1 -1
  101. package/dist/atomic/lang/th.json +1 -1
  102. package/dist/atomic/lang/tr.json +1 -1
  103. package/dist/atomic/lang/zh-CN.json +1 -1
  104. package/dist/atomic/lang/zh-TW.json +1 -1
  105. package/dist/atomic/lang/zh.json +1 -1
  106. package/dist/atomic/{p-955092ed.entry.js → p-01096d1c.entry.js} +2 -2
  107. package/dist/atomic/p-01096d1c.entry.js.map +1 -0
  108. package/dist/atomic/{p-82cd6398.entry.js → p-154cbbfe.entry.js} +2 -2
  109. package/dist/atomic/{p-82cd6398.entry.js.map → p-154cbbfe.entry.js.map} +1 -1
  110. package/dist/atomic/p-16f4ce98.js +2 -0
  111. package/dist/atomic/p-16f4ce98.js.map +1 -0
  112. package/dist/atomic/{p-db3b11ca.entry.js → p-2033533c.entry.js} +2 -2
  113. package/dist/atomic/{p-db3b11ca.entry.js.map → p-2033533c.entry.js.map} +1 -1
  114. package/dist/atomic/{p-4069d801.entry.js → p-268ce7ca.entry.js} +2 -2
  115. package/dist/atomic/p-268ce7ca.entry.js.map +1 -0
  116. package/dist/atomic/{p-9e6462cf.entry.js → p-36ff2bc3.entry.js} +2 -2
  117. package/dist/atomic/p-36ff2bc3.entry.js.map +1 -0
  118. package/dist/atomic/{p-e9dc8e90.entry.js → p-3ec45f9c.entry.js} +2 -2
  119. package/dist/atomic/p-3ec45f9c.entry.js.map +1 -0
  120. package/dist/atomic/{p-18684d4c.js → p-4080f740.js} +1 -1
  121. package/dist/atomic/p-4080f740.js.map +1 -0
  122. package/dist/atomic/{p-8d5228da.entry.js → p-42fffab2.entry.js} +2 -2
  123. package/dist/atomic/p-42fffab2.entry.js.map +1 -0
  124. package/dist/atomic/{p-190ddaca.entry.js → p-4cf97b0a.entry.js} +2 -2
  125. package/dist/atomic/p-4cf97b0a.entry.js.map +1 -0
  126. package/dist/atomic/{p-78427c6a.entry.js → p-5a9460ab.entry.js} +2 -2
  127. package/dist/atomic/p-5a9460ab.entry.js.map +1 -0
  128. package/dist/atomic/{p-15547bd5.entry.js → p-61b3f5ce.entry.js} +2 -2
  129. package/dist/atomic/p-61b3f5ce.entry.js.map +1 -0
  130. package/dist/atomic/{p-1ff7a9da.entry.js → p-6a3b139f.entry.js} +2 -2
  131. package/dist/atomic/p-6a3b139f.entry.js.map +1 -0
  132. package/dist/atomic/{p-df8d38ca.entry.js → p-7015679e.entry.js} +2 -2
  133. package/dist/atomic/p-7015679e.entry.js.map +1 -0
  134. package/dist/atomic/{p-dea22a8d.entry.js → p-886b184f.entry.js} +2 -2
  135. package/dist/atomic/p-886b184f.entry.js.map +1 -0
  136. package/dist/atomic/{p-b3f6561d.entry.js → p-8e964890.entry.js} +2 -2
  137. package/dist/atomic/p-8e964890.entry.js.map +1 -0
  138. package/dist/atomic/{p-182f9112.entry.js → p-a413f820.entry.js} +2 -2
  139. package/dist/atomic/p-a413f820.entry.js.map +1 -0
  140. package/dist/atomic/{p-017aa785.entry.js → p-a7c39901.entry.js} +2 -2
  141. package/dist/atomic/{p-5cab535b.entry.js → p-c5bd7f8d.entry.js} +2 -2
  142. package/dist/atomic/p-c5bd7f8d.entry.js.map +1 -0
  143. package/dist/atomic/{p-567b2841.entry.js → p-ca1425cc.entry.js} +2 -2
  144. package/dist/atomic/{p-852cc16d.entry.js → p-cacb7fd8.entry.js} +2 -2
  145. package/dist/atomic/p-cacb7fd8.entry.js.map +1 -0
  146. package/dist/atomic/{p-c5164dbf.entry.js → p-cee86cff.entry.js} +2 -2
  147. package/dist/atomic/p-cee86cff.entry.js.map +1 -0
  148. package/dist/atomic/{p-4cb91ee7.entry.js → p-d5402772.entry.js} +2 -2
  149. package/dist/atomic/p-d5402772.entry.js.map +1 -0
  150. package/dist/atomic/{p-e6dc9de7.entry.js → p-da141605.entry.js} +2 -2
  151. package/dist/atomic/p-da141605.entry.js.map +1 -0
  152. package/dist/atomic/{p-a1798150.entry.js → p-dd258eaa.entry.js} +2 -2
  153. package/dist/atomic/p-dd258eaa.entry.js.map +1 -0
  154. package/dist/atomic/{p-945ddd53.entry.js → p-e1dbe31d.entry.js} +2 -2
  155. package/dist/atomic/p-e1dbe31d.entry.js.map +1 -0
  156. package/dist/atomic/{p-448091f7.entry.js → p-ecd3c0a9.entry.js} +2 -2
  157. package/dist/atomic/p-ecd3c0a9.entry.js.map +1 -0
  158. package/dist/atomic/{p-c2a5dac0.entry.js → p-f2c4209d.entry.js} +2 -2
  159. package/dist/atomic/{p-57049cd2.entry.js → p-f2c89d7c.entry.js} +2 -2
  160. package/dist/atomic/p-f2c89d7c.entry.js.map +1 -0
  161. package/dist/atomic/p-f800678c.entry.js.map +1 -1
  162. package/dist/cjs/_index.cjs.js +20 -20
  163. package/dist/cjs/atomic-field-condition.cjs.entry.js +2 -2
  164. package/dist/cjs/atomic-field-condition.cjs.entry.js.map +1 -1
  165. package/dist/cjs/atomic-insight-result-action.cjs.entry.js +3 -3
  166. package/dist/cjs/atomic-insight-result-action.cjs.entry.js.map +1 -1
  167. package/dist/cjs/atomic-insight-result-attach-to-case-action.cjs.entry.js +3 -3
  168. package/dist/cjs/atomic-insight-result-attach-to-case-action.cjs.entry.js.map +1 -1
  169. package/dist/cjs/atomic-insight-result-attach-to-case-indicator.cjs.entry.js +3 -3
  170. package/dist/cjs/atomic-insight-result-attach-to-case-indicator.cjs.entry.js.map +1 -1
  171. package/dist/cjs/atomic-insight-result-quickview-action.cjs.entry.js +3 -3
  172. package/dist/cjs/atomic-insight-result-quickview-action.cjs.entry.js.map +1 -1
  173. package/dist/cjs/atomic-insight-search-box.cjs.entry.js +1 -1
  174. package/dist/cjs/atomic-ipx-result-link.cjs.entry.js +4 -4
  175. package/dist/cjs/atomic-ipx-result-link.cjs.entry.js.map +1 -1
  176. package/dist/cjs/atomic-quickview-modal.cjs.entry.js +1 -1
  177. package/dist/cjs/atomic-quickview.cjs.entry.js +3 -3
  178. package/dist/cjs/atomic-quickview.cjs.entry.js.map +1 -1
  179. package/dist/cjs/atomic-recs-interface.cjs.entry.js +1 -1
  180. package/dist/cjs/atomic-result-badge.cjs.entry.js +2 -2
  181. package/dist/cjs/atomic-result-badge.cjs.entry.js.map +1 -1
  182. package/dist/cjs/atomic-result-children.cjs.entry.js +3 -3
  183. package/dist/cjs/atomic-result-children.cjs.entry.js.map +1 -1
  184. package/dist/cjs/atomic-result-date.cjs.entry.js +2 -2
  185. package/dist/cjs/atomic-result-date.cjs.entry.js.map +1 -1
  186. package/dist/cjs/atomic-result-fields-list.cjs.entry.js +3 -3
  187. package/dist/cjs/atomic-result-fields-list.cjs.entry.js.map +1 -1
  188. package/dist/cjs/atomic-result-html.cjs.entry.js +2 -2
  189. package/dist/cjs/atomic-result-html.cjs.entry.js.map +1 -1
  190. package/dist/cjs/atomic-result-icon.cjs.entry.js +2 -2
  191. package/dist/cjs/atomic-result-icon.cjs.entry.js.map +1 -1
  192. package/dist/cjs/atomic-result-image.cjs.entry.js +2 -2
  193. package/dist/cjs/atomic-result-image.cjs.entry.js.map +1 -1
  194. package/dist/cjs/atomic-result-link.cjs.entry.js +4 -4
  195. package/dist/cjs/atomic-result-link.cjs.entry.js.map +1 -1
  196. package/dist/cjs/atomic-result-localized-text.cjs.entry.js +3 -3
  197. package/dist/cjs/atomic-result-localized-text.cjs.entry.js.map +1 -1
  198. package/dist/cjs/atomic-result-multi-value-text.cjs.entry.js +2 -2
  199. package/dist/cjs/atomic-result-multi-value-text.cjs.entry.js.map +1 -1
  200. package/dist/cjs/atomic-result-number.cjs.entry.js +2 -2
  201. package/dist/cjs/atomic-result-number.cjs.entry.js.map +1 -1
  202. package/dist/cjs/atomic-result-printable-uri.cjs.entry.js +2 -2
  203. package/dist/cjs/atomic-result-printable-uri.cjs.entry.js.map +1 -1
  204. package/dist/cjs/atomic-result-rating.cjs.entry.js +2 -2
  205. package/dist/cjs/atomic-result-rating.cjs.entry.js.map +1 -1
  206. package/dist/cjs/atomic-result-text_2.cjs.entry.js +2 -2
  207. package/dist/cjs/atomic-result-text_2.cjs.entry.js.map +1 -1
  208. package/dist/cjs/atomic-result-timespan.cjs.entry.js +2 -2
  209. package/dist/cjs/atomic-result-timespan.cjs.entry.js.map +1 -1
  210. package/dist/cjs/atomic-result.cjs.entry.js.map +1 -1
  211. package/dist/cjs/atomic-search-box.cjs.entry.js +4 -8
  212. package/dist/cjs/atomic-search-box.cjs.entry.js.map +1 -1
  213. package/dist/cjs/atomic-smart-snippet-answer_2.cjs.entry.js +1 -1
  214. package/dist/cjs/atomic-smart-snippet-answer_2.cjs.entry.js.map +1 -1
  215. package/dist/cjs/index.cjs.js.map +1 -1
  216. package/dist/cjs/{result-template-decorators-432d11a9.js → stencil-result-template-decorators-28b05aaf.js} +6 -2
  217. package/dist/cjs/stencil-result-template-decorators-28b05aaf.js.map +1 -0
  218. package/dist/cjs/{stencil-suggestion-manager-88cb88f2.js → stencil-suggestion-manager-2cba6d69.js} +2 -2
  219. package/dist/cjs/stencil-suggestion-manager-2cba6d69.js.map +1 -0
  220. package/dist/cjs/version.cjs.js +1 -1
  221. package/dist/esm/_index.js +19 -19
  222. package/dist/esm/atomic-field-condition.entry.js +1 -1
  223. package/dist/esm/atomic-field-condition.entry.js.map +1 -1
  224. package/dist/esm/atomic-insight-result-action.entry.js +2 -2
  225. package/dist/esm/atomic-insight-result-action.entry.js.map +1 -1
  226. package/dist/esm/atomic-insight-result-attach-to-case-action.entry.js +2 -2
  227. package/dist/esm/atomic-insight-result-attach-to-case-action.entry.js.map +1 -1
  228. package/dist/esm/atomic-insight-result-attach-to-case-indicator.entry.js +2 -2
  229. package/dist/esm/atomic-insight-result-attach-to-case-indicator.entry.js.map +1 -1
  230. package/dist/esm/atomic-insight-result-quickview-action.entry.js +2 -2
  231. package/dist/esm/atomic-insight-result-quickview-action.entry.js.map +1 -1
  232. package/dist/esm/atomic-insight-search-box.entry.js +1 -1
  233. package/dist/esm/atomic-ipx-result-link.entry.js +2 -2
  234. package/dist/esm/atomic-ipx-result-link.entry.js.map +1 -1
  235. package/dist/esm/atomic-quickview-modal.entry.js +1 -1
  236. package/dist/esm/atomic-quickview.entry.js +2 -2
  237. package/dist/esm/atomic-quickview.entry.js.map +1 -1
  238. package/dist/esm/atomic-recs-interface.entry.js +1 -1
  239. package/dist/esm/atomic-result-badge.entry.js +1 -1
  240. package/dist/esm/atomic-result-badge.entry.js.map +1 -1
  241. package/dist/esm/atomic-result-children.entry.js +2 -2
  242. package/dist/esm/atomic-result-children.entry.js.map +1 -1
  243. package/dist/esm/atomic-result-date.entry.js +1 -1
  244. package/dist/esm/atomic-result-date.entry.js.map +1 -1
  245. package/dist/esm/atomic-result-fields-list.entry.js +2 -2
  246. package/dist/esm/atomic-result-fields-list.entry.js.map +1 -1
  247. package/dist/esm/atomic-result-html.entry.js +1 -1
  248. package/dist/esm/atomic-result-html.entry.js.map +1 -1
  249. package/dist/esm/atomic-result-icon.entry.js +1 -1
  250. package/dist/esm/atomic-result-icon.entry.js.map +1 -1
  251. package/dist/esm/atomic-result-image.entry.js +1 -1
  252. package/dist/esm/atomic-result-image.entry.js.map +1 -1
  253. package/dist/esm/atomic-result-link.entry.js +2 -2
  254. package/dist/esm/atomic-result-link.entry.js.map +1 -1
  255. package/dist/esm/atomic-result-localized-text.entry.js +2 -2
  256. package/dist/esm/atomic-result-localized-text.entry.js.map +1 -1
  257. package/dist/esm/atomic-result-multi-value-text.entry.js +1 -1
  258. package/dist/esm/atomic-result-multi-value-text.entry.js.map +1 -1
  259. package/dist/esm/atomic-result-number.entry.js +1 -1
  260. package/dist/esm/atomic-result-number.entry.js.map +1 -1
  261. package/dist/esm/atomic-result-printable-uri.entry.js +1 -1
  262. package/dist/esm/atomic-result-printable-uri.entry.js.map +1 -1
  263. package/dist/esm/atomic-result-rating.entry.js +1 -1
  264. package/dist/esm/atomic-result-rating.entry.js.map +1 -1
  265. package/dist/esm/atomic-result-text_2.entry.js +1 -1
  266. package/dist/esm/atomic-result-text_2.entry.js.map +1 -1
  267. package/dist/esm/atomic-result-timespan.entry.js +1 -1
  268. package/dist/esm/atomic-result-timespan.entry.js.map +1 -1
  269. package/dist/esm/atomic-result.entry.js.map +1 -1
  270. package/dist/esm/atomic-search-box.entry.js +4 -8
  271. package/dist/esm/atomic-search-box.entry.js.map +1 -1
  272. package/dist/esm/atomic-smart-snippet-answer_2.entry.js +1 -1
  273. package/dist/esm/atomic-smart-snippet-answer_2.entry.js.map +1 -1
  274. package/dist/esm/index.js.map +1 -1
  275. package/dist/esm/{result-template-decorators-2ed76ea9.js → stencil-result-template-decorators-f989bc6b.js} +6 -2
  276. package/dist/esm/stencil-result-template-decorators-f989bc6b.js.map +1 -0
  277. package/dist/esm/{stencil-suggestion-manager-1f4ed8d0.js → stencil-suggestion-manager-376f83e8.js} +2 -2
  278. package/dist/esm/stencil-suggestion-manager-376f83e8.js.map +1 -0
  279. package/dist/esm/version.js +1 -1
  280. package/dist/types/components/commerce/atomic-commerce-breadbox/atomic-commerce-breadbox.d.ts +0 -2
  281. package/dist/types/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.d.ts +0 -1
  282. package/dist/types/components/commerce/atomic-commerce-search-box-recent-queries/atomic-commerce-search-box-recent-queries.d.ts +0 -2
  283. package/dist/types/components/commerce/atomic-product/atomic-product.d.ts +1 -1
  284. package/dist/types/components/commerce/product-template-component-utils/context/fetch-product-context.d.ts +12 -0
  285. package/dist/types/components/commerce/product-template-component-utils/context/interactive-product-context-controller.d.ts +27 -0
  286. package/dist/types/components/commerce/product-template-component-utils/context/product-context-controller.d.ts +33 -0
  287. package/dist/types/components/commerce/product-template-component-utils/{stencil-product-template-decorators.d.ts → context/stencil-product-template-decorators.d.ts} +1 -1
  288. package/dist/types/components/common/breadbox/breadcrumb-button.d.ts +0 -2
  289. package/dist/types/components/common/smart-snippets/atomic-smart-snippet-source.d.ts +1 -1
  290. package/dist/types/components/search/atomic-result/atomic-result.d.ts +1 -1
  291. package/dist/types/components/search/atomic-search-box/atomic-search-box.d.ts +0 -1
  292. package/dist/types/components/search/result-template-component-utils/context/fetch-result-context.d.ts +8 -0
  293. package/dist/types/components/search/result-template-component-utils/context/interactive-result-context-controller.d.ts +12 -0
  294. package/dist/types/components/search/result-template-component-utils/context/result-context-controller.d.ts +18 -0
  295. package/dist/types/components/search/{result-template-components/result-template-decorators.d.ts → result-template-component-utils/context/stencil-result-template-decorators.d.ts} +6 -2
  296. package/dist/types/directives/hierarchical-path.d.ts +1 -1
  297. package/dist/types/index.d.ts +3 -3
  298. package/docs/atomic-docs.json +1 -1
  299. package/package.json +6 -3
  300. package/dist/atomic/components/components/common/item-list/fetch-item-context.js +0 -15
  301. package/dist/atomic/components/decorators/commerce/product-template-decorators.js +0 -68
  302. package/dist/atomic/components/result-template-decorators.js.map +0 -1
  303. package/dist/atomic/p-15547bd5.entry.js.map +0 -1
  304. package/dist/atomic/p-182f9112.entry.js.map +0 -1
  305. package/dist/atomic/p-18684d4c.js.map +0 -1
  306. package/dist/atomic/p-190ddaca.entry.js.map +0 -1
  307. package/dist/atomic/p-1ff7a9da.entry.js.map +0 -1
  308. package/dist/atomic/p-2559747d.js +0 -2
  309. package/dist/atomic/p-2559747d.js.map +0 -1
  310. package/dist/atomic/p-4069d801.entry.js.map +0 -1
  311. package/dist/atomic/p-448091f7.entry.js.map +0 -1
  312. package/dist/atomic/p-4cb91ee7.entry.js.map +0 -1
  313. package/dist/atomic/p-57049cd2.entry.js.map +0 -1
  314. package/dist/atomic/p-5cab535b.entry.js.map +0 -1
  315. package/dist/atomic/p-78427c6a.entry.js.map +0 -1
  316. package/dist/atomic/p-852cc16d.entry.js.map +0 -1
  317. package/dist/atomic/p-8d5228da.entry.js.map +0 -1
  318. package/dist/atomic/p-945ddd53.entry.js.map +0 -1
  319. package/dist/atomic/p-955092ed.entry.js.map +0 -1
  320. package/dist/atomic/p-9e6462cf.entry.js.map +0 -1
  321. package/dist/atomic/p-a1798150.entry.js.map +0 -1
  322. package/dist/atomic/p-b3f6561d.entry.js.map +0 -1
  323. package/dist/atomic/p-c5164dbf.entry.js.map +0 -1
  324. package/dist/atomic/p-dea22a8d.entry.js.map +0 -1
  325. package/dist/atomic/p-df8d38ca.entry.js.map +0 -1
  326. package/dist/atomic/p-e6dc9de7.entry.js.map +0 -1
  327. package/dist/atomic/p-e9dc8e90.entry.js.map +0 -1
  328. package/dist/cjs/result-template-decorators-432d11a9.js.map +0 -1
  329. package/dist/cjs/stencil-suggestion-manager-88cb88f2.js.map +0 -1
  330. package/dist/esm/result-template-decorators-2ed76ea9.js.map +0 -1
  331. package/dist/esm/stencil-suggestion-manager-1f4ed8d0.js.map +0 -1
  332. package/dist/types/decorators/commerce/product-template-decorators.d.ts +0 -68
  333. /package/dist/atomic/{p-017aa785.entry.js.map → p-a7c39901.entry.js.map} +0 -0
  334. /package/dist/atomic/{p-567b2841.entry.js.map → p-ca1425cc.entry.js.map} +0 -0
  335. /package/dist/atomic/{p-c2a5dac0.entry.js.map → p-f2c4209d.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"file":"atomic-result-localized-text.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+Ba,yBAAyB;;;;;;QAYjB,UAAK,GAA2B,EAAE,CAAC;;;qBAAH,EAAE;;;IAMrD,MAAM;QACJ,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE;YAC1C,GAAG,IAAI,CAAC,gBAAgB,EAAE;YAC1B,GAAG,IAAI,CAAC,eAAe,EAAE;SAC1B,CAAC,CAAC;KACJ;IAEO,gBAAgB;QACtB,MAAM,GAAG,GAA4B,EAAE,CAAC;QACxC,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;YACxC,OAAO,GAAG,CAAC;SACZ;QACD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,aAAa,CAAC;YAC5D,MAAM,aAAa,GAAGA,+BAAsB,CAAC,iBAAiB,CAC5D,IAAI,CAAC,MAAM,EACX,SAAS,CACV,CAAC;YACF,IAAI,CAACC,uBAAiB,CAAC,aAAa,CAAC,EAAE;gBACrC,GAAG,CAAC,aAAa,CAAC,GAAG,aAAa,CAAC;aACpC;SACF,CAAC,CAAC;QAEH,OAAO,GAAG,CAAC;KACZ;IAEO,eAAe;QACrB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YACpB,OAAO,EAAE,CAAC;SACX;QACD,OAAO;YACL,KAAK,EACFD,+BAAsB,CAAC,iBAAiB,CACvC,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,UAAW,CACN,IAAI,CAAC;SACpB,CAAC;KACH;;AArD4B;IAA5BE,sCAAkB,EAAE;2DAA4B;AAGxB;IAAxBC,sCAAa,EAAE;yDAAyB;AAQtB;IAAVC,kBAAO,EAAE;wDAAoC;;;;","names":["ResultTemplatesHelpers","isNullOrUndefined","InitializeBindings","ResultContext","MapProp"],"sources":["src/components/search/result-template-components/atomic-result-localized-text/atomic-result-localized-text.ts"],"sourcesContent":["import {isNullOrUndefined} from '@coveo/bueno';\nimport {type Result, ResultTemplatesHelpers} from '@coveo/headless';\nimport {Component, Prop, State} from '@stencil/core';\nimport {\n type InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {MapProp} from '../../../../utils/props-utils';\nimport type {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '../result-template-decorators';\n\n/**\n * The `atomic-result-localized-text` component renders a target i18n localized string using the values of a target field.\n *\n * Given this i18n configuration:\n * ```\n * searchInterface.i18n.addResourceBundle('en', 'translation', {\n * classic_book_advert: 'Classic book from {{name}}',\n * });\n * ```\n *\n * The component could be configured in such a way to replace `{{name}}` with the `author` field value from the result item:\n * ```\n * <atomic-result-localized-text locale-key=\"classic_book_advert\" field-author=\"name\"></atomic-result-localized-text>\n * ```\n *\n * @MapProp name: field;attr: field;docs: The field from which to extract the target string and the variable used to map it to the target i18n parameter. For example, the following configuration extracts the value of `author` from a result, and assign it to the i18n parameter `name`: `field-author=\"name\"`;type: Record<string, string> ;default: {}\n */\n@Component({\n tag: 'atomic-result-localized-text',\n})\nexport class AtomicResultLocalizedText implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n @State() public error!: Error;\n\n @ResultContext() private result!: Result;\n /**\n * The i18n translation key.\n */\n @Prop() localeKey!: string;\n /**\n * The field value to dynamically evaluate.\n */\n @Prop() @MapProp() field: Record<string, string> = {};\n /**\n * The numerical field value used to determine whether to use the singular or plural value of a translation.\n * */\n @Prop() fieldCount?: string;\n\n render() {\n return this.bindings.i18n.t(this.localeKey, {\n ...this.parseFieldValues(),\n ...this.parseFieldCount(),\n });\n }\n\n private parseFieldValues() {\n const ret: Record<string, unknown> = {};\n if (Object.keys(this.field).length === 0) {\n return ret;\n }\n Object.entries(this.field).forEach(([fieldName, i18nParameter]) => {\n const fieldValueRaw = ResultTemplatesHelpers.getResultProperty(\n this.result,\n fieldName\n );\n if (!isNullOrUndefined(fieldValueRaw)) {\n ret[i18nParameter] = fieldValueRaw;\n }\n });\n\n return ret;\n }\n\n private parseFieldCount() {\n if (!this.fieldCount) {\n return {};\n }\n return {\n count:\n (ResultTemplatesHelpers.getResultProperty(\n this.result,\n this.fieldCount!\n )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AoC;;;;","names":["ResultTemplatesHelpers","isNullOrUndefined","InitializeBindings","ResultContext","MapProp"],"sources":["src/components/search/result-template-components/atomic-result-localized-text/atomic-result-localized-text.ts"],"sourcesContent":["import {isNullOrUndefined} from '@coveo/bueno';\nimport {type Result, ResultTemplatesHelpers} from '@coveo/headless';\nimport {Component, Prop, State} from '@stencil/core';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\nimport {\n type InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {MapProp} from '../../../../utils/props-utils';\nimport type {Bindings} from '../../atomic-search-interface/atomic-search-interface';\n\n/**\n * The `atomic-result-localized-text` component renders a target i18n localized string using the values of a target field.\n *\n * Given this i18n configuration:\n * ```\n * searchInterface.i18n.addResourceBundle('en', 'translation', {\n * classic_book_advert: 'Classic book from {{name}}',\n * });\n * ```\n *\n * The component could be configured in such a way to replace `{{name}}` with the `author` field value from the result item:\n * ```\n * <atomic-result-localized-text locale-key=\"classic_book_advert\" field-author=\"name\"></atomic-result-localized-text>\n * ```\n *\n * @MapProp name: field;attr: field;docs: The field from which to extract the target string and the variable used to map it to the target i18n parameter. For example, the following configuration extracts the value of `author` from a result, and assign it to the i18n parameter `name`: `field-author=\"name\"`;type: Record<string, string> ;default: {}\n */\n@Component({\n tag: 'atomic-result-localized-text',\n})\nexport class AtomicResultLocalizedText implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n @State() public error!: Error;\n\n @ResultContext() private result!: Result;\n /**\n * The i18n translation key.\n */\n @Prop() localeKey!: string;\n /**\n * The field value to dynamically evaluate.\n */\n @Prop() @MapProp() field: Record<string, string> = {};\n /**\n * The numerical field value used to determine whether to use the singular or plural value of a translation.\n * */\n @Prop() fieldCount?: string;\n\n render() {\n return this.bindings.i18n.t(this.localeKey, {\n ...this.parseFieldValues(),\n ...this.parseFieldCount(),\n });\n }\n\n private parseFieldValues() {\n const ret: Record<string, unknown> = {};\n if (Object.keys(this.field).length === 0) {\n return ret;\n }\n Object.entries(this.field).forEach(([fieldName, i18nParameter]) => {\n const fieldValueRaw = ResultTemplatesHelpers.getResultProperty(\n this.result,\n fieldName\n );\n if (!isNullOrUndefined(fieldValueRaw)) {\n ret[i18nParameter] = fieldValueRaw;\n }\n });\n\n return ret;\n }\n\n private parseFieldCount() {\n if (!this.fieldCount) {\n return {};\n }\n return {\n count:\n (ResultTemplatesHelpers.getResultProperty(\n this.result,\n this.fieldCount!\n ) as number) ?? 1,\n };\n }\n}\n"],"version":3}
@@ -7,7 +7,7 @@ const headless = require('@coveo/headless');
7
7
  const fieldUtils = require('./field-utils-a715deca.js');
8
8
  const initializationUtils = require('./initialization-utils-92f1b080.js');
9
9
  const utils = require('./utils-12b49e87.js');
10
- const resultTemplateDecorators = require('./result-template-decorators-432d11a9.js');
10
+ const stencilResultTemplateDecorators = require('./stencil-result-template-decorators-28b05aaf.js');
11
11
  require('./dom-utils-d4790328.js');
12
12
  require('./event-utils-9bfcf3c5.js');
13
13
  require('./init-queue-a18aa323.js');
@@ -132,7 +132,7 @@ __decorate([
132
132
  initializationUtils.InitializeBindings()
133
133
  ], AtomicResultMultiValueText.prototype, "bindings", void 0);
134
134
  __decorate([
135
- resultTemplateDecorators.ResultContext()
135
+ stencilResultTemplateDecorators.ResultContext()
136
136
  ], AtomicResultMultiValueText.prototype, "result", void 0);
137
137
  AtomicResultMultiValueText.style = AtomicResultMultiValueTextStyle0;
138
138
 
@@ -1 +1 @@
1
- {"file":"atomic-result-multi-value-text.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;AAAA,MAAM,6BAA6B,GAAG,gJAAgJ,CAAC;AACvL,yCAAe,6BAA6B;;;;;;;;;;;;MCyB/B,0BAA0B;;;;;;;QAqBP,uBAAkB,GAAG,CAAC,CAAC;;;;QAKvB,cAAS,GAAkB,IAAI,CAAC;QAEtD,iBAAY,GAAoB,IAAI,CAAC;;;kCAPM,CAAC;yBAKK,IAAI;;IAItD,UAAU;QACf,IAA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AAI,CAAC,MAAM,EAAE,CAAC;YACnB,OAAO;SACR;QACD,QACEA,gBAAI,IAAI,EAAC,8BAA8B,OACjC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,CACxC,EACL;KACH;;;AAjK4B;IAA5BC,sCAAkB,EAAE;4DAA4B;AACxB;IAAxBC,sCAAa,EAAE;0DAAyB;;;;;","names":["buildBreadcrumbManager","ResultTemplatesHelpers","getFieldValueCaption","titleToKebab","h","InitializeBindings","ResultContext"],"sources":["src/components/search/result-template-components/atomic-result-multi-value-text/atomic-result-multi-value-text.pcss?tag=atomic-result-multi-value-text&encapsulation=shadow","src/components/search/result-template-components/atomic-result-multi-value-text/atomic-result-multi-value-text.tsx"],"sourcesContent":[":host {\n > ul {\n display: flex;\n list-style: none;\n margin: 0;\n padding: 0;\n\n li {\n display: inline-block;\n }\n }\n}\n\n.separator {\n &::before {\n display: inline;\n content: ',\\00a0';\n }\n}\n","import {\n BreadcrumbManager,\n buildBreadcrumbManager,\n Result,\n ResultTemplatesHelpers,\n} from '@coveo/headless';\nimport {Component, Element, Prop, h, State, VNode} from '@stencil/core';\nimport {getFieldValueCaption} from '../../../../utils/field-utils';\nimport {InitializeBindings} from '../../../../utils/initialization-utils';\nimport {titleToKebab} from '../../../../utils/utils';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '../result-template-decorators';\n\n/**\n * The `atomic-result-multi-value-text` component renders the values of a multi-value string field.\n * @part result-multi-value-text-list - The list of field values.\n * @part result-multi-value-text-separator - The separator to display between each of the field values.\n * @part result-multi-value-text-value - A field value.\n * @part result-multi-value-text-value-more - A label indicating some values were omitted.\n * @slot result-multi-value-text-value-* - A custom caption value that's specified for a given part of a multi-text field value. For example, if you want to use `Off-Campus Resident` as a caption value for `Off-campus apartment` in `Off-campus apartment;On-campus apartment`, you'd use `<span slot=\"result-multi-value-text-value-off-campus-apartment\">Off-Campus Resident</span>`). The suffix of this slot corresponds with the field value, written in kebab case.\n */\n@Component({\n tag: 'atomic-result-multi-value-text',\n styleUrl: 'atomic-result-multi-value-text.pcss',\n shadow: true,\n})\nexport class AtomicResultMultiValueText {\n public breadcrumbManager!: BreadcrumbManager;\n\n @InitializeBindings() public bindings!: Bindings;\n @ResultContext() private result!: Result;\n\n @Element() host!: HTMLElement;\n\n @State() public error!: Error;\n\n /**\n * The field that the component should use.\n * The component will try to find this field in the `Result.raw` object unless it finds it in the `Result` object first.\n * Make sure this field is present in the `fieldsToInclude` property of the `atomic-search-interface` component.\n */\n @Prop({reflect: true}) public field!: string;\n\n /**\n * The maximum number of field values to display.\n * If there are _n_ more values than the specified maximum, the last displayed value will be \"_n_ more...\".\n */\n @Prop({reflect: true}) public maxValuesToDisplay = 3;\n\n /**\n * The delimiter used to separate values when the field isn't indexed as a multi value field.\n */\n @Prop({reflect: true}) public delimiter: string | null = null;\n\n private sortedValues: string[] | null = null;\n\n public initialize() {\n this.breadcrumbManager = buildBreadcrumbManager(this.bindings.engine);\n }\n\n private get resultValues() {\n const value = ResultTemplatesHelpers.getResultProperty(\n this.result,\n this.field\n );\n\n if (value === null) {\n return null;\n }\n\n if (Array.isArray(value)) {\n return value.map((v) => `${v}`.trim());\n }\n\n if (typeof value !== 'string' || value.trim() === '') {\n this.error = new Error(\n `Could not parse \"${value}\" from field \"${this.field}\" as a string array.`\n );\n return null;\n }\n\n return this.delimiter\n ? value.split(this.delimiter).map((value) => value.trim())\n : [value];\n }\n\n private get facetSelectedValues() {\n return this.breadcrumbManager.state.facetBreadcrumbs\n .filter((facet) => facet.field === this.field)\n .reduce(\n (values, facet) => [\n ...values,\n ...facet.values.map(({value}) => value.value),\n ],\n [] as string[]\n );\n }\n\n private updateSortedValues() {\n const allValues = this.resultValues;\n if (allValues === null) {\n this.sortedValues = null;\n return;\n }\n const allValuesSet = new Set(allValues);\n const firstValues = this.facetSelectedValues.filter((value) =>\n allValuesSet.has(value)\n );\n this.sortedValues = Array.from(\n allValues.reduce((set, value) => set.add(value), new Set(firstValues))\n );\n }\n\n private getShouldDisplayLabel(values: string[]) {\n return (\n this.maxValuesToDisplay > 0 && values.length > this.maxValuesToDisplay\n );\n }\n\n private getNumberOfValuesToDisplay(values: string[]) {\n return Math.min(values.length, this.maxValuesToDisplay);\n }\n\n private renderValue(value: string) {\n const label = getFieldValueCaption(this.field, value, this.bindings.i18n);\n const kebabValue = titleToKebab(value);\n return (\n <li key={value} part=\"result-multi-value-text-value\">\n <slot name={`result-multi-value-text-value-${kebabValue}`}>\n {label}\n </slot>\n </li>\n );\n }\n\n private renderSeparator(beforeValue: string, afterValue: string) {\n return (\n <li\n aria-hidden=\"true\"\n part=\"result-multi-value-text-separator\"\n key={`${beforeValue}~${afterValue}`}\n class=\"separator\"\n ></li>\n );\n }\n\n private renderMoreLabel(value: number) {\n return (\n <li key=\"more-field-values\" part=\"result-multi-value-text-value-more\">\n {this.bindings.i18n.t('n-more', {value})}\n </li>\n );\n }\n\n private renderListItems(values: string[]) {\n const numberOfValuesToDisplay = this.getNumberOfValuesToDisplay(values);\n\n const nodes: VNode[] = [];\n for (let i = 0; i < numberOfValuesToDisplay; i++) {\n if (i > 0) {\n nodes.push(this.renderSeparator(values[i - 1], values[i]));\n }\n nodes.push(this.renderValue(values[i]));\n }\n if (this.getShouldDisplayLabel(values)) {\n nodes.push(\n this.renderSeparator(\n values[numberOfValuesToDisplay - 1],\n 'more-field-values'\n )\n );\n nodes.push(this.renderMoreLabel(values.length - numberOfValuesToDisplay));\n }\n return nodes;\n }\n\n public componentWillRender() {\n this.updateSortedValues();\n }\n\n public render() {\n if (this.sortedValues === null) {\n this.host.remove();\n return;\n }\n return (\n <ul part=\"result-multi-value-text-list\">\n {...this.renderListItems(this.sortedValues)}\n </ul>\n );\n }\n}\n"],"version":3}
1
+ {"file":"atomic-result-multi-value-text.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;AAAA,MAAM,6BAA6B,GAAG,gJAAgJ,CAAC;AACvL,yCAAe,6BAA6B;;;;;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CAAC,CAAC;SAC3E;QACD,OAAO,KAAK,CAAC;KACd;IAEM,mBAAmB;QACxB,IAAI,CAAC,kBAAkB,EAAE,CAAC;KAC3B;IAEM,MAAM;QACX,IAAI,IAAI,CAAC,YAAY,KAAK,IAAI,EAAE;YAC9B,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACnB,OAAO;SACR;QACD,QACEA,gBAAI,IAAI,EAAC,8BAA8B,OACjC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,CACxC,EACL;KACH;;;AAjK4B;IAA5BC,sCAAkB,EAAE;4DAA4B;AACxB;IAAxBC,6CAAa,EAAE;0DAAyB;;;;;","names":["buildBreadcrumbManager","ResultTemplatesHelpers","getFieldValueCaption","titleToKebab","h","InitializeBindings","ResultContext"],"sources":["src/components/search/result-template-components/atomic-result-multi-value-text/atomic-result-multi-value-text.pcss?tag=atomic-result-multi-value-text&encapsulation=shadow","src/components/search/result-template-components/atomic-result-multi-value-text/atomic-result-multi-value-text.tsx"],"sourcesContent":[":host {\n > ul {\n display: flex;\n list-style: none;\n margin: 0;\n padding: 0;\n\n li {\n display: inline-block;\n }\n }\n}\n\n.separator {\n &::before {\n display: inline;\n content: ',\\00a0';\n }\n}\n","import {\n BreadcrumbManager,\n buildBreadcrumbManager,\n Result,\n ResultTemplatesHelpers,\n} from '@coveo/headless';\nimport {Component, Element, Prop, h, State, VNode} from '@stencil/core';\nimport {getFieldValueCaption} from '../../../../utils/field-utils';\nimport {InitializeBindings} from '../../../../utils/initialization-utils';\nimport {titleToKebab} from '../../../../utils/utils';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\n\n/**\n * The `atomic-result-multi-value-text` component renders the values of a multi-value string field.\n * @part result-multi-value-text-list - The list of field values.\n * @part result-multi-value-text-separator - The separator to display between each of the field values.\n * @part result-multi-value-text-value - A field value.\n * @part result-multi-value-text-value-more - A label indicating some values were omitted.\n * @slot result-multi-value-text-value-* - A custom caption value that's specified for a given part of a multi-text field value. For example, if you want to use `Off-Campus Resident` as a caption value for `Off-campus apartment` in `Off-campus apartment;On-campus apartment`, you'd use `<span slot=\"result-multi-value-text-value-off-campus-apartment\">Off-Campus Resident</span>`). The suffix of this slot corresponds with the field value, written in kebab case.\n */\n@Component({\n tag: 'atomic-result-multi-value-text',\n styleUrl: 'atomic-result-multi-value-text.pcss',\n shadow: true,\n})\nexport class AtomicResultMultiValueText {\n public breadcrumbManager!: BreadcrumbManager;\n\n @InitializeBindings() public bindings!: Bindings;\n @ResultContext() private result!: Result;\n\n @Element() host!: HTMLElement;\n\n @State() public error!: Error;\n\n /**\n * The field that the component should use.\n * The component will try to find this field in the `Result.raw` object unless it finds it in the `Result` object first.\n * Make sure this field is present in the `fieldsToInclude` property of the `atomic-search-interface` component.\n */\n @Prop({reflect: true}) public field!: string;\n\n /**\n * The maximum number of field values to display.\n * If there are _n_ more values than the specified maximum, the last displayed value will be \"_n_ more...\".\n */\n @Prop({reflect: true}) public maxValuesToDisplay = 3;\n\n /**\n * The delimiter used to separate values when the field isn't indexed as a multi value field.\n */\n @Prop({reflect: true}) public delimiter: string | null = null;\n\n private sortedValues: string[] | null = null;\n\n public initialize() {\n this.breadcrumbManager = buildBreadcrumbManager(this.bindings.engine);\n }\n\n private get resultValues() {\n const value = ResultTemplatesHelpers.getResultProperty(\n this.result,\n this.field\n );\n\n if (value === null) {\n return null;\n }\n\n if (Array.isArray(value)) {\n return value.map((v) => `${v}`.trim());\n }\n\n if (typeof value !== 'string' || value.trim() === '') {\n this.error = new Error(\n `Could not parse \"${value}\" from field \"${this.field}\" as a string array.`\n );\n return null;\n }\n\n return this.delimiter\n ? value.split(this.delimiter).map((value) => value.trim())\n : [value];\n }\n\n private get facetSelectedValues() {\n return this.breadcrumbManager.state.facetBreadcrumbs\n .filter((facet) => facet.field === this.field)\n .reduce(\n (values, facet) => [\n ...values,\n ...facet.values.map(({value}) => value.value),\n ],\n [] as string[]\n );\n }\n\n private updateSortedValues() {\n const allValues = this.resultValues;\n if (allValues === null) {\n this.sortedValues = null;\n return;\n }\n const allValuesSet = new Set(allValues);\n const firstValues = this.facetSelectedValues.filter((value) =>\n allValuesSet.has(value)\n );\n this.sortedValues = Array.from(\n allValues.reduce((set, value) => set.add(value), new Set(firstValues))\n );\n }\n\n private getShouldDisplayLabel(values: string[]) {\n return (\n this.maxValuesToDisplay > 0 && values.length > this.maxValuesToDisplay\n );\n }\n\n private getNumberOfValuesToDisplay(values: string[]) {\n return Math.min(values.length, this.maxValuesToDisplay);\n }\n\n private renderValue(value: string) {\n const label = getFieldValueCaption(this.field, value, this.bindings.i18n);\n const kebabValue = titleToKebab(value);\n return (\n <li key={value} part=\"result-multi-value-text-value\">\n <slot name={`result-multi-value-text-value-${kebabValue}`}>\n {label}\n </slot>\n </li>\n );\n }\n\n private renderSeparator(beforeValue: string, afterValue: string) {\n return (\n <li\n aria-hidden=\"true\"\n part=\"result-multi-value-text-separator\"\n key={`${beforeValue}~${afterValue}`}\n class=\"separator\"\n ></li>\n );\n }\n\n private renderMoreLabel(value: number) {\n return (\n <li key=\"more-field-values\" part=\"result-multi-value-text-value-more\">\n {this.bindings.i18n.t('n-more', {value})}\n </li>\n );\n }\n\n private renderListItems(values: string[]) {\n const numberOfValuesToDisplay = this.getNumberOfValuesToDisplay(values);\n\n const nodes: VNode[] = [];\n for (let i = 0; i < numberOfValuesToDisplay; i++) {\n if (i > 0) {\n nodes.push(this.renderSeparator(values[i - 1], values[i]));\n }\n nodes.push(this.renderValue(values[i]));\n }\n if (this.getShouldDisplayLabel(values)) {\n nodes.push(\n this.renderSeparator(\n values[numberOfValuesToDisplay - 1],\n 'more-field-values'\n )\n );\n nodes.push(this.renderMoreLabel(values.length - numberOfValuesToDisplay));\n }\n return nodes;\n }\n\n public componentWillRender() {\n this.updateSortedValues();\n }\n\n public render() {\n if (this.sortedValues === null) {\n this.host.remove();\n return;\n }\n return (\n <ul part=\"result-multi-value-text-list\">\n {...this.renderListItems(this.sortedValues)}\n </ul>\n );\n }\n}\n"],"version":3}
@@ -6,7 +6,7 @@ const index = require('./index-757bc886.js');
6
6
  const headless = require('@coveo/headless');
7
7
  const initializationUtils = require('./initialization-utils-92f1b080.js');
8
8
  const formatCommon = require('./format-common-4aa8aa88.js');
9
- const resultTemplateDecorators = require('./result-template-decorators-432d11a9.js');
9
+ const stencilResultTemplateDecorators = require('./stencil-result-template-decorators-28b05aaf.js');
10
10
  require('./dom-utils-d4790328.js');
11
11
  require('./event-utils-9bfcf3c5.js');
12
12
  require('./init-queue-a18aa323.js');
@@ -81,7 +81,7 @@ __decorate([
81
81
  initializationUtils.InitializeBindings()
82
82
  ], AtomicResultNumber.prototype, "bindings", void 0);
83
83
  __decorate([
84
- resultTemplateDecorators.ResultContext()
84
+ stencilResultTemplateDecorators.ResultContext()
85
85
  ], AtomicResultNumber.prototype, "result", void 0);
86
86
 
87
87
  exports.atomic_result_number = AtomicResultNumber;
@@ -1 +1 @@
1
- {"file":"atomic-result-number.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;MAmBa,kBAAkB;;;QAepB,cAAS,GAAoBA,mCAAsB,CAAC;QAEpD,mBAAc,GAAkB,IAAI,CAAC;;;yBAFRA,mCAAsB;8BAEnB,IAAI;;IAGtC,SAAS,CAAC,KAAmC;QAClD,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC;KAC/B;IAEO,UAAU;QAChB,MAAM,KAAK,GAAGC,+BAAsB,CAAC,iBAAiB,CACpD,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,KAAK,CACX,CAAC;QACF,IAAI,KAAK,KAAK,IAAI,EAAE;YAClB,OAAO,IAAI,CAAC;SACb;QACD,MAAM,aAAa,GAAG,UAAU,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC;QAC7C,IAAI,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE;YAC/B,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,CACpB,oBAAoB,KAAK,iBAAiB,IAAI,CAAC,KAAK,gBAAgB,CACrE,CAAC;YACF,OAAO,IAAI,CAAC;SACb;QACD,OAAO,aAAa,CAAC;KACtB;IAEO,WAAW,CAAC,KAAa;QAC/B,IAAI;YACF,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAqB,CAAC,CAAC;SACxE;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,KAAK,GAAG,KAAc,CAAC;YAC5B,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;SACzB;KACF;IAEO,oBAAoB;QAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAChC,IAAI,KAAK,KAAK,IAAI,EAAE;YAClB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;SAC/C;KACF;IAED,mBAAmB;QACjB,IAAI,CAAC,oBAAoB,EAAE,CAAC;KAC7B;IAEM,MAAM;QACX,IAAI,IAAI,CAAC,cAAc,KAAK,IAAI,EAAE;YAChC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACnB,OAAO;SACR;QACD,OAAO,IAAI,CAAC,cAAc,CAAC;KAC5B;;;AArE4B;IAA5BC,sCAAkB,EAAE;oDAA4B;AACxB;IAAxBC,sCAAa,EAAE;kDAAyB;;;;","names":["defaultNumberFormatter","ResultTemplatesHelpers","InitializeBindings","ResultContext"],"sources":["src/components/search/result-template-components/atomic-result-number/atomic-result-number.tsx"],"sourcesContent":["import {Result, ResultTemplatesHelpers} from '@coveo/headless';\nimport {Component, Prop, Element, State, Listen} from '@stencil/core';\nimport {InitializeBindings} from '../../../../utils/initialization-utils';\nimport {\n defaultNumberFormatter,\n NumberFormatter,\n} from '../../../common/formats/format-common';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '../result-template-decorators';\n\n/**\n * The `atomic-result-number` component renders the value of a number result field.\n *\n * @slot default - The number can be formatted by adding a `atomic-format-number`, `atomic-format-currency` or `atomic-format-unit` component into this component.\n */\n@Component({\n tag: 'atomic-result-number',\n shadow: false,\n})\nexport class AtomicResultNumber {\n @InitializeBindings() public bindings!: Bindings;\n @ResultContext() private result!: Result;\n\n @Element() host!: HTMLElement;\n\n @State() public error!: Error;\n\n /**\n * The field that the component should use.\n * The component will try to find this field in the `Result.raw` object unless it finds it in the `Result` object first.\n * Make sure this field is present in the `fieldsToInclude` property of the `atomic-search-interface` component.\n */\n @Prop({reflect: true}) field!: string;\n\n @State() formatter: NumberFormatter = defaultNumberFormatter;\n\n @State() valueToDisplay: string | null = null;\n\n @Listen('atomic/numberFormat')\n public setFormat(event: CustomEvent<NumberFormatter>) {\n event.preventDefault();\n event.stopPropagation();\n this.formatter = event.detail;\n }\n\n private parseValue() {\n const value = ResultTemplatesHelpers.getResultProperty(\n this.result,\n this.field\n );\n if (value === null) {\n return null;\n }\n const valueAsNumber = parseFloat(`${value}`);\n if (Number.isNaN(valueAsNumber)) {\n this.error = new Error(\n `Could not parse \"${value}\" from field \"${this.field}\" as a number.`\n );\n return null;\n }\n return valueAsNumber;\n }\n\n private formatValue(value: number) {\n try {\n return this.formatter(value, this.bindings.i18n.languages as string[]);\n } catch (error) {\n this.error = error as Error;\n return value.toString();\n }\n }\n\n private updateValueToDisplay() {\n const value = this.parseValue();\n if (value !== null) {\n this.valueToDisplay = this.formatValue(value);\n }\n }\n\n componentWillRender() {\n this.updateValueToDisplay();\n }\n\n public render() {\n if (this.valueToDisplay === null) {\n this.host.remove();\n return;\n }\n return this.valueToDisplay;\n }\n}\n"],"version":3}
1
+ {"file":"atomic-result-number.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;MAmBa,kBAAkB;;;QA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,CAAC;KAC7B;IAEM,MAAM;QACX,IAAI,IAAI,CAAC,cAAc,KAAK,IAAI,EAAE;YAChC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACnB,OAAO;SACR;QACD,OAAO,IAAI,CAAC,cAAc,CAAC;KAC5B;;;AArE4B;IAA5BC,sCAAkB,EAAE;oDAA4B;AACxB;IAAxBC,6CAAa,EAAE;kDAAyB;;;;","names":["defaultNumberFormatter","ResultTemplatesHelpers","InitializeBindings","ResultContext"],"sources":["src/components/search/result-template-components/atomic-result-number/atomic-result-number.tsx"],"sourcesContent":["import {Result, ResultTemplatesHelpers} from '@coveo/headless';\nimport {Component, Prop, Element, State, Listen} from '@stencil/core';\nimport {InitializeBindings} from '../../../../utils/initialization-utils';\nimport {\n defaultNumberFormatter,\n NumberFormatter,\n} from '../../../common/formats/format-common';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\n\n/**\n * The `atomic-result-number` component renders the value of a number result field.\n *\n * @slot default - The number can be formatted by adding a `atomic-format-number`, `atomic-format-currency` or `atomic-format-unit` component into this component.\n */\n@Component({\n tag: 'atomic-result-number',\n shadow: false,\n})\nexport class AtomicResultNumber {\n @InitializeBindings() public bindings!: Bindings;\n @ResultContext() private result!: Result;\n\n @Element() host!: HTMLElement;\n\n @State() public error!: Error;\n\n /**\n * The field that the component should use.\n * The component will try to find this field in the `Result.raw` object unless it finds it in the `Result` object first.\n * Make sure this field is present in the `fieldsToInclude` property of the `atomic-search-interface` component.\n */\n @Prop({reflect: true}) field!: string;\n\n @State() formatter: NumberFormatter = defaultNumberFormatter;\n\n @State() valueToDisplay: string | null = null;\n\n @Listen('atomic/numberFormat')\n public setFormat(event: CustomEvent<NumberFormatter>) {\n event.preventDefault();\n event.stopPropagation();\n this.formatter = event.detail;\n }\n\n private parseValue() {\n const value = ResultTemplatesHelpers.getResultProperty(\n this.result,\n this.field\n );\n if (value === null) {\n return null;\n }\n const valueAsNumber = parseFloat(`${value}`);\n if (Number.isNaN(valueAsNumber)) {\n this.error = new Error(\n `Could not parse \"${value}\" from field \"${this.field}\" as a number.`\n );\n return null;\n }\n return valueAsNumber;\n }\n\n private formatValue(value: number) {\n try {\n return this.formatter(value, this.bindings.i18n.languages as string[]);\n } catch (error) {\n this.error = error as Error;\n return value.toString();\n }\n }\n\n private updateValueToDisplay() {\n const value = this.parseValue();\n if (value !== null) {\n this.valueToDisplay = this.formatValue(value);\n }\n }\n\n componentWillRender() {\n this.updateValueToDisplay();\n }\n\n public render() {\n if (this.valueToDisplay === null) {\n this.host.remove();\n return;\n }\n return this.valueToDisplay;\n }\n}\n"],"version":3}
@@ -11,7 +11,7 @@ const stencilAccessibilityUtils = require('./stencil-accessibility-utils-86cc707
11
11
  const utils = require('./utils-12b49e87.js');
12
12
  const attributesSlot = require('./attributes-slot-4e7d7a75.js');
13
13
  const stencilItemLink = require('./stencil-item-link-9feaef61.js');
14
- const resultTemplateDecorators = require('./result-template-decorators-432d11a9.js');
14
+ const stencilResultTemplateDecorators = require('./stencil-result-template-decorators-28b05aaf.js');
15
15
  require('./dom-utils-d4790328.js');
16
16
  require('./event-utils-9bfcf3c5.js');
17
17
  require('./init-queue-a18aa323.js');
@@ -124,7 +124,7 @@ __decorate([
124
124
  initializationUtils.InitializeBindings()
125
125
  ], AtomicResultPrintableUri.prototype, "bindings", void 0);
126
126
  __decorate([
127
- resultTemplateDecorators.ResultContext()
127
+ stencilResultTemplateDecorators.ResultContext()
128
128
  ], AtomicResultPrintableUri.prototype, "result", void 0);
129
129
  AtomicResultPrintableUri.style = AtomicResultPrintableUriStyle0;
130
130
 
@@ -1 +1 @@
1
- {"file":"atomic-result-printable-uri.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,2BAA2B,GAAG,w/lEAAw/lE,CAAC;AAC7hmE,uCAAe,2BAA2B;;;;;;;;;;;;MC0B7B,wBAAwB;;;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ow","LinkWithItemAnalytics","InitializeBindings","ResultContext"],"sources":["src/components/search/result-template-components/atomic-result-printable-uri/atomic-result-printable-uri.pcss?tag=atomic-result-printable-uri","src/components/search/result-template-components/atomic-result-printable-uri/atomic-result-printable-uri.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n\natomic-result-printable-uri {\n max-width: 100%;\n word-break: break-word;\n\n a,\n button {\n @apply text-primary;\n\n &:hover,\n &:focus-visible {\n text-decoration: underline;\n @apply text-primary;\n }\n\n &:focus {\n outline: none;\n }\n\n &:visited {\n @apply text-visited;\n }\n }\n\n ul {\n display: flex;\n flex-wrap: wrap;\n }\n\n li {\n display: inline-flex;\n align-items: center;\n max-width: 100%;\n\n a {\n display: inline-block;\n vertical-align: middle;\n max-width: 100%;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n\n white-space: nowrap;\n &:last-child {\n white-space: normal;\n\n &::after {\n content: none;\n }\n }\n\n .result-printable-uri-separator {\n display: inline-block;\n margin: 0 0.5rem;\n vertical-align: middle;\n width: 0.75rem;\n height: 0.75rem;\n @apply text-neutral-dark;\n }\n }\n}\n","import {Schema, NumberValue} from '@coveo/bueno';\nimport {\n buildInteractiveResult,\n InteractiveResult,\n Result,\n} from '@coveo/headless';\nimport {Component, Element, h, Prop, State, VNode} from '@stencil/core';\nimport Arrow from '../../../../images/arrow-right.svg';\nimport {InitializeBindings} from '../../../../utils/initialization-utils';\nimport {FocusTargetController} from '../../../../utils/stencil-accessibility-utils';\nimport {parseXML} from '../../../../utils/utils';\nimport {getAttributesFromLinkSlot} from '../../../common/item-link/attributes-slot';\nimport {LinkWithItemAnalytics} from '../../../common/item-link/stencil-item-link';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '../result-template-decorators';\n\n/**\n * The `atomic-result-printable-uri` component displays the URI, or path, to access a result.\n *\n * @slot attributes - Lets you pass [attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attributes) down to anchor elements, overriding other attributes.\n * To be used exclusively in anchor elements, such as: `<a slot=\"attributes\" target=\"_blank\" download></a>`.\n */\n@Component({\n tag: 'atomic-result-printable-uri',\n styleUrl: 'atomic-result-printable-uri.pcss',\n shadow: false,\n})\nexport class AtomicResultPrintableUri {\n @InitializeBindings() public bindings!: Bindings;\n @ResultContext() private result!: Result;\n @Element() public host!: HTMLElement;\n\n @State() listExpanded = false;\n @State() error!: Error;\n\n /**\n * The maximum number of Uri parts to display. This has to be over the minimum of `3` in order to be effective. Putting `Infinity` will disable the ellipsis.\n */\n @Prop({reflect: true}) maxNumberOfParts = 5;\n\n private expandedPartFocus?: FocusTargetController;\n\n private interactiveResult!: InteractiveResult;\n private linkAttributes?: Attr[];\n\n private get focusTarget() {\n if (!this.expandedPartFocus) {\n this.expandedPartFocus = new FocusTargetController(this);\n }\n return this.expandedPartFocus;\n }\n\n public connectedCallback() {\n try {\n new Schema({\n maxNumberOfParts: new NumberValue({min: 3}),\n }).validate({maxNumberOfParts: this.maxNumberOfParts});\n } catch (error) {\n this.error = error as Error;\n }\n const slotName = 'attributes';\n this.linkAttributes = getAttributesFromLinkSlot(this.host, slotName);\n }\n\n public initialize() {\n this.interactiveResult = buildInteractiveResult(this.bindings.engine, {\n options: {result: this.result},\n });\n }\n\n private getIndexOfEllipsis(parentsCount: number) {\n const valuesToHide = Math.max(2, parentsCount - this.maxNumberOfParts);\n const valuesToShowBeforeEllipsis = parentsCount - valuesToHide - 1;\n return valuesToShowBeforeEllipsis;\n }\n\n private renderEllipsis() {\n return (\n <li>\n <button\n aria-label={this.bindings.i18n.t('collapsed-uri-parts')}\n onClick={(e) => {\n e.stopPropagation();\n this.focusTarget.focusOnNextTarget();\n this.listExpanded = true;\n }}\n >\n ...\n </button>\n {this.renderSeparator()}\n </li>\n );\n }\n\n private get allParents() {\n const parentsXml = parseXML(`${this.result.raw.parents}`);\n const parents = Array.from(parentsXml.getElementsByTagName('parent'));\n const ellipsisIndex = this.getIndexOfEllipsis(parents.length);\n return parents.map((parent, i) => {\n const name = parent.getAttribute('name');\n const uri = parent.getAttribute('uri')!;\n return (\n <li>\n {this.renderLink(name, uri, i === ellipsisIndex)}\n {i === parents.length - 1 ? null : this.renderSeparator()}\n </li>\n );\n });\n }\n\n private renderSeparator() {\n return (\n <atomic-icon\n class=\"result-printable-uri-separator\"\n icon={Arrow}\n role=\"separator\"\n ></atomic-icon>\n );\n }\n\n private renderParents() {\n const parents = this.allParents;\n if (this.listExpanded || parents.length <= this.maxNumberOfParts) {\n return parents;\n }\n\n return [\n parents.slice(0, this.getIndexOfEllipsis(parents.length)),\n this.renderEllipsis(),\n parents.slice(-1),\n ];\n }\n\n private renderLink(\n content: VNode | string | null,\n uri: string,\n shouldSetTarget: boolean\n ) {\n return (\n <LinkWithItemAnalytics\n href={uri}\n title={typeof content === 'string' ? content : undefined}\n onSelect={() => this.interactiveResult.select()}\n onBeginDelayedSelect={() => this.interactiveResult.beginDelayedSelect()}\n onCancelPendingSelect={() =>\n this.interactiveResult.cancelPendingSelect()\n }\n attributes={this.linkAttributes}\n ref={\n shouldSetTarget\n ? (el?: HTMLAnchorElement) => this.focusTarget.setTarget(el)\n : undefined\n }\n >\n {content}\n </LinkWithItemAnalytics>\n );\n }\n\n public render() {\n const parents = this.renderParents();\n if (parents.length) {\n return (\n <ul aria-label={this.bindings.i18n.t('printable-uri')}>{parents}</ul>\n );\n }\n\n return this.renderLink(\n <atomic-result-text field=\"printableUri\"></atomic-result-text>,\n this.result.clickUri,\n false\n );\n }\n}\n"],"version":3}
1
+ {"file":"atomic-result-printable-uri.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,2BAA2B,GAAG,w/lEAAw/lE,CAAC;AAC7hmE,uCAAe,2BAA2B;;;;;;;;;;;;MC0B7B,wBAAwB;;;QAK1B,iBAAY,GAAG,KAAK,CAAC;;;;QAMP,qBAAgB,GAAG,CAAC,CAAC;4BANpB,KAAK;;gCAMa,CAAC;;IAO3C,IAAY,WAAW;QACr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AE;YACrB,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAClB,CAAC;KACH;IAEO,UAAU,CAChB,OAA8B,EAC9B,GAAW,EACX,eAAwB;QAExB,QACEF,QAACG,qCAAqB,IACpB,IAAI,EAAE,GAAG,EACT,KAAK,EAAE,OAAO,OAAO,KAAK,QAAQ,GAAG,OAAO,GAAG,SAAS,EACxD,QAAQ,EAAE,MAAM,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,EAC/C,oBAAoB,EAAE,MAAM,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,EAAE,EACvE,qBAAqB,EAAE,MACrB,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,EAAE,EAE9C,UAAU,EAAE,IAAI,CAAC,cAAc,EAC/B,GAAG,EACD,eAAe;kBACX,CAAC,EAAsB,KAAK,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC;kBAC1D,SAAS,IAGd,OAAO,CACc,EACxB;KACH;IAEM,MAAM;QACX,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;QACrC,IAAI,OAAO,CAAC,MAAM,EAAE;YAClB,QACEH,8BAAgB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,IAAG,OAAO,CAAM,EACrE;SACH;QAED,OAAO,IAAI,CAAC,UAAU,CACpBA,gCAAoB,KAAK,EAAC,cAAc,GAAsB,EAC9D,IAAI,CAAC,MAAM,CAAC,QAAQ,EACpB,KAAK,CACN,CAAC;KACH;;;AAhJ4B;IAA5BI,sCAAkB,EAAE;0DAA4B;AACxB;IAAxBC,6CAAa,EAAE;wDAAyB;;;;;","names":["FocusTargetController","Schema","NumberValue","getAttributesFromLinkSlot","buildInteractiveResult","h","parseXML","Arrow","LinkWithItemAnalytics","InitializeBindings","ResultContext"],"sources":["src/components/search/result-template-components/atomic-result-printable-uri/atomic-result-printable-uri.pcss?tag=atomic-result-printable-uri","src/components/search/result-template-components/atomic-result-printable-uri/atomic-result-printable-uri.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n\natomic-result-printable-uri {\n max-width: 100%;\n word-break: break-word;\n\n a,\n button {\n @apply text-primary;\n\n &:hover,\n &:focus-visible {\n text-decoration: underline;\n @apply text-primary;\n }\n\n &:focus {\n outline: none;\n }\n\n &:visited {\n @apply text-visited;\n }\n }\n\n ul {\n display: flex;\n flex-wrap: wrap;\n }\n\n li {\n display: inline-flex;\n align-items: center;\n max-width: 100%;\n\n a {\n display: inline-block;\n vertical-align: middle;\n max-width: 100%;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n\n white-space: nowrap;\n &:last-child {\n white-space: normal;\n\n &::after {\n content: none;\n }\n }\n\n .result-printable-uri-separator {\n display: inline-block;\n margin: 0 0.5rem;\n vertical-align: middle;\n width: 0.75rem;\n height: 0.75rem;\n @apply text-neutral-dark;\n }\n }\n}\n","import {Schema, NumberValue} from '@coveo/bueno';\nimport {\n buildInteractiveResult,\n InteractiveResult,\n Result,\n} from '@coveo/headless';\nimport {Component, Element, h, Prop, State, VNode} from '@stencil/core';\nimport Arrow from '../../../../images/arrow-right.svg';\nimport {InitializeBindings} from '../../../../utils/initialization-utils';\nimport {FocusTargetController} from '../../../../utils/stencil-accessibility-utils';\nimport {parseXML} from '../../../../utils/utils';\nimport {getAttributesFromLinkSlot} from '../../../common/item-link/attributes-slot';\nimport {LinkWithItemAnalytics} from '../../../common/item-link/stencil-item-link';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\n\n/**\n * The `atomic-result-printable-uri` component displays the URI, or path, to access a result.\n *\n * @slot attributes - Lets you pass [attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attributes) down to anchor elements, overriding other attributes.\n * To be used exclusively in anchor elements, such as: `<a slot=\"attributes\" target=\"_blank\" download></a>`.\n */\n@Component({\n tag: 'atomic-result-printable-uri',\n styleUrl: 'atomic-result-printable-uri.pcss',\n shadow: false,\n})\nexport class AtomicResultPrintableUri {\n @InitializeBindings() public bindings!: Bindings;\n @ResultContext() private result!: Result;\n @Element() public host!: HTMLElement;\n\n @State() listExpanded = false;\n @State() error!: Error;\n\n /**\n * The maximum number of Uri parts to display. This has to be over the minimum of `3` in order to be effective. Putting `Infinity` will disable the ellipsis.\n */\n @Prop({reflect: true}) maxNumberOfParts = 5;\n\n private expandedPartFocus?: FocusTargetController;\n\n private interactiveResult!: InteractiveResult;\n private linkAttributes?: Attr[];\n\n private get focusTarget() {\n if (!this.expandedPartFocus) {\n this.expandedPartFocus = new FocusTargetController(this);\n }\n return this.expandedPartFocus;\n }\n\n public connectedCallback() {\n try {\n new Schema({\n maxNumberOfParts: new NumberValue({min: 3}),\n }).validate({maxNumberOfParts: this.maxNumberOfParts});\n } catch (error) {\n this.error = error as Error;\n }\n const slotName = 'attributes';\n this.linkAttributes = getAttributesFromLinkSlot(this.host, slotName);\n }\n\n public initialize() {\n this.interactiveResult = buildInteractiveResult(this.bindings.engine, {\n options: {result: this.result},\n });\n }\n\n private getIndexOfEllipsis(parentsCount: number) {\n const valuesToHide = Math.max(2, parentsCount - this.maxNumberOfParts);\n const valuesToShowBeforeEllipsis = parentsCount - valuesToHide - 1;\n return valuesToShowBeforeEllipsis;\n }\n\n private renderEllipsis() {\n return (\n <li>\n <button\n aria-label={this.bindings.i18n.t('collapsed-uri-parts')}\n onClick={(e) => {\n e.stopPropagation();\n this.focusTarget.focusOnNextTarget();\n this.listExpanded = true;\n }}\n >\n ...\n </button>\n {this.renderSeparator()}\n </li>\n );\n }\n\n private get allParents() {\n const parentsXml = parseXML(`${this.result.raw.parents}`);\n const parents = Array.from(parentsXml.getElementsByTagName('parent'));\n const ellipsisIndex = this.getIndexOfEllipsis(parents.length);\n return parents.map((parent, i) => {\n const name = parent.getAttribute('name');\n const uri = parent.getAttribute('uri')!;\n return (\n <li>\n {this.renderLink(name, uri, i === ellipsisIndex)}\n {i === parents.length - 1 ? null : this.renderSeparator()}\n </li>\n );\n });\n }\n\n private renderSeparator() {\n return (\n <atomic-icon\n class=\"result-printable-uri-separator\"\n icon={Arrow}\n role=\"separator\"\n ></atomic-icon>\n );\n }\n\n private renderParents() {\n const parents = this.allParents;\n if (this.listExpanded || parents.length <= this.maxNumberOfParts) {\n return parents;\n }\n\n return [\n parents.slice(0, this.getIndexOfEllipsis(parents.length)),\n this.renderEllipsis(),\n parents.slice(-1),\n ];\n }\n\n private renderLink(\n content: VNode | string | null,\n uri: string,\n shouldSetTarget: boolean\n ) {\n return (\n <LinkWithItemAnalytics\n href={uri}\n title={typeof content === 'string' ? content : undefined}\n onSelect={() => this.interactiveResult.select()}\n onBeginDelayedSelect={() => this.interactiveResult.beginDelayedSelect()}\n onCancelPendingSelect={() =>\n this.interactiveResult.cancelPendingSelect()\n }\n attributes={this.linkAttributes}\n ref={\n shouldSetTarget\n ? (el?: HTMLAnchorElement) => this.focusTarget.setTarget(el)\n : undefined\n }\n >\n {content}\n </LinkWithItemAnalytics>\n );\n }\n\n public render() {\n const parents = this.renderParents();\n if (parents.length) {\n return (\n <ul aria-label={this.bindings.i18n.t('printable-uri')}>{parents}</ul>\n );\n }\n\n return this.renderLink(\n <atomic-result-text field=\"printableUri\"></atomic-result-text>,\n this.result.clickUri,\n false\n );\n }\n}\n"],"version":3}
@@ -6,7 +6,7 @@ const index = require('./index-757bc886.js');
6
6
  const headless = require('@coveo/headless');
7
7
  const stencilRating = require('./stencil-rating-a40e50dd.js');
8
8
  const initializationUtils = require('./initialization-utils-92f1b080.js');
9
- const resultTemplateDecorators = require('./result-template-decorators-432d11a9.js');
9
+ const stencilResultTemplateDecorators = require('./stencil-result-template-decorators-28b05aaf.js');
10
10
  require('./dom-utils-d4790328.js');
11
11
  require('./event-utils-9bfcf3c5.js');
12
12
  require('./init-queue-a18aa323.js');
@@ -80,7 +80,7 @@ __decorate([
80
80
  initializationUtils.InitializeBindings()
81
81
  ], AtomicResultRating.prototype, "bindings", void 0);
82
82
  __decorate([
83
- resultTemplateDecorators.ResultContext()
83
+ stencilResultTemplateDecorators.ResultContext()
84
84
  ], AtomicResultRating.prototype, "result", void 0);
85
85
  AtomicResultRating.style = AtomicResultRatingStyle0;
86
86
 
@@ -1 +1 @@
1
- {"file":"atomic-result-rating.entry.cjs.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,qBAAqB,GAAG,03jEAA03jE,CAAC;AACz5jE,iCAAe,qBAAqB;;;;;;;;;;;;MCwBvB,kBAAkB;;;;;;QAaC,oBAAe,GAAG,CAAC,CAAC;;;;;;;;;;;;;;QAepB,SAAI,GAAGA,kBAAI,CAAC;QAIjC,kBAAa,GAAkB,IAAI,CAAC;;+BAnBG,CAAC;oBAeZA,kBAAI;;6BAID,IAAI;;IAEpC,mBAAmB;QACzB,MAAM,KAAK,GAAGC,+BAAsB,CAAC,iBAAiB,CACpD,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,KAAK,CACX,CAAC;QACF,IAAI;YACF,IAAI,CAAC,aAAa,GAAGC,kCAAoB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;SAC9D;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,KAAK,GAAG,KAAK,YAAY,KAAK,GAAG,KAAK,GAAG,IAAI,KAAK,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC;YACpE,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;SAC3B;KACF;IAED,mBAAmB;QACjB,IAAI,CAAC,mBAAmB,EAAE,CAAC;KAC5B;IAED,MAAM;QACJ,IAAI,IAAI,CAAC,aAAa,KAAK,IAAI,EAAE;YAC/B,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACnB,OAAO;SACR;QACD,QACEC,QAACC,oBAAM,IACL,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,EACxB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,kBAAkB,EAAE,IAAI,CAAC,eAAe,EACxC,mBAAmB,EAAE,IAAI,CAAC,aAAa,EACvC,QAAQ,EAAE,KAAK,GACP,EACV;KACH;;;AAhE4B;IAA5BC,sCAAkB,EAAE;oDAA4B;AACxB;IAAxBC,sCAAa,EAAE;kDAAyB;;;;;","names":["Star","ResultTemplatesHelpers","computeNumberOfStars","h","Rating","InitializeBindings","ResultContext"],"sources":["src/components/search/result-template-components/atomic-result-rating/atomic-result-rating.pcss?tag=atomic-result-rating&encapsulation=shadow","src/components/search/result-template-components/atomic-result-rating/atomic-result-rating.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n@import '../../../common/atomic-rating/atomic-rating.pcss';\n","import {Result, ResultTemplatesHelpers} from '@coveo/headless';\nimport {Component, Element, Prop, h, State} from '@stencil/core';\nimport Star from '../../../../images/star.svg';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {\n Rating,\n computeNumberOfStars,\n} from '../../../common/atomic-rating/stencil-rating';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '../result-template-decorators';\n\n/**\n * The `atomic-result-rating` element renders a star rating.\n *\n * @part value-rating - The wrapper that contains the row of inactive stars and the row of active stars.\n * @part value-rating-icon - The individual star icons used in the rating display.\n */\n@Component({\n tag: 'atomic-result-rating',\n styleUrl: 'atomic-result-rating.pcss',\n shadow: true,\n})\nexport class AtomicResultRating implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n @ResultContext() private result!: Result;\n @Element() host!: HTMLElement;\n\n /**\n * The field whose values you want to display as a rating.\n */\n @Prop({reflect: true}) public field!: string;\n\n /**\n * The maximum value of the field. This value is also used as the number of icons to be displayed.\n */\n @Prop({reflect: true}) public maxValueInIndex = 5;\n\n /**\n * The SVG icon to use to display the rating.\n *\n * - Use a value that starts with `http://`, `https://`, `./`, or `../`, to fetch and display an icon from a given location.\n * - Use a value that starts with `assets://`, to display an icon from the Atomic package.\n * - Use a stringified SVG to display it directly.\n *\n * When using a custom icon, at least part of your icon should have the color set to `fill=\"currentColor\"`.\n * This part of the SVG will take on the colors set in the following [variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties):\n *\n * - `--atomic-rating-icon-active-color`\n * - `--atomic-rating-icon-inactive-color`\n */\n @Prop({reflect: true}) public icon = Star;\n\n @State() public error!: Error;\n\n @State() numberOfStars: number | null = null;\n\n private updateNumberOfStars() {\n const value = ResultTemplatesHelpers.getResultProperty(\n this.result,\n this.field\n );\n try {\n this.numberOfStars = computeNumberOfStars(value, this.field);\n } catch (error) {\n this.error = error instanceof Error ? error : new Error(`${error}`);\n this.numberOfStars = null;\n }\n }\n\n componentWillRender() {\n this.updateNumberOfStars();\n }\n\n render() {\n if (this.numberOfStars === null) {\n this.host.remove();\n return;\n }\n return (\n <Rating\n i18n={this.bindings.i18n}\n icon={this.icon}\n numberOfTotalIcons={this.maxValueInIndex}\n numberOfActiveIcons={this.numberOfStars}\n iconSize={0.875}\n ></Rating>\n );\n }\n}\n"],"version":3}
1
+ {"file":"atomic-result-rating.entry.cjs.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,qBAAqB,GAAG,03jEAA03jE,CAAC;AACz5jE,iCAAe,qBAAqB;;;;;;;;;;;;MCwBvB,kBAAkB;;;;;;QAaC,oBAAe,GAAG,CAAC,CAAC;;;;;;;;;;;;;;QAepB,SAAI,GAAGA,kBAAI,CAAC;QAIjC,kBAAa,GAAkB,IAAI,CAAC;;+BAnBG,CAAC;oBAeZA,kBAAI;;6BAID,IAAI;;IAEpC,mBAAmB;QACzB,MAAM,KAAK,GAAGC,+BAAsB,CAAC,iBAAiB,CACpD,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,KAAK,CACX,CAAC;QACF,IAAI;YACF,IAAI,CAAC,aAAa,GAAGC,kCAAoB,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;SAC9D;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,KAAK,GAAG,KAAK,YAAY,KAAK,GAAG,KAAK,GAAG,IAAI,KAAK,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC;YACpE,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;SAC3B;KACF;IAED,mBAAmB;QACjB,IAAI,CAAC,mBAAmB,EAAE,CAAC;KAC5B;IAED,MAAM;QACJ,IAAI,IAAI,CAAC,aAAa,KAAK,IAAI,EAAE;YAC/B,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACnB,OAAO;SACR;QACD,QACEC,QAACC,oBAAM,IACL,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,EACxB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,kBAAkB,EAAE,IAAI,CAAC,eAAe,EACxC,mBAAmB,EAAE,IAAI,CAAC,aAAa,EACvC,QAAQ,EAAE,KAAK,GACP,EACV;KACH;;;AAhE4B;IAA5BC,sCAAkB,EAAE;oDAA4B;AACxB;IAAxBC,6CAAa,EAAE;kDAAyB;;;;;","names":["Star","ResultTemplatesHelpers","computeNumberOfStars","h","Rating","InitializeBindings","ResultContext"],"sources":["src/components/search/result-template-components/atomic-result-rating/atomic-result-rating.pcss?tag=atomic-result-rating&encapsulation=shadow","src/components/search/result-template-components/atomic-result-rating/atomic-result-rating.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n@import '../../../common/atomic-rating/atomic-rating.pcss';\n","import {Result, ResultTemplatesHelpers} from '@coveo/headless';\nimport {Component, Element, Prop, h, State} from '@stencil/core';\nimport Star from '../../../../images/star.svg';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {\n Rating,\n computeNumberOfStars,\n} from '../../../common/atomic-rating/stencil-rating';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\n\n/**\n * The `atomic-result-rating` element renders a star rating.\n *\n * @part value-rating - The wrapper that contains the row of inactive stars and the row of active stars.\n * @part value-rating-icon - The individual star icons used in the rating display.\n */\n@Component({\n tag: 'atomic-result-rating',\n styleUrl: 'atomic-result-rating.pcss',\n shadow: true,\n})\nexport class AtomicResultRating implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n @ResultContext() private result!: Result;\n @Element() host!: HTMLElement;\n\n /**\n * The field whose values you want to display as a rating.\n */\n @Prop({reflect: true}) public field!: string;\n\n /**\n * The maximum value of the field. This value is also used as the number of icons to be displayed.\n */\n @Prop({reflect: true}) public maxValueInIndex = 5;\n\n /**\n * The SVG icon to use to display the rating.\n *\n * - Use a value that starts with `http://`, `https://`, `./`, or `../`, to fetch and display an icon from a given location.\n * - Use a value that starts with `assets://`, to display an icon from the Atomic package.\n * - Use a stringified SVG to display it directly.\n *\n * When using a custom icon, at least part of your icon should have the color set to `fill=\"currentColor\"`.\n * This part of the SVG will take on the colors set in the following [variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties):\n *\n * - `--atomic-rating-icon-active-color`\n * - `--atomic-rating-icon-inactive-color`\n */\n @Prop({reflect: true}) public icon = Star;\n\n @State() public error!: Error;\n\n @State() numberOfStars: number | null = null;\n\n private updateNumberOfStars() {\n const value = ResultTemplatesHelpers.getResultProperty(\n this.result,\n this.field\n );\n try {\n this.numberOfStars = computeNumberOfStars(value, this.field);\n } catch (error) {\n this.error = error instanceof Error ? error : new Error(`${error}`);\n this.numberOfStars = null;\n }\n }\n\n componentWillRender() {\n this.updateNumberOfStars();\n }\n\n render() {\n if (this.numberOfStars === null) {\n this.host.remove();\n return;\n }\n return (\n <Rating\n i18n={this.bindings.i18n}\n icon={this.icon}\n numberOfTotalIcons={this.maxValueInIndex}\n numberOfActiveIcons={this.numberOfStars}\n iconSize={0.875}\n ></Rating>\n );\n }\n}\n"],"version":3}
@@ -8,7 +8,7 @@ const fieldUtils = require('./field-utils-a715deca.js');
8
8
  const initializationUtils = require('./initialization-utils-92f1b080.js');
9
9
  const resultUtils = require('./result-utils-3313d650.js');
10
10
  const bueno = require('@coveo/bueno');
11
- const resultTemplateDecorators = require('./result-template-decorators-432d11a9.js');
11
+ const stencilResultTemplateDecorators = require('./stencil-result-template-decorators-28b05aaf.js');
12
12
  require('./dom-utils-d4790328.js');
13
13
  require('./event-utils-9bfcf3c5.js');
14
14
  require('./init-queue-a18aa323.js');
@@ -95,7 +95,7 @@ __decorate$1([
95
95
  initializationUtils.InitializeBindings()
96
96
  ], AtomicResultText.prototype, "bindings", void 0);
97
97
  __decorate$1([
98
- resultTemplateDecorators.ResultContext()
98
+ stencilResultTemplateDecorators.ResultContext()
99
99
  ], AtomicResultText.prototype, "result", void 0);
100
100
 
101
101
  var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
@@ -1 +1 @@
1
- {"file":"atomic-result-text.atomic-text.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;SAEgB,0BAA0B,CACxC,KAAa,EACb,YAAqB,EACrB,IAAiB,EACjB,MAA8B;IAE9B,IAAIA,aAAO,CAAC,YAAY,CAAC,EAAE;QACzB,MAAM,CAAC,KAAK,CACV,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,2CAA2C,KAAK,kBAAkB,YAAY,IAAI,EAChH,IAAI,CACL,CAAC;KACH;AACH;;ACDO,MAAM,gBAAgB,GAAG,CAC9B,EAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,EAAmB,EACxE,QAAiB;IAEjB,MAAM,GAAG,GAAG,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACrC,0BAA0B,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAErD,IAAIC,iBAAW,CAAC,YAAY,CAAC,EAAE;QAC7B,IAAI,CAAC,MAAM,EAAE,CAAC;QACd,OAAO,IAAI,CAAC;KACb;SAAM;QACL,OAAOC,QAACC,cAAQ,QAAE,QAAQ,C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EAAE,CAAC;KAC7B;;AA3B4B;IAA5BD,sCAAkB,EAAE;4CAA4B;;;;;","names":["isArray","isUndefined","h","Fragment","Host","getStringValueFromResultOrNull","ResultTemplatesHelpers","getFieldValueCaption","HighlightUtils","__decorate","InitializeBindings","ResultContext"],"sources":["src/components/common/item-text/field-warning.ts","src/components/common/item-text/stencil-item-text-fallback.tsx","src/components/common/item-text/render-highlights.ts","src/components/common/item-text/stencil-item-text-highlighted.tsx","src/components/search/result-template-components/atomic-result-text/atomic-result-text.tsx","src/components/search/atomic-text/atomic-text.tsx"],"sourcesContent":["import {isArray} from '@coveo/bueno';\n\nexport function possiblyWarnOnBadFieldType(\n field: string,\n itemValueRaw: unknown,\n host: HTMLElement,\n logger: Pick<Console, 'error'>\n) {\n if (isArray(itemValueRaw)) {\n logger.error(\n `${host.nodeName.toLowerCase()} cannot be used with multi value field \"${field}\" with values \"${itemValueRaw}\".`,\n host\n );\n }\n}\n","import {isUndefined} from '@coveo/bueno';\nimport {Fragment, FunctionalComponent, VNode, h} from '@stencil/core';\nimport {possiblyWarnOnBadFieldType} from './field-warning';\n\nexport interface ItemTextProps<T> {\n logger: Pick<Console, 'error'>;\n host: HTMLElement;\n defaultValue: string | undefined;\n field: string;\n item: T;\n getProperty: (result: T, property: string) => unknown;\n}\n\nexport const ItemTextFallback = <T,>(\n {field, host, logger, defaultValue, item, getProperty}: ItemTextProps<T>,\n children: VNode[]\n): FunctionalComponent<ItemTextProps<T>> | null => {\n const raw = getProperty(item, field);\n possiblyWarnOnBadFieldType(field, raw, host, logger);\n\n if (isUndefined(defaultValue)) {\n host.remove();\n return null;\n } else {\n return <Fragment>{children}</Fragment>;\n }\n};\n","export type HighlightKeywords = {\n offset: number;\n length: number;\n};\n\nexport type HighlightString = (params: {\n content: string;\n openingDelimiter: string;\n closingDelimiter: string;\n highlights: HighlightKeywords[];\n}) => string;\n\nexport function renderWithHighlights(\n value: string,\n highlights: HighlightKeywords[],\n highlightString: HighlightString\n) {\n const openingDelimiter = '_openingDelimiter_';\n const closingDelimiter = '_closingDelimiter_';\n const highlightedValue = highlightString({\n content: value,\n openingDelimiter,\n closingDelimiter,\n highlights,\n });\n return highlightedValue\n .replace(new RegExp(openingDelimiter, 'g'), '<b>')\n .replace(new RegExp(closingDelimiter, 'g'), '</b>');\n}\n","import {FunctionalComponent, h, Host} from '@stencil/core';\nimport {\n HighlightKeywords,\n HighlightString,\n renderWithHighlights,\n} from './render-highlights';\n\nexport interface ItemTextHighlightedProps {\n textValue: string;\n highlightKeywords: HighlightKeywords[];\n onError: (error: Error) => void;\n highlightString: HighlightString;\n}\n\nexport const ItemTextHighlighted: FunctionalComponent<\n ItemTextHighlightedProps\n> = ({highlightKeywords, highlightString, onError, textValue}) => {\n try {\n const highlightedValue = renderWithHighlights(\n textValue,\n highlightKeywords,\n highlightString\n );\n\n // deepcode ignore ReactSetInnerHtml: This is not React code\n return <Host innerHTML={highlightedValue}></Host>;\n } catch (error) {\n onError(error as Error);\n }\n};\n","import {HighlightUtils, Result, ResultTemplatesHelpers} from '@coveo/headless';\nimport {Component, Prop, h, Element, State} from '@stencil/core';\nimport {getFieldValueCaption} from '../../../../utils/field-utils';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {getStringValueFromResultOrNull} from '../../../../utils/result-utils';\nimport {ItemTextFallback} from '../../../common/item-text/stencil-item-text-fallback';\nimport {ItemTextHighlighted} from '../../../common/item-text/stencil-item-text-highlighted';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '../result-template-decorators';\n\n/**\n * The `atomic-result-text` component renders the value of a string result field.\n */\n@Component({\n tag: 'atomic-result-text',\n shadow: false,\n})\nexport class AtomicResultText implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n @ResultContext() private result!: Result;\n\n @Element() private host!: HTMLElement;\n\n @State() public error!: Error;\n\n /**\n * The result field which the component should use.\n * This will look in the Result object first, and then in the Result.raw object for the fields.\n * It is important to include the necessary field in the `atomic-search-interface` component.\n */\n @Prop({reflect: true}) public field!: string;\n /**\n * When this is set to `true`, the component attempts to highlight text based on the highlighting properties provided by the search API response.\n */\n @Prop({reflect: true}) public shouldHighlight = true;\n\n /**\n * The locale key for the text to display when the configured field has no value.\n */\n @Prop({reflect: true}) public default?: string;\n\n public render() {\n const resultValueAsString = getStringValueFromResultOrNull(\n this.result,\n this.field\n );\n\n if (resultValueAsString === null) {\n return (\n <ItemTextFallback\n field={this.field}\n host={this.host}\n logger={this.bindings.engine.logger}\n defaultValue={this.default}\n item={this.result}\n getProperty={ResultTemplatesHelpers.getResultProperty}\n >\n <atomic-text\n value={getFieldValueCaption(\n this.field,\n this.default!,\n this.bindings.i18n\n )}\n ></atomic-text>\n </ItemTextFallback>\n );\n }\n\n const textValue = `${resultValueAsString}`;\n const highlightKeywords = ResultTemplatesHelpers.getResultProperty(\n this.result,\n `${this.field}Highlights`\n ) as HighlightUtils.HighlightKeyword[];\n\n return this.shouldHighlight && highlightKeywords ? (\n <ItemTextHighlighted\n textValue={textValue}\n highlightKeywords={highlightKeywords}\n highlightString={HighlightUtils.highlightString}\n onError={(error) => (this.error = error)}\n ></ItemTextHighlighted>\n ) : (\n getFieldValueCaption(this.field, textValue, this.bindings.i18n)\n );\n }\n}\n","import {Component, Prop, State} from '@stencil/core';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {Bindings} from '../atomic-search-interface/atomic-search-interface';\n\n/**\n * The `atomic-text` component leverages the I18n translation module through the atomic-search-interface.\n */\n@Component({\n tag: 'atomic-text',\n shadow: true,\n})\nexport class AtomicText implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n\n private strings = {\n value: () =>\n this.bindings.i18n.t(this.value, {\n count: this.count,\n }),\n };\n @State() public error!: Error;\n\n /**\n * The string key value.\n */\n @Prop({reflect: true}) public value!: string;\n /**\n * The count value used for plurals.\n */\n @Prop({reflect: true}) public count?: number;\n\n public connectedCallback() {\n if (!this.value) {\n this.error = new Error('The \"value\" attribute must be defined.');\n }\n }\n\n public render() {\n return this.strings.value();\n }\n}\n"],"version":3}
1
+ {"file":"atomic-result-text.atomic-text.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;SAEgB,0BAA0B,CACxC,KAAa,EACb,YAAqB,EACrB,IAAiB,EACjB,MAA8B;IAE9B,IAAIA,aAAO,CAAC,YAAY,CAAC,EAAE;QACzB,MAAM,CAAC,KAAK,CACV,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,2CAA2C,KAAK,kBAAkB,YAAY,IAAI,EAChH,IAAI,CACL,CAAC;KACH;AACH;;ACDO,MAAM,gBAAgB,GAAG,CAC9B,EAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,EAAmB,EACxE,QAAiB;IAEjB,MAAM,GAAG,GAAG,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACrC,0BAA0B,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAErD,IAAIC,iBAAW,CAAC,YAAY,CAAC,EAAE;QAC7B,IAAI,CAAC,MAAM,EAAE,CAAC;QACd,OAAO,IAAI,CAAC;KACb;SAAM;QACL,OAAOC,QAACC,cAAQ,QAAE,QAAQ,CAAY,CAAC;KACxC;AACH,CAAC;;SCde,oBAAoB,CAClC,KAAa,EACb,UAA+B,EAC/B,eAAgC;IAEhC,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;IAC9C,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;IAC9C,MAAM,gBAAgB,GAAG,eAAe,CAAC;QACvC,OAAO,EAAE,KAAK;QACd,gBAAgB;QAChB,gBAAgB;QAChB,UAAU;KACX,CAAC,CAAC;IACH,OAAO,gBAAgB;SACpB,OAAO,CAAC,IAAI,MAAM,CAAC,gBAAgB,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC;SACjD,OAAO,CAAC,I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vC,OAAO,IAAI,CAAC,eAAe,IAAI,iBAAiB,IAC9CJ,QAAC,mBAAmB,IAClB,SAAS,EAAE,SAAS,EACpB,iBAAiB,EAAE,iBAAiB,EACpC,eAAe,EAAEM,uBAAc,CAAC,eAAe,EAC/C,OAAO,EAAE,CAAC,KAAK,MAAM,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,GACnB,KAEvBD,+BAAoB,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAChE,CAAC;KACH;;;AAlE4BE;IAA5BC,sCAAkB,EAAE;kDAA4B;AACxBD;IAAxBE,6CAAa,EAAE;gDAAyB;;;;;;;;;;;;MCR9B,UAAU;;;QAGb,YAAO,GAAG;YAChB,KAAK,EAAE,MACL,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE;gBAC/B,KAAK,EAAE,IAAI,CAAC,KAAK;aAClB,CAAC;SACL,CAAC;;;;;IAYK,iBAAiB;QACtB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACf,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;SAClE;KACF;IAEM,MAAM;QACX,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;KAC7B;;AA3B4B;IAA5BD,sCAAkB,EAAE;4CAA4B;;;;;","names":["isArray","isUndefined","h","Fragment","Host","getStringValueFromResultOrNull","ResultTemplatesHelpers","getFieldValueCaption","HighlightUtils","__decorate","InitializeBindings","ResultContext"],"sources":["src/components/common/item-text/field-warning.ts","src/components/common/item-text/stencil-item-text-fallback.tsx","src/components/common/item-text/render-highlights.ts","src/components/common/item-text/stencil-item-text-highlighted.tsx","src/components/search/result-template-components/atomic-result-text/atomic-result-text.tsx","src/components/search/atomic-text/atomic-text.tsx"],"sourcesContent":["import {isArray} from '@coveo/bueno';\n\nexport function possiblyWarnOnBadFieldType(\n field: string,\n itemValueRaw: unknown,\n host: HTMLElement,\n logger: Pick<Console, 'error'>\n) {\n if (isArray(itemValueRaw)) {\n logger.error(\n `${host.nodeName.toLowerCase()} cannot be used with multi value field \"${field}\" with values \"${itemValueRaw}\".`,\n host\n );\n }\n}\n","import {isUndefined} from '@coveo/bueno';\nimport {Fragment, FunctionalComponent, VNode, h} from '@stencil/core';\nimport {possiblyWarnOnBadFieldType} from './field-warning';\n\nexport interface ItemTextProps<T> {\n logger: Pick<Console, 'error'>;\n host: HTMLElement;\n defaultValue: string | undefined;\n field: string;\n item: T;\n getProperty: (result: T, property: string) => unknown;\n}\n\nexport const ItemTextFallback = <T,>(\n {field, host, logger, defaultValue, item, getProperty}: ItemTextProps<T>,\n children: VNode[]\n): FunctionalComponent<ItemTextProps<T>> | null => {\n const raw = getProperty(item, field);\n possiblyWarnOnBadFieldType(field, raw, host, logger);\n\n if (isUndefined(defaultValue)) {\n host.remove();\n return null;\n } else {\n return <Fragment>{children}</Fragment>;\n }\n};\n","export type HighlightKeywords = {\n offset: number;\n length: number;\n};\n\nexport type HighlightString = (params: {\n content: string;\n openingDelimiter: string;\n closingDelimiter: string;\n highlights: HighlightKeywords[];\n}) => string;\n\nexport function renderWithHighlights(\n value: string,\n highlights: HighlightKeywords[],\n highlightString: HighlightString\n) {\n const openingDelimiter = '_openingDelimiter_';\n const closingDelimiter = '_closingDelimiter_';\n const highlightedValue = highlightString({\n content: value,\n openingDelimiter,\n closingDelimiter,\n highlights,\n });\n return highlightedValue\n .replace(new RegExp(openingDelimiter, 'g'), '<b>')\n .replace(new RegExp(closingDelimiter, 'g'), '</b>');\n}\n","import {FunctionalComponent, h, Host} from '@stencil/core';\nimport {\n HighlightKeywords,\n HighlightString,\n renderWithHighlights,\n} from './render-highlights';\n\nexport interface ItemTextHighlightedProps {\n textValue: string;\n highlightKeywords: HighlightKeywords[];\n onError: (error: Error) => void;\n highlightString: HighlightString;\n}\n\nexport const ItemTextHighlighted: FunctionalComponent<\n ItemTextHighlightedProps\n> = ({highlightKeywords, highlightString, onError, textValue}) => {\n try {\n const highlightedValue = renderWithHighlights(\n textValue,\n highlightKeywords,\n highlightString\n );\n\n // deepcode ignore ReactSetInnerHtml: This is not React code\n return <Host innerHTML={highlightedValue}></Host>;\n } catch (error) {\n onError(error as Error);\n }\n};\n","import {HighlightUtils, Result, ResultTemplatesHelpers} from '@coveo/headless';\nimport {Component, Prop, h, Element, State} from '@stencil/core';\nimport {getFieldValueCaption} from '../../../../utils/field-utils';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {getStringValueFromResultOrNull} from '../../../../utils/result-utils';\nimport {ItemTextFallback} from '../../../common/item-text/stencil-item-text-fallback';\nimport {ItemTextHighlighted} from '../../../common/item-text/stencil-item-text-highlighted';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\n\n/**\n * The `atomic-result-text` component renders the value of a string result field.\n */\n@Component({\n tag: 'atomic-result-text',\n shadow: false,\n})\nexport class AtomicResultText implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n @ResultContext() private result!: Result;\n\n @Element() private host!: HTMLElement;\n\n @State() public error!: Error;\n\n /**\n * The result field which the component should use.\n * This will look in the Result object first, and then in the Result.raw object for the fields.\n * It is important to include the necessary field in the `atomic-search-interface` component.\n */\n @Prop({reflect: true}) public field!: string;\n /**\n * When this is set to `true`, the component attempts to highlight text based on the highlighting properties provided by the search API response.\n */\n @Prop({reflect: true}) public shouldHighlight = true;\n\n /**\n * The locale key for the text to display when the configured field has no value.\n */\n @Prop({reflect: true}) public default?: string;\n\n public render() {\n const resultValueAsString = getStringValueFromResultOrNull(\n this.result,\n this.field\n );\n\n if (resultValueAsString === null) {\n return (\n <ItemTextFallback\n field={this.field}\n host={this.host}\n logger={this.bindings.engine.logger}\n defaultValue={this.default}\n item={this.result}\n getProperty={ResultTemplatesHelpers.getResultProperty}\n >\n <atomic-text\n value={getFieldValueCaption(\n this.field,\n this.default!,\n this.bindings.i18n\n )}\n ></atomic-text>\n </ItemTextFallback>\n );\n }\n\n const textValue = `${resultValueAsString}`;\n const highlightKeywords = ResultTemplatesHelpers.getResultProperty(\n this.result,\n `${this.field}Highlights`\n ) as HighlightUtils.HighlightKeyword[];\n\n return this.shouldHighlight && highlightKeywords ? (\n <ItemTextHighlighted\n textValue={textValue}\n highlightKeywords={highlightKeywords}\n highlightString={HighlightUtils.highlightString}\n onError={(error) => (this.error = error)}\n ></ItemTextHighlighted>\n ) : (\n getFieldValueCaption(this.field, textValue, this.bindings.i18n)\n );\n }\n}\n","import {Component, Prop, State} from '@stencil/core';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {Bindings} from '../atomic-search-interface/atomic-search-interface';\n\n/**\n * The `atomic-text` component leverages the I18n translation module through the atomic-search-interface.\n */\n@Component({\n tag: 'atomic-text',\n shadow: true,\n})\nexport class AtomicText implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n\n private strings = {\n value: () =>\n this.bindings.i18n.t(this.value, {\n count: this.count,\n }),\n };\n @State() public error!: Error;\n\n /**\n * The string key value.\n */\n @Prop({reflect: true}) public value!: string;\n /**\n * The count value used for plurals.\n */\n @Prop({reflect: true}) public count?: number;\n\n public connectedCallback() {\n if (!this.value) {\n this.error = new Error('The \"value\" attribute must be defined.');\n }\n }\n\n public render() {\n return this.strings.value();\n }\n}\n"],"version":3}
@@ -8,7 +8,7 @@ const headless = require('@coveo/headless');
8
8
  const dayjs_min = require('./dayjs.min-8b80e6d1.js');
9
9
  const _commonjsHelpers = require('./_commonjsHelpers-b3309d7b.js');
10
10
  const initializationUtils = require('./initialization-utils-92f1b080.js');
11
- const resultTemplateDecorators = require('./result-template-decorators-432d11a9.js');
11
+ const stencilResultTemplateDecorators = require('./stencil-result-template-decorators-28b05aaf.js');
12
12
  require('./dom-utils-d4790328.js');
13
13
  require('./event-utils-9bfcf3c5.js');
14
14
  require('./init-queue-a18aa323.js');
@@ -91,7 +91,7 @@ __decorate([
91
91
  initializationUtils.InitializeBindings()
92
92
  ], AtomicResultTimespan.prototype, "bindings", void 0);
93
93
  __decorate([
94
- resultTemplateDecorators.ResultContext()
94
+ stencilResultTemplateDecorators.ResultContext()
95
95
  ], AtomicResultTimespan.prototype, "result", void 0);
96
96
 
97
97
  exports.atomic_result_timespan = AtomicResultTimespan;
@@ -1 +1 @@
1
- {"file":"atomic-result-timespan.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;AAAA,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAsD,eAAe,CAAC,GAAkI,CAAC,CAACA,+BAAI,EAAE,UAAU,CAAc,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,qFAAqF,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,qKAAqK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CA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AAK,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;aACvC,CAAC,CAAC;SACJ;QAED,IAAI,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE;YAC1B,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,EAAE;gBACxC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;aACrC,CAAC,CAAC;SACJ;QAED,OAAO,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;KACpC;IAED,IAAY,KAAK;QACf,OAAOG,+BAAsB,CAAC,iBAAiB,CAC7C,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,KAAK,CACD,CAAC;KACb;;AA7EM;IADNC,sCAAkB,EAAE;sDACM;AAEF;IAAxBC,sCAAa,EAAE;oDAAyB;;;;","names":["this","dayjs","Schema","StringValue","ResultTemplatesHelpers","InitializeBindings","ResultContext"],"sources":["../../node_modules/dayjs/plugin/duration.js","src/components/search/result-template-components/atomic-result-timespan/atomic-result-timespan.tsx"],"sourcesContent":["!function(t,s){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=s():\"function\"==typeof define&&define.amd?define(s):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs_plugin_duration=s()}(this,(function(){\"use strict\";var t,s,n=1e3,i=6e4,e=36e5,r=864e5,o=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,u=31536e6,d=2628e6,a=/^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,h={years:u,months:d,days:r,hours:e,minutes:i,seconds:n,milliseconds:1,weeks:6048e5},c=function(t){return t instanceof g},f=function(t,s,n){return new g(t,n,s.$l)},m=function(t){return s.p(t)+\"s\"},l=function(t){return t<0},$=function(t){return l(t)?Math.ceil(t):Math.floor(t)},y=function(t){return Math.abs(t)},v=function(t,s){return t?l(t)?{negative:!0,format:\"\"+y(t)+s}:{negative:!1,format:\"\"+t+s}:{negative:!1,format:\"\"}},g=function(){function l(t,s,n){var i=this;if(this.$d={},this.$l=n,void 0===t&&(this.$ms=0,this.parseFromMilliseconds()),s)return f(t*h[m(s)],this);if(\"number\"==typeof t)return this.$ms=t,this.parseFromMilliseconds(),this;if(\"object\"==typeof t)return Object.keys(t).forEach((function(s){i.$d[m(s)]=t[s]})),this.calMilliseconds(),this;if(\"string\"==typeof t){var e=t.match(a);if(e){var r=e.slice(2).map((function(t){return null!=t?Number(t):0}));return this.$d.years=r[0],this.$d.months=r[1],this.$d.weeks=r[2],this.$d.days=r[3],this.$d.hours=r[4],this.$d.minutes=r[5],this.$d.seconds=r[6],this.calMilliseconds(),this}}return this}var y=l.prototype;return y.calMilliseconds=function(){var t=this;this.$ms=Object.keys(this.$d).reduce((function(s,n){return s+(t.$d[n]||0)*h[n]}),0)},y.parseFromMilliseconds=function(){var t=this.$ms;this.$d.years=$(t/u),t%=u,this.$d.months=$(t/d),t%=d,this.$d.days=$(t/r),t%=r,this.$d.hours=$(t/e),t%=e,this.$d.minutes=$(t/i),t%=i,this.$d.seconds=$(t/n),t%=n,this.$d.milliseconds=t},y.toISOString=function(){var t=v(this.$d.years,\"Y\"),s=v(this.$d.months,\"M\"),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var i=v(n,\"D\"),e=v(this.$d.hours,\"H\"),r=v(this.$d.minutes,\"M\"),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var u=v(o,\"S\"),d=t.negative||s.negative||i.negative||e.negative||r.negative||u.negative,a=e.format||r.format||u.format?\"T\":\"\",h=(d?\"-\":\"\")+\"P\"+t.format+s.format+i.format+a+e.format+r.format+u.format;return\"P\"===h||\"-P\"===h?\"P0D\":h},y.toJSON=function(){return this.toISOString()},y.format=function(t){var n=t||\"YYYY-MM-DDTHH:mm:ss\",i={Y:this.$d.years,YY:s.s(this.$d.years,2,\"0\"),YYYY:s.s(this.$d.years,4,\"0\"),M:this.$d.months,MM:s.s(this.$d.months,2,\"0\"),D:this.$d.days,DD:s.s(this.$d.days,2,\"0\"),H:this.$d.hours,HH:s.s(this.$d.hours,2,\"0\"),m:this.$d.minutes,mm:s.s(this.$d.minutes,2,\"0\"),s:this.$d.seconds,ss:s.s(this.$d.seconds,2,\"0\"),SSS:s.s(this.$d.milliseconds,3,\"0\")};return n.replace(o,(function(t,s){return s||String(i[t])}))},y.as=function(t){return this.$ms/h[m(t)]},y.get=function(t){var s=this.$ms,n=m(t);return\"milliseconds\"===n?s%=1e3:s=\"weeks\"===n?$(s/h[n]):this.$d[n],s||0},y.add=function(t,s,n){var i;return i=s?t*h[m(s)]:c(t)?t.$ms:f(t,this).$ms,f(this.$ms+i*(n?-1:1),this)},y.subtract=function(t,s){return this.add(t,s,!0)},y.locale=function(t){var s=this.clone();return s.$l=t,s},y.clone=function(){return f(this.$ms,this)},y.humanize=function(s){return t().add(this.$ms,\"ms\").locale(this.$l).fromNow(!s)},y.valueOf=function(){return this.asMilliseconds()},y.milliseconds=function(){return this.get(\"milliseconds\")},y.asMilliseconds=function(){return this.as(\"milliseconds\")},y.seconds=function(){return this.get(\"seconds\")},y.asSeconds=function(){return this.as(\"seconds\")},y.minutes=function(){return this.get(\"minutes\")},y.asMinutes=function(){return this.as(\"minutes\")},y.hours=function(){return this.get(\"hours\")},y.asHours=function(){return this.as(\"hours\")},y.days=function(){return this.get(\"days\")},y.asDays=function(){return this.as(\"days\")},y.weeks=function(){return this.get(\"weeks\")},y.asWeeks=function(){return this.as(\"weeks\")},y.months=function(){return this.get(\"months\")},y.asMonths=function(){return this.as(\"months\")},y.years=function(){return this.get(\"years\")},y.asYears=function(){return this.as(\"years\")},l}(),p=function(t,s,n){return t.add(s.years()*n,\"y\").add(s.months()*n,\"M\").add(s.days()*n,\"d\").add(s.hours()*n,\"h\").add(s.minutes()*n,\"m\").add(s.seconds()*n,\"s\").add(s.milliseconds()*n,\"ms\")};return function(n,i,e){t=e,s=e().$utils(),e.duration=function(t,s){var n=e.locale();return f(t,{$l:n},s)},e.isDuration=c;var r=i.prototype.add,o=i.prototype.subtract;i.prototype.add=function(t,s){return c(t)?p(this,t,1):r.bind(this)(t,s)},i.prototype.subtract=function(t,s){return c(t)?p(this,t,-1):o.bind(this)(t,s)}}}));","import {Schema, StringValue} from '@coveo/bueno';\nimport {Result, ResultTemplatesHelpers} from '@coveo/headless';\nimport {Component, Prop, State} from '@stencil/core';\nimport dayjs from 'dayjs';\nimport {DurationUnitType} from 'dayjs/plugin/duration';\nimport duration from 'dayjs/plugin/duration';\nimport {InitializeBindings} from '../../../../utils/initialization-utils';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '../result-template-decorators';\n\ndayjs.extend(duration);\n\n/**\n * The `atomic-result-timespan` component renders a target result number field value as a duration.\n */\n@Component({\n tag: 'atomic-result-timespan',\n})\nexport class AtomicResultTimespan {\n @InitializeBindings()\n public bindings!: Bindings;\n\n @ResultContext() private result!: Result;\n\n @State() public error!: Error;\n\n /**\n * The target result field.\n * The component first looks for the field in the Result object, and then in the Result.raw object.\n * It is important to include the necessary field in the `atomic-search-interface` component.\n */\n @Prop({reflect: true}) field!: string;\n /**\n * The unit of measurement of the field value.\n * Available units: https://day.js.org/docs/en/durations/creating\n */\n @Prop({reflect: true}) unit = 'ms';\n /**\n * The format to apply to the result field value.\n *\n * By default, the format is HH:mm:ss when the duration is under a day, and it is an approximation when longer (days, months or years).\n *\n * The string displayed when there is an approximation can be modified with [localization](https://docs.coveo.com/en/atomic/latest/usage/atomic-localization/).\n *\n * Available formats: https://day.js.org/docs/en/durations/format\n */\n @Prop({reflect: true}) format?: string;\n\n public initialize() {\n new Schema({\n field: new StringValue({required: true, emptyAllowed: false}),\n }).validate({\n field: this.field,\n });\n if (!this.value) {\n this.error = new Error(`No value found for field ${this.field}`);\n return;\n }\n if (isNaN(this.value)) {\n this.error = new Error(\n `Value ${this.value} for field ${this.field} is not a number`\n );\n }\n }\n\n public render() {\n const duration = dayjs.duration(this.value, this.unit as DurationUnitType);\n if (this.format) {\n return duration.format(this.format);\n }\n\n if (duration.asYears() >= 1) {\n return this.bindings.i18n.t('approx_year', {\n count: Math.round(duration.asYears()),\n });\n }\n\n if (duration.asMonths() >= 1) {\n return this.bindings.i18n.t('approx_month', {\n count: Math.round(duration.asMonths()),\n });\n }\n\n if (duration.asDays() >= 1) {\n return this.bindings.i18n.t('approx_day', {\n count: Math.round(duration.asDays()),\n });\n }\n\n return duration.format('HH:mm:ss');\n }\n\n private get value() {\n return ResultTemplatesHelpers.getResultProperty(\n this.result,\n this.field\n ) as number;\n }\n}\n"],"version":3}
1
+ {"file":"atomic-result-timespan.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;AAAA,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAsD,eAAe,CAAC,GAAkI,CAAC,CAACA,+BAAI,EAAE,UAAU,CAAc,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,qFAAqF,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,qKAAqK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,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3B,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,EAAE;gBACzC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;aACtC,CAAC,CAAC;SACJ;QAED,IAAI,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE;YAC5B,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,EAAE;gBAC1C,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;aACvC,CAAC,CAAC;SACJ;QAED,IAAI,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE;YAC1B,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,EAAE;gBACxC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;aACrC,CAAC,CAAC;SACJ;QAED,OAAO,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;KACpC;IAED,IAAY,KAAK;QACf,OAAOG,+BAAsB,CAAC,iBAAiB,CAC7C,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,KAAK,CACD,CAAC;KACb;;AA7EM;IADNC,sCAAkB,EAAE;sDACM;AAEF;IAAxBC,6CAAa,EAAE;oDAAyB;;;;","names":["this","dayjs","Schema","StringValue","ResultTemplatesHelpers","InitializeBindings","ResultContext"],"sources":["../../node_modules/dayjs/plugin/duration.js","src/components/search/result-template-components/atomic-result-timespan/atomic-result-timespan.tsx"],"sourcesContent":["!function(t,s){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=s():\"function\"==typeof define&&define.amd?define(s):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs_plugin_duration=s()}(this,(function(){\"use strict\";var t,s,n=1e3,i=6e4,e=36e5,r=864e5,o=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,u=31536e6,d=2628e6,a=/^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,h={years:u,months:d,days:r,hours:e,minutes:i,seconds:n,milliseconds:1,weeks:6048e5},c=function(t){return t instanceof g},f=function(t,s,n){return new g(t,n,s.$l)},m=function(t){return s.p(t)+\"s\"},l=function(t){return t<0},$=function(t){return l(t)?Math.ceil(t):Math.floor(t)},y=function(t){return Math.abs(t)},v=function(t,s){return t?l(t)?{negative:!0,format:\"\"+y(t)+s}:{negative:!1,format:\"\"+t+s}:{negative:!1,format:\"\"}},g=function(){function l(t,s,n){var i=this;if(this.$d={},this.$l=n,void 0===t&&(this.$ms=0,this.parseFromMilliseconds()),s)return f(t*h[m(s)],this);if(\"number\"==typeof t)return this.$ms=t,this.parseFromMilliseconds(),this;if(\"object\"==typeof t)return Object.keys(t).forEach((function(s){i.$d[m(s)]=t[s]})),this.calMilliseconds(),this;if(\"string\"==typeof t){var e=t.match(a);if(e){var r=e.slice(2).map((function(t){return null!=t?Number(t):0}));return this.$d.years=r[0],this.$d.months=r[1],this.$d.weeks=r[2],this.$d.days=r[3],this.$d.hours=r[4],this.$d.minutes=r[5],this.$d.seconds=r[6],this.calMilliseconds(),this}}return this}var y=l.prototype;return y.calMilliseconds=function(){var t=this;this.$ms=Object.keys(this.$d).reduce((function(s,n){return s+(t.$d[n]||0)*h[n]}),0)},y.parseFromMilliseconds=function(){var t=this.$ms;this.$d.years=$(t/u),t%=u,this.$d.months=$(t/d),t%=d,this.$d.days=$(t/r),t%=r,this.$d.hours=$(t/e),t%=e,this.$d.minutes=$(t/i),t%=i,this.$d.seconds=$(t/n),t%=n,this.$d.milliseconds=t},y.toISOString=function(){var t=v(this.$d.years,\"Y\"),s=v(this.$d.months,\"M\"),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var i=v(n,\"D\"),e=v(this.$d.hours,\"H\"),r=v(this.$d.minutes,\"M\"),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var u=v(o,\"S\"),d=t.negative||s.negative||i.negative||e.negative||r.negative||u.negative,a=e.format||r.format||u.format?\"T\":\"\",h=(d?\"-\":\"\")+\"P\"+t.format+s.format+i.format+a+e.format+r.format+u.format;return\"P\"===h||\"-P\"===h?\"P0D\":h},y.toJSON=function(){return this.toISOString()},y.format=function(t){var n=t||\"YYYY-MM-DDTHH:mm:ss\",i={Y:this.$d.years,YY:s.s(this.$d.years,2,\"0\"),YYYY:s.s(this.$d.years,4,\"0\"),M:this.$d.months,MM:s.s(this.$d.months,2,\"0\"),D:this.$d.days,DD:s.s(this.$d.days,2,\"0\"),H:this.$d.hours,HH:s.s(this.$d.hours,2,\"0\"),m:this.$d.minutes,mm:s.s(this.$d.minutes,2,\"0\"),s:this.$d.seconds,ss:s.s(this.$d.seconds,2,\"0\"),SSS:s.s(this.$d.milliseconds,3,\"0\")};return n.replace(o,(function(t,s){return s||String(i[t])}))},y.as=function(t){return this.$ms/h[m(t)]},y.get=function(t){var s=this.$ms,n=m(t);return\"milliseconds\"===n?s%=1e3:s=\"weeks\"===n?$(s/h[n]):this.$d[n],s||0},y.add=function(t,s,n){var i;return i=s?t*h[m(s)]:c(t)?t.$ms:f(t,this).$ms,f(this.$ms+i*(n?-1:1),this)},y.subtract=function(t,s){return this.add(t,s,!0)},y.locale=function(t){var s=this.clone();return s.$l=t,s},y.clone=function(){return f(this.$ms,this)},y.humanize=function(s){return t().add(this.$ms,\"ms\").locale(this.$l).fromNow(!s)},y.valueOf=function(){return this.asMilliseconds()},y.milliseconds=function(){return this.get(\"milliseconds\")},y.asMilliseconds=function(){return this.as(\"milliseconds\")},y.seconds=function(){return this.get(\"seconds\")},y.asSeconds=function(){return this.as(\"seconds\")},y.minutes=function(){return this.get(\"minutes\")},y.asMinutes=function(){return this.as(\"minutes\")},y.hours=function(){return this.get(\"hours\")},y.asHours=function(){return this.as(\"hours\")},y.days=function(){return this.get(\"days\")},y.asDays=function(){return this.as(\"days\")},y.weeks=function(){return this.get(\"weeks\")},y.asWeeks=function(){return this.as(\"weeks\")},y.months=function(){return this.get(\"months\")},y.asMonths=function(){return this.as(\"months\")},y.years=function(){return this.get(\"years\")},y.asYears=function(){return this.as(\"years\")},l}(),p=function(t,s,n){return t.add(s.years()*n,\"y\").add(s.months()*n,\"M\").add(s.days()*n,\"d\").add(s.hours()*n,\"h\").add(s.minutes()*n,\"m\").add(s.seconds()*n,\"s\").add(s.milliseconds()*n,\"ms\")};return function(n,i,e){t=e,s=e().$utils(),e.duration=function(t,s){var n=e.locale();return f(t,{$l:n},s)},e.isDuration=c;var r=i.prototype.add,o=i.prototype.subtract;i.prototype.add=function(t,s){return c(t)?p(this,t,1):r.bind(this)(t,s)},i.prototype.subtract=function(t,s){return c(t)?p(this,t,-1):o.bind(this)(t,s)}}}));","import {Schema, StringValue} from '@coveo/bueno';\nimport {Result, ResultTemplatesHelpers} from '@coveo/headless';\nimport {Component, Prop, State} from '@stencil/core';\nimport dayjs from 'dayjs';\nimport {DurationUnitType} from 'dayjs/plugin/duration';\nimport duration from 'dayjs/plugin/duration';\nimport {InitializeBindings} from '../../../../utils/initialization-utils';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\n\ndayjs.extend(duration);\n\n/**\n * The `atomic-result-timespan` component renders a target result number field value as a duration.\n */\n@Component({\n tag: 'atomic-result-timespan',\n})\nexport class AtomicResultTimespan {\n @InitializeBindings()\n public bindings!: Bindings;\n\n @ResultContext() private result!: Result;\n\n @State() public error!: Error;\n\n /**\n * The target result field.\n * The component first looks for the field in the Result object, and then in the Result.raw object.\n * It is important to include the necessary field in the `atomic-search-interface` component.\n */\n @Prop({reflect: true}) field!: string;\n /**\n * The unit of measurement of the field value.\n * Available units: https://day.js.org/docs/en/durations/creating\n */\n @Prop({reflect: true}) unit = 'ms';\n /**\n * The format to apply to the result field value.\n *\n * By default, the format is HH:mm:ss when the duration is under a day, and it is an approximation when longer (days, months or years).\n *\n * The string displayed when there is an approximation can be modified with [localization](https://docs.coveo.com/en/atomic/latest/usage/atomic-localization/).\n *\n * Available formats: https://day.js.org/docs/en/durations/format\n */\n @Prop({reflect: true}) format?: string;\n\n public initialize() {\n new Schema({\n field: new StringValue({required: true, emptyAllowed: false}),\n }).validate({\n field: this.field,\n });\n if (!this.value) {\n this.error = new Error(`No value found for field ${this.field}`);\n return;\n }\n if (isNaN(this.value)) {\n this.error = new Error(\n `Value ${this.value} for field ${this.field} is not a number`\n );\n }\n }\n\n public render() {\n const duration = dayjs.duration(this.value, this.unit as DurationUnitType);\n if (this.format) {\n return duration.format(this.format);\n }\n\n if (duration.asYears() >= 1) {\n return this.bindings.i18n.t('approx_year', {\n count: Math.round(duration.asYears()),\n });\n }\n\n if (duration.asMonths() >= 1) {\n return this.bindings.i18n.t('approx_month', {\n count: Math.round(duration.asMonths()),\n });\n }\n\n if (duration.asDays() >= 1) {\n return this.bindings.i18n.t('approx_day', {\n count: Math.round(duration.asDays()),\n });\n }\n\n return duration.format('HH:mm:ss');\n }\n\n private get value() {\n return ResultTemplatesHelpers.getResultProperty(\n this.result,\n this.field\n ) as number;\n }\n}\n"],"version":3}
@@ -1 +1 @@
1
- {"file":"atomic-result.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,+kkHAA+kkH,CAAC;AACxmkH,2BAAe,eAAe;;MC2BjB,YAAY;;;;;;;;QAqCf,gBAAW,GAAe,IAAI,gBAAgB,EAAE,CAAC;;;;QAKjD,YAAO,GAAsB,MAAM,CA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CAAC,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC/C;QACD,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;KACrC;IAEM,kBAAkB;QACvB,IAAI,IAAI,CAAC,2BAA2B,EAAE,EAAE;YACtC,MAAM,0BAA0B,GAAG,IAAI,CAAC,iBAAkB,CACxD,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,aAAc,EACnB,IAAI,CAAC,gBAAiB,CACvB,CAAC;YAEF,IAAI,CAAC,aAAc,CAAC,SAAS,IAAI,IAAI,IAAI,CAAC,MAAM;iBAC7C,UAAU,CAAC,0BAA0B,CAAC;iBACtC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;iBACpB,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YAEf,IAAI,CAAC,6BAA6B,GAAG,IAAI,CAAC;SAC3C;QACD,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;KACrC;;;;;;;","names":["ItemLayout","parentNodeToString","h","Host","resultComponentClass"],"sources":["src/components/search/atomic-result/atomic-result.pcss?tag=atomic-result&encapsulation=shadow","src/components/search/atomic-result/atomic-result.tsx"],"sourcesContent":["@import '../../common/template-system/template-system.pcss';\n\n:host {\n @apply atomic-template-system;\n}\n","import {FoldedResult, InteractiveResult, Result} from '@coveo/headless';\nimport {Component, h, Prop, Element, Listen, Host} from '@stencil/core';\nimport {parentNodeToString} from '../../../utils/dom-utils';\nimport {DisplayConfig} from '../../common/item-list/stencil-item-decorators';\nimport {\n ItemRenderingFunction,\n resultComponentClass,\n} from '../../common/item-list/stencil-item-list-common';\nimport {\n ItemLayout,\n ItemDisplayDensity,\n ItemDisplayImageSize,\n ItemDisplayLayout,\n} from '../../common/layout/display-options';\nimport {SearchStore} from '../atomic-search-interface/store';\nimport {\n InteractiveResultContextEvent,\n ResultContextEvent,\n} from '../result-template-components/result-template-decorators';\n\n/**\n * The `atomic-result` component is used internally by the `atomic-result-list` component.\n */\n@Component({\n tag: 'atomic-result',\n styleUrl: 'atomic-result.pcss',\n shadow: true,\n})\nexport class AtomicResult {\n private layout!: ItemLayout;\n\n @Element() host!: HTMLElement;\n\n /**\n * Whether an atomic-result-link inside atomic-result should stop click event propagation.\n */\n @Prop() stopPropagation?: boolean;\n\n /**\n * The result item.\n */\n @Prop() result!: Result | FoldedResult;\n\n /**\n * The InteractiveResult item.\n * @internal\n */\n @Prop() interactiveResult!: InteractiveResult;\n\n /**\n * Global Atomic state.\n * @internal\n */\n @Prop() store?: SearchStore;\n\n /**\n * The result content to display.\n */\n @Prop() content?: ParentNode;\n\n /**\n * The result link to use when the result is clicked in a grid layout.\n *\n * @default - An `atomic-result-link` without any customization.\n */\n @Prop() linkContent: ParentNode = new DocumentFragment();\n\n /**\n * How results should be displayed.\n */\n @Prop() display: ItemDisplayLayout = 'list';\n\n /**\n * How large or small results should be.\n */\n @Prop() density: ItemDisplayDensity = 'normal';\n\n /**\n * The size of the visual section in result list items.\n *\n * This is overwritten by the image size defined in the result content, if it exists.\n */\n @Prop() imageSize: ItemDisplayImageSize = 'icon';\n\n /**\n * The classes to add to the result element.\n */\n @Prop() classes = '';\n\n /**\n * @internal\n */\n @Prop() loadingFlag?: string;\n\n /**\n * Internal function used by atomic-recs-list in advanced setups, which lets you bypass the standard HTML template system.\n * Particularly useful for Atomic React\n *\n * @internal\n */\n @Prop() renderingFunction: ItemRenderingFunction;\n\n private resultRootRef?: HTMLElement;\n private linkContainerRef?: HTMLElement;\n private executedRenderingFunctionOnce = false;\n\n @Listen('atomic/resolveResult')\n public resolveResult(event: ResultContextEvent<FoldedResult | Result>) {\n event.preventDefault();\n event.stopPropagation();\n event.detail(this.result);\n }\n\n @Listen('atomic/resolveInteractiveResult')\n public resolveInteractiveResult(event: InteractiveResultContextEvent) {\n event.preventDefault();\n event.stopPropagation();\n if (this.interactiveResult) {\n event.detail(this.interactiveResult);\n }\n }\n\n @Listen('atomic/resolveStopPropagation')\n public resolveStopPropagation(event: CustomEvent) {\n event.detail(this.stopPropagation);\n }\n\n @Listen('atomic/resolveResultDisplayConfig')\n public resolveResultDisplayConfig(event: ResultContextEvent<DisplayConfig>) {\n event.preventDefault();\n event.stopPropagation();\n event.detail({\n density: this.density,\n imageSize: this.imageSize!,\n });\n }\n\n @Listen('click')\n public handleClick(event: MouseEvent) {\n if (this.stopPropagation) {\n event.stopPropagation();\n }\n this.host\n .shadowRoot!.querySelector<HTMLAnchorElement>(\n '.link-container > atomic-result-link a:not([slot])'\n )\n ?.click();\n }\n\n public connectedCallback() {\n this.layout = new ItemLayout(\n this.content!.children,\n this.display,\n this.density,\n this.imageSize\n );\n }\n\n private get isCustomRenderFunctionMode() {\n return this.renderingFunction !== undefined;\n }\n\n private getContentHTML() {\n return parentNodeToString(this.content!);\n }\n\n private getLinkHTML() {\n return parentNodeToString(this.linkContent);\n }\n\n private shouldExecuteRenderFunction() {\n return (\n this.isCustomRenderFunctionMode &&\n this.resultRootRef &&\n !this.executedRenderingFunctionOnce\n );\n }\n\n public render() {\n if (this.isCustomRenderFunctionMode) {\n return (\n <Host class={resultComponentClass}>\n <div\n class=\"result-root\"\n ref={(ref) => (this.resultRootRef = ref)}\n ></div>\n <div\n class=\"link-container\"\n ref={(ref) => (this.linkContainerRef = ref)}\n ></div>\n </Host>\n );\n }\n return (\n <Host class={resultComponentClass}>\n <div\n class={`result-root ${this.layout\n .getClasses()\n .concat(this.classes)\n .join(' ')}`}\n innerHTML={this.getContentHTML()}\n ></div>\n <div class=\"link-container\" innerHTML={this.getLinkHTML()}></div>\n </Host>\n );\n }\n\n public componentDidLoad() {\n if (this.loadingFlag && this.store) {\n this.store.unsetLoadingFlag(this.loadingFlag);\n }\n this.host.classList.add('hydrated');\n }\n\n public componentDidRender() {\n if (this.shouldExecuteRenderFunction()) {\n const customRenderOutputAsString = this.renderingFunction!(\n this.result,\n this.resultRootRef!,\n this.linkContainerRef!\n );\n\n this.resultRootRef!.className += ` ${this.layout\n .getClasses(customRenderOutputAsString)\n .concat(this.classes)\n .join(' ')}`;\n\n this.executedRenderingFunctionOnce = true;\n }\n this.host.classList.add('hydrated');\n }\n}\n"],"version":3}
1
+ {"file":"atomic-result.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,+kkHAA+kkH,CAAC;AACxmkH,2BAAe,eAAe;;MC2BjB,YAAY;;;;;;;;QAqCf,gBAAW,GAAe,IAAI,gBAAgB,EAAE,CAAC;;;;QAKjD,YAAO,GAAsB,MAAM,CAAC;;;;QAKpC,YAAO,GAAuB,QAAQ,CAAC;;;;;;QAOvC,cAAS,GAAyB,MAAM,CAAC;;;;QAKzC,YAAO,GAAG,EAAE,CAAC;QAiBb,kCAA6B,GAAG,KAAK,CAAC;;;;;;2BAvCZ,IAAI,gBAAgB,EAAE;uBAKnB,MAAM;uBAKL,QAAQ;yBAOJ,MAAM;uBAK9B,EAAE;;;;IAoBb,aAAa,CAAC,KAAgD;QACnE,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAC3B;IAGM,wBAAwB,CAAC,KAAoC;QAClE,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,IAAI,IAAI,CAAC,iBAAiB,EAAE;YAC1B,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;SACtC;KACF;IAGM,sBAAsB,CAAC,KAAkB;QAC9C,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;KACpC;IAGM,0BAA0B,CAAC,KAAwC;QACxE,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,KAAK,CAAC,MAAM,CAAC;YACX,OAAO,EAAE,IAAI,CAA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C,MAAM;iBAC9B,UAAU,EAAE;iBACZ,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;iBACpB,IAAI,CAAC,GAAG,CAAC,EAAE,EACd,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,GAC3B,EACPA,iBAAK,KAAK,EAAC,gBAAgB,EAAC,SAAS,EAAE,IAAI,CAAC,WAAW,EAAE,GAAQ,CAC5D,EACP;KACH;IAEM,gBAAgB;QACrB,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK,EAAE;YAClC,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC/C;QACD,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;KACrC;IAEM,kBAAkB;QACvB,IAAI,IAAI,CAAC,2BAA2B,EAAE,EAAE;YACtC,MAAM,0BAA0B,GAAG,IAAI,CAAC,iBAAkB,CACxD,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,aAAc,EACnB,IAAI,CAAC,gBAAiB,CACvB,CAAC;YAEF,IAAI,CAAC,aAAc,CAAC,SAAS,IAAI,IAAI,IAAI,CAAC,MAAM;iBAC7C,UAAU,CAAC,0BAA0B,CAAC;iBACtC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;iBACpB,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YAEf,IAAI,CAAC,6BAA6B,GAAG,IAAI,CAAC;SAC3C;QACD,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;KACrC;;;;;;;","names":["ItemLayout","parentNodeToString","h","Host","resultComponentClass"],"sources":["src/components/search/atomic-result/atomic-result.pcss?tag=atomic-result&encapsulation=shadow","src/components/search/atomic-result/atomic-result.tsx"],"sourcesContent":["@import '../../common/template-system/template-system.pcss';\n\n:host {\n @apply atomic-template-system;\n}\n","import {FoldedResult, InteractiveResult, Result} from '@coveo/headless';\nimport {Component, h, Prop, Element, Listen, Host} from '@stencil/core';\nimport {parentNodeToString} from '../../../utils/dom-utils';\nimport {DisplayConfig} from '../../common/item-list/stencil-item-decorators';\nimport {\n ItemRenderingFunction,\n resultComponentClass,\n} from '../../common/item-list/stencil-item-list-common';\nimport {\n ItemLayout,\n ItemDisplayDensity,\n ItemDisplayImageSize,\n ItemDisplayLayout,\n} from '../../common/layout/display-options';\nimport {SearchStore} from '../atomic-search-interface/store';\nimport {\n InteractiveResultContextEvent,\n ResultContextEvent,\n} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\n\n/**\n * The `atomic-result` component is used internally by the `atomic-result-list` component.\n */\n@Component({\n tag: 'atomic-result',\n styleUrl: 'atomic-result.pcss',\n shadow: true,\n})\nexport class AtomicResult {\n private layout!: ItemLayout;\n\n @Element() host!: HTMLElement;\n\n /**\n * Whether an atomic-result-link inside atomic-result should stop click event propagation.\n */\n @Prop() stopPropagation?: boolean;\n\n /**\n * The result item.\n */\n @Prop() result!: Result | FoldedResult;\n\n /**\n * The InteractiveResult item.\n * @internal\n */\n @Prop() interactiveResult!: InteractiveResult;\n\n /**\n * Global Atomic state.\n * @internal\n */\n @Prop() store?: SearchStore;\n\n /**\n * The result content to display.\n */\n @Prop() content?: ParentNode;\n\n /**\n * The result link to use when the result is clicked in a grid layout.\n *\n * @default - An `atomic-result-link` without any customization.\n */\n @Prop() linkContent: ParentNode = new DocumentFragment();\n\n /**\n * How results should be displayed.\n */\n @Prop() display: ItemDisplayLayout = 'list';\n\n /**\n * How large or small results should be.\n */\n @Prop() density: ItemDisplayDensity = 'normal';\n\n /**\n * The size of the visual section in result list items.\n *\n * This is overwritten by the image size defined in the result content, if it exists.\n */\n @Prop() imageSize: ItemDisplayImageSize = 'icon';\n\n /**\n * The classes to add to the result element.\n */\n @Prop() classes = '';\n\n /**\n * @internal\n */\n @Prop() loadingFlag?: string;\n\n /**\n * Internal function used by atomic-recs-list in advanced setups, which lets you bypass the standard HTML template system.\n * Particularly useful for Atomic React\n *\n * @internal\n */\n @Prop() renderingFunction: ItemRenderingFunction;\n\n private resultRootRef?: HTMLElement;\n private linkContainerRef?: HTMLElement;\n private executedRenderingFunctionOnce = false;\n\n @Listen('atomic/resolveResult')\n public resolveResult(event: ResultContextEvent<FoldedResult | Result>) {\n event.preventDefault();\n event.stopPropagation();\n event.detail(this.result);\n }\n\n @Listen('atomic/resolveInteractiveResult')\n public resolveInteractiveResult(event: InteractiveResultContextEvent) {\n event.preventDefault();\n event.stopPropagation();\n if (this.interactiveResult) {\n event.detail(this.interactiveResult);\n }\n }\n\n @Listen('atomic/resolveStopPropagation')\n public resolveStopPropagation(event: CustomEvent) {\n event.detail(this.stopPropagation);\n }\n\n @Listen('atomic/resolveResultDisplayConfig')\n public resolveResultDisplayConfig(event: ResultContextEvent<DisplayConfig>) {\n event.preventDefault();\n event.stopPropagation();\n event.detail({\n density: this.density,\n imageSize: this.imageSize!,\n });\n }\n\n @Listen('click')\n public handleClick(event: MouseEvent) {\n if (this.stopPropagation) {\n event.stopPropagation();\n }\n this.host\n .shadowRoot!.querySelector<HTMLAnchorElement>(\n '.link-container > atomic-result-link a:not([slot])'\n )\n ?.click();\n }\n\n public connectedCallback() {\n this.layout = new ItemLayout(\n this.content!.children,\n this.display,\n this.density,\n this.imageSize\n );\n }\n\n private get isCustomRenderFunctionMode() {\n return this.renderingFunction !== undefined;\n }\n\n private getContentHTML() {\n return parentNodeToString(this.content!);\n }\n\n private getLinkHTML() {\n return parentNodeToString(this.linkContent);\n }\n\n private shouldExecuteRenderFunction() {\n return (\n this.isCustomRenderFunctionMode &&\n this.resultRootRef &&\n !this.executedRenderingFunctionOnce\n );\n }\n\n public render() {\n if (this.isCustomRenderFunctionMode) {\n return (\n <Host class={resultComponentClass}>\n <div\n class=\"result-root\"\n ref={(ref) => (this.resultRootRef = ref)}\n ></div>\n <div\n class=\"link-container\"\n ref={(ref) => (this.linkContainerRef = ref)}\n ></div>\n </Host>\n );\n }\n return (\n <Host class={resultComponentClass}>\n <div\n class={`result-root ${this.layout\n .getClasses()\n .concat(this.classes)\n .join(' ')}`}\n innerHTML={this.getContentHTML()}\n ></div>\n <div class=\"link-container\" innerHTML={this.getLinkHTML()}></div>\n </Host>\n );\n }\n\n public componentDidLoad() {\n if (this.loadingFlag && this.store) {\n this.store.unsetLoadingFlag(this.loadingFlag);\n }\n this.host.classList.add('hydrated');\n }\n\n public componentDidRender() {\n if (this.shouldExecuteRenderFunction()) {\n const customRenderOutputAsString = this.renderingFunction!(\n this.result,\n this.resultRootRef!,\n this.linkContainerRef!\n );\n\n this.resultRootRef!.className += ` ${this.layout\n .getClasses(customRenderOutputAsString)\n .concat(this.classes)\n .join(' ')}`;\n\n this.executedRenderingFunctionOnce = true;\n }\n this.host.classList.add('hydrated');\n }\n}\n"],"version":3}
@@ -11,7 +11,7 @@ const localStorageUtils = require('./local-storage-utils-380ce22b.js');
11
11
  const replaceBreakpointUtils = require('./replace-breakpoint-utils-47f2eaa4.js');
12
12
  const stencilAccessibilityUtils = require('./stencil-accessibility-utils-86cc7071.js');
13
13
  const utils = require('./utils-12b49e87.js');
14
- const stencilSuggestionManager = require('./stencil-suggestion-manager-88cb88f2.js');
14
+ const stencilSuggestionManager = require('./stencil-suggestion-manager-2cba6d69.js');
15
15
  const stencilButton = require('./stencil-button-94b89acc.js');
16
16
  const suggestionsUtils = require('./suggestions-utils-61000808.js');
17
17
  const slotUtils = require('./slot-utils-a30cb814.js');
@@ -109,7 +109,6 @@ const AtomicSearchBox = class {
109
109
  onInput: (e) => this.onInput(e.target.value),
110
110
  onKeyDown: (e) => this.onKeyDown(e),
111
111
  onClear: () => {
112
- this.announceClearSearchBoxToScreenReader();
113
112
  this.searchBox.clear();
114
113
  this.suggestionManager.clearSuggestions();
115
114
  },
@@ -418,9 +417,6 @@ const AtomicSearchBox = class {
418
417
  this.suggestionsAriaMessage = ariaLabel;
419
418
  }
420
419
  }
421
- announceClearSearchBoxToScreenReader() {
422
- this.suggestionsAriaMessage = this.bindings.i18n.t("search-box-cleared");
423
- }
424
420
  announceNewSuggestionsToScreenReader() {
425
421
  const elsLength = this.suggestionManager.allSuggestionElements.filter(suggestionsUtils.elementHasQuery).length;
426
422
  this.searchBoxAriaMessage = elsLength
@@ -449,14 +445,14 @@ const AtomicSearchBox = class {
449
445
  if (!this.suggestionManager.suggestions.length) {
450
446
  this.registerSearchboxSuggestionEvents();
451
447
  }
452
- return (index.h(index.Host, { key: 'd2c0e6203b317f022e1bdd2880fc5f98fc58cc74' }, this.renderAbsolutePositionSpacer(), [
453
- index.h(stencilSuggestionManager.SearchBoxWrapper, { key: '57da951b8bfd7bbb8971e1bdc6cdca2316c171ec', disabled: isDisabled, onFocusout: (event) => {
448
+ return (index.h(index.Host, { key: '382012077ac5fe02ac08358a3629073748aafbaf' }, this.renderAbsolutePositionSpacer(), [
449
+ index.h(stencilSuggestionManager.SearchBoxWrapper, { key: '5e41ae93494bc4e9d72fe6a4868433112db215c3', disabled: isDisabled, onFocusout: (event) => {
454
450
  if (!utils.isFocusingOut(event)) {
455
451
  return;
456
452
  }
457
453
  this.suggestionManager.clearSuggestions();
458
454
  this.isExpanded = false;
459
- } }, this.renderTextBox(searchLabel), index.h(SubmitButton, { key: 'e0e7e57a1d43bcf7badd78427bf6bc1e779a5f98', bindings: this.bindings, disabled: isDisabled, onClick: () => {
455
+ } }, this.renderTextBox(searchLabel), index.h(SubmitButton, { key: 'b9a7ad00f3e531993b3d70960b59ff49aeabb7ee', bindings: this.bindings, disabled: isDisabled, onClick: () => {
460
456
  this.searchBox.submit();
461
457
  this.suggestionManager.clearSuggestions();
462
458
  } }), this.renderSuggestions()),