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