@coveo/atomic 3.51.0 → 3.52.1

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 (342) hide show
  1. package/custom-elements.json +950 -828
  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 -8
  5. package/dist/atomic/components/_index.js +97 -25
  6. package/dist/atomic/components/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.js +2 -2
  7. package/dist/atomic/components/components/common/atomic-facet-date-input/atomic-facet-date-input.js +1 -0
  8. package/dist/atomic/components/components/common/facets/timeframe-facet-common.js +1 -0
  9. package/dist/atomic/components/components/common/generated-answer/atomic-answer-content/atomic-answer-content.js +180 -0
  10. package/dist/atomic/components/components/common/generated-answer/atomic-generated-answer-thread-item/atomic-generated-answer-thread-item.js +155 -0
  11. package/dist/atomic/components/components/common/generated-answer/atomic-generated-answers-thread/atomic-generated-answers-thread.js +165 -0
  12. package/dist/atomic/components/components/common/generated-answer/render-agent-generation-steps.js +34 -0
  13. package/dist/atomic/components/components/common/generated-answer/render-answer-content.js +7 -19
  14. package/dist/atomic/components/components/common/generated-answer/render-follow-up-input.js +66 -0
  15. package/dist/atomic/components/components/common/generated-answer/styles/generated-answer.tw.css.js +1 -1
  16. package/dist/atomic/components/components/insight/atomic-insight-generated-answer/atomic-insight-generated-answer.js +7 -3
  17. package/dist/atomic/components/components/insight/atomic-insight-result-action/atomic-insight-result-action.js +169 -0
  18. package/dist/atomic/components/components/insight/atomic-insight-result-children/atomic-insight-result-children.js +3 -2
  19. package/dist/atomic/components/components/insight/atomic-insight-result-children-template/atomic-insight-result-children-template.js +79 -0
  20. package/dist/atomic/components/components/insight/atomic-insight-timeframe-facet/atomic-insight-timeframe-facet.js +267 -0
  21. package/dist/atomic/components/components/insight/atomic-insight-user-actions-session/atomic-insight-user-actions-session.js +1 -1
  22. package/dist/atomic/components/components/insight/atomic-insight-user-actions-timeline/atomic-insight-user-actions-timeline.js +1 -1
  23. package/dist/atomic/components/components/insight/index.js +3 -0
  24. package/dist/atomic/components/components/insight/lazy-index.js +3 -0
  25. package/dist/atomic/components/components/search/atomic-external/atomic-external.js +1 -1
  26. package/dist/atomic/components/components/search/atomic-generated-answer/atomic-generated-answer.js +108 -15
  27. package/dist/atomic/components/components/search/atomic-search-box/atomic-search-box.js +2 -2
  28. package/dist/atomic/components/decorators/bindings.js +1 -1
  29. package/dist/atomic/components/global/environment.js +1 -1
  30. package/dist/atomic/components/index.js.map +1 -1
  31. package/dist/atomic/components/mixins/bindings-mixin.js +1 -1
  32. package/dist/atomic/components/utils/custom-element-tags.js +6 -2
  33. package/dist/atomic/components/utils/tailwind.global.tw.css.js +2 -2
  34. package/dist/atomic/index.esm.js +1 -1
  35. package/dist/atomic/index.esm.js.map +1 -1
  36. package/dist/atomic/lang/cs.json +1 -1
  37. package/dist/atomic/lang/da.json +1 -1
  38. package/dist/atomic/lang/de.json +1 -1
  39. package/dist/atomic/lang/dev.json +1 -1
  40. package/dist/atomic/lang/el.json +1 -1
  41. package/dist/atomic/lang/en.json +1 -1
  42. package/dist/atomic/lang/es.json +1 -1
  43. package/dist/atomic/lang/fi.json +1 -1
  44. package/dist/atomic/lang/fr.json +1 -1
  45. package/dist/atomic/lang/hu.json +1 -1
  46. package/dist/atomic/lang/id.json +1 -1
  47. package/dist/atomic/lang/it.json +1 -1
  48. package/dist/atomic/lang/ja.json +1 -1
  49. package/dist/atomic/lang/ko.json +1 -1
  50. package/dist/atomic/lang/nl.json +1 -1
  51. package/dist/atomic/lang/no.json +1 -1
  52. package/dist/atomic/lang/pl.json +1 -1
  53. package/dist/atomic/lang/pt-BR.json +1 -1
  54. package/dist/atomic/lang/pt.json +1 -1
  55. package/dist/atomic/lang/ru.json +1 -1
  56. package/dist/atomic/lang/sv.json +1 -1
  57. package/dist/atomic/lang/th.json +1 -1
  58. package/dist/atomic/lang/tr.json +1 -1
  59. package/dist/atomic/lang/zh-CN.json +1 -1
  60. package/dist/atomic/lang/zh-TW.json +1 -1
  61. package/dist/atomic/lang/zh.json +1 -1
  62. package/dist/atomic/p-998f7983.js +3 -0
  63. package/dist/atomic/p-998f7983.js.map +1 -0
  64. package/dist/cjs/_index.cjs.js +110 -28
  65. package/dist/cjs/_loader.cjs.js +3 -4
  66. package/dist/cjs/app-globals-18f43c37.js +506 -0
  67. package/dist/cjs/app-globals-18f43c37.js.map +1 -0
  68. package/dist/cjs/atomic.cjs.js +4 -5
  69. package/dist/cjs/atomic.cjs.js.map +1 -1
  70. package/dist/cjs/index.cjs.js.map +1 -1
  71. package/dist/cjs/loader.cjs.js.map +1 -1
  72. package/dist/cjs/version.cjs.js +2 -2
  73. package/dist/esm/_index.js +97 -23
  74. package/dist/esm/_loader.js +3 -4
  75. package/dist/esm/app-globals-c5b073da.js +481 -0
  76. package/dist/esm/app-globals-c5b073da.js.map +1 -0
  77. package/dist/esm/atomic.js +3 -4
  78. package/dist/esm/atomic.js.map +1 -1
  79. package/dist/esm/index.js.map +1 -1
  80. package/dist/esm/loader.js.map +1 -1
  81. package/dist/esm/version.js +2 -2
  82. package/dist/types/components/common/context/bindings-context.d.ts +1 -1
  83. package/dist/types/components/common/facets/timeframe-facet-common.d.ts +1 -0
  84. package/dist/types/components/common/generated-answer/{answerContent/answer-content.d.ts → atomic-answer-content/atomic-answer-content.d.ts} +8 -6
  85. package/dist/types/components/common/generated-answer/{generated-answer-thread-item/generated-answer-thread-item.d.ts → atomic-generated-answer-thread-item/atomic-generated-answer-thread-item.d.ts} +3 -3
  86. package/dist/types/components/common/generated-answer/atomic-generated-answers-thread/atomic-generated-answers-thread.d.ts +42 -0
  87. package/dist/types/components/common/generated-answer/render-agent-generation-steps.d.ts +16 -0
  88. package/dist/types/components/common/generated-answer/render-answer-content.d.ts +3 -4
  89. package/dist/types/components/insight/atomic-insight-result-action/atomic-insight-result-action.d.ts +33 -18
  90. package/dist/types/components/insight/atomic-insight-result-children/atomic-insight-result-children.d.ts +1 -0
  91. package/dist/types/components/insight/atomic-insight-result-children-template/atomic-insight-result-children-template.d.ts +62 -0
  92. package/dist/types/components/insight/atomic-insight-timeframe-facet/atomic-insight-timeframe-facet.d.ts +47 -28
  93. package/dist/types/components/insight/index.d.ts +3 -0
  94. package/dist/types/components/search/atomic-external/atomic-external.d.ts +1 -1
  95. package/dist/types/components/search/atomic-generated-answer/atomic-generated-answer.d.ts +11 -2
  96. package/dist/types/components.d.ts +0 -298
  97. package/dist/types/decorators/bindings.d.ts +1 -1
  98. package/dist/types/index.d.ts +2 -3
  99. package/dist/types/utils/accessibility-utils.d.ts +2 -2
  100. package/dist/types/utils/init-queue.d.ts +1 -1
  101. package/docs/atomic-docs.json +2 -43
  102. package/package.json +4 -8
  103. package/dist/atomic/components/_commonjsHelpers.js +0 -5
  104. package/dist/atomic/components/_commonjsHelpers.js.map +0 -1
  105. package/dist/atomic/components/atomic-insight-result-action.d.ts +0 -11
  106. package/dist/atomic/components/atomic-insight-result-action.js +0 -272
  107. package/dist/atomic/components/atomic-insight-result-action.js.map +0 -1
  108. package/dist/atomic/components/atomic-insight-result-children-template.d.ts +0 -11
  109. package/dist/atomic/components/atomic-insight-result-children-template.js +0 -242
  110. package/dist/atomic/components/atomic-insight-result-children-template.js.map +0 -1
  111. package/dist/atomic/components/atomic-insight-timeframe-facet.d.ts +0 -11
  112. package/dist/atomic/components/atomic-insight-timeframe-facet.js +0 -816
  113. package/dist/atomic/components/atomic-insight-timeframe-facet.js.map +0 -1
  114. package/dist/atomic/components/atomic-stencil-facet-date-input.d.ts +0 -11
  115. package/dist/atomic/components/atomic-stencil-facet-date-input.js +0 -107
  116. package/dist/atomic/components/atomic-stencil-facet-date-input.js.map +0 -1
  117. package/dist/atomic/components/date-utils.js +0 -26
  118. package/dist/atomic/components/date-utils.js.map +0 -1
  119. package/dist/atomic/components/initialization-utils.js +0 -226
  120. package/dist/atomic/components/initialization-utils.js.map +0 -1
  121. package/dist/atomic/components/props-utils.js +0 -1457
  122. package/dist/atomic/components/props-utils.js.map +0 -1
  123. package/dist/atomic/components/stencil-button.js +0 -148
  124. package/dist/atomic/components/stencil-button.js.map +0 -1
  125. package/dist/atomic/p-1580513b.js +0 -2
  126. package/dist/atomic/p-1580513b.js.map +0 -1
  127. package/dist/atomic/p-1df0744f.entry.js +0 -9
  128. package/dist/atomic/p-1df0744f.entry.js.map +0 -1
  129. package/dist/atomic/p-2045a1b1.js +0 -2
  130. package/dist/atomic/p-2045a1b1.js.map +0 -1
  131. package/dist/atomic/p-4573c419.js +0 -2
  132. package/dist/atomic/p-4573c419.js.map +0 -1
  133. package/dist/atomic/p-500bf5c4.entry.js +0 -2
  134. package/dist/atomic/p-500bf5c4.entry.js.map +0 -1
  135. package/dist/atomic/p-5226a938.js +0 -3
  136. package/dist/atomic/p-5226a938.js.map +0 -1
  137. package/dist/atomic/p-720863c3.js +0 -2
  138. package/dist/atomic/p-720863c3.js.map +0 -1
  139. package/dist/atomic/p-81336626.entry.js +0 -2
  140. package/dist/atomic/p-81336626.entry.js.map +0 -1
  141. package/dist/atomic/p-81d6e743.js +0 -2
  142. package/dist/atomic/p-81d6e743.js.map +0 -1
  143. package/dist/atomic/p-aad3b4ec.js +0 -3
  144. package/dist/atomic/p-aad3b4ec.js.map +0 -1
  145. package/dist/atomic/p-b5af331b.entry.js +0 -2
  146. package/dist/atomic/p-b5af331b.entry.js.map +0 -1
  147. package/dist/atomic/p-b7209471.js +0 -2
  148. package/dist/atomic/p-b7209471.js.map +0 -1
  149. package/dist/atomic/p-dac60354.js +0 -2
  150. package/dist/atomic/p-dac60354.js.map +0 -1
  151. package/dist/atomic/p-e1255160.js +0 -2
  152. package/dist/atomic/p-e1255160.js.map +0 -1
  153. package/dist/cjs/_commonjsHelpers-68cdf74f.js +0 -7
  154. package/dist/cjs/_commonjsHelpers-68cdf74f.js.map +0 -1
  155. package/dist/cjs/app-globals-3a1e7e63.js +0 -7
  156. package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
  157. package/dist/cjs/atomic-insight-result-action.cjs.entry.js +0 -153
  158. package/dist/cjs/atomic-insight-result-action.cjs.entry.js.map +0 -1
  159. package/dist/cjs/atomic-insight-result-children-template.cjs.entry.js +0 -222
  160. package/dist/cjs/atomic-insight-result-children-template.cjs.entry.js.map +0 -1
  161. package/dist/cjs/atomic-insight-timeframe-facet.cjs.entry.js +0 -790
  162. package/dist/cjs/atomic-insight-timeframe-facet.cjs.entry.js.map +0 -1
  163. package/dist/cjs/atomic-stencil-facet-date-input.cjs.entry.js +0 -86
  164. package/dist/cjs/atomic-stencil-facet-date-input.cjs.entry.js.map +0 -1
  165. package/dist/cjs/date-utils-aae1d713.js +0 -28
  166. package/dist/cjs/date-utils-aae1d713.js.map +0 -1
  167. package/dist/cjs/event-utils-9bfcf3c5.js +0 -27
  168. package/dist/cjs/event-utils-9bfcf3c5.js.map +0 -1
  169. package/dist/cjs/index-122375df.js +0 -1394
  170. package/dist/cjs/index-122375df.js.map +0 -1
  171. package/dist/cjs/initialization-lit-stencil-common-utils-f19f74c0.js +0 -95
  172. package/dist/cjs/initialization-lit-stencil-common-utils-f19f74c0.js.map +0 -1
  173. package/dist/cjs/initialization-utils-c2821271.js +0 -148
  174. package/dist/cjs/initialization-utils-c2821271.js.map +0 -1
  175. package/dist/cjs/props-utils-e4f29f1e.js +0 -1464
  176. package/dist/cjs/props-utils-e4f29f1e.js.map +0 -1
  177. package/dist/cjs/stencil-button-bf22eea4.js +0 -130
  178. package/dist/cjs/stencil-button-bf22eea4.js.map +0 -1
  179. package/dist/cjs/stencil-result-template-decorators-96954751.js +0 -114
  180. package/dist/cjs/stencil-result-template-decorators-96954751.js.map +0 -1
  181. package/dist/esm/_commonjsHelpers-1c8beb5f.js +0 -5
  182. package/dist/esm/_commonjsHelpers-1c8beb5f.js.map +0 -1
  183. package/dist/esm/app-globals-0f993ce5.js +0 -5
  184. package/dist/esm/app-globals-0f993ce5.js.map +0 -1
  185. package/dist/esm/atomic-insight-result-action.entry.js +0 -149
  186. package/dist/esm/atomic-insight-result-action.entry.js.map +0 -1
  187. package/dist/esm/atomic-insight-result-children-template.entry.js +0 -218
  188. package/dist/esm/atomic-insight-result-children-template.entry.js.map +0 -1
  189. package/dist/esm/atomic-insight-timeframe-facet.entry.js +0 -786
  190. package/dist/esm/atomic-insight-timeframe-facet.entry.js.map +0 -1
  191. package/dist/esm/atomic-stencil-facet-date-input.entry.js +0 -82
  192. package/dist/esm/atomic-stencil-facet-date-input.entry.js.map +0 -1
  193. package/dist/esm/date-utils-3b955e79.js +0 -26
  194. package/dist/esm/date-utils-3b955e79.js.map +0 -1
  195. package/dist/esm/event-utils-8de63ec3.js +0 -24
  196. package/dist/esm/event-utils-8de63ec3.js.map +0 -1
  197. package/dist/esm/index-4d679e44.js +0 -1364
  198. package/dist/esm/index-4d679e44.js.map +0 -1
  199. package/dist/esm/initialization-lit-stencil-common-utils-e7755434.js +0 -88
  200. package/dist/esm/initialization-lit-stencil-common-utils-e7755434.js.map +0 -1
  201. package/dist/esm/initialization-utils-9ff399ff.js +0 -144
  202. package/dist/esm/initialization-utils-9ff399ff.js.map +0 -1
  203. package/dist/esm/props-utils-76043c82.js +0 -1457
  204. package/dist/esm/props-utils-76043c82.js.map +0 -1
  205. package/dist/esm/stencil-button-28de709c.js +0 -128
  206. package/dist/esm/stencil-button-28de709c.js.map +0 -1
  207. package/dist/esm/stencil-result-template-decorators-4c2e5132.js +0 -110
  208. package/dist/esm/stencil-result-template-decorators-4c2e5132.js.map +0 -1
  209. package/dist/types/components/commerce/product-template-component-utils/context/stencil-product-template-decorators.d.ts +0 -14
  210. package/dist/types/components/common/atomic-rating/stencil-rating.d.ts +0 -18
  211. package/dist/types/components/common/atomic-result-placeholder/stencil-placeholders.d.ts +0 -20
  212. package/dist/types/components/common/breadbox/stencil-breadcrumb-button.d.ts +0 -15
  213. package/dist/types/components/common/breadbox/stencil-breadcrumb-clear-all.d.ts +0 -13
  214. package/dist/types/components/common/breadbox/stencil-breadcrumb-container.d.ts +0 -11
  215. package/dist/types/components/common/breadbox/stencil-breadcrumb-content.d.ts +0 -14
  216. package/dist/types/components/common/breadbox/stencil-breadcrumb-show-less.d.ts +0 -13
  217. package/dist/types/components/common/breadbox/stencil-breadcrumb-show-more.d.ts +0 -14
  218. package/dist/types/components/common/facets/category-facet/stencil-all-categories-button.d.ts +0 -13
  219. package/dist/types/components/common/facets/category-facet/stencil-child-value-link.d.ts +0 -9
  220. package/dist/types/components/common/facets/category-facet/stencil-children-as-tree-container.d.ts +0 -9
  221. package/dist/types/components/common/facets/category-facet/stencil-parent-as-tree-container.d.ts +0 -10
  222. package/dist/types/components/common/facets/category-facet/stencil-parent-button.d.ts +0 -16
  223. package/dist/types/components/common/facets/category-facet/stencil-parent-value-link.d.ts +0 -9
  224. package/dist/types/components/common/facets/category-facet/stencil-search-results-container.d.ts +0 -5
  225. package/dist/types/components/common/facets/category-facet/stencil-search-value.d.ts +0 -19
  226. package/dist/types/components/common/facets/category-facet/stencil-value-as-tree-container.d.ts +0 -5
  227. package/dist/types/components/common/facets/category-facet/stencil-value-link.d.ts +0 -20
  228. package/dist/types/components/common/facets/facet-container/stencil-facet-container.d.ts +0 -5
  229. package/dist/types/components/common/facets/facet-header/stencil-facet-header.d.ts +0 -17
  230. package/dist/types/components/common/facets/facet-placeholder/stencil-facet-placeholder.d.ts +0 -10
  231. package/dist/types/components/common/facets/facet-search/stencil-facet-search-input-guard.d.ts +0 -11
  232. package/dist/types/components/common/facets/facet-search/stencil-facet-search-input.d.ts +0 -14
  233. package/dist/types/components/common/facets/facet-search/stencil-facet-search-matches.d.ts +0 -14
  234. package/dist/types/components/common/facets/facet-search/stencil-facet-search-value.d.ts +0 -6
  235. package/dist/types/components/common/facets/facet-show-more-less/stencil-facet-show-more-less.d.ts +0 -17
  236. package/dist/types/components/common/facets/facet-value/stencil-facet-value.d.ts +0 -22
  237. package/dist/types/components/common/facets/facet-value-box/stencil-facet-value-box.d.ts +0 -6
  238. package/dist/types/components/common/facets/facet-value-checkbox/stencil-facet-value-checkbox.d.ts +0 -11
  239. package/dist/types/components/common/facets/facet-value-exclude/stencil-facet-value-exclude.d.ts +0 -10
  240. package/dist/types/components/common/facets/facet-value-label-highlight/stencil-facet-value-label-highlight.d.ts +0 -12
  241. package/dist/types/components/common/facets/facet-value-link/stencil-facet-value-link.d.ts +0 -10
  242. package/dist/types/components/common/facets/facet-values-group/stencil-facet-values-group.d.ts +0 -12
  243. package/dist/types/components/common/facets/numeric-facet/stencil-value-link.d.ts +0 -12
  244. package/dist/types/components/common/facets/numeric-facet/stencil-values-container.d.ts +0 -11
  245. package/dist/types/components/common/facets/stencil-facet-common.d.ts +0 -43
  246. package/dist/types/components/common/facets/stencil-facet-date-input/stencil-facet-date-input.d.ts +0 -33
  247. package/dist/types/components/common/facets/stencil-facet-guard.d.ts +0 -12
  248. package/dist/types/components/common/facets/stencil-timeframe-facet-common.d.ts +0 -72
  249. package/dist/types/components/common/generated-answer/generated-answer-common.d.ts +0 -58
  250. package/dist/types/components/common/generated-answer/generated-content/stencil-generated-markdown-content.d.ts +0 -10
  251. package/dist/types/components/common/generated-answer/generated-content/stencil-generated-text-content.d.ts +0 -10
  252. package/dist/types/components/common/generated-answer/stencil-copy-button.d.ts +0 -12
  253. package/dist/types/components/common/generated-answer/stencil-feedback-button.d.ts +0 -13
  254. package/dist/types/components/common/generated-answer/stencil-generated-content-container.d.ts +0 -11
  255. package/dist/types/components/common/generated-answer/stencil-retry-prompt.d.ts +0 -11
  256. package/dist/types/components/common/generated-answer/stencil-show-button.d.ts +0 -12
  257. package/dist/types/components/common/generated-answer/stencil-source-citations.d.ts +0 -10
  258. package/dist/types/components/common/interface/interface-common-stencil.d.ts +0 -34
  259. package/dist/types/components/common/interface/stencil-i18n.d.ts +0 -11
  260. package/dist/types/components/common/item-link/stencil-item-link.d.ts +0 -30
  261. package/dist/types/components/common/item-list/item-list-decorators.d.ts +0 -17
  262. package/dist/types/components/common/item-list/stencil-display-grid.d.ts +0 -17
  263. package/dist/types/components/common/item-list/stencil-display-wrapper.d.ts +0 -11
  264. package/dist/types/components/common/item-list/stencil-item-decorators.d.ts +0 -41
  265. package/dist/types/components/common/item-list/stencil-item-display-guard.d.ts +0 -10
  266. package/dist/types/components/common/item-list/stencil-item-list-common.d.ts +0 -31
  267. package/dist/types/components/common/item-list/stencil-item-list-guard.d.ts +0 -13
  268. package/dist/types/components/common/item-text/stencil-item-text-fallback.d.ts +0 -14
  269. package/dist/types/components/common/item-text/stencil-item-text-highlighted.d.ts +0 -13
  270. package/dist/types/components/common/load-more/guard.d.ts +0 -10
  271. package/dist/types/components/common/load-more/stencil-button.d.ts +0 -13
  272. package/dist/types/components/common/load-more/stencil-container.d.ts +0 -5
  273. package/dist/types/components/common/load-more/stencil-progress-bar.d.ts +0 -10
  274. package/dist/types/components/common/load-more/stencil-summary.d.ts +0 -13
  275. package/dist/types/components/common/no-items/stencil-container.d.ts +0 -5
  276. package/dist/types/components/common/no-items/stencil-guard.d.ts +0 -11
  277. package/dist/types/components/common/no-items/stencil-magnifying-glass.d.ts +0 -5
  278. package/dist/types/components/common/no-items/stencil-no-items.d.ts +0 -12
  279. package/dist/types/components/common/no-items/stencil-tips.d.ts +0 -10
  280. package/dist/types/components/common/pager/stencil-pager-buttons.d.ts +0 -33
  281. package/dist/types/components/common/pager/stencil-pager-navigation.d.ts +0 -10
  282. package/dist/types/components/common/product-template/stencil-product-template-common.d.ts +0 -26
  283. package/dist/types/components/common/query-correction/stencil-auto-correction.d.ts +0 -12
  284. package/dist/types/components/common/query-correction/stencil-correction.d.ts +0 -12
  285. package/dist/types/components/common/query-correction/stencil-guard.d.ts +0 -9
  286. package/dist/types/components/common/query-correction/stencil-trigger-correction.d.ts +0 -13
  287. package/dist/types/components/common/query-error/stencil-container.d.ts +0 -5
  288. package/dist/types/components/common/query-error/stencil-description.d.ts +0 -13
  289. package/dist/types/components/common/query-error/stencil-details.d.ts +0 -10
  290. package/dist/types/components/common/query-error/stencil-guard.d.ts +0 -9
  291. package/dist/types/components/common/query-error/stencil-icon.d.ts +0 -9
  292. package/dist/types/components/common/query-error/stencil-link.d.ts +0 -11
  293. package/dist/types/components/common/query-error/stencil-show-more.d.ts +0 -13
  294. package/dist/types/components/common/query-error/stencil-title.d.ts +0 -12
  295. package/dist/types/components/common/query-summary/stencil-container.d.ts +0 -9
  296. package/dist/types/components/common/query-summary/stencil-guard.d.ts +0 -11
  297. package/dist/types/components/common/query-summary/stencil-utils.d.ts +0 -23
  298. package/dist/types/components/common/refine-modal/stencil-body.d.ts +0 -7
  299. package/dist/types/components/common/refine-modal/stencil-button.d.ts +0 -12
  300. package/dist/types/components/common/refine-modal/stencil-filters.d.ts +0 -20
  301. package/dist/types/components/common/refine-modal/stencil-guard.d.ts +0 -11
  302. package/dist/types/components/common/refine-modal/stencil-modal.d.ts +0 -18
  303. package/dist/types/components/common/refine-modal/stencil-sort.d.ts +0 -11
  304. package/dist/types/components/common/result-children/stencil-children-wrapper.d.ts +0 -9
  305. package/dist/types/components/common/result-children/stencil-collection-guard.d.ts +0 -16
  306. package/dist/types/components/common/result-children/stencil-guard.d.ts +0 -11
  307. package/dist/types/components/common/result-children/stencil-show-hide-button.d.ts +0 -14
  308. package/dist/types/components/common/result-templates/stencil-result-template-common.d.ts +0 -24
  309. package/dist/types/components/common/search-box/stencil-search-box-wrapper.d.ts +0 -10
  310. package/dist/types/components/common/search-box/stencil-search-text-area.d.ts +0 -22
  311. package/dist/types/components/common/search-box/stencil-submit-button.d.ts +0 -12
  312. package/dist/types/components/common/search-box/stencil-text-area-clear-button.d.ts +0 -12
  313. package/dist/types/components/common/smart-snippets/atomic-smart-snippet/stencil-smart-snippet-common.d.ts +0 -31
  314. package/dist/types/components/common/smart-snippets/atomic-smart-snippet-feedback-modal/stencil-smart-snippet-feedback-modal-common.d.ts +0 -57
  315. package/dist/types/components/common/smart-snippets/atomic-smart-snippet-suggestions/stencil-smart-snippet-suggestions-common.d.ts +0 -43
  316. package/dist/types/components/common/smart-snippets/stencil-smart-snippet-feedback-banner.d.ts +0 -18
  317. package/dist/types/components/common/stencil-button-style.d.ts +0 -11
  318. package/dist/types/components/common/stencil-button.d.ts +0 -30
  319. package/dist/types/components/common/stencil-carousel.d.ts +0 -15
  320. package/dist/types/components/common/stencil-checkbox.d.ts +0 -22
  321. package/dist/types/components/common/stencil-fieldset-group.d.ts +0 -9
  322. package/dist/types/components/common/stencil-heading.d.ts +0 -7
  323. package/dist/types/components/common/stencil-hidden.d.ts +0 -5
  324. package/dist/types/components/common/stencil-iconButton.d.ts +0 -13
  325. package/dist/types/components/common/stencil-radio-button.d.ts +0 -12
  326. package/dist/types/components/common/stencil-switch.d.ts +0 -15
  327. package/dist/types/components/common/stencil-triStateCheckbox.d.ts +0 -11
  328. package/dist/types/components/common/suggestions/stencil-instant-item.d.ts +0 -19
  329. package/dist/types/components/common/suggestions/stencil-query-suggestions.d.ts +0 -32
  330. package/dist/types/components/common/suggestions/stencil-suggestion-manager.d.ts +0 -96
  331. package/dist/types/components/insight/result-templates/atomic-insight-result-children-template/atomic-insight-result-children-template.d.ts +0 -50
  332. package/dist/types/components/search/facets/facet-segmented-value/stencil-facet-segmented-value.d.ts +0 -6
  333. package/dist/types/components/search/result-template-component-utils/context/stencil-result-template-decorators.d.ts +0 -32
  334. package/dist/types/components/search/result-template-components/quickview-iframe/stencil-quickview-iframe.d.ts +0 -14
  335. package/dist/types/utils/__mocks__/stencil-resource-url.d.ts +0 -1
  336. package/dist/types/utils/initialization-utils.d.ts +0 -70
  337. package/dist/types/utils/jsx-utils.d.ts +0 -6
  338. package/dist/types/utils/stencil-accessibility-utils.d.ts +0 -43
  339. package/dist/types/utils/stencil-asset-path-utils.d.ts +0 -1
  340. package/dist/types/utils/stencil-resource-url.d.ts +0 -1
  341. /package/dist/atomic/components/utils/{initialization-lit-stencil-common-utils.js → initialization-common-utils.js} +0 -0
  342. /package/dist/types/utils/{initialization-lit-stencil-common-utils.d.ts → initialization-common-utils.d.ts} +0 -0
@@ -1,242 +0,0 @@
1
- import { h, proxyCustomElement, HTMLElement } from '@stencil/core/internal/client';
2
- import { i as isElementNode, a as aggregate, b as isVisualNode, M as MapProp } from './props-utils.js';
3
- import { ResultTemplatesHelpers } from '@coveo/headless';
4
-
5
- const tableElementTagName = 'atomic-table-element';
6
-
7
- const resultSectionTags = new Set([
8
- 'atomic-result-section-visual',
9
- 'atomic-result-section-badges',
10
- 'atomic-result-section-actions',
11
- 'atomic-result-section-title',
12
- 'atomic-result-section-title-metadata',
13
- 'atomic-result-section-emphasized',
14
- 'atomic-result-section-excerpt',
15
- 'atomic-result-section-bottom-metadata',
16
- 'atomic-result-section-children',
17
- ]);
18
- const productSectionTags = new Set([
19
- 'atomic-product-section-visual',
20
- 'atomic-product-section-badges',
21
- 'atomic-product-section-actions',
22
- 'atomic-product-section-name',
23
- 'atomic-product-section-metadata',
24
- 'atomic-product-section-emphasized',
25
- 'atomic-product-section-description',
26
- 'atomic-product-section-bottom-metadata',
27
- 'atomic-product-section-children',
28
- ]);
29
- const allTags = new Set([...resultSectionTags, ...productSectionTags]);
30
- function isResultSectionNode(element) {
31
- if (!isElementNode(element)) {
32
- return false;
33
- }
34
- return allTags.has(element.tagName.toLowerCase());
35
- }
36
-
37
- function getTemplateNodeType(node) {
38
- if (isResultSectionNode(node)) {
39
- return 'section';
40
- }
41
- if (!isVisualNode(node)) {
42
- return 'metadata';
43
- }
44
- if (isElementNode(node) &&
45
- node.tagName.toLowerCase() === tableElementTagName) {
46
- return 'table-column-definition';
47
- }
48
- return 'other';
49
- }
50
- function groupNodesByType(nodes) {
51
- return aggregate(Array.from(nodes), (node) => getTemplateNodeType(node));
52
- }
53
- class ResultTemplateCommon {
54
- constructor({ host, setError, validParents, allowEmpty = false, }) {
55
- this.matchConditions = [];
56
- this.gridCellLinkTarget = '_self';
57
- this.host = host;
58
- this.validateTemplate(host, setError, validParents, allowEmpty);
59
- }
60
- validateTemplate(host, setError, validParents, allowEmpty = true) {
61
- const hasValidParent = validParents
62
- .map((p) => p.toUpperCase())
63
- .includes(host.parentElement?.nodeName || '');
64
- const tagName = host.nodeName.toLowerCase();
65
- if (!hasValidParent) {
66
- setError(new Error(`The "${tagName}" component has to be the child of one of the following: ${validParents
67
- .map((p) => `"${p.toLowerCase()}"`)
68
- .join(', ')}.`));
69
- return;
70
- }
71
- if (host.parentElement?.attributes.getNamedItem('display')?.value === 'grid') {
72
- this.gridCellLinkTarget = host.parentElement?.attributes.getNamedItem('grid-cell-link-target')?.value;
73
- }
74
- const template = host.querySelector('template:not([slot])');
75
- if (!template) {
76
- setError(new Error(`The "${tagName}" component has to contain a "template" element as a child.`));
77
- return;
78
- }
79
- if (!allowEmpty && !template.innerHTML.trim()) {
80
- setError(new Error(`The "template" tag inside "${tagName}" cannot be empty.`));
81
- return;
82
- }
83
- if (template.content.querySelector('script')) {
84
- console.warn('Any "script" tags defined inside of "template" elements are not supported and will not be executed when the results are rendered.', host);
85
- }
86
- const { section: sectionNodes, other: otherNodes } = groupNodesByType(template.content.childNodes);
87
- if (sectionNodes?.length && otherNodes?.length) {
88
- console.warn('Result templates should only contain section elements or non-section elements. Future updates could unpredictably affect this result template.', host, { sectionNodes, otherNodes });
89
- }
90
- }
91
- getTemplate(conditions, error) {
92
- if (error) {
93
- return null;
94
- }
95
- return {
96
- conditions: conditions.concat(this.matchConditions),
97
- content: getTemplateElement(this.host).content,
98
- linkContent: this.getLinkTemplateElement(this.host).content,
99
- priority: 1,
100
- };
101
- }
102
- renderIfError(error) {
103
- if (error) {
104
- return (h("atomic-component-error", { element: this.host, error: error }));
105
- }
106
- }
107
- getDefaultLinkTemplateElement() {
108
- const linkTemplate = document.createElement('template');
109
- linkTemplate.innerHTML = `<atomic-result-link>${this.gridCellLinkTarget ? `<a slot="attributes" target="${this.gridCellLinkTarget}"></a>` : ''}</atomic-result-link>`;
110
- return linkTemplate;
111
- }
112
- getLinkTemplateElement(host) {
113
- return (host.querySelector('template[slot="link"]') ??
114
- this.getDefaultLinkTemplateElement());
115
- }
116
- }
117
- function getTemplateElement(host) {
118
- return host.querySelector('template:not([slot])');
119
- }
120
- function makeMatchConditions(mustMatch, mustNotMatch) {
121
- const conditions = [];
122
- for (const field in mustMatch) {
123
- conditions.push(ResultTemplatesHelpers.fieldMustMatch(field, mustMatch[field]));
124
- }
125
- for (const field in mustNotMatch) {
126
- conditions.push(ResultTemplatesHelpers.fieldMustNotMatch(field, mustNotMatch[field]));
127
- }
128
- return conditions;
129
- }
130
- function makeDefinedConditions(ifDefined, ifNotDefined) {
131
- const conditions = [];
132
- if (ifDefined) {
133
- const fieldNames = ifDefined.split(',');
134
- conditions.push(ResultTemplatesHelpers.fieldsMustBeDefined(fieldNames));
135
- }
136
- if (ifNotDefined) {
137
- const fieldNames = ifNotDefined.split(',');
138
- conditions.push(ResultTemplatesHelpers.fieldsMustNotBeDefined(fieldNames));
139
- }
140
- return conditions;
141
- }
142
-
143
- var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
144
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
145
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
146
- r = Reflect.decorate(decorators, target, key, desc);
147
- else
148
- for (var i = decorators.length - 1; i >= 0; i--)
149
- if (d = decorators[i])
150
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
151
- return c > 3 && r && Object.defineProperty(target, key, r), r;
152
- };
153
- const AtomicInsightResultChildrenTemplate$1 = /*@__PURE__*/ proxyCustomElement(class AtomicInsightResultChildrenTemplate extends HTMLElement {
154
- constructor() {
155
- super();
156
- this.__registerHost();
157
- this.__attachShadow();
158
- /**
159
- * A function that must return true on results for the result template to apply.
160
- * Set programmatically before initialization, not via attribute.
161
- *
162
- * For example, the following targets a template and sets a condition to make it apply only to results whose `title` contains `singapore`:
163
- * `document.querySelector('#target-template').conditions = [(result) => /singapore/i.test(result.title)];`
164
- */
165
- this.conditions = [];
166
- /**
167
- * The field and values that define which result items the condition must be applied to.
168
- *
169
- * For example, a template with the following attribute only applies to result items whose `filetype` is `lithiummessage` or `YouTubePlaylist`: `must-match-filetype="lithiummessage,YouTubePlaylist"`
170
- */
171
- this.mustMatch = {};
172
- /**
173
- * The field and values that define which result items the condition must not be applied to.
174
- *
175
- * For example, a template with the following attribute only applies to result items whose `filetype` is not `lithiummessage`: `must-not-match-filetype="lithiummessage"`
176
- */
177
- this.mustNotMatch = {};
178
- this.error = undefined;
179
- this.conditions = [];
180
- this.ifDefined = undefined;
181
- this.ifNotDefined = undefined;
182
- this.mustMatch = {};
183
- this.mustNotMatch = {};
184
- }
185
- connectedCallback() {
186
- this.resultTemplateCommon = new ResultTemplateCommon({
187
- host: this.host,
188
- setError: (err) => {
189
- this.error = err;
190
- },
191
- validParents: ['atomic-insight-result-children'],
192
- });
193
- }
194
- componentWillLoad() {
195
- this.conditions = makeDefinedConditions(this.ifDefined, this.ifNotDefined);
196
- this.resultTemplateCommon.matchConditions = makeMatchConditions(this.mustMatch, this.mustNotMatch);
197
- }
198
- /**
199
- * Gets the appropriate result template based on conditions applied.
200
- */
201
- async getTemplate() {
202
- return this.resultTemplateCommon.getTemplate(this.conditions, this.error);
203
- }
204
- render() {
205
- return this.resultTemplateCommon.renderIfError(this.error);
206
- }
207
- get host() { return this; }
208
- }, [1, "atomic-insight-result-children-template", {
209
- "conditions": [16],
210
- "ifDefined": [513, "if-defined"],
211
- "ifNotDefined": [513, "if-not-defined"],
212
- "mustMatch": [16],
213
- "mustNotMatch": [16],
214
- "error": [32],
215
- "getTemplate": [64]
216
- }]);
217
- __decorate([
218
- MapProp({ splitValues: true })
219
- ], AtomicInsightResultChildrenTemplate$1.prototype, "mustMatch", void 0);
220
- __decorate([
221
- MapProp({ splitValues: true })
222
- ], AtomicInsightResultChildrenTemplate$1.prototype, "mustNotMatch", void 0);
223
- function defineCustomElement$1() {
224
- if (typeof customElements === "undefined") {
225
- return;
226
- }
227
- const components = ["atomic-insight-result-children-template"];
228
- components.forEach(tagName => { switch (tagName) {
229
- case "atomic-insight-result-children-template":
230
- if (!customElements.get(tagName)) {
231
- customElements.define(tagName, AtomicInsightResultChildrenTemplate$1);
232
- }
233
- break;
234
- } });
235
- }
236
-
237
- const AtomicInsightResultChildrenTemplate = AtomicInsightResultChildrenTemplate$1;
238
- const defineCustomElement = defineCustomElement$1;
239
-
240
- export { AtomicInsightResultChildrenTemplate, defineCustomElement };
241
-
242
- //# sourceMappingURL=atomic-insight-result-children-template.js.map
@@ -1 +0,0 @@
1
- {"file":"atomic-insight-result-children-template.js","mappings":";;;;AAAO,MAAM,mBAAmB,GAAG,sBAAsB;;ACEzD,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC;IAChC,8BAA8B;IAC9B,8BAA8B;IAC9B,+BAA+B;IAC/B,6BAA6B;IAC7B,sCAAsC;IACtC,kCAAkC;IAClC,+BAA+B;IAC/B,uCAAuC;IACvC,gCAAgC;CACxB,CAAC,CAAC;AAEZ,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC;IACjC,+BAA+B;IAC/B,+BAA+B;IAC/B,gCAAgC;IAChC,6BAA6B;IAC7B,iCAAiC;IACjC,mCAAmC;IACnC,oCAAoC;IACpC,wCAAwC;IACxC,iCAAiC;CACzB,CAAC,CAAC;AAEZ,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,iBAAiB,EAAE,GAAG,kBAAkB,CAAC,CAAC,CAAC;SAMvD,mBAAmB,CAAC,OAAa;IAC/C,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE;QAC3B,OAAO,KAAK,CAAC;KACd;IACD,OAAO,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,EAAwB,CAAC,CAAC;AAC1E;;SCXgB,mBAAmB,CAAC,IAAU;IAC5C,IAAI,mBAAmB,CAAC,IAAI,CAAC,EAAE;QAC7B,OAAO,SAAS,CAAC;KAClB;I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AI,CAAC,KAAK,CAAC,CAAC;KAC3E;IAEM,MAAM;QACX,OAAO,IAAI,CAAC,oBAAoB,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KAC5D;;;;;;;;;;;AA/C4C;IAApC,OAAO,CAAC,EAAC,WAAW,EAAE,IAAI,EAAC,CAAC;wEAG9B;AAOsC;IAApC,OAAO,CAAC,EAAC,WAAW,EAAE,IAAI,EAAC,CAAC;2EAG9B;;;;;;;;;;;;;;;;;;;;","names":["AtomicInsightResultChildrenTemplate"],"sources":["src/components/common/table-element-utils.ts","src/components/common/layout/item-layout-sections.ts","src/components/common/result-templates/stencil-result-template-common.tsx","src/components/insight/result-templates/atomic-insight-result-children-template/atomic-insight-result-children-template.tsx"],"sourcesContent":["export const tableElementTagName = 'atomic-table-element';\n","import {isElementNode} from '@/src/utils/utils';\n\nconst resultSectionTags = new Set([\n 'atomic-result-section-visual',\n 'atomic-result-section-badges',\n 'atomic-result-section-actions',\n 'atomic-result-section-title',\n 'atomic-result-section-title-metadata',\n 'atomic-result-section-emphasized',\n 'atomic-result-section-excerpt',\n 'atomic-result-section-bottom-metadata',\n 'atomic-result-section-children',\n] as const);\n\nconst productSectionTags = new Set([\n 'atomic-product-section-visual',\n 'atomic-product-section-badges',\n 'atomic-product-section-actions',\n 'atomic-product-section-name',\n 'atomic-product-section-metadata',\n 'atomic-product-section-emphasized',\n 'atomic-product-section-description',\n 'atomic-product-section-bottom-metadata',\n 'atomic-product-section-children',\n] as const);\n\nconst allTags = new Set([...resultSectionTags, ...productSectionTags]);\n\ntype SetValueType<T> = T extends Set<infer U> ? U : never;\n\nexport type ItemSectionTagName = SetValueType<typeof allTags>;\n\nexport function isResultSectionNode(element: Node) {\n if (!isElementNode(element)) {\n return false;\n }\n return allTags.has(element.tagName.toLowerCase() as ItemSectionTagName);\n}\n\nexport function containsSections(content: string | NodeList | HTMLCollection) {\n if (typeof content === 'string') {\n return Array.from(allTags.values()).some((tag) => content.includes(tag));\n }\n return Array.from(content).some((child) => isResultSectionNode(child));\n}\n","import {\n ResultTemplate,\n ResultTemplateCondition,\n ResultTemplatesHelpers,\n} from '@coveo/headless';\nimport {h} from '@stencil/core';\nimport {aggregate, isElementNode, isVisualNode} from '@/src/utils/utils';\nimport {tableElementTagName} from '../table-element-utils';\nimport {ItemTarget} from '../layout/display-options';\nimport {isResultSectionNode} from '../layout/item-layout-sections';\n\nexport type TemplateContent = DocumentFragment;\n\ninterface ResultTemplateCommonProps {\n allowEmpty?: boolean;\n host: HTMLDivElement;\n validParents: string[];\n setError: (error: Error) => void;\n}\n\ntype TemplateNodeType =\n | 'section'\n | 'metadata'\n | 'table-column-definition'\n | 'other';\n\nexport function getTemplateNodeType(node: Node): TemplateNodeType {\n if (isResultSectionNode(node)) {\n return 'section';\n }\n if (!isVisualNode(node)) {\n return 'metadata';\n }\n if (\n isElementNode(node) &&\n node.tagName.toLowerCase() === tableElementTagName\n ) {\n return 'table-column-definition';\n }\n return 'other';\n}\n\nfunction groupNodesByType(nodes: NodeList) {\n return aggregate(Array.from(nodes), (node) => getTemplateNodeType(node));\n}\n\nexport class ResultTemplateCommon {\n private host: HTMLDivElement;\n public matchConditions: ResultTemplateCondition[] = [];\n private gridCellLinkTarget: ItemTarget = '_self';\n\n constructor({\n host,\n setError,\n validParents,\n allowEmpty = false,\n }: ResultTemplateCommonProps) {\n this.host = host;\n this.validateTemplate(host, setError, validParents, allowEmpty);\n }\n\n validateTemplate(\n host: HTMLDivElement,\n setError: (error: Error) => void,\n validParents: string[],\n allowEmpty = true\n ) {\n const hasValidParent = validParents\n .map((p) => p.toUpperCase())\n .includes(host.parentElement?.nodeName || '');\n const tagName = host.nodeName.toLowerCase();\n\n if (!hasValidParent) {\n setError(\n new Error(\n `The \"${tagName}\" component has to be the child of one of the following: ${validParents\n .map((p) => `\"${p.toLowerCase()}\"`)\n .join(', ')}.`\n )\n );\n return;\n }\n\n if (\n host.parentElement?.attributes.getNamedItem('display')?.value === 'grid'\n ) {\n this.gridCellLinkTarget = host.parentElement?.attributes.getNamedItem(\n 'grid-cell-link-target'\n )?.value as ItemTarget;\n }\n\n const template = host.querySelector<HTMLTemplateElement>(\n 'template:not([slot])'\n );\n if (!template) {\n setError(\n new Error(\n `The \"${tagName}\" component has to contain a \"template\" element as a child.`\n )\n );\n return;\n }\n\n if (!allowEmpty && !template.innerHTML.trim()) {\n setError(\n new Error(`The \"template\" tag inside \"${tagName}\" cannot be empty.`)\n );\n return;\n }\n\n if (template.content.querySelector('script')) {\n console.warn(\n 'Any \"script\" tags defined inside of \"template\" elements are not supported and will not be executed when the results are rendered.',\n host\n );\n }\n\n const {section: sectionNodes, other: otherNodes} = groupNodesByType(\n template.content.childNodes\n );\n if (sectionNodes?.length && otherNodes?.length) {\n console.warn(\n 'Result templates should only contain section elements or non-section elements. Future updates could unpredictably affect this result template.',\n host,\n {sectionNodes, otherNodes}\n );\n }\n }\n\n getTemplate(\n conditions: ResultTemplateCondition[],\n error: Error\n ): ResultTemplate<TemplateContent> | null {\n if (error) {\n return null;\n }\n\n return {\n conditions: conditions.concat(this.matchConditions),\n content: getTemplateElement(this.host).content!,\n linkContent: this.getLinkTemplateElement(this.host).content!,\n priority: 1,\n };\n }\n\n renderIfError(error: Error) {\n if (error) {\n return (\n <atomic-component-error\n element={this.host}\n error={error}\n ></atomic-component-error>\n );\n }\n }\n\n getDefaultLinkTemplateElement() {\n const linkTemplate = document.createElement('template');\n linkTemplate.innerHTML = `<atomic-result-link>${this.gridCellLinkTarget ? `<a slot=\"attributes\" target=\"${this.gridCellLinkTarget}\"></a>` : ''}</atomic-result-link>`;\n return linkTemplate;\n }\n\n getLinkTemplateElement(host: HTMLElement) {\n return (\n host.querySelector<HTMLTemplateElement>('template[slot=\"link\"]') ??\n this.getDefaultLinkTemplateElement()\n );\n }\n}\n\nfunction getTemplateElement(host: HTMLElement) {\n return host.querySelector<HTMLTemplateElement>('template:not([slot])')!;\n}\n\nexport function makeMatchConditions(\n mustMatch: Record<string, string[]>,\n mustNotMatch: Record<string, string[]>\n): ResultTemplateCondition[] {\n const conditions: ResultTemplateCondition[] = [];\n for (const field in mustMatch) {\n conditions.push(\n ResultTemplatesHelpers.fieldMustMatch(field, mustMatch[field])\n );\n }\n\n for (const field in mustNotMatch) {\n conditions.push(\n ResultTemplatesHelpers.fieldMustNotMatch(field, mustNotMatch[field])\n );\n }\n return conditions;\n}\n\nexport function makeDefinedConditions(\n ifDefined?: string,\n ifNotDefined?: string\n): ResultTemplateCondition[] {\n const conditions: ResultTemplateCondition[] = [];\n if (ifDefined) {\n const fieldNames = ifDefined.split(',');\n conditions.push(ResultTemplatesHelpers.fieldsMustBeDefined(fieldNames));\n }\n\n if (ifNotDefined) {\n const fieldNames = ifNotDefined.split(',');\n conditions.push(ResultTemplatesHelpers.fieldsMustNotBeDefined(fieldNames));\n }\n return conditions;\n}\n","import {ResultTemplate, ResultTemplateCondition} from '@coveo/headless';\nimport {Component, Element, Prop, State, Method} from '@stencil/core';\nimport {MapProp} from '../../../../utils/props-utils';\nimport {\n makeDefinedConditions,\n makeMatchConditions,\n ResultTemplateCommon,\n} from '../../../common/result-templates/stencil-result-template-common';\n\n/**\n * @internal\n */\n@Component({\n tag: 'atomic-insight-result-children-template',\n shadow: true,\n})\nexport class AtomicInsightResultChildrenTemplate {\n @Element() public host!: HTMLDivElement;\n\n @State() public error!: Error;\n\n /**\n * A function that must return true on results for the result template to apply.\n * Set programmatically before initialization, not via attribute.\n *\n * For example, the following targets a template and sets a condition to make it apply only to results whose `title` contains `singapore`:\n * `document.querySelector('#target-template').conditions = [(result) => /singapore/i.test(result.title)];`\n */\n @Prop() public conditions: ResultTemplateCondition[] = [];\n\n /**\n * The field that, when defined on a result item, would allow the template to be applied.\n *\n * For example, a template with the following attribute only applies to result items whose `filetype` and `sourcetype` fields are defined: `if-defined=\"filetype,sourcetype\"`\n */\n @Prop({reflect: true}) ifDefined?: string;\n\n /**\n * The field that, when defined on a result item, would prevent the template from being applied.\n *\n * For example, a template with the following attribute only applies to result items whose `filetype` and `sourcetype` fields are NOT defined: `if-not-defined=\"filetype,sourcetype\"`\n */\n @Prop({reflect: true}) ifNotDefined?: string;\n\n /**\n * The field and values that define which result items the condition must be applied to.\n *\n * For example, a template with the following attribute only applies to result items whose `filetype` is `lithiummessage` or `YouTubePlaylist`: `must-match-filetype=\"lithiummessage,YouTubePlaylist\"`\n */\n @Prop() @MapProp({splitValues: true}) public mustMatch: Record<\n string,\n string[]\n > = {};\n\n /**\n * The field and values that define which result items the condition must not be applied to.\n *\n * For example, a template with the following attribute only applies to result items whose `filetype` is not `lithiummessage`: `must-not-match-filetype=\"lithiummessage\"`\n */\n @Prop() @MapProp({splitValues: true}) public mustNotMatch: Record<\n string,\n string[]\n > = {};\n\n public resultTemplateCommon!: ResultTemplateCommon;\n\n constructor() {}\n\n connectedCallback() {\n this.resultTemplateCommon = new ResultTemplateCommon({\n host: this.host,\n setError: (err) => {\n this.error = err;\n },\n validParents: ['atomic-insight-result-children'],\n });\n }\n\n public componentWillLoad() {\n this.conditions = makeDefinedConditions(this.ifDefined, this.ifNotDefined);\n this.resultTemplateCommon.matchConditions = makeMatchConditions(\n this.mustMatch,\n this.mustNotMatch\n );\n }\n\n /**\n * Gets the appropriate result template based on conditions applied.\n */\n @Method()\n public async getTemplate(): Promise<ResultTemplate<DocumentFragment> | null> {\n return this.resultTemplateCommon.getTemplate(this.conditions, this.error);\n }\n\n public render() {\n return this.resultTemplateCommon.renderIfError(this.error);\n }\n}\n"],"version":3}
@@ -1,11 +0,0 @@
1
- import type { Components, JSX } from "../../types/components";
2
-
3
- interface AtomicInsightTimeframeFacet extends Components.AtomicInsightTimeframeFacet, HTMLElement {}
4
- export const AtomicInsightTimeframeFacet: {
5
- prototype: AtomicInsightTimeframeFacet;
6
- new (): AtomicInsightTimeframeFacet;
7
- };
8
- /**
9
- * Used to define this component and all nested components recursively.
10
- */
11
- export const defineCustomElement: () => void;