@coveo/atomic 3.35.0-pre.df6792920f → 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 (273) 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-smart-snippet-source2.js +1 -1
  51. package/dist/atomic/components/atomic-smart-snippet-source2.js.map +1 -1
  52. package/dist/atomic/components/components/commerce/atomic-product-children/atomic-product-children.js +1 -1
  53. package/dist/atomic/components/components/commerce/atomic-product-description/atomic-product-description.js +1 -1
  54. package/dist/atomic/components/components/commerce/atomic-product-excerpt/atomic-product-excerpt.js +1 -1
  55. package/dist/atomic/components/components/commerce/atomic-product-field-condition/atomic-product-field-condition.js +1 -1
  56. package/dist/atomic/components/components/commerce/atomic-product-image/atomic-product-image.js +1 -1
  57. package/dist/atomic/components/components/commerce/atomic-product-link/atomic-product-link.js +2 -1
  58. package/dist/atomic/components/components/commerce/atomic-product-multi-value-text/atomic-product-multi-value-text.js +1 -1
  59. package/dist/atomic/components/components/commerce/atomic-product-numeric-field-value/atomic-product-numeric-field-value.js +1 -1
  60. package/dist/atomic/components/components/commerce/atomic-product-price/atomic-product-price.js +1 -1
  61. package/dist/atomic/components/components/commerce/atomic-product-rating/atomic-product-rating.js +1 -1
  62. package/dist/atomic/components/components/commerce/atomic-product-text/atomic-product-text.js +1 -1
  63. package/dist/atomic/components/components/commerce/product-template-component-utils/context/interactive-product-context-controller.js +25 -0
  64. package/dist/atomic/components/components/commerce/product-template-component-utils/context/product-context-controller.js +29 -0
  65. package/dist/atomic/components/global/environment.js +1 -1
  66. package/dist/atomic/components/index.js.map +1 -1
  67. package/dist/atomic/components/{result-template-decorators.js → stencil-result-template-decorators.js} +6 -2
  68. package/dist/atomic/components/stencil-result-template-decorators.js.map +1 -0
  69. package/dist/atomic/index.esm.js +1 -1
  70. package/dist/atomic/index.esm.js.map +1 -1
  71. package/dist/atomic/{p-955092ed.entry.js → p-01096d1c.entry.js} +2 -2
  72. package/dist/atomic/p-01096d1c.entry.js.map +1 -0
  73. package/dist/atomic/{p-82cd6398.entry.js → p-154cbbfe.entry.js} +2 -2
  74. package/dist/atomic/{p-82cd6398.entry.js.map → p-154cbbfe.entry.js.map} +1 -1
  75. package/dist/atomic/{p-db3b11ca.entry.js → p-2033533c.entry.js} +2 -2
  76. package/dist/atomic/{p-db3b11ca.entry.js.map → p-2033533c.entry.js.map} +1 -1
  77. package/dist/atomic/{p-4069d801.entry.js → p-268ce7ca.entry.js} +2 -2
  78. package/dist/atomic/p-268ce7ca.entry.js.map +1 -0
  79. package/dist/atomic/{p-e9dc8e90.entry.js → p-3ec45f9c.entry.js} +2 -2
  80. package/dist/atomic/p-3ec45f9c.entry.js.map +1 -0
  81. package/dist/atomic/{p-18684d4c.js → p-4080f740.js} +1 -1
  82. package/dist/atomic/p-4080f740.js.map +1 -0
  83. package/dist/atomic/{p-8d5228da.entry.js → p-42fffab2.entry.js} +2 -2
  84. package/dist/atomic/p-42fffab2.entry.js.map +1 -0
  85. package/dist/atomic/{p-190ddaca.entry.js → p-4cf97b0a.entry.js} +2 -2
  86. package/dist/atomic/p-4cf97b0a.entry.js.map +1 -0
  87. package/dist/atomic/{p-78427c6a.entry.js → p-5a9460ab.entry.js} +2 -2
  88. package/dist/atomic/p-5a9460ab.entry.js.map +1 -0
  89. package/dist/atomic/{p-15547bd5.entry.js → p-61b3f5ce.entry.js} +2 -2
  90. package/dist/atomic/p-61b3f5ce.entry.js.map +1 -0
  91. package/dist/atomic/{p-1ff7a9da.entry.js → p-6a3b139f.entry.js} +2 -2
  92. package/dist/atomic/p-6a3b139f.entry.js.map +1 -0
  93. package/dist/atomic/{p-df8d38ca.entry.js → p-7015679e.entry.js} +2 -2
  94. package/dist/atomic/p-7015679e.entry.js.map +1 -0
  95. package/dist/atomic/{p-dea22a8d.entry.js → p-886b184f.entry.js} +2 -2
  96. package/dist/atomic/p-886b184f.entry.js.map +1 -0
  97. package/dist/atomic/{p-b3f6561d.entry.js → p-8e964890.entry.js} +2 -2
  98. package/dist/atomic/p-8e964890.entry.js.map +1 -0
  99. package/dist/atomic/{p-182f9112.entry.js → p-a413f820.entry.js} +2 -2
  100. package/dist/atomic/p-a413f820.entry.js.map +1 -0
  101. package/dist/atomic/{p-1a5ff6af.entry.js → p-a7c39901.entry.js} +2 -2
  102. package/dist/atomic/{p-5cab535b.entry.js → p-c5bd7f8d.entry.js} +2 -2
  103. package/dist/atomic/p-c5bd7f8d.entry.js.map +1 -0
  104. package/dist/atomic/{p-852cc16d.entry.js → p-cacb7fd8.entry.js} +2 -2
  105. package/dist/atomic/p-cacb7fd8.entry.js.map +1 -0
  106. package/dist/atomic/{p-c5164dbf.entry.js → p-cee86cff.entry.js} +2 -2
  107. package/dist/atomic/p-cee86cff.entry.js.map +1 -0
  108. package/dist/atomic/{p-4cb91ee7.entry.js → p-d5402772.entry.js} +2 -2
  109. package/dist/atomic/p-d5402772.entry.js.map +1 -0
  110. package/dist/atomic/{p-e6dc9de7.entry.js → p-da141605.entry.js} +2 -2
  111. package/dist/atomic/p-da141605.entry.js.map +1 -0
  112. package/dist/atomic/{p-a1798150.entry.js → p-dd258eaa.entry.js} +2 -2
  113. package/dist/atomic/p-dd258eaa.entry.js.map +1 -0
  114. package/dist/atomic/{p-945ddd53.entry.js → p-e1dbe31d.entry.js} +2 -2
  115. package/dist/atomic/p-e1dbe31d.entry.js.map +1 -0
  116. package/dist/atomic/{p-448091f7.entry.js → p-ecd3c0a9.entry.js} +2 -2
  117. package/dist/atomic/p-ecd3c0a9.entry.js.map +1 -0
  118. package/dist/atomic/{p-c2a5dac0.entry.js → p-f2c4209d.entry.js} +2 -2
  119. package/dist/atomic/{p-57049cd2.entry.js → p-f2c89d7c.entry.js} +2 -2
  120. package/dist/atomic/p-f2c89d7c.entry.js.map +1 -0
  121. package/dist/atomic/p-f800678c.entry.js.map +1 -1
  122. package/dist/cjs/_index.cjs.js +20 -20
  123. package/dist/cjs/atomic-field-condition.cjs.entry.js +2 -2
  124. package/dist/cjs/atomic-field-condition.cjs.entry.js.map +1 -1
  125. package/dist/cjs/atomic-insight-result-action.cjs.entry.js +3 -3
  126. package/dist/cjs/atomic-insight-result-action.cjs.entry.js.map +1 -1
  127. package/dist/cjs/atomic-insight-result-attach-to-case-action.cjs.entry.js +3 -3
  128. package/dist/cjs/atomic-insight-result-attach-to-case-action.cjs.entry.js.map +1 -1
  129. package/dist/cjs/atomic-insight-result-attach-to-case-indicator.cjs.entry.js +3 -3
  130. package/dist/cjs/atomic-insight-result-attach-to-case-indicator.cjs.entry.js.map +1 -1
  131. package/dist/cjs/atomic-insight-result-quickview-action.cjs.entry.js +3 -3
  132. package/dist/cjs/atomic-insight-result-quickview-action.cjs.entry.js.map +1 -1
  133. package/dist/cjs/atomic-ipx-result-link.cjs.entry.js +4 -4
  134. package/dist/cjs/atomic-ipx-result-link.cjs.entry.js.map +1 -1
  135. package/dist/cjs/atomic-quickview-modal.cjs.entry.js +1 -1
  136. package/dist/cjs/atomic-quickview.cjs.entry.js +3 -3
  137. package/dist/cjs/atomic-quickview.cjs.entry.js.map +1 -1
  138. package/dist/cjs/atomic-recs-interface.cjs.entry.js +1 -1
  139. package/dist/cjs/atomic-result-badge.cjs.entry.js +2 -2
  140. package/dist/cjs/atomic-result-badge.cjs.entry.js.map +1 -1
  141. package/dist/cjs/atomic-result-children.cjs.entry.js +3 -3
  142. package/dist/cjs/atomic-result-children.cjs.entry.js.map +1 -1
  143. package/dist/cjs/atomic-result-date.cjs.entry.js +2 -2
  144. package/dist/cjs/atomic-result-date.cjs.entry.js.map +1 -1
  145. package/dist/cjs/atomic-result-fields-list.cjs.entry.js +3 -3
  146. package/dist/cjs/atomic-result-fields-list.cjs.entry.js.map +1 -1
  147. package/dist/cjs/atomic-result-html.cjs.entry.js +2 -2
  148. package/dist/cjs/atomic-result-html.cjs.entry.js.map +1 -1
  149. package/dist/cjs/atomic-result-icon.cjs.entry.js +2 -2
  150. package/dist/cjs/atomic-result-icon.cjs.entry.js.map +1 -1
  151. package/dist/cjs/atomic-result-image.cjs.entry.js +2 -2
  152. package/dist/cjs/atomic-result-image.cjs.entry.js.map +1 -1
  153. package/dist/cjs/atomic-result-link.cjs.entry.js +4 -4
  154. package/dist/cjs/atomic-result-link.cjs.entry.js.map +1 -1
  155. package/dist/cjs/atomic-result-localized-text.cjs.entry.js +3 -3
  156. package/dist/cjs/atomic-result-localized-text.cjs.entry.js.map +1 -1
  157. package/dist/cjs/atomic-result-multi-value-text.cjs.entry.js +2 -2
  158. package/dist/cjs/atomic-result-multi-value-text.cjs.entry.js.map +1 -1
  159. package/dist/cjs/atomic-result-number.cjs.entry.js +2 -2
  160. package/dist/cjs/atomic-result-number.cjs.entry.js.map +1 -1
  161. package/dist/cjs/atomic-result-printable-uri.cjs.entry.js +2 -2
  162. package/dist/cjs/atomic-result-printable-uri.cjs.entry.js.map +1 -1
  163. package/dist/cjs/atomic-result-rating.cjs.entry.js +2 -2
  164. package/dist/cjs/atomic-result-rating.cjs.entry.js.map +1 -1
  165. package/dist/cjs/atomic-result-text_2.cjs.entry.js +2 -2
  166. package/dist/cjs/atomic-result-text_2.cjs.entry.js.map +1 -1
  167. package/dist/cjs/atomic-result-timespan.cjs.entry.js +2 -2
  168. package/dist/cjs/atomic-result-timespan.cjs.entry.js.map +1 -1
  169. package/dist/cjs/atomic-result.cjs.entry.js.map +1 -1
  170. package/dist/cjs/atomic-smart-snippet-answer_2.cjs.entry.js +1 -1
  171. package/dist/cjs/atomic-smart-snippet-answer_2.cjs.entry.js.map +1 -1
  172. package/dist/cjs/index.cjs.js.map +1 -1
  173. package/dist/cjs/{result-template-decorators-432d11a9.js → stencil-result-template-decorators-28b05aaf.js} +6 -2
  174. package/dist/cjs/stencil-result-template-decorators-28b05aaf.js.map +1 -0
  175. package/dist/cjs/version.cjs.js +1 -1
  176. package/dist/esm/_index.js +19 -19
  177. package/dist/esm/atomic-field-condition.entry.js +1 -1
  178. package/dist/esm/atomic-field-condition.entry.js.map +1 -1
  179. package/dist/esm/atomic-insight-result-action.entry.js +2 -2
  180. package/dist/esm/atomic-insight-result-action.entry.js.map +1 -1
  181. package/dist/esm/atomic-insight-result-attach-to-case-action.entry.js +2 -2
  182. package/dist/esm/atomic-insight-result-attach-to-case-action.entry.js.map +1 -1
  183. package/dist/esm/atomic-insight-result-attach-to-case-indicator.entry.js +2 -2
  184. package/dist/esm/atomic-insight-result-attach-to-case-indicator.entry.js.map +1 -1
  185. package/dist/esm/atomic-insight-result-quickview-action.entry.js +2 -2
  186. package/dist/esm/atomic-insight-result-quickview-action.entry.js.map +1 -1
  187. package/dist/esm/atomic-ipx-result-link.entry.js +2 -2
  188. package/dist/esm/atomic-ipx-result-link.entry.js.map +1 -1
  189. package/dist/esm/atomic-quickview-modal.entry.js +1 -1
  190. package/dist/esm/atomic-quickview.entry.js +2 -2
  191. package/dist/esm/atomic-quickview.entry.js.map +1 -1
  192. package/dist/esm/atomic-recs-interface.entry.js +1 -1
  193. package/dist/esm/atomic-result-badge.entry.js +1 -1
  194. package/dist/esm/atomic-result-badge.entry.js.map +1 -1
  195. package/dist/esm/atomic-result-children.entry.js +2 -2
  196. package/dist/esm/atomic-result-children.entry.js.map +1 -1
  197. package/dist/esm/atomic-result-date.entry.js +1 -1
  198. package/dist/esm/atomic-result-date.entry.js.map +1 -1
  199. package/dist/esm/atomic-result-fields-list.entry.js +2 -2
  200. package/dist/esm/atomic-result-fields-list.entry.js.map +1 -1
  201. package/dist/esm/atomic-result-html.entry.js +1 -1
  202. package/dist/esm/atomic-result-html.entry.js.map +1 -1
  203. package/dist/esm/atomic-result-icon.entry.js +1 -1
  204. package/dist/esm/atomic-result-icon.entry.js.map +1 -1
  205. package/dist/esm/atomic-result-image.entry.js +1 -1
  206. package/dist/esm/atomic-result-image.entry.js.map +1 -1
  207. package/dist/esm/atomic-result-link.entry.js +2 -2
  208. package/dist/esm/atomic-result-link.entry.js.map +1 -1
  209. package/dist/esm/atomic-result-localized-text.entry.js +2 -2
  210. package/dist/esm/atomic-result-localized-text.entry.js.map +1 -1
  211. package/dist/esm/atomic-result-multi-value-text.entry.js +1 -1
  212. package/dist/esm/atomic-result-multi-value-text.entry.js.map +1 -1
  213. package/dist/esm/atomic-result-number.entry.js +1 -1
  214. package/dist/esm/atomic-result-number.entry.js.map +1 -1
  215. package/dist/esm/atomic-result-printable-uri.entry.js +1 -1
  216. package/dist/esm/atomic-result-printable-uri.entry.js.map +1 -1
  217. package/dist/esm/atomic-result-rating.entry.js +1 -1
  218. package/dist/esm/atomic-result-rating.entry.js.map +1 -1
  219. package/dist/esm/atomic-result-text_2.entry.js +1 -1
  220. package/dist/esm/atomic-result-text_2.entry.js.map +1 -1
  221. package/dist/esm/atomic-result-timespan.entry.js +1 -1
  222. package/dist/esm/atomic-result-timespan.entry.js.map +1 -1
  223. package/dist/esm/atomic-result.entry.js.map +1 -1
  224. package/dist/esm/atomic-smart-snippet-answer_2.entry.js +1 -1
  225. package/dist/esm/atomic-smart-snippet-answer_2.entry.js.map +1 -1
  226. package/dist/esm/index.js.map +1 -1
  227. package/dist/esm/{result-template-decorators-2ed76ea9.js → stencil-result-template-decorators-f989bc6b.js} +6 -2
  228. package/dist/esm/stencil-result-template-decorators-f989bc6b.js.map +1 -0
  229. package/dist/esm/version.js +1 -1
  230. package/dist/types/components/commerce/atomic-product/atomic-product.d.ts +1 -1
  231. package/dist/types/components/commerce/product-template-component-utils/context/fetch-product-context.d.ts +12 -0
  232. package/dist/types/components/commerce/product-template-component-utils/context/interactive-product-context-controller.d.ts +27 -0
  233. package/dist/types/components/commerce/product-template-component-utils/context/product-context-controller.d.ts +33 -0
  234. package/dist/types/components/commerce/product-template-component-utils/{stencil-product-template-decorators.d.ts → context/stencil-product-template-decorators.d.ts} +1 -1
  235. package/dist/types/components/common/smart-snippets/atomic-smart-snippet-source.d.ts +1 -1
  236. package/dist/types/components/search/atomic-result/atomic-result.d.ts +1 -1
  237. package/dist/types/components/search/result-template-component-utils/context/fetch-result-context.d.ts +8 -0
  238. package/dist/types/components/search/result-template-component-utils/context/interactive-result-context-controller.d.ts +12 -0
  239. package/dist/types/components/search/result-template-component-utils/context/result-context-controller.d.ts +18 -0
  240. 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
  241. package/dist/types/index.d.ts +3 -3
  242. package/docs/atomic-docs.json +1 -1
  243. package/package.json +1 -1
  244. package/dist/atomic/components/components/common/item-list/fetch-item-context.js +0 -15
  245. package/dist/atomic/components/decorators/commerce/product-template-decorators.js +0 -68
  246. package/dist/atomic/components/result-template-decorators.js.map +0 -1
  247. package/dist/atomic/p-15547bd5.entry.js.map +0 -1
  248. package/dist/atomic/p-182f9112.entry.js.map +0 -1
  249. package/dist/atomic/p-18684d4c.js.map +0 -1
  250. package/dist/atomic/p-190ddaca.entry.js.map +0 -1
  251. package/dist/atomic/p-1ff7a9da.entry.js.map +0 -1
  252. package/dist/atomic/p-4069d801.entry.js.map +0 -1
  253. package/dist/atomic/p-448091f7.entry.js.map +0 -1
  254. package/dist/atomic/p-4cb91ee7.entry.js.map +0 -1
  255. package/dist/atomic/p-57049cd2.entry.js.map +0 -1
  256. package/dist/atomic/p-5cab535b.entry.js.map +0 -1
  257. package/dist/atomic/p-78427c6a.entry.js.map +0 -1
  258. package/dist/atomic/p-852cc16d.entry.js.map +0 -1
  259. package/dist/atomic/p-8d5228da.entry.js.map +0 -1
  260. package/dist/atomic/p-945ddd53.entry.js.map +0 -1
  261. package/dist/atomic/p-955092ed.entry.js.map +0 -1
  262. package/dist/atomic/p-a1798150.entry.js.map +0 -1
  263. package/dist/atomic/p-b3f6561d.entry.js.map +0 -1
  264. package/dist/atomic/p-c5164dbf.entry.js.map +0 -1
  265. package/dist/atomic/p-dea22a8d.entry.js.map +0 -1
  266. package/dist/atomic/p-df8d38ca.entry.js.map +0 -1
  267. package/dist/atomic/p-e6dc9de7.entry.js.map +0 -1
  268. package/dist/atomic/p-e9dc8e90.entry.js.map +0 -1
  269. package/dist/cjs/result-template-decorators-432d11a9.js.map +0 -1
  270. package/dist/esm/result-template-decorators-2ed76ea9.js.map +0 -1
  271. package/dist/types/decorators/commerce/product-template-decorators.d.ts +0 -68
  272. /package/dist/atomic/{p-1a5ff6af.entry.js.map → p-a7c39901.entry.js.map} +0 -0
  273. /package/dist/atomic/{p-c2a5dac0.entry.js.map → p-f2c4209d.entry.js.map} +0 -0
@@ -7,7 +7,7 @@ const insight = require('@coveo/headless/insight');
7
7
  const attach = require('./attach-19283bec.js');
8
8
  const initializationUtils = require('./initialization-utils-92f1b080.js');
9
9
  const stencilIconButton = require('./stencil-iconButton-738b1548.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');
@@ -74,7 +74,7 @@ const AtomicInsightResultAttachToCaseAction = class {
74
74
  : this.bindings.i18n.t('attach-to-case');
75
75
  }
76
76
  render() {
77
- return (index.h(stencilIconButton.IconButton, { key: 'a4c379e41bf53fe8a84830744aa3b6eb9ee793b7', partPrefix: "result-action", style: "outline-neutral", icon: this.getIcon(), title: this.getTooltip(), onClick: () => this.onClick() }));
77
+ return (index.h(stencilIconButton.IconButton, { key: 'e1c89295cfce20a53f7fb4ee0c6bb749c9512969', partPrefix: "result-action", style: "outline-neutral", icon: this.getIcon(), title: this.getTooltip(), onClick: () => this.onClick() }));
78
78
  }
79
79
  get host() { return index.getElement(this); }
80
80
  };
@@ -82,7 +82,7 @@ __decorate([
82
82
  initializationUtils.InitializeBindings()
83
83
  ], AtomicInsightResultAttachToCaseAction.prototype, "bindings", void 0);
84
84
  __decorate([
85
- resultTemplateDecorators.ResultContext()
85
+ stencilResultTemplateDecorators.ResultContext()
86
86
  ], AtomicInsightResultAttachToCaseAction.prototype, "result", void 0);
87
87
  __decorate([
88
88
  initializationUtils.BindStateToController('attachToCase')
@@ -1 +1 @@
1
- {"file":"atomic-insight-result-attach-to-case-action.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,wCAAwC,GAAG,0ljEAA0ljE,CAAC;AAC5ojE,oDAAe,wCAAwC;;;;;;;;;;;;MC4B1C,qCAAqC;;;;;;;;IA+BzC,UAAU;QACf,MAAM,MAAM,GACV,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,EAAE,MAAM,IAAI,EAAE,CAAC;QAC9D,IAAI,CAAC,YAAY,GAAGA,yBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YAC1D,OAAO,EAAE;gBACP,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,MAAM,EAAE,MAAM;aACf;SACF,CAAC,CAAC;KACJ;IAEO,OAAO;QACb,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,EAAE;YAClC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;gBACf,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;gBAClC,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;SACJ;aAAM;YACL,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;gBACf,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;gBAClC,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;SACJ;KACF;IAEO,OAAO;QACb,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,GAAG,UAAU,GAAGC,iBAAU,CAAC;KACjE;IAEO,UAAU;QAChB,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE;cACjC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC;cACxC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;KAC5C;IAEM,MAAM;QACX,QACEC,QAACC,4BAAU,qDACT,UAAU,EAAC,eAAe,EAC1B,KAAK,EAAC,iBAAiB,EACvB,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,EACpB,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EACxB,OAAO,EAAE,MAAM,IAAI,CAAC,OAAO,EAAE,GAC7B,EACF;KACH;;;AAzE4B;IAA5BC,sCAAkB,EAAE;uEAAmC;AAC/B;IAAxBC,sCAAa,EAAE;qEAAyB;AASlC;IAFNC,yCAAqB,CAAC,cAAc,CAAC;gFAER;;;;;","names":["buildAttachToCase","AttachIcon","h","IconButton","InitializeBindings","ResultContext","BindStateToController"],"sources":["src/components/insight/atomic-insight-result-attach-to-case-action/atomic-insight-result-attach-to-case-action.pcss?tag=atomic-insight-result-attach-to-case-action","src/components/insight/atomic-insight-result-attach-to-case-action/atomic-insight-result-attach-to-case-action.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n","import {AttachToCase, buildAttachToCase, Result} from '@coveo/headless/insight';\nimport {Component, Event, State, h, Element, EventEmitter} from '@stencil/core';\nimport AttachIcon from '../../../images/attach.svg';\nimport DetachIcon from '../../../images/detach.svg';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {IconButton} from '../../common/stencil-iconButton';\nimport {ResultContext} from '../../search/result-template-components/result-template-decorators';\nimport {InsightBindings} from '../atomic-insight-interface/atomic-insight-interface';\n\nexport interface InsightResultAttachToCaseEvent {\n callback: () => void;\n result: Result;\n}\n/**\n * @internal\n * The `atomic-insight-result-attach-to-case-action` component can be nested inside a `atomic-insight-result-actions` to render an interactive button that will emit an `atomic/insight/attachToCase/attach` or `atomic/insight/attachToCase/detach` JavaScript event, based on its current state, when clicked.\n *\n * @part result-action-container - The result action container\n * @part result-action-button - The result action button\n * @part result-action-icon - The result action icon\n */\n@Component({\n tag: 'atomic-insight-result-attach-to-case-action',\n styleUrl: 'atomic-insight-result-attach-to-case-action.pcss',\n})\nexport class AtomicInsightResultAttachToCaseAction\n implements InitializableComponent<InsightBindings>\n{\n @InitializeBindings() public bindings!: InsightBindings;\n @ResultContext() private result!: Result;\n\n @Element() host!: HTMLElement;\n @State() public error!: Error;\n\n public attachToCase!: AttachToCase;\n\n @BindStateToController('attachToCase')\n @State()\n public attachToCaseState!: {};\n\n @Event({\n eventName: 'atomic/insight/attachToCase/attach',\n composed: true,\n cancelable: true,\n bubbles: true,\n })\n private attach!: EventEmitter<InsightResultAttachToCaseEvent>;\n\n @Event({\n eventName: 'atomic/insight/attachToCase/detach',\n composed: true,\n cancelable: true,\n bubbles: true,\n })\n private detach!: EventEmitter<InsightResultAttachToCaseEvent>;\n\n public initialize() {\n const caseId: string =\n this.bindings.engine.state.insightCaseContext?.caseId || '';\n this.attachToCase = buildAttachToCase(this.bindings.engine, {\n options: {\n result: this.result,\n caseId: caseId,\n },\n });\n }\n\n private onClick() {\n if (this.attachToCase.isAttached()) {\n this.detach.emit({\n callback: this.attachToCase.detach,\n result: this.result,\n });\n } else {\n this.attach.emit({\n callback: this.attachToCase.attach,\n result: this.result,\n });\n }\n }\n\n private getIcon() {\n return this.attachToCase.isAttached() ? DetachIcon : AttachIcon;\n }\n\n private getTooltip() {\n return this.attachToCase.isAttached()\n ? this.bindings.i18n.t('detach-from-case')\n : this.bindings.i18n.t('attach-to-case');\n }\n\n public render() {\n return (\n <IconButton\n partPrefix=\"result-action\"\n style=\"outline-neutral\"\n icon={this.getIcon()}\n title={this.getTooltip()}\n onClick={() => this.onClick()}\n />\n );\n }\n}\n"],"version":3}
1
+ {"file":"atomic-insight-result-attach-to-case-action.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,wCAAwC,GAAG,0ljEAA0ljE,CAAC;AAC5ojE,oDAAe,wCAAwC;;;;;;;;;;;;MC4B1C,qCAAqC;;;;;;;;IA+BzC,UAAU;QACf,MAAM,MAAM,GACV,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,EAAE,MAAM,IAAI,EAAE,CAAC;QAC9D,IAAI,CAAC,YAAY,GAAGA,yBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YAC1D,OAAO,EAAE;gBACP,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,MAAM,EAAE,MAAM;aACf;SACF,CAAC,CAAC;KACJ;IAEO,OAAO;QACb,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,EAAE;YAClC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;gBACf,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;gBAClC,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;SACJ;aAAM;YACL,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;gBACf,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;gBAClC,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;SACJ;KACF;IAEO,OAAO;QACb,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,GAAG,UAAU,GAAGC,iBAAU,CAAC;KACjE;IAEO,UAAU;QAChB,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE;cACjC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC;cACxC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;KAC5C;IAEM,MAAM;QACX,QACEC,QAACC,4BAAU,qDACT,UAAU,EAAC,eAAe,EAC1B,KAAK,EAAC,iBAAiB,EACvB,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,EACpB,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EACxB,OAAO,EAAE,MAAM,IAAI,CAAC,OAAO,EAAE,GAC7B,EACF;KACH;;;AAzE4B;IAA5BC,sCAAkB,EAAE;uEAAmC;AAC/B;IAAxBC,6CAAa,EAAE;qEAAyB;AASlC;IAFNC,yCAAqB,CAAC,cAAc,CAAC;gFAER;;;;;","names":["buildAttachToCase","AttachIcon","h","IconButton","InitializeBindings","ResultContext","BindStateToController"],"sources":["src/components/insight/atomic-insight-result-attach-to-case-action/atomic-insight-result-attach-to-case-action.pcss?tag=atomic-insight-result-attach-to-case-action","src/components/insight/atomic-insight-result-attach-to-case-action/atomic-insight-result-attach-to-case-action.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n","import {AttachToCase, buildAttachToCase, Result} from '@coveo/headless/insight';\nimport {Component, Event, State, h, Element, EventEmitter} from '@stencil/core';\nimport AttachIcon from '../../../images/attach.svg';\nimport DetachIcon from '../../../images/detach.svg';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {IconButton} from '../../common/stencil-iconButton';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\nimport {InsightBindings} from '../atomic-insight-interface/atomic-insight-interface';\n\nexport interface InsightResultAttachToCaseEvent {\n callback: () => void;\n result: Result;\n}\n/**\n * @internal\n * The `atomic-insight-result-attach-to-case-action` component can be nested inside a `atomic-insight-result-actions` to render an interactive button that will emit an `atomic/insight/attachToCase/attach` or `atomic/insight/attachToCase/detach` JavaScript event, based on its current state, when clicked.\n *\n * @part result-action-container - The result action container\n * @part result-action-button - The result action button\n * @part result-action-icon - The result action icon\n */\n@Component({\n tag: 'atomic-insight-result-attach-to-case-action',\n styleUrl: 'atomic-insight-result-attach-to-case-action.pcss',\n})\nexport class AtomicInsightResultAttachToCaseAction\n implements InitializableComponent<InsightBindings>\n{\n @InitializeBindings() public bindings!: InsightBindings;\n @ResultContext() private result!: Result;\n\n @Element() host!: HTMLElement;\n @State() public error!: Error;\n\n public attachToCase!: AttachToCase;\n\n @BindStateToController('attachToCase')\n @State()\n public attachToCaseState!: {};\n\n @Event({\n eventName: 'atomic/insight/attachToCase/attach',\n composed: true,\n cancelable: true,\n bubbles: true,\n })\n private attach!: EventEmitter<InsightResultAttachToCaseEvent>;\n\n @Event({\n eventName: 'atomic/insight/attachToCase/detach',\n composed: true,\n cancelable: true,\n bubbles: true,\n })\n private detach!: EventEmitter<InsightResultAttachToCaseEvent>;\n\n public initialize() {\n const caseId: string =\n this.bindings.engine.state.insightCaseContext?.caseId || '';\n this.attachToCase = buildAttachToCase(this.bindings.engine, {\n options: {\n result: this.result,\n caseId: caseId,\n },\n });\n }\n\n private onClick() {\n if (this.attachToCase.isAttached()) {\n this.detach.emit({\n callback: this.attachToCase.detach,\n result: this.result,\n });\n } else {\n this.attach.emit({\n callback: this.attachToCase.attach,\n result: this.result,\n });\n }\n }\n\n private getIcon() {\n return this.attachToCase.isAttached() ? DetachIcon : AttachIcon;\n }\n\n private getTooltip() {\n return this.attachToCase.isAttached()\n ? this.bindings.i18n.t('detach-from-case')\n : this.bindings.i18n.t('attach-to-case');\n }\n\n public render() {\n return (\n <IconButton\n partPrefix=\"result-action\"\n style=\"outline-neutral\"\n icon={this.getIcon()}\n title={this.getTooltip()}\n onClick={() => this.onClick()}\n />\n );\n }\n}\n"],"version":3}
@@ -6,7 +6,7 @@ const index = require('./index-757bc886.js');
6
6
  const insight = require('@coveo/headless/insight');
7
7
  const attach = require('./attach-19283bec.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');
@@ -43,7 +43,7 @@ const AtomicInsightResultAttachToCaseIndicator = class {
43
43
  }
44
44
  render() {
45
45
  if (this.attachToCase.isAttached()) {
46
- return (index.h("atomic-icon", { key: '9e286dbe3cf26d55d1f4407c6125c13d2d8a3026', part: "icon", class: "flex w-5 justify-center", icon: attach.AttachIcon, title: this.bindings.i18n.t('result-is-attached') }));
46
+ return (index.h("atomic-icon", { key: 'ba05b4a5586e7d21e3f5e2657b410a2514183874', part: "icon", class: "flex w-5 justify-center", icon: attach.AttachIcon, title: this.bindings.i18n.t('result-is-attached') }));
47
47
  }
48
48
  }
49
49
  get host() { return index.getElement(this); }
@@ -52,7 +52,7 @@ __decorate([
52
52
  initializationUtils.InitializeBindings()
53
53
  ], AtomicInsightResultAttachToCaseIndicator.prototype, "bindings", void 0);
54
54
  __decorate([
55
- resultTemplateDecorators.ResultContext()
55
+ stencilResultTemplateDecorators.ResultContext()
56
56
  ], AtomicInsightResultAttachToCaseIndicator.prototype, "result", void 0);
57
57
  __decorate([
58
58
  initializationUtils.BindStateToController('attachToCase')
@@ -1 +1 @@
1
- {"file":"atomic-insight-result-attach-to-case-indicator.entry.cjs.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,2CAA2C,GAAG,0ljEAA0ljE,CAAC;AAC/ojE,uDAAe,2CAA2C;;;;;;;;;;;;MCoB7C,wCAAwC;;;;;;IAe5C,UAAU;QACf,MAAM,MAAM,GACV,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,EAAE,MAAM,IAAI,EAAE,CAAC;QAC9D,IAAI,CAAC,YAAY,GAAGA,yBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YAC1D,OAAO,EAAE;gBACP,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,MAAM,EAAE,MAAM;aACf;SACF,CAAC,CAAC;KACJ;IAEM,MAAM;QACX,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,EAAE;YAClC,QACEC,0EACE,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,yBAAyB,EAC/B,IAAI,EAAEC,iBAAU,EAChB,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAoB,CAAC,GACpC,EACf;SACH;KACF;;;AAlC4B;IAA5BC,sCAAkB,EAAE;0EAAmC;AAC/B;IAAxBC,sCAAa,EAAE;wEAAyB;AASlC;IAFNC,yCAAqB,CAAC,cAAc,CAAC;mFAER;;;;;","names":["buildAttachToCase","h","AttachIcon","InitializeBindings","ResultContext","BindStateToController"],"sources":["src/components/insight/atomic-insight-result-attach-to-case-indicator/atomic-insight-result-attach-to-case-indicator.pcss?tag=atomic-insight-result-attach-to-case-indicator","src/components/insight/atomic-insight-result-attach-to-case-indicator/atomic-insight-result-attach-to-case-indicator.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n","import {AttachToCase, buildAttachToCase, Result} from '@coveo/headless/insight';\nimport {Component, State, h, Element} from '@stencil/core';\nimport AttachIcon from '../../../images/attach.svg';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {ResultContext} from '../../search/result-template-components/result-template-decorators';\nimport {InsightBindings} from '../atomic-insight-interface/atomic-insight-interface';\n\n/**\n * @internal\n * The `atomic-insight-result-attach-to-case-indicator` component can be included inside a result template to indicate whether a result is attached to the current case.\n *\n * @part icon The icon that indicates whether the result is attached to the case.\n */\n@Component({\n tag: 'atomic-insight-result-attach-to-case-indicator',\n styleUrl: 'atomic-insight-result-attach-to-case-indicator.pcss',\n})\nexport class AtomicInsightResultAttachToCaseIndicator\n implements InitializableComponent<InsightBindings>\n{\n @InitializeBindings() public bindings!: InsightBindings;\n @ResultContext() private result!: Result;\n\n @Element() host!: HTMLElement;\n @State() public error!: Error;\n\n public attachToCase!: AttachToCase;\n\n @BindStateToController('attachToCase')\n @State()\n public attachToCaseState!: {};\n\n public initialize() {\n const caseId: string =\n this.bindings.engine.state.insightCaseContext?.caseId || '';\n this.attachToCase = buildAttachToCase(this.bindings.engine, {\n options: {\n result: this.result,\n caseId: caseId,\n },\n });\n }\n\n public render() {\n if (this.attachToCase.isAttached()) {\n return (\n <atomic-icon\n part=\"icon\"\n class=\"flex w-5 justify-center\"\n icon={AttachIcon}\n title={this.bindings.i18n.t('result-is-attached')}\n ></atomic-icon>\n );\n }\n }\n}\n"],"version":3}
1
+ {"file":"atomic-insight-result-attach-to-case-indicator.entry.cjs.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,2CAA2C,GAAG,0ljEAA0ljE,CAAC;AAC/ojE,uDAAe,2CAA2C;;;;;;;;;;;;MCoB7C,wCAAwC;;;;;;IAe5C,UAAU;QACf,MAAM,MAAM,GACV,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,EAAE,MAAM,IAAI,EAAE,CAAC;QAC9D,IAAI,CAAC,YAAY,GAAGA,yBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YAC1D,OAAO,EAAE;gBACP,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,MAAM,EAAE,MAAM;aACf;SACF,CAAC,CAAC;KACJ;IAEM,MAAM;QACX,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,EAAE;YAClC,QACEC,0EACE,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,yBAAyB,EAC/B,IAAI,EAAEC,iBAAU,EAChB,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAoB,CAAC,GACpC,EACf;SACH;KACF;;;AAlC4B;IAA5BC,sCAAkB,EAAE;0EAAmC;AAC/B;IAAxBC,6CAAa,EAAE;wEAAyB;AASlC;IAFNC,yCAAqB,CAAC,cAAc,CAAC;mFAER;;;;;","names":["buildAttachToCase","h","AttachIcon","InitializeBindings","ResultContext","BindStateToController"],"sources":["src/components/insight/atomic-insight-result-attach-to-case-indicator/atomic-insight-result-attach-to-case-indicator.pcss?tag=atomic-insight-result-attach-to-case-indicator","src/components/insight/atomic-insight-result-attach-to-case-indicator/atomic-insight-result-attach-to-case-indicator.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n","import {AttachToCase, buildAttachToCase, Result} from '@coveo/headless/insight';\nimport {Component, State, h, Element} from '@stencil/core';\nimport AttachIcon from '../../../images/attach.svg';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\nimport {InsightBindings} from '../atomic-insight-interface/atomic-insight-interface';\n\n/**\n * @internal\n * The `atomic-insight-result-attach-to-case-indicator` component can be included inside a result template to indicate whether a result is attached to the current case.\n *\n * @part icon The icon that indicates whether the result is attached to the case.\n */\n@Component({\n tag: 'atomic-insight-result-attach-to-case-indicator',\n styleUrl: 'atomic-insight-result-attach-to-case-indicator.pcss',\n})\nexport class AtomicInsightResultAttachToCaseIndicator\n implements InitializableComponent<InsightBindings>\n{\n @InitializeBindings() public bindings!: InsightBindings;\n @ResultContext() private result!: Result;\n\n @Element() host!: HTMLElement;\n @State() public error!: Error;\n\n public attachToCase!: AttachToCase;\n\n @BindStateToController('attachToCase')\n @State()\n public attachToCaseState!: {};\n\n public initialize() {\n const caseId: string =\n this.bindings.engine.state.insightCaseContext?.caseId || '';\n this.attachToCase = buildAttachToCase(this.bindings.engine, {\n options: {\n result: this.result,\n caseId: caseId,\n },\n });\n }\n\n public render() {\n if (this.attachToCase.isAttached()) {\n return (\n <atomic-icon\n part=\"icon\"\n class=\"flex w-5 justify-center\"\n icon={AttachIcon}\n title={this.bindings.i18n.t('result-is-attached')}\n ></atomic-icon>\n );\n }\n }\n}\n"],"version":3}
@@ -9,7 +9,7 @@ const preview = require('./preview-8eebe5d5.js');
9
9
  const initializationUtils = require('./initialization-utils-92f1b080.js');
10
10
  const stencilAccessibilityUtils = require('./stencil-accessibility-utils-86cc7071.js');
11
11
  const stencilIconButton = require('./stencil-iconButton-738b1548.js');
12
- const resultTemplateDecorators = require('./result-template-decorators-432d11a9.js');
12
+ const stencilResultTemplateDecorators = require('./stencil-result-template-decorators-28b05aaf.js');
13
13
  require('./dom-utils-d4790328.js');
14
14
  require('./event-utils-9bfcf3c5.js');
15
15
  require('./init-queue-a18aa323.js');
@@ -118,7 +118,7 @@ const AtomicInsightResultQuickviewAction = class {
118
118
  this.addQuickviewModalIfNeeded();
119
119
  this.updateModalContent();
120
120
  if (this.shouldRenderQuickview) {
121
- return (index.h(stencilIconButton.IconButton, { key: '648a72bbc1fff6f70b9718c24dcda9551bd94ff6', partPrefix: "result-action", style: "outline-neutral", ref: this.focusTarget.setTarget, icon: preview.QuickviewIcon, title: this.bindings.i18n.t('quickview'), onClick: () => this.onClick() }));
121
+ return (index.h(stencilIconButton.IconButton, { key: 'e23b1775e764f5304d2247fe30cb090811abf86f', partPrefix: "result-action", style: "outline-neutral", ref: this.focusTarget.setTarget, icon: preview.QuickviewIcon, title: this.bindings.i18n.t('quickview'), onClick: () => this.onClick() }));
122
122
  }
123
123
  }
124
124
  get host() { return index.getElement(this); }
@@ -127,7 +127,7 @@ __decorate([
127
127
  initializationUtils.InitializeBindings()
128
128
  ], AtomicInsightResultQuickviewAction.prototype, "bindings", void 0);
129
129
  __decorate([
130
- resultTemplateDecorators.ResultContext()
130
+ stencilResultTemplateDecorators.ResultContext()
131
131
  ], AtomicInsightResultQuickviewAction.prototype, "result", void 0);
132
132
  __decorate([
133
133
  initializationUtils.BindStateToController('quickview')
@@ -1 +1 @@
1
- {"file":"atomic-insight-result-quickview-action.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,qCAAqC,GAAG,0ljEAA0ljE,CAAC;AACzojE,iDAAe,qCAAqC;;;;;;;;;;;;MC4BvC,kCAAkC;;;;;;;;;;;;;;QA6BtC,YAAO,GAAG,qDAAqD,CAAC;;;uBAAtD,qDAAqD;;IAM/D,eAAe,CAAC,GAAU;QAC/B,GAAG,CAAC,wBAAwB,EAAE,CAAC;QAC/B,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;KACvB;IAGM,mBAAmB,CAAC,GAAU;QACnC,GAAG,CAAC,wBAAwB,EAAE,CAAC;QAC/B,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;KAC3B;IAID,IAAW,WAAW;QACpB,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE;YAC3B,IAAI,CAAC,iBAAiB,GAAG,IAAIA,+CAAqB,CAAC,IAAI,CAAC,CAAC;SAC1D;QACD,OAAO,IAAI,CAAC,iBAAiB,CAAC;KAC/B;IAEM,UAAU;QACf,IAAI,CAAC,SAAS,GAAGC,uBAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YACpD,OAAO,EAAE,EAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC;SAC/B,CAAC,CAAC;QACH,IAAIC,YAAM,CAAC;YACT,OAAO,EAAE,IAAIC,iBAAW,CAAC;gBACvB,QAAQ,EAAE,IAAI;gBACd,KAAK,EAAE,mBAAmB;aAC3B,CAAC;SACH,CAAC,CAAC,QAAQ,CAAC,EAA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zC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAkB,EAAE;oBACvC,KAAK,EAAE,IAAI,CAAC,cAAc,CAAC,aAAa;oBACxC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,YAAY;oBACtC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK;iBACzB,CAAC,CAAC;SACR;KACF;IAEO,OAAO,CAAC,KAAkB;QAChC,KAAK,EAAE,eAAe,EAAE,CAAC;QACzB,IAAI,CAAC,SAAS,CAAC,kBAAkB,EAAE,CAAC;KACrC;IAED,IAAY,qBAAqB;QAC/B,OAAO,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC;KAC7C;IAEM,MAAM;QACX,IAAI,CAAC,yBAAyB,EAAE,CAAC;QACjC,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC1B,IAAI,IAAI,CAAC,qBAAqB,EAAE;YAC9B,QACEC,QAACC,4BAAU,qDACT,UAAU,EAAC,eAAe,EAC1B,KAAK,EAAC,iBAAiB,EACvB,GAAG,EAAE,IAAI,CAAC,WAAW,CAAC,SAAS,EAC/B,IAAI,EAAEC,qBAAa,EACnB,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,EACxC,OAAO,EAAE,MAAM,IAAI,CAAC,OAAO,EAAE,GAC7B,EACF;SACH;KACF;;;AA5H4B;IAA5BC,sCAAkB,EAAE;oEAA4B;AACxB;IAAxBC,sCAAa,EAAE;kEAAyB;AAWlC;IAFNC,yCAAqB,CAAC,WAAW,CAAC;0EAEI;AAiB7B;IADTC,wCAAc,CAAC,WAAW,CAAC;gFACY;;;;;","names":["FocusTargetController","buildQuickview","Schema","StringValue","h","IconButton","QuickviewIcon","InitializeBindings","ResultContext","BindStateToController","AriaLiveRegion"],"sources":["src/components/insight/atomic-insight-result-quickview-action/atomic-insight-result-quickview-action.pcss?tag=atomic-insight-result-quickview-action","src/components/insight/atomic-insight-result-quickview-action/atomic-insight-result-quickview-action.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n","import {Schema, StringValue} from '@coveo/bueno';\nimport {\n buildQuickview,\n QuickviewState,\n Quickview,\n Result,\n} from '@coveo/headless';\nimport {Component, Listen, Prop, State, h, Element} from '@stencil/core';\nimport QuickviewIcon from '../../../images/preview.svg';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {\n AriaLiveRegion,\n FocusTargetController,\n} from '../../../utils/stencil-accessibility-utils';\nimport {IconButton} from '../../common/stencil-iconButton';\nimport {Bindings} from '../../search/atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '../../search/result-template-components/result-template-decorators';\n\n/**\n * @internal\n */\n@Component({\n tag: 'atomic-insight-result-quickview-action',\n styleUrl: 'atomic-insight-result-quickview-action.pcss',\n})\nexport class AtomicInsightResultQuickviewAction\n implements InitializableComponent\n{\n @InitializeBindings() public bindings!: Bindings;\n @ResultContext() private result!: Result;\n\n private buttonFocusTarget?: FocusTargetController;\n\n @Element() host!: HTMLElement;\n @State() public error!: Error;\n\n public quickview!: Quickview;\n\n @BindStateToController('quickview')\n @State()\n public quickviewState!: QuickviewState;\n\n /**\n * The `sandbox` attribute to apply to the quickview iframe.\n *\n * The quickview is loaded inside an iframe with a [`sandbox`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-sandbox) attribute for security reasons.\n *\n * This attribute exists primarily to protect against potential XSS attacks that could originate from the document being displayed.\n *\n * By default, the sandbox attributes are: `allow-popups allow-top-navigation allow-same-origin`.\n *\n * `allow-same-origin` is not optional, and must always be included in the list of allowed capabilities for the component to function properly.\n */\n @Prop()\n public sandbox = 'allow-popups allow-top-navigation allow-same-origin';\n\n @AriaLiveRegion('quickview')\n protected quickviewAriaMessage!: string;\n\n @Listen('atomic/quickview/next', {target: 'body'})\n public onNextQuickview(evt: Event) {\n evt.stopImmediatePropagation();\n this.quickview.next();\n }\n\n @Listen('atomic/quickview/previous', {target: 'body'})\n public onPreviousQuickview(evt: Event) {\n evt.stopImmediatePropagation();\n this.quickview.previous();\n }\n\n private quickviewModalRef?: HTMLAtomicQuickviewModalElement;\n\n public get focusTarget() {\n if (!this.buttonFocusTarget) {\n this.buttonFocusTarget = new FocusTargetController(this);\n }\n return this.buttonFocusTarget;\n }\n\n public initialize() {\n this.quickview = buildQuickview(this.bindings.engine, {\n options: {result: this.result},\n });\n new Schema({\n sandbox: new StringValue({\n required: true,\n regex: /allow-same-origin/,\n }),\n }).validate({sandbox: this.sandbox});\n }\n\n private addQuickviewModalIfNeeded() {\n if (this.quickviewModalRef) {\n return;\n }\n\n const quickviewModal = this.bindings.interfaceElement.querySelector(\n 'atomic-quickview-modal'\n );\n if (quickviewModal) {\n this.quickviewModalRef = quickviewModal;\n return;\n }\n this.quickviewModalRef = document.createElement('atomic-quickview-modal');\n this.quickviewModalRef.setAttribute('sandbox', this.sandbox);\n this.bindings.interfaceElement.appendChild(this.quickviewModalRef);\n }\n\n private updateModalContent() {\n if (this.quickviewModalRef && this.quickview.state.content) {\n this.quickviewModalRef.content = this.quickview.state.content;\n this.quickviewModalRef.result = this.result;\n this.quickviewModalRef.total = this.quickviewState.totalResults;\n this.quickviewModalRef.current = this.quickviewState.currentResult;\n this.quickviewModalRef.modalCloseCallback = () =>\n this.focusTarget.focus();\n\n this.quickviewAriaMessage = this.quickviewState.isLoading\n ? this.bindings.i18n.t('quickview-loading')\n : this.bindings.i18n.t('quickview-loaded', {\n first: this.quickviewState.currentResult,\n last: this.quickviewState.totalResults,\n title: this.result.title,\n });\n }\n }\n\n private onClick(event?: MouseEvent) {\n event?.stopPropagation();\n this.quickview.fetchResultContent();\n }\n\n private get shouldRenderQuickview() {\n return this.quickviewState.resultHasPreview;\n }\n\n public render() {\n this.addQuickviewModalIfNeeded();\n this.updateModalContent();\n if (this.shouldRenderQuickview) {\n return (\n <IconButton\n partPrefix=\"result-action\"\n style=\"outline-neutral\"\n ref={this.focusTarget.setTarget}\n icon={QuickviewIcon}\n title={this.bindings.i18n.t('quickview')}\n onClick={() => this.onClick()}\n />\n );\n }\n }\n}\n"],"version":3}
1
+ {"file":"atomic-insight-result-quickview-action.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,qCAAqC,GAAG,0ljEAA0ljE,CAAC;AACzojE,iDAAe,qCAAqC;;;;;;;;;;;;MC4BvC,kCAAkC;;;;;;;;;;;;;;QA6BtC,YAAO,GAAG,qDAAqD,CAAC;;;uBAAtD,qDAAqD;;IAM/D,eAAe,CAAC,GAAU;QAC/B,GAAG,CAAC,wBAAwB,EAAE,CAAC;QAC/B,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;KACvB;IAGM,mBAAmB,CAAC,GAAU;QACnC,GAAG,CAAC,wBAAwB,EAAE,CAAC;QAC/B,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;KAC3B;IAID,IAAW,WAAW;QACpB,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE;YAC3B,IAAI,CAAC,iBAAiB,GAAG,IAAIA,+CAAqB,CAAC,IAAI,CAAC,CAAC;SAC1D;QACD,OAAO,IAAI,CAAC,iBAAiB,CAAC;KAC/B;IAEM,UAAU;QACf,IAAI,CAAC,SAAS,GAAGC,uBAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;YACpD,OAAO,EAAE,EAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAC;SAC/B,CAAC,CAAC;QACH,IAAIC,YAAM,CAAC;YACT,OAAO,EAAE,IAAIC,iBAAW,CAAC;gBACvB,QAAQ,EAAE,IAAI;gBACd,KAAK,EAAE,mBAAmB;aAC3B,CAAC;SACH,CAAC,CAAC,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAC,CAAC,CAAC;KACtC;IAEO,yBAAyB;QAC/B,IAAI,IAAI,CAAC,iBAAiB,EAAE;YAC1B,OAAO;S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AAI,EAAE,IAAI,CAAC,cAAc,CAAC,YAAY;oBACtC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK;iBACzB,CAAC,CAAC;SACR;KACF;IAEO,OAAO,CAAC,KAAkB;QAChC,KAAK,EAAE,eAAe,EAAE,CAAC;QACzB,IAAI,CAAC,SAAS,CAAC,kBAAkB,EAAE,CAAC;KACrC;IAED,IAAY,qBAAqB;QAC/B,OAAO,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC;KAC7C;IAEM,MAAM;QACX,IAAI,CAAC,yBAAyB,EAAE,CAAC;QACjC,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC1B,IAAI,IAAI,CAAC,qBAAqB,EAAE;YAC9B,QACEC,QAACC,4BAAU,qDACT,UAAU,EAAC,eAAe,EAC1B,KAAK,EAAC,iBAAiB,EACvB,GAAG,EAAE,IAAI,CAAC,WAAW,CAAC,SAAS,EAC/B,IAAI,EAAEC,qBAAa,EACnB,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,EACxC,OAAO,EAAE,MAAM,IAAI,CAAC,OAAO,EAAE,GAC7B,EACF;SACH;KACF;;;AA5H4B;IAA5BC,sCAAkB,EAAE;oEAA4B;AACxB;IAAxBC,6CAAa,EAAE;kEAAyB;AAWlC;IAFNC,yCAAqB,CAAC,WAAW,CAAC;0EAEI;AAiB7B;IADTC,wCAAc,CAAC,WAAW,CAAC;gFACY;;;;;","names":["FocusTargetController","buildQuickview","Schema","StringValue","h","IconButton","QuickviewIcon","InitializeBindings","ResultContext","BindStateToController","AriaLiveRegion"],"sources":["src/components/insight/atomic-insight-result-quickview-action/atomic-insight-result-quickview-action.pcss?tag=atomic-insight-result-quickview-action","src/components/insight/atomic-insight-result-quickview-action/atomic-insight-result-quickview-action.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n","import {Schema, StringValue} from '@coveo/bueno';\nimport {\n buildQuickview,\n QuickviewState,\n Quickview,\n Result,\n} from '@coveo/headless';\nimport {Component, Listen, Prop, State, h, Element} from '@stencil/core';\nimport QuickviewIcon from '../../../images/preview.svg';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {\n AriaLiveRegion,\n FocusTargetController,\n} from '../../../utils/stencil-accessibility-utils';\nimport {IconButton} from '../../common/stencil-iconButton';\nimport {Bindings} from '../../search/atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\n\n/**\n * @internal\n */\n@Component({\n tag: 'atomic-insight-result-quickview-action',\n styleUrl: 'atomic-insight-result-quickview-action.pcss',\n})\nexport class AtomicInsightResultQuickviewAction\n implements InitializableComponent\n{\n @InitializeBindings() public bindings!: Bindings;\n @ResultContext() private result!: Result;\n\n private buttonFocusTarget?: FocusTargetController;\n\n @Element() host!: HTMLElement;\n @State() public error!: Error;\n\n public quickview!: Quickview;\n\n @BindStateToController('quickview')\n @State()\n public quickviewState!: QuickviewState;\n\n /**\n * The `sandbox` attribute to apply to the quickview iframe.\n *\n * The quickview is loaded inside an iframe with a [`sandbox`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-sandbox) attribute for security reasons.\n *\n * This attribute exists primarily to protect against potential XSS attacks that could originate from the document being displayed.\n *\n * By default, the sandbox attributes are: `allow-popups allow-top-navigation allow-same-origin`.\n *\n * `allow-same-origin` is not optional, and must always be included in the list of allowed capabilities for the component to function properly.\n */\n @Prop()\n public sandbox = 'allow-popups allow-top-navigation allow-same-origin';\n\n @AriaLiveRegion('quickview')\n protected quickviewAriaMessage!: string;\n\n @Listen('atomic/quickview/next', {target: 'body'})\n public onNextQuickview(evt: Event) {\n evt.stopImmediatePropagation();\n this.quickview.next();\n }\n\n @Listen('atomic/quickview/previous', {target: 'body'})\n public onPreviousQuickview(evt: Event) {\n evt.stopImmediatePropagation();\n this.quickview.previous();\n }\n\n private quickviewModalRef?: HTMLAtomicQuickviewModalElement;\n\n public get focusTarget() {\n if (!this.buttonFocusTarget) {\n this.buttonFocusTarget = new FocusTargetController(this);\n }\n return this.buttonFocusTarget;\n }\n\n public initialize() {\n this.quickview = buildQuickview(this.bindings.engine, {\n options: {result: this.result},\n });\n new Schema({\n sandbox: new StringValue({\n required: true,\n regex: /allow-same-origin/,\n }),\n }).validate({sandbox: this.sandbox});\n }\n\n private addQuickviewModalIfNeeded() {\n if (this.quickviewModalRef) {\n return;\n }\n\n const quickviewModal = this.bindings.interfaceElement.querySelector(\n 'atomic-quickview-modal'\n );\n if (quickviewModal) {\n this.quickviewModalRef = quickviewModal;\n return;\n }\n this.quickviewModalRef = document.createElement('atomic-quickview-modal');\n this.quickviewModalRef.setAttribute('sandbox', this.sandbox);\n this.bindings.interfaceElement.appendChild(this.quickviewModalRef);\n }\n\n private updateModalContent() {\n if (this.quickviewModalRef && this.quickview.state.content) {\n this.quickviewModalRef.content = this.quickview.state.content;\n this.quickviewModalRef.result = this.result;\n this.quickviewModalRef.total = this.quickviewState.totalResults;\n this.quickviewModalRef.current = this.quickviewState.currentResult;\n this.quickviewModalRef.modalCloseCallback = () =>\n this.focusTarget.focus();\n\n this.quickviewAriaMessage = this.quickviewState.isLoading\n ? this.bindings.i18n.t('quickview-loading')\n : this.bindings.i18n.t('quickview-loaded', {\n first: this.quickviewState.currentResult,\n last: this.quickviewState.totalResults,\n title: this.result.title,\n });\n }\n }\n\n private onClick(event?: MouseEvent) {\n event?.stopPropagation();\n this.quickview.fetchResultContent();\n }\n\n private get shouldRenderQuickview() {\n return this.quickviewState.resultHasPreview;\n }\n\n public render() {\n this.addQuickviewModalIfNeeded();\n this.updateModalContent();\n if (this.shouldRenderQuickview) {\n return (\n <IconButton\n partPrefix=\"result-action\"\n style=\"outline-neutral\"\n ref={this.focusTarget.setTarget}\n icon={QuickviewIcon}\n title={this.bindings.i18n.t('quickview')}\n onClick={() => this.onClick()}\n />\n );\n }\n }\n}\n"],"version":3}
@@ -11,7 +11,7 @@ const resultUtils = require('./result-utils-3313d650.js');
11
11
  const slotUtils = require('./slot-utils-a30cb814.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('./init-queue-a18aa323.js');
17
17
  require('./initialization-lit-stencil-common-utils-730030b0.js');
@@ -59,7 +59,7 @@ const AtomicIPXResultLink = class {
59
59
  const href = bueno.isUndefined(this.hrefTemplate)
60
60
  ? this.result.clickUri
61
61
  : resultUtils.buildStringTemplateFromResult(this.hrefTemplate, this.result, this.bindings);
62
- return (index.h(stencilItemLink.LinkWithItemAnalytics, { key: 'f5c87e8855c2f386d5ddcca2d8fa7e543d5f3ac8', href: href, onSelect: () => this.onSelect(), onBeginDelayedSelect: () => this.interactiveResult.beginDelayedSelect(), onCancelPendingSelect: () => this.interactiveResult.cancelPendingSelect(), attributes: this.linkAttributes, stopPropagation: this.stopPropagation }, this.hasDefaultSlot ? (index.h("slot", null)) : (index.h("atomic-result-text", { field: "title", default: "no-title" }))));
62
+ return (index.h(stencilItemLink.LinkWithItemAnalytics, { key: 'dce9d569cd2ad2a03e89e5d86365dbfb3ca78deb', href: href, onSelect: () => this.onSelect(), onBeginDelayedSelect: () => this.interactiveResult.beginDelayedSelect(), onCancelPendingSelect: () => this.interactiveResult.cancelPendingSelect(), attributes: this.linkAttributes, stopPropagation: this.stopPropagation }, this.hasDefaultSlot ? (index.h("slot", null)) : (index.h("atomic-result-text", { field: "title", default: "no-title" }))));
63
63
  }
64
64
  get host() { return index.getElement(this); }
65
65
  };
@@ -67,10 +67,10 @@ __decorate([
67
67
  initializationUtils.InitializeBindings()
68
68
  ], AtomicIPXResultLink.prototype, "bindings", void 0);
69
69
  __decorate([
70
- resultTemplateDecorators.ResultContext()
70
+ stencilResultTemplateDecorators.ResultContext()
71
71
  ], AtomicIPXResultLink.prototype, "result", void 0);
72
72
  __decorate([
73
- resultTemplateDecorators.InteractiveResultContext()
73
+ stencilResultTemplateDecorators.InteractiveResultContext()
74
74
  ], AtomicIPXResultLink.prototype, "interactiveResult", void 0);
75
75
  AtomicIPXResultLink.style = AtomicIpxResultLinkStyle0;
76
76
 
@@ -1 +1 @@
1
- {"file":"atomic-ipx-result-link.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;AAAA,MAAM,sBAAsB,GAAG,o8kEAAo8kE,CAAC;AACp+kE,kCAAe,sBAAsB;;;;;;;;;;;;MCiCxB,mBAAmB;;;;;IA6BvB,UAAU;QACf,IAAI,CAAC,IAAI,CAAC,aAAa,CACrBA,2BAAgB,CACd,+BAA+B,EAC/B,CAAC,eAAwB;YACvB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;SACxC,CACF,CACF,CAAC;QACF,IAAI,CAAC,qBAAqB,GAAGC,qCAA4B,CACvD,IAAI,CAAC,QAAQ,CAAC,MAAM,CACrB,CAAC;KACH;IAEM,iBAAiB;QACtB,MAAM,QAAQ,GAAG,YAAY,CAAC;QAC9B,IAAI,CAAC,cAAc,GAAG,CAAC,CAACC,gCAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1D,IAAI,CAAC,cAAc,GAAGC,wCAAyB,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;KACtE;IAEM,MAAM,QAAQ;QACnB,MAAM,iBAAiB,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC;QACtD,IAAI,iBAAiB,IAAI,IAAI,CAAC,qBAAqB,EAAE;YACnD,MAAM,MAAM,GACV,IAAI,CAAC,qBAAqB,CAAC,gCAAgC,CACzD,iBAAiB,CAClB,CAAC;YACJ,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;SACvC;QACD,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC;KACjC;IAEM,MAAM;QACX,MAAM,IAAI,GAAGC,iBAAW,CAAC,IAAI,CAAC,YAAY,CAAC;cACvC,IAAI,CAAC,MAAM,CAAC,QAAQ;cACpBC,yCAA6B,CAC3B,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,QAAQ,CACd,CAAC;QAEN,QACEC,QAACC,qCAAqB,qDACpB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE,EAC/B,oBAAoB,EAAE,MAAM,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,EAAE,EACvE,qBAAqB,EAAE,MACrB,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,EAAE,EAE9C,UAAU,EAAE,IAAI,CAAC,cAAc,EAC/B,eAAe,EAAE,IAAI,CAAC,eAAe,IAEpC,IAAI,CAAC,cAAc,IAClBD,qBAAQ,KAERA,gCACE,KAAK,EAAC,OAAO,EACb,OAAO,EAAC,UAAU,GACE,CACvB,CACqB,EACxB;KACH;;;AAxF4B;IAA5BE,sCAAkB,EAAE;qDAAgC;AAG5B;IAAxBC,sCAAa,EAAE;mDAAkC;AACd;IAAnCC,iDAAwB,EAAE;8DAA+C;;;;;","names":["buildCustomEvent","loadIPXActionsHistoryActions","getDefaultSlotFromHost","getAttributesFromLinkSlot","isUndefined","buildStringTemplateFromResult","h","LinkWithItemAnalytics","InitializeBindings","ResultContext","InteractiveResultContext"],"sources":["src/components/ipx/atomic-ipx-result-link/atomic-ipx-result-link.pcss?tag=atomic-ipx-result-link","src/components/ipx/atomic-ipx-result-link/atomic-ipx-result-link.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n@reference '../../../utils/tailwind-utilities/link-style.css';\n\natomic-ipx-result-link {\n a {\n @apply link-style;\n }\n}\n","import {isUndefined} from '@coveo/bueno';\nimport {\n IPXActionsHistoryActionCreators,\n InteractiveResult,\n loadIPXActionsHistoryActions,\n} from '@coveo/headless';\nimport {Component, h, Prop, Element} from '@stencil/core';\nimport {buildCustomEvent} from '../../../utils/event-utils';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {buildStringTemplateFromResult} from '../../../utils/result-utils';\nimport {getDefaultSlotFromHost} from '../../../utils/slot-utils';\nimport {AnyUnfoldedItem} from '../../common/item-list/unfolded-item';\nimport {getAttributesFromLinkSlot} from '../../common/item-link/attributes-slot';\nimport {LinkWithItemAnalytics} from '../../common/item-link/stencil-item-link';\nimport {RecsBindings} from '../../recommendations/atomic-recs-interface/atomic-recs-interface';\nimport {\n ResultContext,\n InteractiveResultContext,\n} from '../../search/result-template-components/result-template-decorators';\n\n/**\n * The `atomic-ipx-result-link` component automatically transforms a search result title into a clickable link that points to the original item. It is an experimental internal component not intended for general use.\n * @slot default - Lets you display alternative content inside the link\n * @slot attributes - Lets you pass [attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attributes) down to the link element, overriding other attributes, to be used exclusively with an \"a\" tag such as `<a slot=\"attributes\" target=\"_blank\" download></a>`.\n * @internal\n */\n@Component({\n tag: 'atomic-ipx-result-link',\n styleUrl: 'atomic-ipx-result-link.pcss',\n shadow: false,\n})\nexport class AtomicIPXResultLink\n implements InitializableComponent<RecsBindings>\n{\n @InitializeBindings() public bindings!: RecsBindings;\n public error!: Error;\n\n @ResultContext() private result!: AnyUnfoldedItem;\n @InteractiveResultContext() private interactiveResult!: InteractiveResult;\n\n @Element() private host!: HTMLElement;\n\n /**\n * Specifies a template literal from which to generate the `href` attribute value (see\n * [Template literals](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals)).\n *\n * The template literal can reference any number of result properties from the parent result. It can also reference the window object.\n *\n * For example, the following markup generates an `href` value such as `http://uri.com?id=itemTitle`, using the result's `clickUri` and `itemtitle` fields.\n * ```html\n * <atomic-ipx-result-link href-template='${clickUri}?id=${raw.itemtitle}'></atomic-ipx-result-link>\n * ```\n */\n @Prop({reflect: true}) hrefTemplate?: string;\n\n private hasDefaultSlot!: boolean;\n private linkAttributes?: Attr[];\n private stopPropagation?: boolean;\n private actionsHistoryActions?: IPXActionsHistoryActionCreators;\n\n public initialize() {\n this.host.dispatchEvent(\n buildCustomEvent(\n 'atomic/resolveStopPropagation',\n (stopPropagation: boolean) => {\n this.stopPropagation = stopPropagation;\n }\n )\n );\n this.actionsHistoryActions = loadIPXActionsHistoryActions(\n this.bindings.engine\n );\n }\n\n public connectedCallback() {\n const slotName = 'attributes';\n this.hasDefaultSlot = !!getDefaultSlotFromHost(this.host);\n this.linkAttributes = getAttributesFromLinkSlot(this.host, slotName);\n }\n\n public async onSelect() {\n const resultPermanentId = this.result.raw.permanentid;\n if (resultPermanentId && this.actionsHistoryActions) {\n const action =\n this.actionsHistoryActions.addPageViewEntryInActionsHistory(\n resultPermanentId\n );\n this.bindings.engine.dispatch(action);\n }\n this.interactiveResult.select();\n }\n\n public render() {\n const href = isUndefined(this.hrefTemplate)\n ? this.result.clickUri\n : buildStringTemplateFromResult(\n this.hrefTemplate,\n this.result,\n this.bindings\n );\n\n return (\n <LinkWithItemAnalytics\n href={href}\n onSelect={() => this.onSelect()}\n onBeginDelayedSelect={() => this.interactiveResult.beginDelayedSelect()}\n onCancelPendingSelect={() =>\n this.interactiveResult.cancelPendingSelect()\n }\n attributes={this.linkAttributes}\n stopPropagation={this.stopPropagation}\n >\n {this.hasDefaultSlot ? (\n <slot />\n ) : (\n <atomic-result-text\n field=\"title\"\n default=\"no-title\"\n ></atomic-result-text>\n )}\n </LinkWithItemAnalytics>\n );\n }\n}\n"],"version":3}
1
+ {"file":"atomic-ipx-result-link.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;AAAA,MAAM,sBAAsB,GAAG,o8kEAAo8kE,CAAC;AACp+kE,kCAAe,sBAAsB;;;;;;;;;;;;MCiCxB,mBAAmB;;;;;IA6BvB,UAAU;QACf,IAAI,CAAC,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rB,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,EAAE,EAE9C,UAAU,EAAE,IAAI,CAAC,cAAc,EAC/B,eAAe,EAAE,IAAI,CAAC,eAAe,IAEpC,IAAI,CAAC,cAAc,IAClBD,qBAAQ,KAERA,gCACE,KAAK,EAAC,OAAO,EACb,OAAO,EAAC,UAAU,GACE,CACvB,CACqB,EACxB;KACH;;;AAxF4B;IAA5BE,sCAAkB,EAAE;qDAAgC;AAG5B;IAAxBC,6CAAa,EAAE;mDAAkC;AACd;IAAnCC,wDAAwB,EAAE;8DAA+C;;;;;","names":["buildCustomEvent","loadIPXActionsHistoryActions","getDefaultSlotFromHost","getAttributesFromLinkSlot","isUndefined","buildStringTemplateFromResult","h","LinkWithItemAnalytics","InitializeBindings","ResultContext","InteractiveResultContext"],"sources":["src/components/ipx/atomic-ipx-result-link/atomic-ipx-result-link.pcss?tag=atomic-ipx-result-link","src/components/ipx/atomic-ipx-result-link/atomic-ipx-result-link.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n@reference '../../../utils/tailwind-utilities/link-style.css';\n\natomic-ipx-result-link {\n a {\n @apply link-style;\n }\n}\n","import {isUndefined} from '@coveo/bueno';\nimport {\n IPXActionsHistoryActionCreators,\n InteractiveResult,\n loadIPXActionsHistoryActions,\n} from '@coveo/headless';\nimport {Component, h, Prop, Element} from '@stencil/core';\nimport {buildCustomEvent} from '../../../utils/event-utils';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {buildStringTemplateFromResult} from '../../../utils/result-utils';\nimport {getDefaultSlotFromHost} from '../../../utils/slot-utils';\nimport {AnyUnfoldedItem} from '../../common/item-list/unfolded-item';\nimport {getAttributesFromLinkSlot} from '../../common/item-link/attributes-slot';\nimport {LinkWithItemAnalytics} from '../../common/item-link/stencil-item-link';\nimport {RecsBindings} from '../../recommendations/atomic-recs-interface/atomic-recs-interface';\nimport {\n ResultContext,\n InteractiveResultContext,\n} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\n\n/**\n * The `atomic-ipx-result-link` component automatically transforms a search result title into a clickable link that points to the original item. It is an experimental internal component not intended for general use.\n * @slot default - Lets you display alternative content inside the link\n * @slot attributes - Lets you pass [attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attributes) down to the link element, overriding other attributes, to be used exclusively with an \"a\" tag such as `<a slot=\"attributes\" target=\"_blank\" download></a>`.\n * @internal\n */\n@Component({\n tag: 'atomic-ipx-result-link',\n styleUrl: 'atomic-ipx-result-link.pcss',\n shadow: false,\n})\nexport class AtomicIPXResultLink\n implements InitializableComponent<RecsBindings>\n{\n @InitializeBindings() public bindings!: RecsBindings;\n public error!: Error;\n\n @ResultContext() private result!: AnyUnfoldedItem;\n @InteractiveResultContext() private interactiveResult!: InteractiveResult;\n\n @Element() private host!: HTMLElement;\n\n /**\n * Specifies a template literal from which to generate the `href` attribute value (see\n * [Template literals](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals)).\n *\n * The template literal can reference any number of result properties from the parent result. It can also reference the window object.\n *\n * For example, the following markup generates an `href` value such as `http://uri.com?id=itemTitle`, using the result's `clickUri` and `itemtitle` fields.\n * ```html\n * <atomic-ipx-result-link href-template='${clickUri}?id=${raw.itemtitle}'></atomic-ipx-result-link>\n * ```\n */\n @Prop({reflect: true}) hrefTemplate?: string;\n\n private hasDefaultSlot!: boolean;\n private linkAttributes?: Attr[];\n private stopPropagation?: boolean;\n private actionsHistoryActions?: IPXActionsHistoryActionCreators;\n\n public initialize() {\n this.host.dispatchEvent(\n buildCustomEvent(\n 'atomic/resolveStopPropagation',\n (stopPropagation: boolean) => {\n this.stopPropagation = stopPropagation;\n }\n )\n );\n this.actionsHistoryActions = loadIPXActionsHistoryActions(\n this.bindings.engine\n );\n }\n\n public connectedCallback() {\n const slotName = 'attributes';\n this.hasDefaultSlot = !!getDefaultSlotFromHost(this.host);\n this.linkAttributes = getAttributesFromLinkSlot(this.host, slotName);\n }\n\n public async onSelect() {\n const resultPermanentId = this.result.raw.permanentid;\n if (resultPermanentId && this.actionsHistoryActions) {\n const action =\n this.actionsHistoryActions.addPageViewEntryInActionsHistory(\n resultPermanentId\n );\n this.bindings.engine.dispatch(action);\n }\n this.interactiveResult.select();\n }\n\n public render() {\n const href = isUndefined(this.hrefTemplate)\n ? this.result.clickUri\n : buildStringTemplateFromResult(\n this.hrefTemplate,\n this.result,\n this.bindings\n );\n\n return (\n <LinkWithItemAnalytics\n href={href}\n onSelect={() => this.onSelect()}\n onBeginDelayedSelect={() => this.interactiveResult.beginDelayedSelect()}\n onCancelPendingSelect={() =>\n this.interactiveResult.cancelPendingSelect()\n }\n attributes={this.linkAttributes}\n stopPropagation={this.stopPropagation}\n >\n {this.hasDefaultSlot ? (\n <slot />\n ) : (\n <atomic-result-text\n field=\"title\"\n default=\"no-title\"\n ></atomic-result-text>\n )}\n </LinkWithItemAnalytics>\n );\n }\n}\n"],"version":3}
@@ -590,7 +590,7 @@ const AtomicQuickviewModal = class {
590
590
  });
591
591
  }
592
592
  render() {
593
- return (index.h("atomic-modal", { key: '112196e88d5418e6a08eee196c96f674f22c0bb4', fullscreen: this.bindings.store.isMobile(), class: 'atomic-quickview-modal', isOpen: this.isOpen, close: () => this.onClose(), exportparts: exportParts.ATOMIC_MODAL_EXPORT_PARTS }, this.renderHeader(), this.renderBody(), this.renderFooter()));
593
+ return (index.h("atomic-modal", { key: 'a99d0aa49ca1f74b0894dd9764e2c02498b848eb', fullscreen: this.bindings.store.isMobile(), class: 'atomic-quickview-modal', isOpen: this.isOpen, close: () => this.onClose(), exportparts: exportParts.ATOMIC_MODAL_EXPORT_PARTS }, this.renderHeader(), this.renderBody(), this.renderFooter()));
594
594
  }
595
595
  static get watchers() { return {
596
596
  "highlightKeywords": ["watchHighlightKeywords"]
@@ -9,7 +9,7 @@ const quickview = require('./quickview-b74d3d85.js');
9
9
  const initializationUtils = require('./initialization-utils-92f1b080.js');
10
10
  const stencilAccessibilityUtils = require('./stencil-accessibility-utils-86cc7071.js');
11
11
  const stencilButton = require('./stencil-button-94b89acc.js');
12
- const resultTemplateDecorators = require('./result-template-decorators-432d11a9.js');
12
+ const stencilResultTemplateDecorators = require('./stencil-result-template-decorators-28b05aaf.js');
13
13
  require('./dom-utils-d4790328.js');
14
14
  require('./event-utils-9bfcf3c5.js');
15
15
  require('./init-queue-a18aa323.js');
@@ -116,7 +116,7 @@ const AtomicQuickview = class {
116
116
  }
117
117
  render() {
118
118
  if (this.quickviewState.resultHasPreview) {
119
- return (index.h(stencilButton.Button, { key: '298e249e3c98adc8856881a76d19bd5667d432a0', part: "button", title: this.bindings.i18n.t('quickview'), style: "outline-primary", class: "p-2", onClick: (event) => this.onClick(event), ref: this.focusTarget.setTarget }, index.h("atomic-icon", { key: 'f752f36ac2f621624147c3130e5c48e182509373', part: "icon", class: "flex w-5 justify-center", icon: quickview.QuickviewIcon })));
119
+ return (index.h(stencilButton.Button, { key: '812c28d91ada60004a79baf65b805c0974c506ad', part: "button", title: this.bindings.i18n.t('quickview'), style: "outline-primary", class: "p-2", onClick: (event) => this.onClick(event), ref: this.focusTarget.setTarget }, index.h("atomic-icon", { key: 'b2c17750551b3c893b5b6e1f22a5969bbc76ecab', part: "icon", class: "flex w-5 justify-center", icon: quickview.QuickviewIcon })));
120
120
  }
121
121
  }
122
122
  };
@@ -124,7 +124,7 @@ __decorate([
124
124
  initializationUtils.InitializeBindings()
125
125
  ], AtomicQuickview.prototype, "bindings", void 0);
126
126
  __decorate([
127
- resultTemplateDecorators.ResultContext()
127
+ stencilResultTemplateDecorators.ResultContext()
128
128
  ], AtomicQuickview.prototype, "result", void 0);
129
129
  __decorate([
130
130
  initializationUtils.BindStateToController('quickview')
@@ -1 +1 @@
1
- {"file":"atomic-quickview.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,kBAAkB,GAAG,0ljEAA0ljE,CAAC;AACtnjE,8BAAe,kBAAkB;;;;;;;;;;;;MCoCpB,eAAe;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B,EAAE,CAAC;QACjC,IAAI,CAAC,kBAAkB,EAAE,CAAC;KAC3B;IAEM,MAAM;QACX,IAAI,IAAI,CAAC,cAAc,CAAC,gBAAgB,EAAE;YACxC,QACEC,QAACC,oBAAM,qDACL,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,EACxC,KAAK,EAAC,iBAAiB,EACvB,KAAK,EAAC,KAAK,EACX,OAAO,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EACvC,GAAG,EAAE,IAAI,CAAC,WAAW,CAAC,SAAS,IAE/BD,0EACE,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,yBAAyB,EAC/B,IAAI,EAAEE,uBAAa,GACN,CACR,EACT;SACH;KACF;;AA/H4B;IAA5BC,sCAAkB,EAAE;iDAA4B;AACxB;IAAxBC,sCAAa,EAAE;+CAAyB;AASlC;IAFNC,yCAAqB,CAAC,WAAW,CAAC;uDAEI;AAiB7B;IADTC,wCAAc,CAAC,WAAW,CAAC;6DACY;;;;;","names":["FocusTargetController","buildQuickview","Schema","StringValue","h","Button","QuickviewIcon","InitializeBindings","ResultContext","BindStateToController","AriaLiveRegion"],"sources":["src/components/search/result-template-components/atomic-quickview/atomic-quickview.pcss?tag=atomic-quickview&encapsulation=shadow","src/components/search/result-template-components/atomic-quickview/atomic-quickview.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n","import {Schema, StringValue} from '@coveo/bueno';\nimport {\n Result,\n buildQuickview,\n Quickview,\n QuickviewState,\n} from '@coveo/headless';\nimport {Component, h, Listen, Prop, State} from '@stencil/core';\nimport QuickviewIcon from '../../../../images/quickview.svg';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {\n AriaLiveRegion,\n FocusTargetController,\n} from '../../../../utils/stencil-accessibility-utils';\nimport {Button} from '../../../common/stencil-button';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '../result-template-decorators';\n\n/**\n * The `atomic-quickview` component renders a button which the end user can click to open a modal box containing a preview\n * about a result.\n *\n * The `atomic-quickview` is not meant to replace the `atomic-result-link` to access an item in a result template; it has certain limitations (e.g., custom styles and embedded\n * images/links may not work as expected in an `atomic-quickview`).\n *\n * @part button - The button that opens the quickview modal on click.\n * @part icon - The icon for the quickview button.\n */\n@Component({\n tag: 'atomic-quickview',\n styleUrl: 'atomic-quickview.pcss',\n shadow: true,\n})\nexport class AtomicQuickview implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n @ResultContext() private result!: Result;\n private buttonFocusTarget?: FocusTargetController;\n\n @State() public error!: Error;\n\n public quickview!: Quickview;\n\n @BindStateToController('quickview')\n @State()\n public quickviewState!: QuickviewState;\n\n /**\n * The `sandbox` attribute to apply to the quickview iframe.\n *\n * The quickview is loaded inside an iframe with a [`sandbox`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-sandbox) attribute for security reasons.\n *\n * This attribute exists primarily to protect against potential XSS attacks that could originate from the document being displayed.\n *\n * By default, the sandbox attributes are: `allow-popups allow-top-navigation allow-same-origin`.\n *\n * `allow-same-origin` is not optional, and must always be included in the list of allowed capabilities for the component to function properly.\n */\n @Prop() public sandbox =\n 'allow-popups allow-top-navigation allow-same-origin';\n\n @AriaLiveRegion('quickview')\n protected quickviewAriaMessage!: string;\n\n @Listen('atomic/quickview/next', {target: 'body'})\n public onNextQuickview(evt: Event) {\n evt.stopImmediatePropagation();\n this.quickview.next();\n }\n\n @Listen('atomic/quickview/previous', {target: 'body'})\n public onPreviousQuickview(evt: Event) {\n evt.stopImmediatePropagation();\n this.quickview.previous();\n }\n\n private quickviewModalRef?: HTMLAtomicQuickviewModalElement;\n\n public get focusTarget() {\n if (!this.buttonFocusTarget) {\n this.buttonFocusTarget = new FocusTargetController(this);\n }\n return this.buttonFocusTarget;\n }\n\n public initialize() {\n this.quickview = buildQuickview(this.bindings.engine, {\n options: {result: this.result},\n });\n new Schema({\n sandbox: new StringValue({\n required: true,\n regex: /allow-same-origin/,\n }),\n }).validate({sandbox: this.sandbox});\n }\n\n private addQuickviewModalIfNeeded() {\n if (this.quickviewModalRef) {\n return;\n }\n\n const quickviewModal = this.bindings.interfaceElement.querySelector(\n 'atomic-quickview-modal'\n );\n if (quickviewModal) {\n this.quickviewModalRef = quickviewModal;\n return;\n }\n this.quickviewModalRef = document.createElement('atomic-quickview-modal');\n this.quickviewModalRef.setAttribute('sandbox', this.sandbox);\n this.bindings.interfaceElement.appendChild(this.quickviewModalRef);\n }\n\n private updateModalContent() {\n if (this.quickviewModalRef && this.quickview.state.content) {\n this.quickviewModalRef.content = this.quickview.state.content;\n this.quickviewModalRef.result = this.result;\n this.quickviewModalRef.total = this.quickviewState.totalResults;\n this.quickviewModalRef.current = this.quickviewState.currentResult;\n this.quickviewModalRef.modalCloseCallback = () =>\n this.focusTarget.focus();\n\n this.quickviewAriaMessage = this.quickviewState.isLoading\n ? this.bindings.i18n.t('quickview-loading')\n : this.bindings.i18n.t('quickview-loaded', {\n first: this.quickviewState.currentResult,\n last: this.quickviewState.totalResults,\n title: this.result.title,\n });\n }\n }\n\n private onClick(event?: MouseEvent) {\n event?.stopPropagation();\n this.quickview.fetchResultContent();\n }\n\n componentWillUpdate(): void {\n this.addQuickviewModalIfNeeded();\n this.updateModalContent();\n }\n\n public render() {\n if (this.quickviewState.resultHasPreview) {\n return (\n <Button\n part=\"button\"\n title={this.bindings.i18n.t('quickview')}\n style=\"outline-primary\"\n class=\"p-2\"\n onClick={(event) => this.onClick(event)}\n ref={this.focusTarget.setTarget}\n >\n <atomic-icon\n part=\"icon\"\n class=\"flex w-5 justify-center\"\n icon={QuickviewIcon}\n ></atomic-icon>\n </Button>\n );\n }\n }\n}\n"],"version":3}
1
+ {"file":"atomic-quickview.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM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AAI,CAAC,SAAS,CAAC,kBAAkB,EAAE,CAAC;KACrC;IAED,mBAAmB;QACjB,IAAI,CAAC,yBAAyB,EAAE,CAAC;QACjC,IAAI,CAAC,kBAAkB,EAAE,CAAC;KAC3B;IAEM,MAAM;QACX,IAAI,IAAI,CAAC,cAAc,CAAC,gBAAgB,EAAE;YACxC,QACEC,QAACC,oBAAM,qDACL,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,EACxC,KAAK,EAAC,iBAAiB,EACvB,KAAK,EAAC,KAAK,EACX,OAAO,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EACvC,GAAG,EAAE,IAAI,CAAC,WAAW,CAAC,SAAS,IAE/BD,0EACE,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,yBAAyB,EAC/B,IAAI,EAAEE,uBAAa,GACN,CACR,EACT;SACH;KACF;;AA/H4B;IAA5BC,sCAAkB,EAAE;iDAA4B;AACxB;IAAxBC,6CAAa,EAAE;+CAAyB;AASlC;IAFNC,yCAAqB,CAAC,WAAW,CAAC;uDAEI;AAiB7B;IADTC,wCAAc,CAAC,WAAW,CAAC;6DACY;;;;;","names":["FocusTargetController","buildQuickview","Schema","StringValue","h","Button","QuickviewIcon","InitializeBindings","ResultContext","BindStateToController","AriaLiveRegion"],"sources":["src/components/search/result-template-components/atomic-quickview/atomic-quickview.pcss?tag=atomic-quickview&encapsulation=shadow","src/components/search/result-template-components/atomic-quickview/atomic-quickview.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n","import {Schema, StringValue} from '@coveo/bueno';\nimport {\n Result,\n buildQuickview,\n Quickview,\n QuickviewState,\n} from '@coveo/headless';\nimport {Component, h, Listen, Prop, State} from '@stencil/core';\nimport QuickviewIcon from '../../../../images/quickview.svg';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {\n AriaLiveRegion,\n FocusTargetController,\n} from '../../../../utils/stencil-accessibility-utils';\nimport {Button} from '../../../common/stencil-button';\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-quickview` component renders a button which the end user can click to open a modal box containing a preview\n * about a result.\n *\n * The `atomic-quickview` is not meant to replace the `atomic-result-link` to access an item in a result template; it has certain limitations (e.g., custom styles and embedded\n * images/links may not work as expected in an `atomic-quickview`).\n *\n * @part button - The button that opens the quickview modal on click.\n * @part icon - The icon for the quickview button.\n */\n@Component({\n tag: 'atomic-quickview',\n styleUrl: 'atomic-quickview.pcss',\n shadow: true,\n})\nexport class AtomicQuickview implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n @ResultContext() private result!: Result;\n private buttonFocusTarget?: FocusTargetController;\n\n @State() public error!: Error;\n\n public quickview!: Quickview;\n\n @BindStateToController('quickview')\n @State()\n public quickviewState!: QuickviewState;\n\n /**\n * The `sandbox` attribute to apply to the quickview iframe.\n *\n * The quickview is loaded inside an iframe with a [`sandbox`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-sandbox) attribute for security reasons.\n *\n * This attribute exists primarily to protect against potential XSS attacks that could originate from the document being displayed.\n *\n * By default, the sandbox attributes are: `allow-popups allow-top-navigation allow-same-origin`.\n *\n * `allow-same-origin` is not optional, and must always be included in the list of allowed capabilities for the component to function properly.\n */\n @Prop() public sandbox =\n 'allow-popups allow-top-navigation allow-same-origin';\n\n @AriaLiveRegion('quickview')\n protected quickviewAriaMessage!: string;\n\n @Listen('atomic/quickview/next', {target: 'body'})\n public onNextQuickview(evt: Event) {\n evt.stopImmediatePropagation();\n this.quickview.next();\n }\n\n @Listen('atomic/quickview/previous', {target: 'body'})\n public onPreviousQuickview(evt: Event) {\n evt.stopImmediatePropagation();\n this.quickview.previous();\n }\n\n private quickviewModalRef?: HTMLAtomicQuickviewModalElement;\n\n public get focusTarget() {\n if (!this.buttonFocusTarget) {\n this.buttonFocusTarget = new FocusTargetController(this);\n }\n return this.buttonFocusTarget;\n }\n\n public initialize() {\n this.quickview = buildQuickview(this.bindings.engine, {\n options: {result: this.result},\n });\n new Schema({\n sandbox: new StringValue({\n required: true,\n regex: /allow-same-origin/,\n }),\n }).validate({sandbox: this.sandbox});\n }\n\n private addQuickviewModalIfNeeded() {\n if (this.quickviewModalRef) {\n return;\n }\n\n const quickviewModal = this.bindings.interfaceElement.querySelector(\n 'atomic-quickview-modal'\n );\n if (quickviewModal) {\n this.quickviewModalRef = quickviewModal;\n return;\n }\n this.quickviewModalRef = document.createElement('atomic-quickview-modal');\n this.quickviewModalRef.setAttribute('sandbox', this.sandbox);\n this.bindings.interfaceElement.appendChild(this.quickviewModalRef);\n }\n\n private updateModalContent() {\n if (this.quickviewModalRef && this.quickview.state.content) {\n this.quickviewModalRef.content = this.quickview.state.content;\n this.quickviewModalRef.result = this.result;\n this.quickviewModalRef.total = this.quickviewState.totalResults;\n this.quickviewModalRef.current = this.quickviewState.currentResult;\n this.quickviewModalRef.modalCloseCallback = () =>\n this.focusTarget.focus();\n\n this.quickviewAriaMessage = this.quickviewState.isLoading\n ? this.bindings.i18n.t('quickview-loading')\n : this.bindings.i18n.t('quickview-loaded', {\n first: this.quickviewState.currentResult,\n last: this.quickviewState.totalResults,\n title: this.result.title,\n });\n }\n }\n\n private onClick(event?: MouseEvent) {\n event?.stopPropagation();\n this.quickview.fetchResultContent();\n }\n\n componentWillUpdate(): void {\n this.addQuickviewModalIfNeeded();\n this.updateModalContent();\n }\n\n public render() {\n if (this.quickviewState.resultHasPreview) {\n return (\n <Button\n part=\"button\"\n title={this.bindings.i18n.t('quickview')}\n style=\"outline-primary\"\n class=\"p-2\"\n onClick={(event) => this.onClick(event)}\n ref={this.focusTarget.setTarget}\n >\n <atomic-icon\n part=\"icon\"\n class=\"flex w-5 justify-center\"\n icon={QuickviewIcon}\n ></atomic-icon>\n </Button>\n );\n }\n }\n}\n"],"version":3}
@@ -2167,7 +2167,7 @@ function getWindow() {
2167
2167
  }
2168
2168
  function getAtomicEnvironment(headlessVersion) {
2169
2169
  return {
2170
- version: "3.35.0-pre.df6792920f",
2170
+ version: "3.35.0-pre.e9982a2757",
2171
2171
  headlessVersion,
2172
2172
  };
2173
2173
  }
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-757bc886.js');
6
6
  const headless = require('@coveo/headless');
7
- const resultTemplateDecorators = require('./result-template-decorators-432d11a9.js');
7
+ const stencilResultTemplateDecorators = require('./stencil-result-template-decorators-28b05aaf.js');
8
8
  require('./stencil-item-decorators-43a96f33.js');
9
9
  require('./dom-utils-d4790328.js');
10
10
  require('./event-utils-9bfcf3c5.js');
@@ -62,7 +62,7 @@ const AtomicResultBadge = class {
62
62
  get host() { return index.getElement(this); }
63
63
  };
64
64
  __decorate([
65
- resultTemplateDecorators.ResultContext()
65
+ stencilResultTemplateDecorators.ResultContext()
66
66
  ], AtomicResultBadge.prototype, "result", void 0);
67
67
  AtomicResultBadge.style = AtomicResultBadgeStyle0;
68
68
 
@@ -1 +1 @@
1
- {"file":"atomic-result-badge.entry.cjs.js","mappings":";;;;;;;;;;;AAAA,MAAM,oBAAoB,GAAG,stjEAAstjE,CAAC;AACpvjE,gCAAe,oBAAoB;;;;;;;;;;;;MC2CtB,iBAAiB;;;;;;;IA2BpB,UAAU;QAChB,QACEA,yBACE,IAAI,EAAC,mBAAmB,EACxB,IAAI,EAAE,IAAI,CAAC,IAAK,EAChB,KAAK,EAAC,sBAAsB,GACf,EACf;KACH;IAEO,cAAc;QACpB,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;YAC5B,OAAOA,gCAAoB,KAAK,EAAE,IAAI,CAAC,KAAK,GAAuB,CAAC;SACrE;QACD,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;YAC5B,OAAOA,yBAAa,KAAK,EAAE,IAAI,CAAC,KAAK,GAAgB,CAAC;SACvD;QACD,OAAOA,qBAAa,CAAC;KACtB;IAEO,UAAU;QAChB,OAAOA,kBAAM,IAAI,EAAC,oBAAoB,IAAE,IAAI,CAAC,cAAc,EAAE,CAAQ,CAAC;KACvE;IAEO,WAAW;QACjB,QACEA,iBACE,IAAI,EAAC,sBAAsB,EAC3B,KAAK,EAAC,wGAAwG,IAE7G,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE,EAC9B,IAAI,CAAC,UAAU,EAAE,CACd,EACN;KACH;IAED,mBAAmB;QACjB,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,MAAM,QAAQ,GACZC,+BAAsB,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC;gBACjE,IAAI,CAAC;YACP,IAAI,CAAC,QAAQ,EAAE;gBACb,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;aACpB;SACF;KACF;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;KAC3B;;;AA3EwB;IAAxBC,sCAAa,EAAE;iDAAyB;;;;;","names":["h","ResultTemplatesHelpers","ResultContext"],"sources":["src/components/search/result-template-components/atomic-result-badge/atomic-result-badge.pcss?tag=atomic-result-badge&encapsulation=shadow","src/components/search/result-template-components/atomic-result-badge/atomic-result-badge.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n\n:host {\n display: inline-flex;\n place-items: center;\n height: var(--row-height, auto);\n word-break: break-word;\n}\n","import {Result, ResultTemplatesHelpers} from '@coveo/headless';\nimport {Component, Element, Prop, h} from '@stencil/core';\nimport {ResultContext} from '../result-template-decorators';\n\n/**\n * The `atomic-result-badge` element renders a badge to highlight special features of a result.\n *\n * A badge can either display:\n * * Text:\n * ```html\n * <atomic-result-badge label=\"trending\"></atomic-result-badge>\n * ```\n * * The contents of a single-value field:\n * ```html\n * <atomic-result-badge field=\"objecttype\"></atomic-result-badge>\n * ```\n * * An icon:\n * ```html\n * <atomic-result-badge icon=\"https://my-website.fake/star.svg\"></atomic-result-badge>\n * ```\n * * Slotted elements:\n * ```html\n * <atomic-result-badge icon=\"https://my-website.fake/stopwatch.svg\">\n * Deal ends in <my-dynamic-countdown></my-dynamic-countdown>\n * </atomic-result-badge>\n * ```\n *\n * The contents of a multi-value field can be displayed as in the following example:\n * ```html\n * <atomic-result-badge icon=\"https://my-website.fake/language.svg\">\n * <atomic-result-multi-value-text field=\"language\"></atomic-result-multi-value-text>\n * </atomic-result-badge>\n * ```\n *\n * @part result-badge-element - The decorative outer-most element with the background color and text color.\n * @part result-badge-icon - The icon displayed at the left-end of the badge, if present.\n * @part result-badge-label - The wrapper around the contents at the right-end of the badge. This may be text, a field or slotted elements depending on which was configured.\n * @slot default - The element(s) to display inside the badge, instead of a field or label.\n */\n@Component({\n tag: 'atomic-result-badge',\n styleUrl: 'atomic-result-badge.pcss',\n shadow: true,\n})\nexport class AtomicResultBadge {\n @ResultContext() private result!: Result;\n @Element() host!: HTMLElement;\n /**\n * The field to display in the badge.\n *\n * Not compatible with `label`, slotted elements nor multi-value fields.\n */\n @Prop({reflect: true}) public field?: string;\n\n /**\n * The text to display in the badge.\n *\n * Not compatible with `field` nor slotted elements.\n */\n @Prop({reflect: true}) public label?: string;\n\n /**\n * Specifies an icon to display at the left-end of the badge.\n * This can be used in conjunction with `field`, `label` or slotted elements.\n *\n * - Use a value that starts with `http://`, `https://`, `./`, or `../`, to fetch and display an icon from a given location.\n * - Use a value that starts with `assets://`, to display an icon from the Atomic package.\n * - Use a stringified SVG to display it directly\n */\n @Prop({reflect: true}) public icon?: string;\n\n private renderIcon() {\n return (\n <atomic-icon\n part=\"result-badge-icon\"\n icon={this.icon!}\n class=\"h-3 w-3 fill-current\"\n ></atomic-icon>\n );\n }\n\n private getTextContent() {\n if (this.field !== undefined) {\n return <atomic-result-text field={this.field}></atomic-result-text>;\n }\n if (this.label !== undefined) {\n return <atomic-text value={this.label}></atomic-text>;\n }\n return <slot></slot>;\n }\n\n private renderText() {\n return <span part=\"result-badge-label\">{this.getTextContent()}</span>;\n }\n\n private renderBadge() {\n return (\n <div\n part=\"result-badge-element\"\n class=\"bg-neutral-light text-neutral-dark inline-flex h-full place-items-center space-x-1.5 rounded-full px-3\"\n >\n {this.icon && this.renderIcon()}\n {this.renderText()}\n </div>\n );\n }\n\n componentWillRender() {\n if (this.field) {\n const hasValue =\n ResultTemplatesHelpers.getResultProperty(this.result, this.field) !==\n null;\n if (!hasValue) {\n this.host.remove();\n }\n }\n }\n\n render() {\n return this.renderBadge();\n }\n}\n"],"version":3}
1
+ {"file":"atomic-result-badge.entry.cjs.js","mappings":";;;;;;;;;;;AAAA,MAAM,oBAAoB,GAAG,stjEAAstjE,CAAC;AACpvjE,gCAAe,oBAAoB;;;;;;;;;;;;MC2CtB,iBAAiB;;;;;;;IA2BpB,UAAU;QAChB,QACEA,yBACE,IAAI,EAAC,mBAAmB,EACxB,IAAI,EAAE,IAAI,CAAC,IAAK,EAChB,KAAK,EAAC,sBAAsB,GACf,EACf;KACH;IAEO,cAAc;QACpB,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;YAC5B,OAAOA,gCAAoB,KAAK,EAAE,IAAI,CAAC,KAAK,GAAuB,CAAC;SACrE;QACD,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;YAC5B,OAAOA,yBAAa,KAAK,EAAE,IAAI,CAAC,KAAK,GAAgB,CAAC;SACvD;QACD,OAAOA,qBAAa,CAAC;KACtB;IAEO,UAAU;QAChB,OAAOA,kBAAM,IAAI,EAAC,oBAAoB,IAAE,IAAI,CAAC,cAAc,EAAE,CAAQ,CAAC;KACvE;IAEO,WAAW;QACjB,QACEA,iBACE,IAAI,EAAC,sBAAsB,EAC3B,KAAK,EAAC,wGAAwG,IAE7G,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE,EAC9B,IAAI,CAAC,UAAU,EAAE,CACd,EACN;KACH;IAED,mBAAmB;QACjB,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,MAAM,QAAQ,GACZC,+BAAsB,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC;gBACjE,IAAI,CAAC;YACP,IAAI,CAAC,QAAQ,EAAE;gBACb,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;aACpB;SACF;KACF;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;KAC3B;;;AA3EwB;IAAxBC,6CAAa,EAAE;iDAAyB;;;;;","names":["h","ResultTemplatesHelpers","ResultContext"],"sources":["src/components/search/result-template-components/atomic-result-badge/atomic-result-badge.pcss?tag=atomic-result-badge&encapsulation=shadow","src/components/search/result-template-components/atomic-result-badge/atomic-result-badge.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n\n:host {\n display: inline-flex;\n place-items: center;\n height: var(--row-height, auto);\n word-break: break-word;\n}\n","import {Result, ResultTemplatesHelpers} from '@coveo/headless';\nimport {Component, Element, Prop, h} from '@stencil/core';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\n\n/**\n * The `atomic-result-badge` element renders a badge to highlight special features of a result.\n *\n * A badge can either display:\n * * Text:\n * ```html\n * <atomic-result-badge label=\"trending\"></atomic-result-badge>\n * ```\n * * The contents of a single-value field:\n * ```html\n * <atomic-result-badge field=\"objecttype\"></atomic-result-badge>\n * ```\n * * An icon:\n * ```html\n * <atomic-result-badge icon=\"https://my-website.fake/star.svg\"></atomic-result-badge>\n * ```\n * * Slotted elements:\n * ```html\n * <atomic-result-badge icon=\"https://my-website.fake/stopwatch.svg\">\n * Deal ends in <my-dynamic-countdown></my-dynamic-countdown>\n * </atomic-result-badge>\n * ```\n *\n * The contents of a multi-value field can be displayed as in the following example:\n * ```html\n * <atomic-result-badge icon=\"https://my-website.fake/language.svg\">\n * <atomic-result-multi-value-text field=\"language\"></atomic-result-multi-value-text>\n * </atomic-result-badge>\n * ```\n *\n * @part result-badge-element - The decorative outer-most element with the background color and text color.\n * @part result-badge-icon - The icon displayed at the left-end of the badge, if present.\n * @part result-badge-label - The wrapper around the contents at the right-end of the badge. This may be text, a field or slotted elements depending on which was configured.\n * @slot default - The element(s) to display inside the badge, instead of a field or label.\n */\n@Component({\n tag: 'atomic-result-badge',\n styleUrl: 'atomic-result-badge.pcss',\n shadow: true,\n})\nexport class AtomicResultBadge {\n @ResultContext() private result!: Result;\n @Element() host!: HTMLElement;\n /**\n * The field to display in the badge.\n *\n * Not compatible with `label`, slotted elements nor multi-value fields.\n */\n @Prop({reflect: true}) public field?: string;\n\n /**\n * The text to display in the badge.\n *\n * Not compatible with `field` nor slotted elements.\n */\n @Prop({reflect: true}) public label?: string;\n\n /**\n * Specifies an icon to display at the left-end of the badge.\n * This can be used in conjunction with `field`, `label` or slotted elements.\n *\n * - Use a value that starts with `http://`, `https://`, `./`, or `../`, to fetch and display an icon from a given location.\n * - Use a value that starts with `assets://`, to display an icon from the Atomic package.\n * - Use a stringified SVG to display it directly\n */\n @Prop({reflect: true}) public icon?: string;\n\n private renderIcon() {\n return (\n <atomic-icon\n part=\"result-badge-icon\"\n icon={this.icon!}\n class=\"h-3 w-3 fill-current\"\n ></atomic-icon>\n );\n }\n\n private getTextContent() {\n if (this.field !== undefined) {\n return <atomic-result-text field={this.field}></atomic-result-text>;\n }\n if (this.label !== undefined) {\n return <atomic-text value={this.label}></atomic-text>;\n }\n return <slot></slot>;\n }\n\n private renderText() {\n return <span part=\"result-badge-label\">{this.getTextContent()}</span>;\n }\n\n private renderBadge() {\n return (\n <div\n part=\"result-badge-element\"\n class=\"bg-neutral-light text-neutral-dark inline-flex h-full place-items-center space-x-1.5 rounded-full px-3\"\n >\n {this.icon && this.renderIcon()}\n {this.renderText()}\n </div>\n );\n }\n\n componentWillRender() {\n if (this.field) {\n const hasValue =\n ResultTemplatesHelpers.getResultProperty(this.result, this.field) !==\n null;\n if (!hasValue) {\n this.host.remove();\n }\n }\n }\n\n render() {\n return this.renderBadge();\n }\n}\n"],"version":3}
@@ -11,7 +11,7 @@ const unfoldedItem = require('./unfolded-item-148d21d6.js');
11
11
  const showHideButton = require('./show-hide-button-c4717f52.js');
12
12
  const itemTemplateProvider = require('./item-template-provider-470c1774.js');
13
13
  const stencilItemDecorators = require('./stencil-item-decorators-43a96f33.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('./init-queue-a18aa323.js');
17
17
  require('./initialization-lit-stencil-common-utils-730030b0.js');
@@ -139,7 +139,7 @@ const AtomicResultChildren = class {
139
139
  return (index.h(showHideButton.ChildrenWrapper, { hasChildren: children.length > 0 }, children.map((child, i) => this.renderChild(child, i === children.length - 1))));
140
140
  }
141
141
  render() {
142
- return (index.h(showHideButton.ResultChildrenGuard, { key: '2f38b68fcb83a72db4101044cd74107cc834ac97', inheritTemplates: this.inheritTemplates, resultTemplateRegistered: this.resultTemplateRegistered, templateHasError: this.templateHasError }, this.collection ? this.renderCollection() : this.renderFoldedResult()));
142
+ return (index.h(showHideButton.ResultChildrenGuard, { key: 'af34654062e5d43cba6986228afb510599647099', inheritTemplates: this.inheritTemplates, resultTemplateRegistered: this.resultTemplateRegistered, templateHasError: this.templateHasError }, this.collection ? this.renderCollection() : this.renderFoldedResult()));
143
143
  }
144
144
  get host() { return index.getElement(this); }
145
145
  };
@@ -153,7 +153,7 @@ __decorate([
153
153
  showHideButton.FoldedItemListContext()
154
154
  ], AtomicResultChildren.prototype, "foldedResultList", void 0);
155
155
  __decorate([
156
- resultTemplateDecorators.ResultContext({ folded: true })
156
+ stencilResultTemplateDecorators.ResultContext({ folded: true })
157
157
  ], AtomicResultChildren.prototype, "result", void 0);
158
158
  __decorate([
159
159
  stencilItemDecorators.ItemDisplayConfigContext()
@@ -1 +1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AK,EAAE,CAAC,KAAK,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CACnD,CACe,EAClB;KACH;IAEM,MAAM;QACX,QACEP,QAACQ,kCAAmB,qDAClB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EACvC,wBAAwB,EAAE,IAAI,CAAC,wBAAwB,EACvD,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,IAEtC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,gBAAgB,EAAE,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAClD,EACtB;KACH;;;AAtM4B;IAA5BC,sCAAkB,EAAE;sDAA4B;AAE1C;IADNC,2CAAqB,EAAE;kEAC2B;AAE3C;IADPC,oCAAqB,EAAE;8DACoB;AAEpC;IADPC,sCAAa,CAAC,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC;oDACA;AAEtB;IADPC,8CAAwB,EAAE;2DACW;AAS9B;IAFPC,yCAA0B,EAAE;mEAEyB;;;;;","names":["elementHasAncestorTag","ItemTemplateProvider","h","buildInteractiveResult","extractUnfoldedItem","buildCustomEvent","Fragment","ShowHideButton","CollectionGuard","ChildrenWrapper","ResultChildrenGuard","InitializeBindings","ChildTemplatesContext","FoldedItemListContext","ResultContext","ItemDisplayConfigContext","FoldedItemListStateContext"],"sources":["src/components/search/result-lists/atomic-result-children/atomic-result-children.pcss?tag=atomic-result-children&encapsulation=shadow","src/components/search/result-lists/atomic-result-children/atomic-result-children.tsx"],"sourcesContent":["@import '../../../../components/common/result-children/result-children.pcss';\n","import {\n buildInteractiveResult,\n FoldedResult,\n FoldedResultList,\n FoldedResultListState,\n} from '@coveo/headless';\nimport {\n Component,\n Element,\n State,\n h,\n Listen,\n Prop,\n Fragment,\n} from '@stencil/core';\nimport {buildCustomEvent} from '../../../../utils/event-utils';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {elementHasAncestorTag} from '../../../../utils/utils';\nimport {extractUnfoldedItem} from '../../../common/item-list/unfolded-item';\nimport {\n FoldedItemListContext,\n FoldedItemListStateContext,\n} from '../../../common/item-list/item-list-decorators';\nimport {ItemTemplateProvider} from '../../../common/item-list/item-template-provider';\nimport {\n ChildTemplatesContext,\n ChildTemplatesContextEvent,\n DisplayConfig,\n ItemDisplayConfigContext,\n} from '../../../common/item-list/stencil-item-decorators';\nimport {ItemDisplayImageSize} from '../../../common/layout/display-options';\nimport {ChildrenWrapper} from '../../../common/result-children/children-wrapper';\nimport {CollectionGuard} from '../../../common/result-children/collection-guard';\nimport {ResultChildrenGuard} from '../../../common/result-children/guard';\nimport {ShowHideButton} from '../../../common/result-children/show-hide-button';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '../../result-template-components/result-template-decorators';\n\nconst childTemplateComponent = 'atomic-result-children-template';\nconst componentTag = 'atomic-result-children';\n\n/**\n * The `atomic-result-children` component is responsible for displaying child results by applying one or more child result templates.\n * Includes two slots, \"before-children\" and \"after-children\", which allow for rendering content before and after the list of children,\n * only when children exist.\n * @part children-root - The wrapper for the message when there are child results\n * @part no-result-root - The wrapper for the message when there are no results.\n * @part show-hide-button - The button that allows to collapse or show all child results.\n * @slot before-children - Slot that allows rendering content before the list of children, only when children exist.\n * @slot after-children - Slot that allows rendering content after the list of children, only when children exist.\n */\n@Component({\n tag: 'atomic-result-children',\n styleUrl: 'atomic-result-children.pcss',\n shadow: true,\n})\nexport class AtomicResultChildren implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n @ChildTemplatesContext()\n public itemTemplateProvider?: ItemTemplateProvider;\n @FoldedItemListContext()\n private foldedResultList!: FoldedResultList;\n @ResultContext({folded: true})\n private result!: FoldedResult;\n @ItemDisplayConfigContext()\n private displayConfig!: DisplayConfig;\n private initialChildren!: FoldedResult[];\n\n @Element() public host!: HTMLDivElement;\n @State() public error!: Error;\n @State() private resultTemplateRegistered = false;\n @State() private templateHasError = false;\n @FoldedItemListStateContext()\n @State()\n private foldedResultListState!: FoldedResultListState;\n @State()\n private showInitialChildren = false;\n\n /**\n * Whether to inherit templates defined in a parent atomic-result-children. Only works for the second level of child nesting.\n */\n @Prop() inheritTemplates = false;\n /**\n * The expected size of the image displayed in the children results.\n */\n @Prop({reflect: true}) imageSize?: ItemDisplayImageSize;\n /**\n * The non-localized copy for an empty result state. An empty string will result in the component being hidden.\n */\n @Prop() public noResultText = 'no-documents-related';\n\n @Listen('atomic/resolveChildTemplates')\n public resolveChildTemplates(event: ChildTemplatesContextEvent) {\n event.preventDefault();\n event.detail(this.itemTemplateProvider);\n }\n\n public initialize() {\n if (this.inheritTemplates) {\n return;\n }\n\n const childrenTemplates = Array.from(\n this.host.querySelectorAll(childTemplateComponent)\n ).filter(\n (template) => !elementHasAncestorTag(template, childTemplateComponent)\n );\n\n if (!childrenTemplates.length) {\n this.error = new Error(\n `The \"${componentTag}\" component requires at least one \"${childTemplateComponent}\" component.`\n );\n return;\n }\n\n this.itemTemplateProvider = new ItemTemplateProvider({\n includeDefaultTemplate: false,\n templateElements: childrenTemplates,\n getResultTemplateRegistered: () => this.resultTemplateRegistered,\n getTemplateHasError: () => this.templateHasError,\n setResultTemplateRegistered: (value: boolean) => {\n this.resultTemplateRegistered = value;\n },\n setTemplateHasError: (value: boolean) => {\n this.templateHasError = value;\n },\n bindings: this.bindings,\n });\n }\n\n private renderChild(child: FoldedResult, isLast: boolean) {\n const content = this.itemTemplateProvider?.getTemplateContent(child.result);\n\n if (!content) {\n return;\n }\n\n const key =\n child.result.uniqueId +\n child.children.map((child) => child.result.uniqueId);\n return (\n <atomic-result\n key={key}\n content={content}\n result={child}\n interactiveResult={buildInteractiveResult(this.bindings.engine, {\n options: {result: extractUnfoldedItem(child)},\n })}\n store={this.bindings.store}\n density={this.displayConfig.density}\n imageSize={this.imageSize || this.displayConfig.imageSize}\n classes={`child-result ${isLast ? 'last-child' : ''}`.trim()}\n ></atomic-result>\n );\n }\n\n public componentWillRender() {\n if (this.initialChildren || !this.collection) {\n return;\n }\n\n this.initialChildren = this.collection.children;\n }\n\n private get collection() {\n return this.foldedResultListState.results.find((r) => {\n return r.result.uniqueId === this.result.result.uniqueId;\n });\n }\n private loadFullCollection() {\n this.loadedFullCollection = true;\n this.host.dispatchEvent(\n buildCustomEvent('atomic/loadCollection', this.collection)\n );\n }\n private toggleShowInitialChildren = () => {\n if (this.showInitialChildren) {\n this.foldedResultList.logShowMoreFoldedResults(this.result.result);\n } else {\n this.foldedResultList.logShowLessFoldedResults();\n }\n\n this.showInitialChildren = !this.showInitialChildren;\n };\n\n @State() private loadedFullCollection = false;\n\n private renderCollection() {\n const collection = this.collection!;\n\n const children = this.showInitialChildren\n ? this.initialChildren\n : collection.children;\n\n const showShouldButtons =\n this.loadedFullCollection || collection.moreResultsAvailable;\n\n return (\n <Fragment>\n {showShouldButtons && (\n <ShowHideButton\n moreResultsAvailable={collection.moreResultsAvailable}\n loadFullCollection={() => this.loadFullCollection()}\n showInitialChildren={this.showInitialChildren}\n toggleShowInitialChildren={this.toggleShowInitialChildren}\n loadAllResults={this.bindings.i18n.t('load-all-results')}\n collapseResults={this.bindings.i18n.t('collapse-results')}\n />\n )}\n\n <CollectionGuard\n isLoadingMoreResults={collection.isLoadingMoreResults}\n moreResultsAvailable={collection.moreResultsAvailable}\n hasChildren={collection.children.length > 0}\n numberOfChildren={collection.children.length}\n density={this.displayConfig.density}\n imageSize={this.imageSize || this.displayConfig.imageSize}\n noResultText={this.bindings.i18n.t(this.noResultText)}\n >\n <ChildrenWrapper hasChildren={collection.children.length > 0}>\n {children.map((child, i) =>\n this.renderChild(child, i === children.length - 1)\n )}\n </ChildrenWrapper>\n </CollectionGuard>\n </Fragment>\n );\n }\n\n private renderFoldedResult() {\n if (this.result.children.length === 0) {\n return;\n }\n\n const children = this.result.children;\n\n return (\n <ChildrenWrapper hasChildren={children.length > 0}>\n {children.map((child, i) =>\n this.renderChild(child, i === children.length - 1)\n )}\n </ChildrenWrapper>\n );\n }\n\n public render() {\n return (\n <ResultChildrenGuard\n inheritTemplates={this.inheritTemplates}\n resultTemplateRegistered={this.resultTemplateRegistered}\n templateHasError={this.templateHasError}\n >\n {this.collection ? this.renderCollection() : this.renderFoldedResult()}\n </ResultChildrenGuard>\n );\n }\n}\n"],"version":3}
1
+ {"file":"atomic-result-children.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,uBAAuB,GAAG,gkkEAAgkkE,CAAC;AACjmkE,mCAAe,uBAAuB;;;;;;;;;;;;ACwCtC,MAAM,sBAAsB,GAAG,iCAAiC,CAAC;AACjE,MAAM,YAAY,GAAG,wBAAwB,CAAC;MAiBjC,oBAAoB;;;QAcd,6BAAwB,GAAG,KAAK,CAAC;QACjC,qBAAgB,GAAG,KAAK,CAAC;QAKlC,wBAAmB,GAAG,KAAK,CAAC;;;;QAK5B,qBAAgB,GAAG,KAAK,CAAC;;;;QAQlB,iBAAY,GAAG,sBAAsB,CAAC;QAsF7C,8BAAyB,GAAG;YAClC,IAAI,IAAI,CAAC,mBAAmB,EAAE;gBAC5B,IAAI,CAAC,gBAAgB,CAAC,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;aACpE;iBAAM;gBACL,IAAI,CAAC,gBAAgB,CAAC,wBAAwB,EAAE,CAAC;aAClD;YAED,IAAI,CAAC,mBAAmB,GAAG,CAAC,IAAI,CAAC,mBAAmB,CAAC;SACtD,CAAC;QAEe,yBAAoB,GAAG,KAAK,CAAC;;wCAnHF,KAAK;gCACb,KAAK;;mCAKX,KAAK;gCAKR,KAAK;;4BAQF,sBAAsB;oCAgGZ,KAAK;;IA7FtC,qBAAqB,CAAC,KAAiC;QAC5D,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;KACzC;IAEM,UAAU;QACf,IAAI,IAAI,CAAC,gBAAgB,EAAE;YACzB,OAAO;SACR;QAED,MAAM,iBAAiB,GAAG,KA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P,QAACO,8BAAe,IAAC,WAAW,EAAE,QAAQ,CAAC,MAAM,GAAG,CAAC,IAC9C,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,KACrB,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC,KAAK,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CACnD,CACe,EAClB;KACH;IAEM,MAAM;QACX,QACEP,QAACQ,kCAAmB,qDAClB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EACvC,wBAAwB,EAAE,IAAI,CAAC,wBAAwB,EACvD,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,IAEtC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,gBAAgB,EAAE,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAClD,EACtB;KACH;;;AAtM4B;IAA5BC,sCAAkB,EAAE;sDAA4B;AAE1C;IADNC,2CAAqB,EAAE;kEAC2B;AAE3C;IADPC,oCAAqB,EAAE;8DACoB;AAEpC;IADPC,6CAAa,CAAC,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC;oDACA;AAEtB;IADPC,8CAAwB,EAAE;2DACW;AAS9B;IAFPC,yCAA0B,EAAE;mEAEyB;;;;;","names":["elementHasAncestorTag","ItemTemplateProvider","h","buildInteractiveResult","extractUnfoldedItem","buildCustomEvent","Fragment","ShowHideButton","CollectionGuard","ChildrenWrapper","ResultChildrenGuard","InitializeBindings","ChildTemplatesContext","FoldedItemListContext","ResultContext","ItemDisplayConfigContext","FoldedItemListStateContext"],"sources":["src/components/search/result-lists/atomic-result-children/atomic-result-children.pcss?tag=atomic-result-children&encapsulation=shadow","src/components/search/result-lists/atomic-result-children/atomic-result-children.tsx"],"sourcesContent":["@import '../../../../components/common/result-children/result-children.pcss';\n","import {\n buildInteractiveResult,\n FoldedResult,\n FoldedResultList,\n FoldedResultListState,\n} from '@coveo/headless';\nimport {\n Component,\n Element,\n State,\n h,\n Listen,\n Prop,\n Fragment,\n} from '@stencil/core';\nimport {buildCustomEvent} from '../../../../utils/event-utils';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {elementHasAncestorTag} from '../../../../utils/utils';\nimport {extractUnfoldedItem} from '../../../common/item-list/unfolded-item';\nimport {\n FoldedItemListContext,\n FoldedItemListStateContext,\n} from '../../../common/item-list/item-list-decorators';\nimport {ItemTemplateProvider} from '../../../common/item-list/item-template-provider';\nimport {\n ChildTemplatesContext,\n ChildTemplatesContextEvent,\n DisplayConfig,\n ItemDisplayConfigContext,\n} from '../../../common/item-list/stencil-item-decorators';\nimport {ItemDisplayImageSize} from '../../../common/layout/display-options';\nimport {ChildrenWrapper} from '../../../common/result-children/children-wrapper';\nimport {CollectionGuard} from '../../../common/result-children/collection-guard';\nimport {ResultChildrenGuard} from '../../../common/result-children/guard';\nimport {ShowHideButton} from '../../../common/result-children/show-hide-button';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '@/src/components/search/result-template-component-utils/context/stencil-result-template-decorators';\n\nconst childTemplateComponent = 'atomic-result-children-template';\nconst componentTag = 'atomic-result-children';\n\n/**\n * The `atomic-result-children` component is responsible for displaying child results by applying one or more child result templates.\n * Includes two slots, \"before-children\" and \"after-children\", which allow for rendering content before and after the list of children,\n * only when children exist.\n * @part children-root - The wrapper for the message when there are child results\n * @part no-result-root - The wrapper for the message when there are no results.\n * @part show-hide-button - The button that allows to collapse or show all child results.\n * @slot before-children - Slot that allows rendering content before the list of children, only when children exist.\n * @slot after-children - Slot that allows rendering content after the list of children, only when children exist.\n */\n@Component({\n tag: 'atomic-result-children',\n styleUrl: 'atomic-result-children.pcss',\n shadow: true,\n})\nexport class AtomicResultChildren implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n @ChildTemplatesContext()\n public itemTemplateProvider?: ItemTemplateProvider;\n @FoldedItemListContext()\n private foldedResultList!: FoldedResultList;\n @ResultContext({folded: true})\n private result!: FoldedResult;\n @ItemDisplayConfigContext()\n private displayConfig!: DisplayConfig;\n private initialChildren!: FoldedResult[];\n\n @Element() public host!: HTMLDivElement;\n @State() public error!: Error;\n @State() private resultTemplateRegistered = false;\n @State() private templateHasError = false;\n @FoldedItemListStateContext()\n @State()\n private foldedResultListState!: FoldedResultListState;\n @State()\n private showInitialChildren = false;\n\n /**\n * Whether to inherit templates defined in a parent atomic-result-children. Only works for the second level of child nesting.\n */\n @Prop() inheritTemplates = false;\n /**\n * The expected size of the image displayed in the children results.\n */\n @Prop({reflect: true}) imageSize?: ItemDisplayImageSize;\n /**\n * The non-localized copy for an empty result state. An empty string will result in the component being hidden.\n */\n @Prop() public noResultText = 'no-documents-related';\n\n @Listen('atomic/resolveChildTemplates')\n public resolveChildTemplates(event: ChildTemplatesContextEvent) {\n event.preventDefault();\n event.detail(this.itemTemplateProvider);\n }\n\n public initialize() {\n if (this.inheritTemplates) {\n return;\n }\n\n const childrenTemplates = Array.from(\n this.host.querySelectorAll(childTemplateComponent)\n ).filter(\n (template) => !elementHasAncestorTag(template, childTemplateComponent)\n );\n\n if (!childrenTemplates.length) {\n this.error = new Error(\n `The \"${componentTag}\" component requires at least one \"${childTemplateComponent}\" component.`\n );\n return;\n }\n\n this.itemTemplateProvider = new ItemTemplateProvider({\n includeDefaultTemplate: false,\n templateElements: childrenTemplates,\n getResultTemplateRegistered: () => this.resultTemplateRegistered,\n getTemplateHasError: () => this.templateHasError,\n setResultTemplateRegistered: (value: boolean) => {\n this.resultTemplateRegistered = value;\n },\n setTemplateHasError: (value: boolean) => {\n this.templateHasError = value;\n },\n bindings: this.bindings,\n });\n }\n\n private renderChild(child: FoldedResult, isLast: boolean) {\n const content = this.itemTemplateProvider?.getTemplateContent(child.result);\n\n if (!content) {\n return;\n }\n\n const key =\n child.result.uniqueId +\n child.children.map((child) => child.result.uniqueId);\n return (\n <atomic-result\n key={key}\n content={content}\n result={child}\n interactiveResult={buildInteractiveResult(this.bindings.engine, {\n options: {result: extractUnfoldedItem(child)},\n })}\n store={this.bindings.store}\n density={this.displayConfig.density}\n imageSize={this.imageSize || this.displayConfig.imageSize}\n classes={`child-result ${isLast ? 'last-child' : ''}`.trim()}\n ></atomic-result>\n );\n }\n\n public componentWillRender() {\n if (this.initialChildren || !this.collection) {\n return;\n }\n\n this.initialChildren = this.collection.children;\n }\n\n private get collection() {\n return this.foldedResultListState.results.find((r) => {\n return r.result.uniqueId === this.result.result.uniqueId;\n });\n }\n private loadFullCollection() {\n this.loadedFullCollection = true;\n this.host.dispatchEvent(\n buildCustomEvent('atomic/loadCollection', this.collection)\n );\n }\n private toggleShowInitialChildren = () => {\n if (this.showInitialChildren) {\n this.foldedResultList.logShowMoreFoldedResults(this.result.result);\n } else {\n this.foldedResultList.logShowLessFoldedResults();\n }\n\n this.showInitialChildren = !this.showInitialChildren;\n };\n\n @State() private loadedFullCollection = false;\n\n private renderCollection() {\n const collection = this.collection!;\n\n const children = this.showInitialChildren\n ? this.initialChildren\n : collection.children;\n\n const showShouldButtons =\n this.loadedFullCollection || collection.moreResultsAvailable;\n\n return (\n <Fragment>\n {showShouldButtons && (\n <ShowHideButton\n moreResultsAvailable={collection.moreResultsAvailable}\n loadFullCollection={() => this.loadFullCollection()}\n showInitialChildren={this.showInitialChildren}\n toggleShowInitialChildren={this.toggleShowInitialChildren}\n loadAllResults={this.bindings.i18n.t('load-all-results')}\n collapseResults={this.bindings.i18n.t('collapse-results')}\n />\n )}\n\n <CollectionGuard\n isLoadingMoreResults={collection.isLoadingMoreResults}\n moreResultsAvailable={collection.moreResultsAvailable}\n hasChildren={collection.children.length > 0}\n numberOfChildren={collection.children.length}\n density={this.displayConfig.density}\n imageSize={this.imageSize || this.displayConfig.imageSize}\n noResultText={this.bindings.i18n.t(this.noResultText)}\n >\n <ChildrenWrapper hasChildren={collection.children.length > 0}>\n {children.map((child, i) =>\n this.renderChild(child, i === children.length - 1)\n )}\n </ChildrenWrapper>\n </CollectionGuard>\n </Fragment>\n );\n }\n\n private renderFoldedResult() {\n if (this.result.children.length === 0) {\n return;\n }\n\n const children = this.result.children;\n\n return (\n <ChildrenWrapper hasChildren={children.length > 0}>\n {children.map((child, i) =>\n this.renderChild(child, i === children.length - 1)\n )}\n </ChildrenWrapper>\n );\n }\n\n public render() {\n return (\n <ResultChildrenGuard\n inheritTemplates={this.inheritTemplates}\n resultTemplateRegistered={this.resultTemplateRegistered}\n templateHasError={this.templateHasError}\n >\n {this.collection ? this.renderCollection() : this.renderFoldedResult()}\n </ResultChildrenGuard>\n );\n }\n}\n"],"version":3}
@@ -8,7 +8,7 @@ const dayjs_min = require('./dayjs.min-8b80e6d1.js');
8
8
  const _commonjsHelpers = require('./_commonjsHelpers-b3309d7b.js');
9
9
  const dateUtils = require('./date-utils-f0803dd3.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');
@@ -107,7 +107,7 @@ __decorate([
107
107
  initializationUtils.InitializeBindings()
108
108
  ], AtomicResultDate.prototype, "bindings", void 0);
109
109
  __decorate([
110
- resultTemplateDecorators.ResultContext()
110
+ stencilResultTemplateDecorators.ResultContext()
111
111
  ], AtomicResultDate.prototype, "result", void 0);
112
112
 
113
113
  exports.atomic_result_date = AtomicResultDate;
@@ -1 +1 @@
1
- {"file":"atomic-result-date.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;AAAA,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAsD,eAAe,CAAC,GAAkI,CAAC,CAACA,+BAAI,EAAE,UAAU,CAAc,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC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,CAAC,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC;oBAClD,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC;oBAClD,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAoB,CAAC;oBACpD,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC;oBAClD,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAoB,CAAC;oBACpD,QAAQ,EAAE,IAAI,CAAC,MAAM;iBACtB;aACF,CAAC,CAAC;YACH,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;SAC5C;aAAM;YACL,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SACrD;KACF;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,OAAO,IAAI,CAAC,YAAY,CAAC;KAC1B;;;AA3EM;IADNG,sCAAkB,EAAE;kDACM;AAEF;IAAxBC,sCAAa,EAAE;gDAAyB;;;;","names":["this","dayjs","ResultTemplatesHelpers","parseDate","InitializeBindings","ResultContext"],"sources":["../../node_modules/dayjs/plugin/calendar.js","../../node_modules/dayjs/plugin/updateLocale.js","src/components/search/result-template-components/atomic-result-date/atomic-result-date.tsx"],"sourcesContent":["!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(t):(e=\"undefined\"!=typeof globalThis?globalThis:e||self).dayjs_plugin_calendar=t()}(this,(function(){\"use strict\";return function(e,t,a){var n=\"h:mm A\",d={lastDay:\"[Yesterday at] \"+n,sameDay:\"[Today at] \"+n,nextDay:\"[Tomorrow at] \"+n,nextWeek:\"dddd [at] \"+n,lastWeek:\"[Last] dddd [at] \"+n,sameElse:\"MM/DD/YYYY\"};t.prototype.calendar=function(e,t){var n=t||this.$locale().calendar||d,o=a(e||void 0).startOf(\"d\"),s=this.diff(o,\"d\",!0),i=\"sameElse\",f=s<-6?i:s<-1?\"lastWeek\":s<0?\"lastDay\":s<1?\"sameDay\":s<2?\"nextDay\":s<7?\"nextWeek\":i,l=n[f]||d[f];return\"function\"==typeof l?l.call(this,a()):this.format(l)}}}));","!function(e,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):(e=\"undefined\"!=typeof globalThis?globalThis:e||self).dayjs_plugin_updateLocale=n()}(this,(function(){\"use strict\";return function(e,n,t){t.updateLocale=function(e,n){var o=t.Ls[e];if(o)return(n?Object.keys(n):[]).forEach((function(e){o[e]=n[e]})),o}}}));","import {Result, ResultTemplatesHelpers} from '@coveo/headless';\nimport {Component, Prop, Element, State} from '@stencil/core';\nimport dayjs from 'dayjs';\nimport calendar from 'dayjs/plugin/calendar';\nimport updateLocale from 'dayjs/plugin/updateLocale';\nimport {parseDate} from '../../../../utils/date-utils';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '../result-template-decorators';\n\ndayjs.extend(calendar);\ndayjs.extend(updateLocale);\n\n/**\n * The `atomic-result-date` component renders the value of a date result field.\n */\n@Component({\n tag: 'atomic-result-date',\n shadow: false,\n})\nexport class AtomicResultDate implements InitializableComponent {\n @InitializeBindings()\n public bindings!: Bindings;\n\n @ResultContext() private result!: Result;\n\n @Element() host!: HTMLElement;\n\n @State() public error!: Error;\n\n /**\n * The result field which the component should use.\n * This will look for the field in the Result object first, 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 = 'date';\n /**\n * Available formats: https://day.js.org/docs/en/display/format\n */\n @Prop({reflect: true}) format = 'D/M/YYYY';\n\n /**\n * Whether the date should display in the [relative time format](https://day.js.org/docs/en/plugin/calendar).\n *\n * To modify the relative time string, use the [localization feature](https://docs.coveo.com/en/atomic/latest/usage/atomic-localization/).\n */\n @Prop({reflect: true}) relativeTime?: boolean;\n\n private dateToRender: string | null = null;\n\n private updateDateToRender() {\n const value = ResultTemplatesHelpers.getResultProperty(\n this.result,\n this.field\n );\n\n if (value === null) {\n this.dateToRender = null;\n return;\n }\n\n const parsedValue = parseDate(value as never);\n if (!parsedValue.isValid()) {\n this.error = new Error(\n `Field \"${this.field}\" does not contain a valid date.`\n );\n this.dateToRender = null;\n return;\n }\n\n if (this.relativeTime) {\n dayjs.updateLocale(this.bindings.interfaceElement.language, {\n calendar: {\n sameDay: this.bindings.i18n.t('calendar-same-day'),\n nextDay: this.bindings.i18n.t('calendar-next-day'),\n nextWeek: this.bindings.i18n.t('calendar-next-week'),\n lastDay: this.bindings.i18n.t('calendar-last-day'),\n lastWeek: this.bindings.i18n.t('calendar-last-week'),\n sameElse: this.format,\n },\n });\n this.dateToRender = parsedValue.calendar();\n } else {\n this.dateToRender = parsedValue.format(this.format);\n }\n }\n\n public componentWillRender() {\n this.updateDateToRender();\n }\n\n public render() {\n if (this.dateToRender === null) {\n this.host.remove();\n return;\n }\n return this.dateToRender;\n }\n}\n"],"version":3}
1
+ {"file":"atomic-result-date.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;AAAA,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAsD,eAAe,CAAC,GAAkI,CAAC,CAACA,+BAAI,EAAE,UAAU,CAAc,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,CA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C,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC;oBAClD,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC;oBAClD,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAoB,CAAC;oBACpD,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC;oBAClD,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAoB,CAAC;oBACpD,QAAQ,EAAE,IAAI,CAAC,MAAM;iBACtB;aACF,CAAC,CAAC;YACH,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;SAC5C;aAAM;YACL,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SACrD;KACF;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,OAAO,IAAI,CAAC,YAAY,CAAC;KAC1B;;;AA3EM;IADNG,sCAAkB,EAAE;kDACM;AAEF;IAAxBC,6CAAa,EAAE;gDAAyB;;;;","names":["this","dayjs","ResultTemplatesHelpers","parseDate","InitializeBindings","ResultContext"],"sources":["../../node_modules/dayjs/plugin/calendar.js","../../node_modules/dayjs/plugin/updateLocale.js","src/components/search/result-template-components/atomic-result-date/atomic-result-date.tsx"],"sourcesContent":["!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(t):(e=\"undefined\"!=typeof globalThis?globalThis:e||self).dayjs_plugin_calendar=t()}(this,(function(){\"use strict\";return function(e,t,a){var n=\"h:mm A\",d={lastDay:\"[Yesterday at] \"+n,sameDay:\"[Today at] \"+n,nextDay:\"[Tomorrow at] \"+n,nextWeek:\"dddd [at] \"+n,lastWeek:\"[Last] dddd [at] \"+n,sameElse:\"MM/DD/YYYY\"};t.prototype.calendar=function(e,t){var n=t||this.$locale().calendar||d,o=a(e||void 0).startOf(\"d\"),s=this.diff(o,\"d\",!0),i=\"sameElse\",f=s<-6?i:s<-1?\"lastWeek\":s<0?\"lastDay\":s<1?\"sameDay\":s<2?\"nextDay\":s<7?\"nextWeek\":i,l=n[f]||d[f];return\"function\"==typeof l?l.call(this,a()):this.format(l)}}}));","!function(e,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):(e=\"undefined\"!=typeof globalThis?globalThis:e||self).dayjs_plugin_updateLocale=n()}(this,(function(){\"use strict\";return function(e,n,t){t.updateLocale=function(e,n){var o=t.Ls[e];if(o)return(n?Object.keys(n):[]).forEach((function(e){o[e]=n[e]})),o}}}));","import {Result, ResultTemplatesHelpers} from '@coveo/headless';\nimport {Component, Prop, Element, State} from '@stencil/core';\nimport dayjs from 'dayjs';\nimport calendar from 'dayjs/plugin/calendar';\nimport updateLocale from 'dayjs/plugin/updateLocale';\nimport {parseDate} from '../../../../utils/date-utils';\nimport {\n InitializableComponent,\n InitializeBindings,\n} 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(calendar);\ndayjs.extend(updateLocale);\n\n/**\n * The `atomic-result-date` component renders the value of a date result field.\n */\n@Component({\n tag: 'atomic-result-date',\n shadow: false,\n})\nexport class AtomicResultDate implements InitializableComponent {\n @InitializeBindings()\n public bindings!: Bindings;\n\n @ResultContext() private result!: Result;\n\n @Element() host!: HTMLElement;\n\n @State() public error!: Error;\n\n /**\n * The result field which the component should use.\n * This will look for the field in the Result object first, 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 = 'date';\n /**\n * Available formats: https://day.js.org/docs/en/display/format\n */\n @Prop({reflect: true}) format = 'D/M/YYYY';\n\n /**\n * Whether the date should display in the [relative time format](https://day.js.org/docs/en/plugin/calendar).\n *\n * To modify the relative time string, use the [localization feature](https://docs.coveo.com/en/atomic/latest/usage/atomic-localization/).\n */\n @Prop({reflect: true}) relativeTime?: boolean;\n\n private dateToRender: string | null = null;\n\n private updateDateToRender() {\n const value = ResultTemplatesHelpers.getResultProperty(\n this.result,\n this.field\n );\n\n if (value === null) {\n this.dateToRender = null;\n return;\n }\n\n const parsedValue = parseDate(value as never);\n if (!parsedValue.isValid()) {\n this.error = new Error(\n `Field \"${this.field}\" does not contain a valid date.`\n );\n this.dateToRender = null;\n return;\n }\n\n if (this.relativeTime) {\n dayjs.updateLocale(this.bindings.interfaceElement.language, {\n calendar: {\n sameDay: this.bindings.i18n.t('calendar-same-day'),\n nextDay: this.bindings.i18n.t('calendar-next-day'),\n nextWeek: this.bindings.i18n.t('calendar-next-week'),\n lastDay: this.bindings.i18n.t('calendar-last-day'),\n lastWeek: this.bindings.i18n.t('calendar-last-week'),\n sameElse: this.format,\n },\n });\n this.dateToRender = parsedValue.calendar();\n } else {\n this.dateToRender = parsedValue.format(this.format);\n }\n }\n\n public componentWillRender() {\n this.updateDateToRender();\n }\n\n public render() {\n if (this.dateToRender === null) {\n this.host.remove();\n return;\n }\n return this.dateToRender;\n }\n}\n"],"version":3}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-757bc886.js');
6
- const resultTemplateDecorators = require('./result-template-decorators-432d11a9.js');
6
+ const stencilResultTemplateDecorators = require('./stencil-result-template-decorators-28b05aaf.js');
7
7
  require('./stencil-item-decorators-43a96f33.js');
8
8
  require('./dom-utils-d4790328.js');
9
9
  require('./event-utils-9bfcf3c5.js');
@@ -104,12 +104,12 @@ const AtomicResultFieldsList = class {
104
104
  }
105
105
  }
106
106
  render() {
107
- return index.h(index.Host, { key: 'dd3ddbee78fac8ab084eb346cb0d2d5a020446a3' });
107
+ return index.h(index.Host, { key: '5130a2c93d24997eea3d11bc181595cef9a100a7' });
108
108
  }
109
109
  get host() { return index.getElement(this); }
110
110
  };
111
111
  __decorate([
112
- resultTemplateDecorators.ResultContext()
112
+ stencilResultTemplateDecorators.ResultContext()
113
113
  ], AtomicResultFieldsList.prototype, "result", void 0);
114
114
  AtomicResultFieldsList.style = AtomicResultFieldsListStyle0;
115
115