@coveo/atomic 3.48.0 → 3.49.0

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 (265) hide show
  1. package/custom-elements.json +1361 -332
  2. package/dist/atomic/_atomic.esm.js +1 -1
  3. package/dist/atomic/atomic.esm.js.map +1 -1
  4. package/dist/atomic/components/_index.d.ts +0 -6
  5. package/dist/atomic/components/_index.js +1 -4
  6. package/dist/atomic/components/atomic-insight-generated-answer.js +16 -5
  7. package/dist/atomic/components/atomic-insight-generated-answer.js.map +1 -1
  8. package/dist/atomic/components/atomic-insight-result-action.js +2 -2
  9. package/dist/atomic/components/atomic-insight-result-action.js.map +1 -1
  10. package/dist/atomic/components/atomic-insight-result-attach-to-case-action.js +2 -2
  11. package/dist/atomic/components/atomic-insight-result-attach-to-case-action.js.map +1 -1
  12. package/dist/atomic/components/atomic-insight-result-children-template.js +2 -2
  13. package/dist/atomic/components/atomic-insight-result-children-template.js.map +1 -1
  14. package/dist/atomic/components/atomic-insight-timeframe-facet.js +7 -6
  15. package/dist/atomic/components/atomic-insight-timeframe-facet.js.map +1 -1
  16. package/dist/atomic/components/atomic-ipx-recs-list.js +323 -10
  17. package/dist/atomic/components/atomic-ipx-recs-list.js.map +1 -1
  18. package/dist/atomic/components/atomic-ipx-refine-modal2.js +3 -3
  19. package/dist/atomic/components/atomic-ipx-refine-modal2.js.map +1 -1
  20. package/dist/atomic/components/atomic-ipx-refine-toggle.js +2 -2
  21. package/dist/atomic/components/atomic-ipx-refine-toggle.js.map +1 -1
  22. package/dist/atomic/components/attach.js +1 -1
  23. package/dist/atomic/components/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.js +3 -3
  24. package/dist/atomic/components/components/insight/atomic-insight-folded-result-list/atomic-insight-folded-result-list.js +309 -0
  25. package/dist/atomic/components/components/insight/atomic-insight-result-children/atomic-insight-result-children.js +3 -3
  26. package/dist/atomic/components/components/insight/atomic-insight-smart-snippet-suggestions/atomic-insight-smart-snippet-suggestions.js +198 -0
  27. package/dist/atomic/components/components/insight/atomic-insight-smart-snippet-suggestions/atomic-insight-smart-snippet-suggestions.tw.css.js +3 -0
  28. package/dist/atomic/components/components/insight/index.js +2 -0
  29. package/dist/atomic/components/components/insight/lazy-index.js +2 -0
  30. package/dist/atomic/components/components/recommendations/atomic-recs-list/atomic-recs-list.js +437 -0
  31. package/dist/atomic/components/components/recommendations/index.js +1 -0
  32. package/dist/atomic/components/components/recommendations/lazy-index.js +1 -0
  33. package/dist/atomic/components/components/search/atomic-generated-answer/atomic-generated-answer.js +6 -0
  34. package/dist/atomic/components/components/search/atomic-search-box/atomic-search-box.js +3 -3
  35. package/dist/atomic/components/global/environment.js +1 -1
  36. package/dist/atomic/components/index.js.map +1 -1
  37. package/dist/atomic/components/initialization-utils.js +1 -1
  38. package/dist/atomic/components/popover-type.js +1 -1
  39. package/dist/atomic/components/stencil-button.js +22 -2
  40. package/dist/atomic/components/stencil-button.js.map +1 -1
  41. package/dist/atomic/components/stencil-heading.js +157 -1
  42. package/dist/atomic/components/stencil-heading.js.map +1 -1
  43. package/dist/atomic/components/store.js +0 -2
  44. package/dist/atomic/components/store.js.map +1 -1
  45. package/dist/atomic/components/utils/custom-element-tags.js +3 -0
  46. package/dist/atomic/components/utils/tailwind.global.tw.css.js +3 -3
  47. package/dist/atomic/components/utils.js +1360 -2
  48. package/dist/atomic/components/utils.js.map +1 -1
  49. package/dist/atomic/lang/cs.json +1 -1
  50. package/dist/atomic/lang/da.json +1 -1
  51. package/dist/atomic/lang/de.json +1 -1
  52. package/dist/atomic/lang/dev.json +1 -1
  53. package/dist/atomic/lang/el.json +1 -1
  54. package/dist/atomic/lang/en.json +1 -1
  55. package/dist/atomic/lang/es.json +1 -1
  56. package/dist/atomic/lang/fi.json +1 -1
  57. package/dist/atomic/lang/fr.json +1 -1
  58. package/dist/atomic/lang/hu.json +1 -1
  59. package/dist/atomic/lang/id.json +1 -1
  60. package/dist/atomic/lang/it.json +1 -1
  61. package/dist/atomic/lang/ja.json +1 -1
  62. package/dist/atomic/lang/ko.json +1 -1
  63. package/dist/atomic/lang/nl.json +1 -1
  64. package/dist/atomic/lang/no.json +1 -1
  65. package/dist/atomic/lang/pl.json +1 -1
  66. package/dist/atomic/lang/pt-BR.json +1 -1
  67. package/dist/atomic/lang/pt.json +1 -1
  68. package/dist/atomic/lang/ru.json +1 -1
  69. package/dist/atomic/lang/sv.json +1 -1
  70. package/dist/atomic/lang/th.json +1 -1
  71. package/dist/atomic/lang/tr.json +1 -1
  72. package/dist/atomic/lang/zh-CN.json +1 -1
  73. package/dist/atomic/lang/zh-TW.json +1 -1
  74. package/dist/atomic/lang/zh.json +1 -1
  75. package/dist/atomic/p-2c08a419.entry.js +2 -0
  76. package/dist/atomic/{p-026a51a7.entry.js.map → p-2c08a419.entry.js.map} +1 -1
  77. package/dist/atomic/p-4117289b.entry.js +2 -0
  78. package/dist/atomic/{p-77250a6b.entry.js.map → p-4117289b.entry.js.map} +1 -1
  79. package/dist/atomic/p-4a32511f.js +1 -1
  80. package/dist/atomic/p-52d14165.entry.js +2 -0
  81. package/dist/atomic/p-52d14165.entry.js.map +1 -0
  82. package/dist/atomic/p-64f83898.entry.js +2 -0
  83. package/dist/atomic/{p-15074eb9.entry.js.map → p-64f83898.entry.js.map} +1 -1
  84. package/dist/atomic/{p-c0fbee64.js → p-9c5ec170.js} +2 -2
  85. package/dist/atomic/p-9dfe5ab1.js +2 -0
  86. package/dist/atomic/p-9dfe5ab1.js.map +1 -0
  87. package/dist/atomic/{p-3df103c1.js → p-b09433bb.js} +2 -2
  88. package/dist/atomic/p-b09433bb.js.map +1 -0
  89. package/dist/atomic/p-c8452548.entry.js +2 -0
  90. package/dist/atomic/{p-3bb48254.entry.js.map → p-c8452548.entry.js.map} +1 -1
  91. package/dist/atomic/p-c95ac794.entry.js +2 -0
  92. package/dist/atomic/{p-40e4e762.entry.js.map → p-c95ac794.entry.js.map} +1 -1
  93. package/dist/atomic/p-d8230482.entry.js +9 -0
  94. package/dist/atomic/{p-5ec9bf71.entry.js.map → p-d8230482.entry.js.map} +1 -1
  95. package/dist/atomic/p-e94ba0e1.entry.js +2 -0
  96. package/dist/atomic/p-e94ba0e1.entry.js.map +1 -0
  97. package/dist/atomic/p-f321aab0.js +2 -0
  98. package/dist/atomic/{p-141bf64c.js.map → p-f321aab0.js.map} +1 -1
  99. package/dist/cjs/_loader.cjs.js +1 -1
  100. package/dist/cjs/atomic-insight-generated-answer.cjs.entry.js +19 -9
  101. package/dist/cjs/atomic-insight-generated-answer.cjs.entry.js.map +1 -1
  102. package/dist/cjs/atomic-insight-result-action.cjs.entry.js +1 -1
  103. package/dist/cjs/atomic-insight-result-action.cjs.entry.js.map +1 -1
  104. package/dist/cjs/atomic-insight-result-attach-to-case-action.cjs.entry.js +1 -1
  105. package/dist/cjs/atomic-insight-result-attach-to-case-action.cjs.entry.js.map +1 -1
  106. package/dist/cjs/atomic-insight-result-children-template.cjs.entry.js +4 -5
  107. package/dist/cjs/atomic-insight-result-children-template.cjs.entry.js.map +1 -1
  108. package/dist/cjs/atomic-insight-timeframe-facet.cjs.entry.js +10 -10
  109. package/dist/cjs/atomic-insight-timeframe-facet.cjs.entry.js.map +1 -1
  110. package/dist/cjs/atomic-ipx-recs-list.cjs.entry.js +328 -18
  111. package/dist/cjs/atomic-ipx-recs-list.cjs.entry.js.map +1 -1
  112. package/dist/cjs/atomic-ipx-refine-modal.cjs.entry.js +3 -5
  113. package/dist/cjs/atomic-ipx-refine-modal.cjs.entry.js.map +1 -1
  114. package/dist/cjs/atomic-ipx-refine-toggle.cjs.entry.js +2 -2
  115. package/dist/cjs/atomic-ipx-refine-toggle.cjs.entry.js.map +1 -1
  116. package/dist/cjs/atomic.cjs.js +1 -1
  117. package/dist/cjs/index-3532822e.js +0 -12
  118. package/dist/cjs/{props-utils-4a99eda6.js → props-utils-bc5feb04.js} +2 -2
  119. package/dist/cjs/{props-utils-4a99eda6.js.map → props-utils-bc5feb04.js.map} +1 -1
  120. package/dist/cjs/{stencil-accessibility-utils-e64abd7b.js → stencil-heading-ecec9ab3.js} +12 -2
  121. package/dist/cjs/stencil-heading-ecec9ab3.js.map +1 -0
  122. package/dist/cjs/{store-9d4daf92.js → store-70fff5e6.js} +1 -3
  123. package/dist/cjs/store-70fff5e6.js.map +1 -0
  124. package/dist/cjs/{purify-d8fb6acd.js → utils-e845f262.js} +67 -1
  125. package/dist/cjs/utils-e845f262.js.map +1 -0
  126. package/dist/cjs/version.cjs.js +2 -2
  127. package/dist/esm/_loader.js +1 -1
  128. package/dist/esm/atomic-insight-generated-answer.entry.js +16 -6
  129. package/dist/esm/atomic-insight-generated-answer.entry.js.map +1 -1
  130. package/dist/esm/atomic-insight-result-action.entry.js +1 -1
  131. package/dist/esm/atomic-insight-result-action.entry.js.map +1 -1
  132. package/dist/esm/atomic-insight-result-attach-to-case-action.entry.js +1 -1
  133. package/dist/esm/atomic-insight-result-attach-to-case-action.entry.js.map +1 -1
  134. package/dist/esm/atomic-insight-result-children-template.entry.js +4 -5
  135. package/dist/esm/atomic-insight-result-children-template.entry.js.map +1 -1
  136. package/dist/esm/atomic-insight-timeframe-facet.entry.js +9 -9
  137. package/dist/esm/atomic-insight-timeframe-facet.entry.js.map +1 -1
  138. package/dist/esm/atomic-ipx-recs-list.entry.js +324 -14
  139. package/dist/esm/atomic-ipx-recs-list.entry.js.map +1 -1
  140. package/dist/esm/atomic-ipx-refine-modal.entry.js +4 -6
  141. package/dist/esm/atomic-ipx-refine-modal.entry.js.map +1 -1
  142. package/dist/esm/atomic-ipx-refine-toggle.entry.js +2 -2
  143. package/dist/esm/atomic-ipx-refine-toggle.entry.js.map +1 -1
  144. package/dist/esm/atomic.js +1 -1
  145. package/dist/esm/index-3eb0b28e.js +0 -12
  146. package/dist/esm/initialization-utils-82d28c63.js +1 -1
  147. package/dist/esm/{props-utils-e322e9dd.js → props-utils-d343133b.js} +2 -2
  148. package/dist/esm/{props-utils-e322e9dd.js.map → props-utils-d343133b.js.map} +1 -1
  149. package/dist/esm/{stencil-accessibility-utils-69ea92b0.js → stencil-heading-98a5f23f.js} +12 -3
  150. package/dist/{atomic/p-b3524b97.js.map → esm/stencil-heading-98a5f23f.js.map} +1 -1
  151. package/dist/esm/{store-3bc9050f.js → store-50d170c8.js} +1 -3
  152. package/dist/esm/store-50d170c8.js.map +1 -0
  153. package/dist/esm/{purify-985ba52e.js → utils-b5bab369.js} +60 -2
  154. package/dist/esm/utils-b5bab369.js.map +1 -0
  155. package/dist/esm/version.js +2 -2
  156. package/dist/types/components/common/generated-answer/render-follow-up-input.d.ts +17 -0
  157. package/dist/types/components/insight/atomic-insight-folded-result-list/atomic-insight-folded-result-list.d.ts +99 -0
  158. package/dist/types/components/insight/atomic-insight-smart-snippet-suggestions/atomic-insight-smart-snippet-suggestions.d.ts +83 -0
  159. package/dist/types/components/insight/atomic-insight-smart-snippet-suggestions/atomic-insight-smart-snippet-suggestions.tw.css.d.ts +2 -0
  160. package/dist/types/components/insight/index.d.ts +2 -0
  161. package/dist/types/components/recommendations/atomic-recs-list/atomic-recs-list.d.ts +40 -23
  162. package/dist/types/components/recommendations/index.d.ts +1 -0
  163. package/dist/types/components/search/atomic-generated-answer/atomic-generated-answer.d.ts +5 -0
  164. package/dist/types/components.d.ts +4 -198
  165. package/docs/atomic-docs.json +17 -434
  166. package/package.json +9 -4
  167. package/dist/atomic/components/arrow-right.js +0 -8
  168. package/dist/atomic/components/arrow-right.js.map +0 -1
  169. package/dist/atomic/components/atomic-insight-folded-result-list.d.ts +0 -11
  170. package/dist/atomic/components/atomic-insight-folded-result-list.js +0 -213
  171. package/dist/atomic/components/atomic-insight-folded-result-list.js.map +0 -1
  172. package/dist/atomic/components/atomic-insight-smart-snippet-suggestions.d.ts +0 -11
  173. package/dist/atomic/components/atomic-insight-smart-snippet-suggestions.js +0 -175
  174. package/dist/atomic/components/atomic-insight-smart-snippet-suggestions.js.map +0 -1
  175. package/dist/atomic/components/atomic-recs-list.d.ts +0 -11
  176. package/dist/atomic/components/atomic-recs-list.js +0 -304
  177. package/dist/atomic/components/atomic-recs-list.js.map +0 -1
  178. package/dist/atomic/components/display-options.js +0 -277
  179. package/dist/atomic/components/display-options.js.map +0 -1
  180. package/dist/atomic/components/event-utils.js +0 -24
  181. package/dist/atomic/components/event-utils.js.map +0 -1
  182. package/dist/atomic/components/purify.js +0 -1363
  183. package/dist/atomic/components/purify.js.map +0 -1
  184. package/dist/atomic/components/slot-utils.js +0 -16
  185. package/dist/atomic/components/slot-utils.js.map +0 -1
  186. package/dist/atomic/components/stencil-accessibility-utils.js +0 -160
  187. package/dist/atomic/components/stencil-accessibility-utils.js.map +0 -1
  188. package/dist/atomic/components/stencil-carousel.js +0 -50
  189. package/dist/atomic/components/stencil-carousel.js.map +0 -1
  190. package/dist/atomic/p-026a51a7.entry.js +0 -2
  191. package/dist/atomic/p-09ff88b4.entry.js +0 -2
  192. package/dist/atomic/p-09ff88b4.entry.js.map +0 -1
  193. package/dist/atomic/p-0c4a4e30.js +0 -2
  194. package/dist/atomic/p-0c4a4e30.js.map +0 -1
  195. package/dist/atomic/p-141bf64c.js +0 -2
  196. package/dist/atomic/p-15074eb9.entry.js +0 -2
  197. package/dist/atomic/p-3bb48254.entry.js +0 -2
  198. package/dist/atomic/p-3df103c1.js.map +0 -1
  199. package/dist/atomic/p-40e4e762.entry.js +0 -2
  200. package/dist/atomic/p-4cab9607.js +0 -2
  201. package/dist/atomic/p-4cab9607.js.map +0 -1
  202. package/dist/atomic/p-5ec9bf71.entry.js +0 -9
  203. package/dist/atomic/p-77250a6b.entry.js +0 -2
  204. package/dist/atomic/p-78be3137.js +0 -2
  205. package/dist/atomic/p-78be3137.js.map +0 -1
  206. package/dist/atomic/p-994b3e51.entry.js +0 -2
  207. package/dist/atomic/p-994b3e51.entry.js.map +0 -1
  208. package/dist/atomic/p-b3524b97.js +0 -2
  209. package/dist/atomic/p-cc6320d9.entry.js +0 -2
  210. package/dist/atomic/p-cc6320d9.entry.js.map +0 -1
  211. package/dist/atomic/p-cfa9c12b.js +0 -2
  212. package/dist/atomic/p-cfa9c12b.js.map +0 -1
  213. package/dist/atomic/p-d189f1a5.js +0 -2
  214. package/dist/atomic/p-d189f1a5.js.map +0 -1
  215. package/dist/atomic/p-e58840b6.js +0 -2
  216. package/dist/atomic/p-e58840b6.js.map +0 -1
  217. package/dist/atomic/p-f24c22bb.entry.js +0 -2
  218. package/dist/atomic/p-f24c22bb.entry.js.map +0 -1
  219. package/dist/atomic/p-f2906e7c.entry.js +0 -2
  220. package/dist/atomic/p-f2906e7c.entry.js.map +0 -1
  221. package/dist/cjs/arrow-right-a3be291c.js +0 -10
  222. package/dist/cjs/arrow-right-a3be291c.js.map +0 -1
  223. package/dist/cjs/atomic-insight-folded-result-list.cjs.entry.js +0 -191
  224. package/dist/cjs/atomic-insight-folded-result-list.cjs.entry.js.map +0 -1
  225. package/dist/cjs/atomic-insight-smart-snippet-suggestions.cjs.entry.js +0 -161
  226. package/dist/cjs/atomic-insight-smart-snippet-suggestions.cjs.entry.js.map +0 -1
  227. package/dist/cjs/atomic-recs-list.cjs.entry.js +0 -277
  228. package/dist/cjs/atomic-recs-list.cjs.entry.js.map +0 -1
  229. package/dist/cjs/display-options-24763cf8.js +0 -284
  230. package/dist/cjs/display-options-24763cf8.js.map +0 -1
  231. package/dist/cjs/purify-d8fb6acd.js.map +0 -1
  232. package/dist/cjs/slot-utils-987a7dd6.js +0 -18
  233. package/dist/cjs/slot-utils-987a7dd6.js.map +0 -1
  234. package/dist/cjs/stencil-accessibility-utils-e64abd7b.js.map +0 -1
  235. package/dist/cjs/stencil-carousel-ba8e11b5.js +0 -53
  236. package/dist/cjs/stencil-carousel-ba8e11b5.js.map +0 -1
  237. package/dist/cjs/stencil-heading-e2df37e4.js +0 -15
  238. package/dist/cjs/stencil-heading-e2df37e4.js.map +0 -1
  239. package/dist/cjs/store-9d4daf92.js.map +0 -1
  240. package/dist/cjs/utils-2a022008.js +0 -72
  241. package/dist/cjs/utils-2a022008.js.map +0 -1
  242. package/dist/esm/arrow-right-cb365b01.js +0 -8
  243. package/dist/esm/arrow-right-cb365b01.js.map +0 -1
  244. package/dist/esm/atomic-insight-folded-result-list.entry.js +0 -187
  245. package/dist/esm/atomic-insight-folded-result-list.entry.js.map +0 -1
  246. package/dist/esm/atomic-insight-smart-snippet-suggestions.entry.js +0 -157
  247. package/dist/esm/atomic-insight-smart-snippet-suggestions.entry.js.map +0 -1
  248. package/dist/esm/atomic-recs-list.entry.js +0 -273
  249. package/dist/esm/atomic-recs-list.entry.js.map +0 -1
  250. package/dist/esm/display-options-d03040a8.js +0 -277
  251. package/dist/esm/display-options-d03040a8.js.map +0 -1
  252. package/dist/esm/purify-985ba52e.js.map +0 -1
  253. package/dist/esm/slot-utils-df87a95a.js +0 -16
  254. package/dist/esm/slot-utils-df87a95a.js.map +0 -1
  255. package/dist/esm/stencil-accessibility-utils-69ea92b0.js.map +0 -1
  256. package/dist/esm/stencil-carousel-eac65a6c.js +0 -50
  257. package/dist/esm/stencil-carousel-eac65a6c.js.map +0 -1
  258. package/dist/esm/stencil-heading-adb44de7.js +0 -13
  259. package/dist/esm/stencil-heading-adb44de7.js.map +0 -1
  260. package/dist/esm/store-3bc9050f.js.map +0 -1
  261. package/dist/esm/utils-6771fbc6.js +0 -63
  262. package/dist/esm/utils-6771fbc6.js.map +0 -1
  263. package/dist/types/components/insight/result-lists/atomic-insight-folded-result-list/atomic-insight-folded-result-list.d.ts +0 -68
  264. package/dist/types/components/insight/smart-snippets/atomic-insight-smart-snippet-suggestions/atomic-insight-smart-snippet-suggestions.d.ts +0 -38
  265. /package/dist/atomic/{p-c0fbee64.js.map → p-9c5ec170.js.map} +0 -0
@@ -0,0 +1,437 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var AtomicRecsList_1;
8
+ import { NumberValue, Schema, StringValue } from '@coveo/bueno';
9
+ import { buildRecommendationList, buildInteractiveResult as buildRecsInteractiveResult, loadConfigurationActions, } from '@coveo/headless/recommendation';
10
+ import { css, html, LitElement, nothing } from 'lit';
11
+ import { customElement, property, state } from 'lit/decorators.js';
12
+ import { keyed } from 'lit/directives/keyed.js';
13
+ import { map } from 'lit/directives/map.js';
14
+ import { when } from 'lit/directives/when.js';
15
+ import { renderItemPlaceholders } from "../../common/atomic-result-placeholder/item-placeholders";
16
+ import { renderCarousel } from "../../common/carousel";
17
+ import { renderHeading } from "../../common/heading";
18
+ import { createAppLoadedListener } from "../../common/interface/store";
19
+ import { renderDisplayWrapper } from "../../common/item-list/display-wrapper";
20
+ import { renderGridLayout } from "../../common/item-list/grid-layout";
21
+ import { ItemListCommon, } from "../../common/item-list/item-list-common";
22
+ import { ResultTemplateProvider } from "../../common/item-list/result-template-provider";
23
+ import { getItemListDisplayClasses, } from "../../common/layout/item-layout-utils";
24
+ import { ValidatePropsController } from "../../common/validate-props-controller/validate-props-controller";
25
+ import { bindStateToController } from "../../../decorators/bind-state";
26
+ import { bindingGuard } from "../../../decorators/binding-guard";
27
+ import { bindings } from "../../../decorators/bindings";
28
+ import { errorGuard } from "../../../decorators/error-guard";
29
+ import { withTailwindStyles } from "../../../decorators/with-tailwind-styles";
30
+ import { ChildrenUpdateCompleteMixin } from "../../../mixins/children-update-complete-mixin";
31
+ import { FocusTargetController } from "../../../utils/accessibility-utils";
32
+ import { randomID } from "../../../utils/utils";
33
+ import '../atomic-recs-result/atomic-recs-result';
34
+ /**
35
+ * The `atomic-recs-list` component displays recommendations by applying one or more result templates.
36
+ *
37
+ * @slot default - The default slot where to insert the template element.
38
+ * @part result-list - The element containing the list of results.
39
+ * @part result-list-grid-clickable-container - The parent of the result and the clickable link encompassing it.
40
+ * @part result-list-grid-clickable - The clickable link encompassing the result.
41
+ * @part label - The label of the result list.
42
+ * @part previous-button - The previous button.
43
+ * @part next-button - The next button.
44
+ * @part indicators - The list of indicators.
45
+ * @part indicator - A single indicator.
46
+ * @part active-indicator - The active indicator.
47
+ */
48
+ let AtomicRecsList = AtomicRecsList_1 = class AtomicRecsList extends ChildrenUpdateCompleteMixin(LitElement) {
49
+ constructor() {
50
+ super();
51
+ this.loadingFlag = randomID('firstRecommendationLoaded-');
52
+ this.isAppLoaded = false;
53
+ this.isEveryResultReady = false;
54
+ this.resultTemplateRegistered = false;
55
+ this.templateHasError = false;
56
+ this.currentPage = 0;
57
+ /**
58
+ * The Recommendation identifier used by the Coveo platform to retrieve recommended documents.
59
+ * Make sure to set a different value for each atomic-recs-list in your page.
60
+ */
61
+ this.recommendation = 'Recommendation';
62
+ /**
63
+ * The layout to apply when displaying results themselves. This does not affect the display of the surrounding list itself.
64
+ * To modify the number of recommendations per column, modify the --atomic-recs-number-of-columns CSS variable.
65
+ */
66
+ this.display = 'list';
67
+ /**
68
+ * The spacing of various elements in the result list, including the gap between results, the gap between parts of a result, and the font sizes of different parts in a result.
69
+ */
70
+ this.density = 'normal';
71
+ /**
72
+ * The expected size of the image displayed in the results.
73
+ */
74
+ this.imageSize = 'small';
75
+ /**
76
+ * The total number of recommendations to display.
77
+ * This does not modify the number of recommendations per column. To do so, modify the --atomic-recs-number-of-columns CSS variable.
78
+ */
79
+ this.numberOfRecommendations = 10;
80
+ /**
81
+ * The [heading level](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements) to use for the heading label, from 1 to 6.
82
+ */
83
+ this.headingLevel = 0;
84
+ new ValidatePropsController(this, () => ({
85
+ density: this.density,
86
+ display: this.display,
87
+ imageSize: this.imageSize,
88
+ }), AtomicRecsList_1.propsSchema,
89
+ // TODO V4: KIT-5197 - Remove false
90
+ false);
91
+ }
92
+ /**
93
+ * Sets a rendering function to bypass the standard HTML template mechanism for rendering results.
94
+ * You can use this function while working with web frameworks that don't use plain HTML syntax such as React, Angular, or Vue.
95
+ *
96
+ * Do not use this method if you integrate Atomic in a plain HTML deployment.
97
+ *
98
+ * @param resultRenderingFunction
99
+ */
100
+ async setRenderFunction(resultRenderingFunction) {
101
+ this.itemRenderingFunction = resultRenderingFunction;
102
+ }
103
+ /**
104
+ * Moves to the previous page, when the carousel is activated.
105
+ */
106
+ async previousPage() {
107
+ this.currentPage =
108
+ this.currentPage - 1 < 0 ? this.numberOfPages - 1 : this.currentPage - 1;
109
+ }
110
+ /**
111
+ * Moves to the next page, when the carousel is activated.
112
+ */
113
+ async nextPage() {
114
+ this.currentPage = (this.currentPage + 1) % this.numberOfPages;
115
+ }
116
+ initialize() {
117
+ this.validateNumberOfRecommendationsPerPage();
118
+ this.validateRecommendationIdentifier();
119
+ this.updateOriginLevel2();
120
+ this.recommendationList = buildRecommendationList(this.bindings.engine, {
121
+ options: {
122
+ id: this.recommendation,
123
+ numberOfRecommendations: this.numberOfRecommendations,
124
+ },
125
+ });
126
+ this.initResultTemplateProvider();
127
+ this.initItemListCommon();
128
+ createAppLoadedListener(this.bindings.store, (isAppLoaded) => {
129
+ this.isAppLoaded = isAppLoaded;
130
+ });
131
+ }
132
+ async willUpdate(changedProperties) {
133
+ super.willUpdate(changedProperties);
134
+ if (changedProperties.has('numberOfRecommendationsPerPage')) {
135
+ this.currentPage = 0;
136
+ }
137
+ if (changedProperties.has('recommendationListState')) {
138
+ const oldState = changedProperties.get('recommendationListState');
139
+ if (this.recommendationListState.searchResponseId !== '') {
140
+ this.bindings.store.unsetLoadingFlag(this.loadingFlag);
141
+ }
142
+ if (!oldState?.isLoading && this.recommendationListState.isLoading) {
143
+ this.isEveryResultReady = false;
144
+ }
145
+ }
146
+ await this.updateResultReadyState();
147
+ }
148
+ async updateResultReadyState() {
149
+ if (this.isAppLoaded &&
150
+ !this.isEveryResultReady &&
151
+ this.recommendationListState?.searchResponseId !== '' &&
152
+ this.recommendationListState?.recommendations?.length > 0) {
153
+ await this.getUpdateComplete();
154
+ this.isEveryResultReady = true;
155
+ }
156
+ }
157
+ render() {
158
+ if (!this.resultTemplateRegistered ||
159
+ this.templateHasError ||
160
+ this.error ||
161
+ this.recommendationListStateWithAugment.hasError) {
162
+ return nothing;
163
+ }
164
+ const listContent = this.renderListOfRecommendations();
165
+ return html `
166
+ ${this.renderHeading()}
167
+ ${when(this.shouldRenderPagination, () => renderCarousel({
168
+ props: {
169
+ bindings: this.bindings,
170
+ currentPage: this.currentPage,
171
+ nextPage: () => this.nextPage(),
172
+ previousPage: () => this.previousPage(),
173
+ numberOfPages: this.numberOfPages,
174
+ ariaLabel: this.label
175
+ ? this.bindings.i18n.t(this.label)
176
+ : this.bindings.i18n.t('recommendations'),
177
+ },
178
+ })(listContent), () => listContent)}
179
+ `;
180
+ }
181
+ get focusTarget() {
182
+ if (!this.nextNewResultTarget) {
183
+ this.nextNewResultTarget = new FocusTargetController(this, this.bindings);
184
+ }
185
+ return this.nextNewResultTarget;
186
+ }
187
+ get recommendationListStateWithAugment() {
188
+ return {
189
+ ...this.recommendationListState,
190
+ firstRequestExecuted: this.recommendationListState.searchResponseId !== '',
191
+ hasError: this.recommendationListState.error !== null,
192
+ hasItems: this.recommendationListState.recommendations.length !== 0,
193
+ results: this.subsetRecommendations,
194
+ };
195
+ }
196
+ get currentIndex() {
197
+ return Math.abs((this.currentPage * this.numberOfRecommendationsPerPage) %
198
+ this.recommendationListState.recommendations.length);
199
+ }
200
+ get subsetRecommendations() {
201
+ if (!this.numberOfRecommendationsPerPage) {
202
+ return this.recommendationListState.recommendations;
203
+ }
204
+ return this.recommendationListState.recommendations.slice(this.currentIndex, this.currentIndex + this.numberOfRecommendationsPerPage);
205
+ }
206
+ get numberOfPages() {
207
+ return Math.ceil(this.recommendationListState.recommendations.length /
208
+ this.numberOfRecommendationsPerPage);
209
+ }
210
+ get hasPagination() {
211
+ return this.numberOfPages > 1;
212
+ }
213
+ get shouldRenderPagination() {
214
+ return (this.hasPagination && this.recommendationListStateWithAugment.hasItems);
215
+ }
216
+ validateNumberOfRecommendationsPerPage() {
217
+ if (this.numberOfRecommendationsPerPage === undefined) {
218
+ return;
219
+ }
220
+ const msg = new NumberValue({
221
+ min: 1,
222
+ max: this.numberOfRecommendations - 1,
223
+ }).validate(this.numberOfRecommendationsPerPage);
224
+ if (msg) {
225
+ this.error = new Error(`The "numberOfRecommendationsPerPage" is invalid: ${msg}`);
226
+ }
227
+ }
228
+ validateRecommendationIdentifier() {
229
+ const recListWithRecommendation = document.querySelectorAll(`atomic-recs-list[recommendation="${this.recommendation}"]`);
230
+ if (recListWithRecommendation.length > 1) {
231
+ this.bindings.engine.logger.warn(`There are multiple atomic-recs-list in this page with the same recommendation property "${this.recommendation}". Make sure to set a different recommendation property for each.`);
232
+ }
233
+ }
234
+ updateOriginLevel2() {
235
+ if (this.label) {
236
+ const action = loadConfigurationActions(this.bindings.engine).setOriginLevel2({
237
+ originLevel2: this.label,
238
+ });
239
+ this.bindings.engine.dispatch(action);
240
+ }
241
+ }
242
+ initResultTemplateProvider() {
243
+ this.itemTemplateProvider = new ResultTemplateProvider({
244
+ includeDefaultTemplate: true,
245
+ templateElements: Array.from(this.querySelectorAll('atomic-recs-result-template')),
246
+ getResultTemplateRegistered: () => this.resultTemplateRegistered,
247
+ getTemplateHasError: () => this.templateHasError,
248
+ setResultTemplateRegistered: (value) => {
249
+ this.resultTemplateRegistered = value;
250
+ },
251
+ setTemplateHasError: (value) => {
252
+ this.templateHasError = value;
253
+ },
254
+ bindings: this.bindings,
255
+ });
256
+ }
257
+ initItemListCommon() {
258
+ this.itemListCommon = new ItemListCommon({
259
+ engineSubscribe: this.bindings.engine.subscribe,
260
+ getCurrentNumberOfItems: () => this.recommendationListState.recommendations.length,
261
+ getIsLoading: () => this.recommendationListState.isLoading,
262
+ host: this,
263
+ loadingFlag: this.loadingFlag,
264
+ nextNewItemTarget: this.focusTarget,
265
+ store: this.bindings.store,
266
+ });
267
+ }
268
+ computeListDisplayClasses() {
269
+ const displayPlaceholders = !(this.isAppLoaded && this.isEveryResultReady);
270
+ return getItemListDisplayClasses('grid', this.density, this.imageSize, this.recommendationListState?.isLoading, displayPlaceholders);
271
+ }
272
+ renderHeading() {
273
+ if (!this.label) {
274
+ return nothing;
275
+ }
276
+ if (this.recommendationListStateWithAugment.hasError) {
277
+ return nothing;
278
+ }
279
+ if (this.recommendationListStateWithAugment.firstRequestExecuted &&
280
+ !this.recommendationListStateWithAugment.hasItems) {
281
+ return nothing;
282
+ }
283
+ return renderHeading({
284
+ props: {
285
+ level: this.headingLevel,
286
+ part: 'label',
287
+ class: 'm-0 mb-2',
288
+ },
289
+ })(html `${this.bindings.i18n.t(this.label)}`);
290
+ }
291
+ renderListOfRecommendations() {
292
+ const listClasses = this.computeListDisplayClasses();
293
+ const resultClasses = `${listClasses} ${!this.isEveryResultReady && 'hidden'}`;
294
+ // Results must be rendered immediately (though hidden) to start their initialization and loading processes.
295
+ // If we wait to render results until placeholders are removed, the components won't begin loading until then,
296
+ // causing a longer delay. The `isEveryResultReady` flag hides results while preserving placeholders,
297
+ // then removes placeholders once results are fully loaded to prevent content flash.
298
+ return html `
299
+ ${when(this.isAppLoaded, () => renderDisplayWrapper({
300
+ props: {
301
+ listClasses: resultClasses,
302
+ display: 'grid',
303
+ },
304
+ })(html `${this.renderGrid()}`))}
305
+ ${when(!this.isEveryResultReady, () => renderDisplayWrapper({
306
+ props: { listClasses, display: 'grid' },
307
+ })(renderItemPlaceholders({
308
+ props: {
309
+ density: this.density,
310
+ display: this.display,
311
+ imageSize: this.imageSize,
312
+ numberOfPlaceholders: this.numberOfRecommendationsPerPage ??
313
+ this.numberOfRecommendations,
314
+ },
315
+ })))}
316
+ `;
317
+ }
318
+ renderGrid() {
319
+ return html `${map(this.subsetRecommendations, (recommendation, index) => {
320
+ return renderGridLayout({
321
+ props: {
322
+ item: {
323
+ ...recommendation,
324
+ title: recommendation.title ?? '',
325
+ },
326
+ selectorForItem: 'atomic-recs-result',
327
+ setRef: (element) => {
328
+ element instanceof HTMLElement &&
329
+ this.itemListCommon.setNewResultRef(element, index);
330
+ },
331
+ },
332
+ })(html `${keyed(this.getResultId(recommendation), html `<atomic-recs-result
333
+ .content=${this.getContent(recommendation)}
334
+ .density=${this.density}
335
+ .display=${this.display}
336
+ .imageSize=${this.imageSize}
337
+ .interactiveResult=${this.getInteractiveResult(recommendation)}
338
+ .linkContent=${this.getLinkContent(recommendation)}
339
+ .loadingFlag=${this.loadingFlag}
340
+ .result=${recommendation}
341
+ .renderingFunction=${this.itemRenderingFunction}
342
+ .store=${this.bindings.store}
343
+ ></atomic-recs-result>`)}`);
344
+ })}`;
345
+ }
346
+ getLinkContent(result) {
347
+ return this.itemTemplateProvider.getLinkTemplateContent(result);
348
+ }
349
+ getContent(result) {
350
+ return this.itemTemplateProvider.getTemplateContent(result);
351
+ }
352
+ getInteractiveResult(result) {
353
+ return buildRecsInteractiveResult(this.bindings.engine, {
354
+ options: { result },
355
+ });
356
+ }
357
+ getResultId(result) {
358
+ return this.itemListCommon.getResultId(result.uniqueId, this.recommendationListState.searchResponseId, this.density, this.imageSize);
359
+ }
360
+ };
361
+ AtomicRecsList.styles = css`/*! tailwindcss v4.1.13 | MIT License | https://tailwindcss.com */@layer properties;.list-wrapper.placeholder{.result-component,table.list-root{display:none}}.list-wrapper:not(.placeholder){atomic-result-placeholder,atomic-result-table-placeholder{display:none}}.list-root.loading{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}:host{display:block;[part~=outline][part~=result-list-grid-clickable-container]{border:1px solid transparent;border-radius:1rem;padding:1rem;position:relative;transition:all .12s ease-out;&:hover{border-color:var(--atomic-neutral);border-style:var(--tw-border-style);border-width:1px;box-shadow:0 10px 25px var(--atomic-neutral);cursor:pointer}}[part=result-list-grid-clickable]:focus-visible{border-color:var(--atomic-primary);border-radius:2px;border-style:var(--tw-border-style);border-width:2px;color:var(--atomic-primary);cursor:pointer;display:inline-block;position:absolute;text-align:center;text-decoration:underline}[part=result-list-grid-clickable]:not(:focus){clip:rect(1px,1px,1px,1px);overflow:hidden;padding:0;position:absolute}.list-wrapper{word-break:break-word}.list-root.display-grid{display:grid;justify-content:space-evenly;.result-component{box-sizing:border-box;height:100%}}.list-root{grid-column-gap:.5rem;grid-row-gap:.5rem;grid-template-columns:repeat(var(--atomic-recs-number-of-columns,1),minmax(0,1fr));[part~=outline]{border-color:var(--atomic-neutral);border-radius:1rem;border-style:var(--tw-border-style);border-width:1px;padding:1rem}atomic-result-placeholder{border-color:transparent}}[part=label]{font-family:var(--atomic-font-family);font-size:var(--atomic-text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height,1.33333));--tw-font-weight:var(--atomic-font-bold);font-weight:var(--atomic-font-bold)}atomic-result:not(.hydrated){visibility:hidden}}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-border-style:solid;--tw-font-weight:initial}}}`;
362
+ AtomicRecsList.propsSchema = new Schema({
363
+ density: new StringValue({
364
+ constrainTo: ['normal', 'comfortable', 'compact'],
365
+ }),
366
+ display: new StringValue({ constrainTo: ['grid', 'list'] }),
367
+ imageSize: new StringValue({
368
+ constrainTo: ['small', 'large', 'icon', 'none'],
369
+ }),
370
+ });
371
+ __decorate([
372
+ state()
373
+ ], AtomicRecsList.prototype, "bindings", void 0);
374
+ __decorate([
375
+ state()
376
+ ], AtomicRecsList.prototype, "error", void 0);
377
+ __decorate([
378
+ state()
379
+ ], AtomicRecsList.prototype, "isAppLoaded", void 0);
380
+ __decorate([
381
+ state()
382
+ ], AtomicRecsList.prototype, "isEveryResultReady", void 0);
383
+ __decorate([
384
+ state()
385
+ ], AtomicRecsList.prototype, "resultTemplateRegistered", void 0);
386
+ __decorate([
387
+ state()
388
+ ], AtomicRecsList.prototype, "templateHasError", void 0);
389
+ __decorate([
390
+ state()
391
+ ], AtomicRecsList.prototype, "currentPage", void 0);
392
+ __decorate([
393
+ bindStateToController('recommendationList'),
394
+ state()
395
+ ], AtomicRecsList.prototype, "recommendationListState", void 0);
396
+ __decorate([
397
+ property({ reflect: true, type: String })
398
+ ], AtomicRecsList.prototype, "recommendation", void 0);
399
+ __decorate([
400
+ property({ reflect: true, type: String })
401
+ ], AtomicRecsList.prototype, "display", void 0);
402
+ __decorate([
403
+ property({ reflect: true, type: String })
404
+ ], AtomicRecsList.prototype, "density", void 0);
405
+ __decorate([
406
+ property({ reflect: true, attribute: 'image-size', type: String })
407
+ ], AtomicRecsList.prototype, "imageSize", void 0);
408
+ __decorate([
409
+ property({
410
+ reflect: true,
411
+ attribute: 'number-of-recommendations',
412
+ type: Number,
413
+ })
414
+ ], AtomicRecsList.prototype, "numberOfRecommendations", void 0);
415
+ __decorate([
416
+ property({
417
+ reflect: true,
418
+ attribute: 'number-of-recommendations-per-page',
419
+ type: Number,
420
+ })
421
+ ], AtomicRecsList.prototype, "numberOfRecommendationsPerPage", void 0);
422
+ __decorate([
423
+ property({ reflect: true, type: String })
424
+ ], AtomicRecsList.prototype, "label", void 0);
425
+ __decorate([
426
+ property({ reflect: true, attribute: 'heading-level', type: Number })
427
+ ], AtomicRecsList.prototype, "headingLevel", void 0);
428
+ __decorate([
429
+ bindingGuard(),
430
+ errorGuard()
431
+ ], AtomicRecsList.prototype, "render", null);
432
+ AtomicRecsList = AtomicRecsList_1 = __decorate([
433
+ customElement('atomic-recs-list'),
434
+ bindings(),
435
+ withTailwindStyles
436
+ ], AtomicRecsList);
437
+ export { AtomicRecsList };
@@ -1,5 +1,6 @@
1
1
  // Auto-generated file
2
2
  export { AtomicRecsError } from './atomic-recs-error/atomic-recs-error.js';
3
3
  export { AtomicRecsInterface } from './atomic-recs-interface/atomic-recs-interface.js';
4
+ export { AtomicRecsList } from './atomic-recs-list/atomic-recs-list.js';
4
5
  export { AtomicRecsResult } from './atomic-recs-result/atomic-recs-result.js';
5
6
  export { AtomicRecsResultTemplate } from './atomic-recs-result-template/atomic-recs-result-template.js';
@@ -2,6 +2,7 @@
2
2
  export default {
3
3
  'atomic-recs-error': async () => await import('./atomic-recs-error/atomic-recs-error.js'),
4
4
  'atomic-recs-interface': async () => await import('./atomic-recs-interface/atomic-recs-interface.js'),
5
+ 'atomic-recs-list': async () => await import('./atomic-recs-list/atomic-recs-list.js'),
5
6
  'atomic-recs-result': async () => await import('./atomic-recs-result/atomic-recs-result.js'),
6
7
  'atomic-recs-result-template': async () => await import('./atomic-recs-result-template/atomic-recs-result-template.js'),
7
8
  };
@@ -156,6 +156,9 @@ let AtomicGeneratedAnswer = AtomicGeneratedAnswer_1 = class AtomicGeneratedAnswe
156
156
  ...(this.answerConfigurationId && {
157
157
  answerConfigurationId: this.answerConfigurationId,
158
158
  }),
159
+ ...(this.agentId && {
160
+ agentId: this.agentId,
161
+ }),
159
162
  fieldsToIncludeInCitations: this.getCitationFields(),
160
163
  });
161
164
  this.searchStatus = buildSearchStatus(this.bindings.engine);
@@ -435,6 +438,9 @@ __decorate([
435
438
  __decorate([
436
439
  property({ type: String, attribute: 'answer-configuration-id' })
437
440
  ], AtomicGeneratedAnswer.prototype, "answerConfigurationId", void 0);
441
+ __decorate([
442
+ property({ type: String, attribute: 'agent-id' })
443
+ ], AtomicGeneratedAnswer.prototype, "agentId", void 0);
438
444
  __decorate([
439
445
  property({
440
446
  type: String,