@coveo/atomic 3.31.0-pre.f83bd005a5 → 3.31.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 (223) hide show
  1. package/dist/atomic/_atomic.esm.js +1 -1
  2. package/dist/atomic/components/analytics-config.js +1 -1
  3. package/dist/atomic/components/analytics-config.js.map +1 -1
  4. package/dist/atomic/components/atomic-folded-result-list.js +1 -1
  5. package/dist/atomic/components/atomic-folded-result-list.js.map +1 -1
  6. package/dist/atomic/components/atomic-insight-folded-result-list.js +2 -2
  7. package/dist/atomic/components/atomic-insight-folded-result-list.js.map +1 -1
  8. package/dist/atomic/components/atomic-insight-result-children.js +2 -2
  9. package/dist/atomic/components/atomic-insight-result-children.js.map +1 -1
  10. package/dist/atomic/components/atomic-ipx-result-link.js +1 -1
  11. package/dist/atomic/components/atomic-ipx-result-link.js.map +1 -1
  12. package/dist/atomic/components/atomic-result-children.js +2 -2
  13. package/dist/atomic/components/atomic-result-children.js.map +1 -1
  14. package/dist/atomic/components/atomic-result-link.js +1 -1
  15. package/dist/atomic/components/atomic-result-link.js.map +1 -1
  16. package/dist/atomic/components/atomic-result-list.js.map +1 -1
  17. package/dist/atomic/components/atomic-tab-manager.js +1 -1
  18. package/dist/atomic/components/atomic-tab-manager.js.map +1 -1
  19. package/dist/atomic/components/global/environment.js +1 -1
  20. package/dist/atomic/components/props-utils.js +3 -0
  21. package/dist/atomic/components/props-utils.js.map +1 -1
  22. package/dist/atomic/components/stencil-item-decorators.js.map +1 -1
  23. package/dist/atomic/components/stencil-item-list-common.js.map +1 -1
  24. package/dist/atomic/components/{item.js → unfolded-item.js} +1 -1
  25. package/dist/atomic/components/unfolded-item.js.map +1 -0
  26. package/dist/atomic/components/utils/props-utils.js +3 -0
  27. package/dist/atomic/{p-b8beb062.entry.js → p-0007beed.entry.js} +2 -2
  28. package/dist/atomic/{p-9c091b29.entry.js → p-0077ba58.entry.js} +2 -2
  29. package/dist/atomic/p-0077ba58.entry.js.map +1 -0
  30. package/dist/atomic/{p-07d19b22.entry.js → p-01e9f7b0.entry.js} +2 -2
  31. package/dist/atomic/p-01e9f7b0.entry.js.map +1 -0
  32. package/dist/atomic/{p-446b788b.entry.js → p-0674783d.entry.js} +2 -2
  33. package/dist/atomic/p-0674783d.entry.js.map +1 -0
  34. package/dist/atomic/{p-1234c69e.js → p-0f046687.js} +1 -1
  35. package/dist/atomic/p-0f046687.js.map +1 -0
  36. package/dist/atomic/{p-a24a8702.entry.js → p-0f3df0e6.entry.js} +2 -2
  37. package/dist/atomic/{p-85749286.entry.js → p-11dd759c.entry.js} +2 -2
  38. package/dist/atomic/{p-d1d012bc.entry.js → p-16914fd4.entry.js} +2 -2
  39. package/dist/atomic/{p-10f25780.entry.js → p-1b491649.entry.js} +2 -2
  40. package/dist/atomic/p-1b491649.entry.js.map +1 -0
  41. package/dist/atomic/{p-7b6843d6.entry.js → p-2e00152f.entry.js} +2 -2
  42. package/dist/atomic/{p-7969276e.entry.js → p-2e028d26.entry.js} +2 -2
  43. package/dist/atomic/{p-bdfd2e76.entry.js → p-391c26ba.entry.js} +2 -2
  44. package/dist/atomic/p-391c26ba.entry.js.map +1 -0
  45. package/dist/atomic/p-3dc06261.js.map +1 -1
  46. package/dist/atomic/{p-28cea2b1.entry.js → p-494c57a0.entry.js} +2 -2
  47. package/dist/atomic/{p-64dc1a62.entry.js → p-4e77fe24.entry.js} +2 -2
  48. package/dist/atomic/p-61f9c3f7.js.map +1 -1
  49. package/dist/atomic/{p-9d3858df.entry.js → p-66eeb9f8.entry.js} +2 -2
  50. package/dist/atomic/p-66eeb9f8.entry.js.map +1 -0
  51. package/dist/atomic/{p-e53f3fe2.entry.js → p-6cf521a3.entry.js} +2 -2
  52. package/dist/atomic/{p-55b7c67f.entry.js → p-76489bf6.entry.js} +2 -2
  53. package/dist/atomic/{p-be04b3b0.entry.js → p-7d2a47f5.entry.js} +2 -2
  54. package/dist/atomic/{p-d2db2d70.js → p-86428057.js} +1 -1
  55. package/dist/atomic/p-86428057.js.map +1 -0
  56. package/dist/atomic/{p-741cfe8d.entry.js → p-89fbc54c.entry.js} +2 -2
  57. package/dist/atomic/{p-e14019fd.entry.js → p-8bb323e8.entry.js} +2 -2
  58. package/dist/atomic/{p-8edfd289.entry.js → p-a0b3c6e2.entry.js} +2 -2
  59. package/dist/atomic/{p-800ffc7e.js → p-be5e8359.js} +2 -2
  60. package/dist/atomic/{p-800ffc7e.js.map → p-be5e8359.js.map} +1 -1
  61. package/dist/atomic/{p-f7ae7657.entry.js → p-c874a70b.entry.js} +2 -2
  62. package/dist/atomic/{p-174f6410.entry.js → p-c9fc93d7.entry.js} +2 -2
  63. package/dist/atomic/{p-84740eed.entry.js → p-cbaf262a.entry.js} +2 -2
  64. package/dist/atomic/{p-0ec46480.entry.js → p-d8953e30.entry.js} +2 -2
  65. package/dist/atomic/{p-5a1b0c43.entry.js → p-da185993.entry.js} +2 -2
  66. package/dist/atomic/{p-c2a06774.entry.js → p-e0169a14.entry.js} +2 -2
  67. package/dist/atomic/{p-609d801e.entry.js → p-e215ba76.entry.js} +2 -2
  68. package/dist/atomic/{p-842bd0bc.entry.js → p-e2560da8.entry.js} +2 -2
  69. package/dist/atomic/p-e2560da8.entry.js.map +1 -0
  70. package/dist/atomic/{p-a4f1e397.entry.js → p-ebb8ae5b.entry.js} +2 -2
  71. package/dist/atomic/{p-c4b07e90.entry.js → p-efe9ef19.entry.js} +2 -2
  72. package/dist/atomic/p-efe9ef19.entry.js.map +1 -0
  73. package/dist/atomic/{p-538fa6a8.entry.js → p-fae68fde.entry.js} +2 -2
  74. package/dist/atomic/{p-c8f4a164.entry.js → p-fc73190d.entry.js} +2 -2
  75. package/dist/cjs/{analytics-config-90c18094.js → analytics-config-d10e762b.js} +2 -2
  76. package/dist/cjs/analytics-config-d10e762b.js.map +1 -0
  77. package/dist/cjs/atomic-category-facet.cjs.entry.js +1 -1
  78. package/dist/cjs/atomic-color-facet.cjs.entry.js +1 -1
  79. package/dist/cjs/atomic-facet.cjs.entry.js +1 -1
  80. package/dist/cjs/atomic-field-condition.cjs.entry.js +1 -1
  81. package/dist/cjs/atomic-folded-result-list.cjs.entry.js +3 -3
  82. package/dist/cjs/atomic-folded-result-list.cjs.entry.js.map +1 -1
  83. package/dist/cjs/atomic-generated-answer.cjs.entry.js +1 -1
  84. package/dist/cjs/atomic-insight-folded-result-list.cjs.entry.js +3 -3
  85. package/dist/cjs/atomic-insight-folded-result-list.cjs.entry.js.map +1 -1
  86. package/dist/cjs/atomic-insight-interface.cjs.entry.js +2 -2
  87. package/dist/cjs/atomic-insight-numeric-facet.cjs.entry.js +1 -1
  88. package/dist/cjs/atomic-insight-result-children-template.cjs.entry.js +1 -1
  89. package/dist/cjs/atomic-insight-result-children.cjs.entry.js +3 -3
  90. package/dist/cjs/atomic-insight-result-children.cjs.entry.js.map +1 -1
  91. package/dist/cjs/atomic-insight-result-template.cjs.entry.js +1 -1
  92. package/dist/cjs/atomic-insight-timeframe-facet.cjs.entry.js +1 -1
  93. package/dist/cjs/atomic-ipx-result-link.cjs.entry.js +1 -1
  94. package/dist/cjs/atomic-ipx-result-link.cjs.entry.js.map +1 -1
  95. package/dist/cjs/atomic-numeric-facet.cjs.entry.js +1 -1
  96. package/dist/cjs/atomic-product-field-condition.cjs.entry.js +1 -1
  97. package/dist/cjs/atomic-rating-facet.cjs.entry.js +1 -1
  98. package/dist/cjs/atomic-rating-range-facet.cjs.entry.js +1 -1
  99. package/dist/cjs/atomic-recs-interface.cjs.entry.js +2 -2
  100. package/dist/cjs/atomic-recs-result-template.cjs.entry.js +1 -1
  101. package/dist/cjs/atomic-result-children-template.cjs.entry.js +1 -1
  102. package/dist/cjs/atomic-result-children.cjs.entry.js +3 -3
  103. package/dist/cjs/atomic-result-children.cjs.entry.js.map +1 -1
  104. package/dist/cjs/atomic-result-link.cjs.entry.js +1 -1
  105. package/dist/cjs/atomic-result-link.cjs.entry.js.map +1 -1
  106. package/dist/cjs/atomic-result-list.cjs.entry.js +1 -1
  107. package/dist/cjs/atomic-result-list.cjs.entry.js.map +1 -1
  108. package/dist/cjs/atomic-result-localized-text.cjs.entry.js +1 -1
  109. package/dist/cjs/atomic-result-template.cjs.entry.js +1 -1
  110. package/dist/cjs/atomic-search-interface.cjs.entry.js +2 -2
  111. package/dist/cjs/atomic-segmented-facet.cjs.entry.js +1 -1
  112. package/dist/cjs/atomic-smart-snippet.cjs.entry.js +1 -1
  113. package/dist/cjs/atomic-sort-expression.cjs.entry.js +1 -1
  114. package/dist/cjs/atomic-tab-manager.cjs.entry.js +1 -1
  115. package/dist/cjs/atomic-tab-manager.cjs.entry.js.map +1 -1
  116. package/dist/cjs/atomic-timeframe-facet.cjs.entry.js +1 -1
  117. package/dist/cjs/{props-utils-dd638419.js → props-utils-1e4ba1b0.js} +4 -1
  118. package/dist/cjs/props-utils-1e4ba1b0.js.map +1 -0
  119. package/dist/cjs/stencil-item-decorators-43a96f33.js.map +1 -1
  120. package/dist/cjs/stencil-item-list-common-013ad9a0.js.map +1 -1
  121. package/dist/cjs/{item-c460c5a3.js → unfolded-item-148d21d6.js} +1 -1
  122. package/dist/cjs/unfolded-item-148d21d6.js.map +1 -0
  123. package/dist/cjs/version.cjs.js +2 -2
  124. package/dist/esm/{analytics-config-e5bd4e1b.js → analytics-config-e2c4641d.js} +2 -2
  125. package/dist/esm/analytics-config-e2c4641d.js.map +1 -0
  126. package/dist/esm/atomic-category-facet.entry.js +1 -1
  127. package/dist/esm/atomic-color-facet.entry.js +1 -1
  128. package/dist/esm/atomic-facet.entry.js +1 -1
  129. package/dist/esm/atomic-field-condition.entry.js +1 -1
  130. package/dist/esm/atomic-folded-result-list.entry.js +2 -2
  131. package/dist/esm/atomic-folded-result-list.entry.js.map +1 -1
  132. package/dist/esm/atomic-generated-answer.entry.js +1 -1
  133. package/dist/esm/atomic-insight-folded-result-list.entry.js +2 -2
  134. package/dist/esm/atomic-insight-folded-result-list.entry.js.map +1 -1
  135. package/dist/esm/atomic-insight-interface.entry.js +2 -2
  136. package/dist/esm/atomic-insight-numeric-facet.entry.js +1 -1
  137. package/dist/esm/atomic-insight-result-children-template.entry.js +1 -1
  138. package/dist/esm/atomic-insight-result-children.entry.js +2 -2
  139. package/dist/esm/atomic-insight-result-children.entry.js.map +1 -1
  140. package/dist/esm/atomic-insight-result-template.entry.js +1 -1
  141. package/dist/esm/atomic-insight-timeframe-facet.entry.js +1 -1
  142. package/dist/esm/atomic-ipx-result-link.entry.js +1 -1
  143. package/dist/esm/atomic-ipx-result-link.entry.js.map +1 -1
  144. package/dist/esm/atomic-numeric-facet.entry.js +1 -1
  145. package/dist/esm/atomic-product-field-condition.entry.js +1 -1
  146. package/dist/esm/atomic-rating-facet.entry.js +1 -1
  147. package/dist/esm/atomic-rating-range-facet.entry.js +1 -1
  148. package/dist/esm/atomic-recs-interface.entry.js +2 -2
  149. package/dist/esm/atomic-recs-result-template.entry.js +1 -1
  150. package/dist/esm/atomic-result-children-template.entry.js +1 -1
  151. package/dist/esm/atomic-result-children.entry.js +2 -2
  152. package/dist/esm/atomic-result-children.entry.js.map +1 -1
  153. package/dist/esm/atomic-result-link.entry.js +1 -1
  154. package/dist/esm/atomic-result-link.entry.js.map +1 -1
  155. package/dist/esm/atomic-result-list.entry.js +1 -1
  156. package/dist/esm/atomic-result-list.entry.js.map +1 -1
  157. package/dist/esm/atomic-result-localized-text.entry.js +1 -1
  158. package/dist/esm/atomic-result-template.entry.js +1 -1
  159. package/dist/esm/atomic-search-interface.entry.js +2 -2
  160. package/dist/esm/atomic-segmented-facet.entry.js +1 -1
  161. package/dist/esm/atomic-smart-snippet.entry.js +1 -1
  162. package/dist/esm/atomic-sort-expression.entry.js +1 -1
  163. package/dist/esm/atomic-tab-manager.entry.js +1 -1
  164. package/dist/esm/atomic-tab-manager.entry.js.map +1 -1
  165. package/dist/esm/atomic-timeframe-facet.entry.js +1 -1
  166. package/dist/esm/{props-utils-8e3d7f26.js → props-utils-e17fa18c.js} +4 -1
  167. package/dist/esm/props-utils-e17fa18c.js.map +1 -0
  168. package/dist/esm/stencil-item-decorators-6c453c11.js.map +1 -1
  169. package/dist/esm/stencil-item-list-common-ddc6fb51.js.map +1 -1
  170. package/dist/esm/{item-813944d1.js → unfolded-item-c5795c0f.js} +1 -1
  171. package/dist/esm/unfolded-item-c5795c0f.js.map +1 -0
  172. package/dist/esm/version.js +2 -2
  173. package/dist/types/components/common/item-list/item-list-common.d.ts +1 -1
  174. package/dist/types/components/common/item-list/stencil-display-table.d.ts +1 -1
  175. package/dist/types/components/common/item-list/stencil-item-list-common.d.ts +1 -1
  176. package/dist/types/components/common/item-list/table-layout.d.ts +1 -1
  177. package/dist/types/components/search/tabs/atomic-tab-manager/atomic-tab-manager.d.ts +6 -0
  178. package/dist/types/utils/props-utils.d.ts +3 -0
  179. package/docs/atomic-docs.json +49 -1
  180. package/package.json +5 -5
  181. package/dist/atomic/components/item.js.map +0 -1
  182. package/dist/atomic/p-07d19b22.entry.js.map +0 -1
  183. package/dist/atomic/p-10f25780.entry.js.map +0 -1
  184. package/dist/atomic/p-1234c69e.js.map +0 -1
  185. package/dist/atomic/p-446b788b.entry.js.map +0 -1
  186. package/dist/atomic/p-842bd0bc.entry.js.map +0 -1
  187. package/dist/atomic/p-9c091b29.entry.js.map +0 -1
  188. package/dist/atomic/p-9d3858df.entry.js.map +0 -1
  189. package/dist/atomic/p-bdfd2e76.entry.js.map +0 -1
  190. package/dist/atomic/p-c4b07e90.entry.js.map +0 -1
  191. package/dist/atomic/p-d2db2d70.js.map +0 -1
  192. package/dist/cjs/analytics-config-90c18094.js.map +0 -1
  193. package/dist/cjs/item-c460c5a3.js.map +0 -1
  194. package/dist/cjs/props-utils-dd638419.js.map +0 -1
  195. package/dist/esm/analytics-config-e5bd4e1b.js.map +0 -1
  196. package/dist/esm/item-813944d1.js.map +0 -1
  197. package/dist/esm/props-utils-8e3d7f26.js.map +0 -1
  198. /package/dist/atomic/components/components/common/{interface/item.js → item-list/unfolded-item.js} +0 -0
  199. /package/dist/atomic/{p-b8beb062.entry.js.map → p-0007beed.entry.js.map} +0 -0
  200. /package/dist/atomic/{p-a24a8702.entry.js.map → p-0f3df0e6.entry.js.map} +0 -0
  201. /package/dist/atomic/{p-85749286.entry.js.map → p-11dd759c.entry.js.map} +0 -0
  202. /package/dist/atomic/{p-d1d012bc.entry.js.map → p-16914fd4.entry.js.map} +0 -0
  203. /package/dist/atomic/{p-7b6843d6.entry.js.map → p-2e00152f.entry.js.map} +0 -0
  204. /package/dist/atomic/{p-7969276e.entry.js.map → p-2e028d26.entry.js.map} +0 -0
  205. /package/dist/atomic/{p-28cea2b1.entry.js.map → p-494c57a0.entry.js.map} +0 -0
  206. /package/dist/atomic/{p-64dc1a62.entry.js.map → p-4e77fe24.entry.js.map} +0 -0
  207. /package/dist/atomic/{p-e53f3fe2.entry.js.map → p-6cf521a3.entry.js.map} +0 -0
  208. /package/dist/atomic/{p-55b7c67f.entry.js.map → p-76489bf6.entry.js.map} +0 -0
  209. /package/dist/atomic/{p-be04b3b0.entry.js.map → p-7d2a47f5.entry.js.map} +0 -0
  210. /package/dist/atomic/{p-741cfe8d.entry.js.map → p-89fbc54c.entry.js.map} +0 -0
  211. /package/dist/atomic/{p-e14019fd.entry.js.map → p-8bb323e8.entry.js.map} +0 -0
  212. /package/dist/atomic/{p-8edfd289.entry.js.map → p-a0b3c6e2.entry.js.map} +0 -0
  213. /package/dist/atomic/{p-f7ae7657.entry.js.map → p-c874a70b.entry.js.map} +0 -0
  214. /package/dist/atomic/{p-174f6410.entry.js.map → p-c9fc93d7.entry.js.map} +0 -0
  215. /package/dist/atomic/{p-84740eed.entry.js.map → p-cbaf262a.entry.js.map} +0 -0
  216. /package/dist/atomic/{p-0ec46480.entry.js.map → p-d8953e30.entry.js.map} +0 -0
  217. /package/dist/atomic/{p-5a1b0c43.entry.js.map → p-da185993.entry.js.map} +0 -0
  218. /package/dist/atomic/{p-c2a06774.entry.js.map → p-e0169a14.entry.js.map} +0 -0
  219. /package/dist/atomic/{p-609d801e.entry.js.map → p-e215ba76.entry.js.map} +0 -0
  220. /package/dist/atomic/{p-a4f1e397.entry.js.map → p-ebb8ae5b.entry.js.map} +0 -0
  221. /package/dist/atomic/{p-538fa6a8.entry.js.map → p-fae68fde.entry.js.map} +0 -0
  222. /package/dist/atomic/{p-c8f4a164.entry.js.map → p-fc73190d.entry.js.map} +0 -0
  223. /package/dist/types/components/common/{interface/item.d.ts → item-list/unfolded-item.d.ts} +0 -0
@@ -9,6 +9,9 @@ export declare function mapProperty<Element extends ReactiveElement>(options?: M
9
9
  * @deprecated Use the `mapProperty` decorator instead.
10
10
  */
11
11
  export declare function MapProp(opts?: MapPropOptions): (component: ComponentInterface, variableName: string) => void;
12
+ /**
13
+ * @deprecated In Lit, you can achieve the same behavior by using `@property({type: Array})`.
14
+ */
12
15
  export declare function ArrayProp(): (component: ComponentInterface, variableName: string) => void;
13
16
  export declare function mapAttributesToProp(prefix: string, mapVariable: Record<string, string | string[]>, attributes: {
14
17
  name: string;
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2025-07-27T15:05:16",
2
+ "timestamp": "2025-07-30T02:51:58",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "4.20.0",
@@ -16817,6 +16817,30 @@
16817
16817
  "name": "part",
16818
16818
  "text": "tab-area - The tab area."
16819
16819
  },
16820
+ {
16821
+ "name": "part",
16822
+ "text": "popover-button - The \"More\" button shown when the tabs are collapsed."
16823
+ },
16824
+ {
16825
+ "name": "part",
16826
+ "text": "value-label - The label shown on the \"More\" button."
16827
+ },
16828
+ {
16829
+ "name": "part",
16830
+ "text": "arrow-icon - The down chevron icon shown on the \"More\" button."
16831
+ },
16832
+ {
16833
+ "name": "part",
16834
+ "text": "overflow-tabs - The list of tabs shown when the \"More\" button is clicked."
16835
+ },
16836
+ {
16837
+ "name": "part",
16838
+ "text": "popover-tab - The individual tab buttons shown when the \"More\" button is clicked."
16839
+ },
16840
+ {
16841
+ "name": "part",
16842
+ "text": "backdrop - The backdrop shown when the \"More\" button is clicked."
16843
+ },
16820
16844
  {
16821
16845
  "name": "slot",
16822
16846
  "text": "default"
@@ -16861,6 +16885,14 @@
16861
16885
  }
16862
16886
  ],
16863
16887
  "parts": [
16888
+ {
16889
+ "name": "arrow-icon",
16890
+ "docs": "The down chevron icon shown on the \"More\" button."
16891
+ },
16892
+ {
16893
+ "name": "backdrop",
16894
+ "docs": "The backdrop shown when the \"More\" button is clicked."
16895
+ },
16864
16896
  {
16865
16897
  "name": "button-container",
16866
16898
  "docs": "The container for the tab button."
@@ -16873,6 +16905,18 @@
16873
16905
  "name": "dropdown-area",
16874
16906
  "docs": "The dropdown area."
16875
16907
  },
16908
+ {
16909
+ "name": "overflow-tabs",
16910
+ "docs": "The list of tabs shown when the \"More\" button is clicked."
16911
+ },
16912
+ {
16913
+ "name": "popover-button",
16914
+ "docs": "The \"More\" button shown when the tabs are collapsed."
16915
+ },
16916
+ {
16917
+ "name": "popover-tab",
16918
+ "docs": "The individual tab buttons shown when the \"More\" button is clicked."
16919
+ },
16876
16920
  {
16877
16921
  "name": "tab-area",
16878
16922
  "docs": "The tab area."
@@ -16884,6 +16928,10 @@
16884
16928
  {
16885
16929
  "name": "tab-button-active",
16886
16930
  "docs": "The container for the active tab button."
16931
+ },
16932
+ {
16933
+ "name": "value-label",
16934
+ "docs": "The label shown on the \"More\" button."
16887
16935
  }
16888
16936
  ],
16889
16937
  "dependents": [],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coveo/atomic",
3
3
  "type": "module",
4
- "version": "3.31.0-pre.f83bd005a5",
4
+ "version": "3.31.0",
5
5
  "description": "A web-component library for building modern UIs interfacing with the Coveo platform",
6
6
  "homepage": "https://docs.coveo.com/en/atomic/latest/",
7
7
  "repository": {
@@ -71,8 +71,8 @@
71
71
  },
72
72
  "dependencies": {
73
73
  "@lit/context": "1.1.6",
74
- "@coveo/bueno": "1.0.23-pre.f83bd005a5",
75
- "@coveo/headless": "3.27.6-pre.f83bd005a5",
74
+ "@coveo/bueno": "1.0.23",
75
+ "@coveo/headless": "3.27.6",
76
76
  "@popperjs/core": "2.11.8",
77
77
  "@salesforce-ux/design-system": "2.27.2",
78
78
  "@stencil/core": "4.20.0",
@@ -157,8 +157,8 @@
157
157
  "wait-on": "8.0.3"
158
158
  },
159
159
  "peerDependencies": {
160
- "@coveo/bueno": "1.0.23-pre.f83bd005a5",
161
- "@coveo/headless": "3.27.6-pre.f83bd005a5",
160
+ "@coveo/bueno": "1.0.23",
161
+ "@coveo/headless": "3.27.6",
162
162
  "typescript": ">=5.0.0"
163
163
  },
164
164
  "peerDependenciesMeta": {
@@ -1 +0,0 @@
1
- {"file":"item.js","mappings":"SAOgB,mBAAmB,CAAC,SAAkB;IACpD,OAAQ,SAA0B,CAAC,MAAM,IAAI,SAAS,CAAC;AACzD;;;;","names":[],"sources":["src/components/common/interface/item.ts"],"sourcesContent":["import type {FoldedResult, Result} from '@coveo/headless';\nimport type {Product} from '@coveo/headless/commerce';\nimport type {Result as InsightResult} from '@coveo/headless/insight';\n\nexport type AnyItem = FoldedResult | AnyUnfoldedItem | Product;\nexport type AnyUnfoldedItem = Result | InsightResult;\n\nexport function extractUnfoldedItem(anyResult: AnyItem): AnyUnfoldedItem {\n return (anyResult as FoldedResult).result || anyResult;\n}\n"],"version":3}
@@ -1 +0,0 @@
1
- {"version":3,"names":["atomicInsightFoldedResultListCss","AtomicInsightFoldedResultListStyle0","AtomicInsightFoldedResultList","this","loadingFlag","randomID","display","resultTemplateRegistered","isAppLoaded","templateHasError","density","imageSize","setRenderFunction","resultRenderingFunction","itemRenderingFunction","resolveFoldedResultList","event","preventDefault","stopPropagation","detail","foldedResultList","loadCollection","initialize","initFolding","resultsPerPage","buildInsightResultsPerPage","bindings","engine","e","error","itemTemplateProvider","ItemTemplateProvider","includeDefaultTemplate","templateElements","Array","from","host","querySelectorAll","getResultTemplateRegistered","getTemplateHasError","setResultTemplateRegistered","value","setTemplateHasError","itemListCommon","ItemListCommon","engineSubscribe","subscribe","getCurrentNumberOfItems","foldedResultListState","results","length","getIsLoading","isLoading","nextNewItemTarget","focusTarget","store","createAppLoadedListener","nextNewResultTarget","FocusTargetController","props","options","buildInsightFoldedResultList","folding","collectionField","parentField","childField","render","updateBreakpoints","listClasses","computeListDisplayClasses","h","ItemListGuard","key","firstRequestExecuted","firstSearchExecuted","hasItems","hasResults","hasTemplate","hasError","DisplayWrapper","ResultsPlaceholdersGuard","displayPlaceholders","numberOfPlaceholders","resultsPerPageState","numberOfResults","ItemDisplayGuard","map","collection","i","atomicInsightResultProps","getPropsForAtomicInsightResult","part","ref","element","setNewResultRef","getItemListDisplayClasses","result","extractUnfoldedItem","interactiveResult","buildInsightInteractiveResult","renderingFunction","getResultId","uniqueId","searchResponseId","content","getTemplateContent","__decorate","InitializeBindings","BindStateToController"],"sources":["src/components/insight/result-lists/atomic-insight-folded-result-list/atomic-insight-folded-result-list.pcss?tag=atomic-insight-folded-result-list&encapsulation=shadow","src/components/insight/result-lists/atomic-insight-folded-result-list/atomic-insight-folded-result-list.tsx"],"sourcesContent":["@import '../../../common/item-list/styles/placeholders.pcss';\n@import '../styles/list-display.pcss';\natomic-result:not(.hydrated) {\n visibility: hidden;\n}\n","import {\n ResultsPerPageState as InsightResultsPerPageState,\n ResultsPerPage as InsightResultsPerPage,\n buildFoldedResultList as buildInsightFoldedResultList,\n FoldedResultList as InsightFoldedResultList,\n FoldedResultListState as InsightFoldedResultListState,\n buildResultsPerPage as buildInsightResultsPerPage,\n FoldedCollection as InsightFoldedCollection,\n buildInteractiveResult as buildInsightInteractiveResult,\n} from '@coveo/headless/insight';\nimport {\n Component,\n Element,\n State,\n Prop,\n Listen,\n Method,\n h,\n} from '@stencil/core';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {FocusTargetController} from '../../../../utils/stencil-accessibility-utils';\nimport {randomID} from '../../../../utils/utils';\nimport {ResultsPlaceholdersGuard} from '../../../common/atomic-result-placeholder/stencil-placeholders';\nimport {extractUnfoldedItem} from '../../../common/interface/item';\nimport {createAppLoadedListener} from '../../../common/interface/store';\nimport {ItemDisplayGuard} from '../../../common/item-list/item-display-guard';\nimport {FoldedItemListStateContextEvent} from '../../../common/item-list/item-list-decorators';\nimport {ItemListGuard} from '../../../common/item-list/item-list-guard';\nimport {ItemTemplateProvider} from '../../../common/item-list/item-template-provider';\nimport {DisplayWrapper} from '../../../common/item-list/stencil-display-wrapper';\nimport {\n ItemListCommon,\n ItemRenderingFunction,\n} from '../../../common/item-list/stencil-item-list-common';\nimport {\n ItemDisplayDensity,\n ItemDisplayImageSize,\n ItemDisplayLayout,\n getItemListDisplayClasses,\n} from '../../../common/layout/display-options';\nimport {InsightBindings} from '../../atomic-insight-interface/atomic-insight-interface';\n\n/**\n * @internal\n */\n@Component({\n tag: 'atomic-insight-folded-result-list',\n styleUrl: 'atomic-insight-folded-result-list.pcss',\n shadow: true,\n})\nexport class AtomicInsightFoldedResultList\n implements InitializableComponent<InsightBindings>\n{\n @InitializeBindings() public bindings!: InsightBindings;\n public foldedResultList!: InsightFoldedResultList;\n public resultsPerPage!: InsightResultsPerPage;\n private itemRenderingFunction: ItemRenderingFunction;\n private loadingFlag = randomID('firstResultLoaded-');\n private itemTemplateProvider!: ItemTemplateProvider;\n private nextNewResultTarget?: FocusTargetController;\n private display: ItemDisplayLayout = 'list';\n private itemListCommon!: ItemListCommon;\n\n @Element() public host!: HTMLDivElement;\n\n @BindStateToController('foldedResultList')\n @State()\n public foldedResultListState!: InsightFoldedResultListState;\n @BindStateToController('resultsPerPage')\n @State()\n public resultsPerPageState!: InsightResultsPerPageState;\n @State() private resultTemplateRegistered = false;\n @State() public error!: Error;\n @State() private isAppLoaded = false;\n @State() private templateHasError = false;\n\n /**\n * The spacing of various elements in the result list, including the gap between results, the gap between parts of a result, and the font sizes of different parts in a result.\n */\n @Prop({reflect: true}) density: ItemDisplayDensity = 'normal';\n /**\n * The expected size of the image displayed in the results.\n */\n @Prop({reflect: true}) imageSize: ItemDisplayImageSize = 'icon';\n /**\n * The name of the field on which to do the folding. The folded result list component will use the values of this field to resolve the collections of result items.\n *\n * @defaultValue `foldingcollection`\n */\n @Prop({reflect: true}) public collectionField?: string;\n /**\n * The name of the field that determines whether a certain result is a top result containing other child results within a collection.\n *\n * @defaultValue `foldingparent`\n */\n @Prop({reflect: true}) public parentField?: string;\n /**\n * The name of the field that uniquely identifies a result within a collection.\n *\n * @defaultValue `foldingchild`\n */\n @Prop({reflect: true}) public childField?: string;\n\n /**\n * Sets a rendering function to bypass the standard HTML template mechanism for rendering results.\n * You can use this function while working with web frameworks that don't use plain HTML syntax, e.g., React, Angular or Vue.\n *\n * Do not use this method if you integrate Atomic in a plain HTML deployment.\n */\n @Method() public async setRenderFunction(\n resultRenderingFunction: ItemRenderingFunction\n ) {\n this.itemRenderingFunction = resultRenderingFunction;\n }\n\n @Listen('atomic/resolveFoldedResultList')\n resolveFoldedResultList(event: FoldedItemListStateContextEvent) {\n event.preventDefault();\n event.stopPropagation();\n event.detail(this.foldedResultList);\n }\n\n @Listen('atomic/loadCollection')\n loadCollection(event: CustomEvent<InsightFoldedCollection>) {\n event.preventDefault();\n event.stopPropagation();\n this.foldedResultList.loadCollection(event.detail);\n }\n\n public initialize() {\n try {\n this.foldedResultList = this.initFolding();\n this.resultsPerPage = buildInsightResultsPerPage(this.bindings.engine);\n } catch (e) {\n this.error = e as Error;\n }\n\n this.itemTemplateProvider = new ItemTemplateProvider({\n includeDefaultTemplate: true,\n templateElements: Array.from(\n this.host.querySelectorAll('atomic-insight-result-template')\n ),\n getResultTemplateRegistered: () => this.resultTemplateRegistered,\n getTemplateHasError: () => this.templateHasError,\n setResultTemplateRegistered: (value: boolean) => {\n this.resultTemplateRegistered = value;\n },\n setTemplateHasError: (value: boolean) => {\n this.templateHasError = value;\n },\n bindings: this.bindings,\n });\n\n this.itemListCommon = new ItemListCommon({\n engineSubscribe: this.bindings.engine.subscribe,\n getCurrentNumberOfItems: () => this.foldedResultListState.results.length,\n getIsLoading: () => this.foldedResultListState.isLoading,\n host: this.host,\n loadingFlag: this.loadingFlag,\n nextNewItemTarget: this.focusTarget,\n store: this.bindings.store,\n });\n createAppLoadedListener(this.bindings.store, (isAppLoaded) => {\n this.isAppLoaded = isAppLoaded;\n });\n }\n\n private get focusTarget(): FocusTargetController {\n if (!this.nextNewResultTarget) {\n this.nextNewResultTarget = new FocusTargetController(this);\n }\n return this.nextNewResultTarget;\n }\n\n private initFolding(props = {options: {}}): InsightFoldedResultList {\n return buildInsightFoldedResultList(this.bindings.engine, {\n options: {\n ...props.options,\n folding: {\n collectionField: this.collectionField,\n parentField: this.parentField,\n childField: this.childField,\n },\n },\n });\n }\n\n public render() {\n this.itemListCommon.updateBreakpoints();\n const listClasses = this.computeListDisplayClasses();\n\n return (\n <ItemListGuard\n firstRequestExecuted={this.foldedResultListState.firstSearchExecuted}\n hasItems={this.foldedResultListState.hasResults}\n hasTemplate={this.resultTemplateRegistered}\n templateHasError={this.itemTemplateProvider.hasError}\n hasError={this.foldedResultListState.hasError}\n >\n <DisplayWrapper listClasses={listClasses} display={this.display}>\n <ResultsPlaceholdersGuard\n displayPlaceholders={!this.isAppLoaded}\n numberOfPlaceholders={this.resultsPerPageState.numberOfResults}\n display={this.display}\n density={this.density}\n imageSize={this.imageSize}\n ></ResultsPlaceholdersGuard>\n <ItemDisplayGuard\n firstRequestExecuted={\n this.foldedResultListState.firstSearchExecuted\n }\n hasItems={this.foldedResultListState.hasResults}\n >\n {this.foldedResultListState.results.map((collection, i) => {\n const atomicInsightResultProps =\n this.getPropsForAtomicInsightResult(collection);\n return (\n <atomic-insight-result\n {...atomicInsightResultProps}\n part=\"outline\"\n ref={(element) =>\n element && this.itemListCommon.setNewResultRef(element, i)\n }\n ></atomic-insight-result>\n );\n })}\n </ItemDisplayGuard>\n </DisplayWrapper>\n </ItemListGuard>\n );\n }\n\n private computeListDisplayClasses() {\n const displayPlaceholders = !this.isAppLoaded;\n\n return getItemListDisplayClasses(\n this.display,\n this.density,\n this.imageSize,\n this.foldedResultListState.firstSearchExecuted &&\n this.foldedResultListState.isLoading,\n displayPlaceholders\n );\n }\n\n private getPropsForAtomicInsightResult(collection: InsightFoldedCollection) {\n const result = extractUnfoldedItem(collection);\n\n return {\n interactiveResult: buildInsightInteractiveResult(this.bindings.engine, {\n options: {result},\n }),\n result,\n renderingFunction: this.itemRenderingFunction,\n loadingFlag: this.loadingFlag,\n key: this.itemListCommon.getResultId(\n result.uniqueId,\n this.foldedResultListState.searchResponseId,\n this.density,\n this.imageSize\n ),\n content: this.itemTemplateProvider.getTemplateContent(result),\n store: this.bindings.store,\n density: this.density,\n display: this.display,\n imageSize: this.imageSize,\n };\n }\n}\n"],"mappings":"yxBAAA,MAAMA,EAAmC,irtEACzC,MAAAC,EAAeD,E,iXCqDFE,EAA6B,M,yBAOhCC,KAAAC,YAAcC,EAAS,sBAGvBF,KAAAG,QAA6B,OAWpBH,KAAAI,yBAA2B,MAE3BJ,KAAAK,YAAc,MACdL,KAAAM,iBAAmB,MAKbN,KAAAO,QAA8B,SAI9BP,KAAAQ,UAAkC,O,sGAZb,M,sCAEb,M,sBACK,M,aAKiB,S,eAII,O,oFA0BxC,uBAAMC,CACrBC,GAEAV,KAAKW,sBAAwBD,C,CAI/B,uBAAAE,CAAwBC,GACtBA,EAAMC,iBACND,EAAME,kBACNF,EAAMG,OAAOhB,KAAKiB,iB,CAIpB,cAAAC,CAAeL,GACbA,EAAMC,iBACND,EAAME,kBACNf,KAAKiB,iBAAiBC,eAAeL,EAAMG,O,CAGtC,UAAAG,GACL,IACEnB,KAAKiB,iBAAmBjB,KAAKoB,cAC7BpB,KAAKqB,eAAiBC,EAA2BtB,KAAKuB,SAASC,O,CAC/D,MAAOC,GACPzB,KAAK0B,MAAQD,C,CAGfzB,KAAK2B,qBAAuB,IAAIC,EAAqB,CACnDC,uBAAwB,KACxBC,iBAA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
- {"version":3,"names":["atomicResultLinkCss","AtomicResultLinkStyle0","AtomicResultLink","initialize","this","host","dispatchEvent","buildCustomEvent","stopPropagation","connectedCallback","slotName","hasDefaultSlot","getDefaultSlotFromHost","linkAttributes","getAttributesFromLinkSlot","render","href","isUndefined","hrefTemplate","result","clickUri","buildStringTemplateFromResult","bindings","h","LinkWithItemAnalytics","key","onSelect","interactiveResult","select","onBeginDelayedSelect","beginDelayedSelect","onCancelPendingSelect","cancelPendingSelect","attributes","field","default","__decorate","InitializeBindings","ResultContext","InteractiveResultContext"],"sources":["src/components/search/result-template-components/atomic-result-link/atomic-result-link.pcss?tag=atomic-result-link","src/components/search/result-template-components/atomic-result-link/atomic-result-link.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n@import '../../../../utils/tailwind-utilities/link-style.tw.css';\natomic-result-link {\n a {\n @apply link-style;\n }\n}\n","import {isUndefined} from '@coveo/bueno';\nimport {InteractiveResult} from '@coveo/headless';\nimport {Component, h, Prop, Element} from '@stencil/core';\nimport {buildCustomEvent} from '../../../../utils/event-utils';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {buildStringTemplateFromResult} from '../../../../utils/result-utils';\nimport {getDefaultSlotFromHost} from '../../../../utils/slot-utils';\nimport {AnyUnfoldedItem} from '../../../common/interface/item';\nimport {getAttributesFromLinkSlot} from '../../../common/item-link/attributes-slot';\nimport {LinkWithItemAnalytics} from '../../../common/item-link/stencil-item-link';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {\n InteractiveResultContext,\n ResultContext,\n} from '../result-template-decorators';\n\n/**\n * The `atomic-result-link` component automatically transforms a search result title into a clickable link that points to the original item.\n * @slot default - Lets you display alternative content inside the link\n * @slot attributes - Lets you pass [attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attributes) down to the link element, overriding other attributes, to be used exclusively with an \"a\" tag such as `<a slot=\"attributes\" target=\"_blank\" download></a>`.\n */\n@Component({\n tag: 'atomic-result-link',\n styleUrl: 'atomic-result-link.pcss',\n shadow: false,\n})\nexport class AtomicResultLink implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n public error!: Error;\n\n @ResultContext() private result!: AnyUnfoldedItem;\n @InteractiveResultContext() private interactiveResult!: InteractiveResult;\n\n @Element() private host!: HTMLElement;\n\n /**\n * Specifies a template literal from which to generate the `href` attribute value (see\n * [Template literals](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals)).\n *\n * The template literal can reference any number of result properties from the parent result. It can also reference the window object.\n *\n * For example, the following markup generates an `href` value such as `http://uri.com?id=itemTitle`, using the result's `clickUri` and `itemtitle` fields.\n * ```html\n * <atomic-result-link href-template='${clickUri}?id=${raw.itemtitle}'></atomic-result-link>\n * ```\n */\n @Prop({reflect: true}) hrefTemplate?: string;\n\n private hasDefaultSlot!: boolean;\n private linkAttributes?: Attr[];\n private stopPropagation?: boolean;\n\n public initialize() {\n this.host.dispatchEvent(\n buildCustomEvent(\n 'atomic/resolveStopPropagation',\n (stopPropagation: boolean) => {\n this.stopPropagation = stopPropagation;\n }\n )\n );\n }\n\n public connectedCallback() {\n const slotName = 'attributes';\n this.hasDefaultSlot = !!getDefaultSlotFromHost(this.host);\n this.linkAttributes = getAttributesFromLinkSlot(this.host, slotName);\n }\n\n public render() {\n const href = isUndefined(this.hrefTemplate)\n ? this.result.clickUri\n : buildStringTemplateFromResult(\n this.hrefTemplate,\n this.result,\n this.bindings\n );\n\n return (\n <LinkWithItemAnalytics\n href={href}\n onSelect={() => this.interactiveResult.select()}\n onBeginDelayedSelect={() => this.interactiveResult.beginDelayedSelect()}\n onCancelPendingSelect={() =>\n this.interactiveResult.cancelPendingSelect()\n }\n attributes={this.linkAttributes}\n stopPropagation={this.stopPropagation}\n >\n {this.hasDefaultSlot ? (\n <slot />\n ) : (\n <atomic-result-text\n field=\"title\"\n default=\"no-title\"\n ></atomic-result-text>\n )}\n </LinkWithItemAnalytics>\n );\n }\n}\n"],"mappings":"2eAAA,MAAMA,EAAsB,o32DAC5B,MAAAC,EAAeD,E,iXC4BFE,EAAgB,M,qDA0BpB,UAAAC,GACLC,KAAKC,KAAKC,cACRC,EACE,iCACCC,IACCJ,KAAKI,gBAAkBA,CAAe,I,CAMvC,iBAAAC,GACL,MAAMC,EAAW,aACjBN,KAAKO,iBAAmBC,EAAuBR,KAAKC,MACpDD,KAAKS,eAAiBC,EAA0BV,KAAKC,KAAMK,E,CAGtD,MAAAK,GACL,MAAMC,EAAOC,EAAYb,KAAKc,cAC1Bd,KAAKe,OAAOC,SACZC,EACEjB,KAAKc,aACLd,KAAKe,OACLf,KAAKkB,UAGX,OACEC,EAACC,EAAqB,CAAAC,IAAA,2CACpBT,KAAMA,EACNU,SAAU,IAAMtB,KAAKuB,kBAAkBC,SACvCC,qBAAsB,IAAMzB,KAAKuB,kBAAkBG,qBACnDC,sBAAuB,IACrB3B,KAAKuB,kBAAkBK,sBAEzBC,WAAY7B,KAAKS,eACjBL,gBAAiBJ,KAAKI,iBAErBJ,KAAKO,eACJY,EAAA,aAEAA,EAAA,sBACEW,MAAM,QACNC,QAAQ,a,6BAnEWC,EAAA,CAA5BC,K,+BAGwBD,EAAA,CAAxBE,K,6BACmCF,EAAA,CAAnCG,K","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["extractUnfoldedItem","anyResult","result"],"sources":["src/components/common/interface/item.ts"],"sourcesContent":["import type {FoldedResult, Result} from '@coveo/headless';\nimport type {Product} from '@coveo/headless/commerce';\nimport type {Result as InsightResult} from '@coveo/headless/insight';\n\nexport type AnyItem = FoldedResult | AnyUnfoldedItem | Product;\nexport type AnyUnfoldedItem = Result | InsightResult;\n\nexport function extractUnfoldedItem(anyResult: AnyItem): AnyUnfoldedItem {\n return (anyResult as FoldedResult).result || anyResult;\n}\n"],"mappings":"SAOgBA,EAAoBC,GAClC,OAAQA,EAA2BC,QAAUD,CAC/C,Q","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["getFieldTableColumns","props","itemRenderingFunction","getFieldTableColumnsFromRenderingFunction","getFieldTableColumnsFromHTMLTemplate","contentOfRenderingFunction","document","createElement","contentOfRenderingFunctionAsString","firstItem","innerHTML","Array","from","querySelectorAll","tableElementTagName","templateContentForFirstItem","DisplayTable","children","fieldColumns","length","logger","error","host","h","class","listClasses","part","map","column","value","getAttribute","DisplayTableRow","key","rowIndex","setRef","ref","element","DisplayTableData","renderItem","TabGuard","tabsIncluded","tabsExcluded","activeTab","shouldDisplayOnCurrentTab","Hidden","Fragment","atomicResultListCss","AtomicResultListStyle0","AtomicResultList","this","loadingFlag","randomID","resultTemplateRegistered","isAppLoaded","templateHasError","display","density","imageSize","setRenderFunction","resultRenderingFunction","focusTarget","nextNewResultTarget","FocusTargetController","initialize","includes","console","warn","tabManager","buildTabManager","bindings","engine","resultList","buildResultList","resultsPerPage","buildResultsPerPage","itemTemplateProvider","ItemTemplateProvider","includeDefaultTemplate","templateElements","getResultTemplateRegistered","getTemplateHasError","setResultTemplateRegistered","setTemplateHasError","resultListCommon","ItemListCommon","engineSubscribe","subscribe","getCurrentNumberOfItems","resultListState","results","getIsLoading","isLoading","nextNewItemTarget","store","createAppLoadedListener","watchTabManagerState","newValue","oldValue","unsetLoadingFlag","render","updateBreakpoints","computeListDisplayClasses","tabManagerState","ItemListGuard","hasError","hasTemplate","firstRequestExecuted","firstSearchExecuted","hasItems","hasResults","DisplayWrapper","ResultsPlaceholdersGuard","displayPlaceholders","numberOfPlaceholders","resultsPerPageState","numberOfResults","ItemDisplayGuard","renderAsTable","renderAsGrid","renderAsList","getPropsForAtomicResult","result","interactiveResult","buildInteractiveResult","options","renderingFunction","getResultId","uniqueId","searchResponseId","content","getTemplateContent","linkContent","getLinkTemplateContent","getEmptyLinkTemplateContent","getItemListDisplayClasses","i","propsForAtomicResult","DisplayGrid","selectorForItem","item","setNewResultRef","propsForTableColumns","__decorate","InitializeBindings","BindStateToController","ArrayProp"],"sources":["src/components/common/item-list/stencil-display-table.tsx","src/components/common/tabs/tab-guard.tsx","src/components/search/result-lists/atomic-result-list/atomic-result-list.pcss?tag=atomic-result-list&encapsulation=shadow","src/components/search/result-lists/atomic-result-list/atomic-result-list.tsx"],"sourcesContent":["// The Lit equivalent of this file is table-layout.ts\nimport {FunctionalComponent, VNode, h} from '@stencil/core';\nimport {tableElementTagName} from '../../search/atomic-table-result/table-element-utils.js';\nimport {AnyItem} from '../interface/item.js';\nimport {ItemRenderingFunction} from './stencil-item-list-common.js';\n\ninterface TableColumnsProps {\n templateContentForFirstItem: DocumentFragment;\n firstItem: AnyItem;\n itemRenderingFunction?: ItemRenderingFunction;\n}\n\nexport interface DisplayTableProps extends TableColumnsProps {\n logger: Pick<Console, 'error'>;\n host: HTMLElement;\n listClasses: string;\n}\n\nexport interface TableDataProps extends TableColumnsProps {\n key: string;\n}\n\nexport interface DisplayTableRowProps {\n key: string;\n rowIndex: number;\n setRef: (element?: HTMLElement) => void;\n}\n\nconst getFieldTableColumns = (props: TableColumnsProps) => {\n if (props.itemRenderingFunction) {\n return getFieldTableColumnsFromRenderingFunction(props);\n }\n return getFieldTableColumnsFromHTMLTemplate(props);\n};\n\nconst getFieldTableColumnsFromRenderingFunction = (\n props: Pick<TableColumnsProps, 'itemRenderingFunction' | 'firstItem'>\n): HTMLAtomicTableElementElement[] => {\n const contentOfRenderingFunction = document.createElement('div');\n\n const contentOfRenderingFunctionAsString = props.itemRenderingFunction!(\n props.firstItem,\n document.createElement('div')\n );\n contentOfRenderingFunction.innerHTML = contentOfRenderingFunctionAsString;\n\n return Array.from(\n contentOfRenderingFunction.querySelectorAll(tableElementTagName)\n );\n};\n\nconst getFieldTableColumnsFromHTMLTemplate = (\n props: Pick<DisplayTableProps, 'templateContentForFirstItem'>\n): HTMLAtomicTableElementElement[] =>\n Array.from(\n props.templateContentForFirstItem.querySelectorAll(tableElementTagName)\n );\n\nexport const DisplayTable: FunctionalComponent<DisplayTableProps> = (\n props,\n children\n) => {\n const fieldColumns = getFieldTableColumns(props);\n\n if (!fieldColumns.length) {\n props.logger.error(\n 'atomic-table-element elements missing in the template to display columns.',\n props.host\n );\n }\n\n return (\n <table class={`list-root ${props.listClasses}`} part=\"result-table\">\n <thead part=\"result-table-heading\">\n <tr part=\"result-table-heading-row\">\n {fieldColumns.map((column) => (\n <th part=\"result-table-heading-cell\">\n <atomic-text value={column.getAttribute('label')!}></atomic-text>\n </th>\n ))}\n </tr>\n </thead>\n <tbody part=\"result-table-body\">{...children}</tbody>\n </table>\n );\n};\n\nexport const DisplayTableRow: FunctionalComponent<DisplayTableRowProps> = (\n {key, rowIndex, setRef},\n children\n) => {\n return (\n <tr\n key={key}\n part={\n 'result-table-row ' +\n (rowIndex % 2 === 1 ? 'result-table-row-even' : 'result-table-row-odd')\n }\n ref={(element) => setRef(element)}\n >\n {...children}\n </tr>\n );\n};\n\nexport const DisplayTableData: FunctionalComponent<\n TableDataProps & {\n renderItem: (content: HTMLAtomicTableElementElement) => VNode;\n }\n> = (props) => {\n const fieldColumns = getFieldTableColumns(props);\n\n return fieldColumns.map((column) => {\n const key = column.getAttribute('label')! + props.key;\n return (\n <td key={key} part=\"result-table-cell\">\n {props.renderItem(column)}\n </td>\n );\n });\n};\n","import {Fragment, FunctionalComponent, h} from '@stencil/core';\nimport {shouldDisplayOnCurrentTab} from '../../../utils/tab-utils';\nimport {Hidden} from '../stencil-hidden';\n\ninterface TabGuardProps {\n tabsIncluded: string | string[];\n tabsExcluded: string | string[];\n activeTab: string;\n}\n\nexport const TabGuard: FunctionalComponent<TabGuardProps> = (\n {tabsIncluded, tabsExcluded, activeTab},\n children\n) => {\n if (\n !shouldDisplayOnCurrentTab([...tabsIncluded], [...tabsExcluded], activeTab)\n ) {\n return <Hidden></Hidden>;\n }\n return <Fragment>{...children}</Fragment>;\n};\n","@import '../../../../global/global.pcss';\n@import '../../../common/item-list/styles/placeholders.pcss';\n@import '../../../common/item-list/styles/table-display.pcss';\n@import '../../../common/item-list/styles/list-display.pcss';\n@import '../../../common/item-list/styles/grid-display.pcss';\n\natomic-result:not(.hydrated) {\n visibility: hidden;\n}\n","import {\n ResultList,\n ResultListState,\n buildResultList,\n ResultsPerPageState,\n ResultsPerPage,\n buildResultsPerPage,\n buildInteractiveResult,\n Result,\n TabManager,\n TabManagerState,\n buildTabManager,\n} from '@coveo/headless';\nimport {Component, Element, State, Prop, Method, h, Watch} from '@stencil/core';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {ArrayProp} from '../../../../utils/props-utils';\nimport {FocusTargetController} from '../../../../utils/stencil-accessibility-utils';\nimport {randomID} from '../../../../utils/utils';\nimport {ResultsPlaceholdersGuard} from '../../../common/atomic-result-placeholder/stencil-placeholders';\nimport {createAppLoadedListener} from '../../../common/interface/store';\nimport {ItemDisplayGuard} from '../../../common/item-list/item-display-guard';\nimport {ItemListGuard} from '../../../common/item-list/item-list-guard';\nimport {ItemTemplateProvider} from '../../../common/item-list/item-template-provider';\nimport {DisplayGrid} from '../../../common/item-list/stencil-display-grid';\nimport {\n DisplayTableData,\n DisplayTable,\n DisplayTableRow,\n} from '../../../common/item-list/stencil-display-table';\nimport {DisplayWrapper} from '../../../common/item-list/stencil-display-wrapper';\nimport {\n ItemListCommon,\n ItemRenderingFunction,\n} from '../../../common/item-list/stencil-item-list-common';\nimport {\n ItemDisplayDensity,\n ItemDisplayImageSize,\n ItemDisplayLayout,\n getItemListDisplayClasses,\n} from '../../../common/layout/display-options';\nimport {TabGuard} from '../../../common/tabs/tab-guard';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\n\n/**\n * The `atomic-result-list` component is responsible for displaying query results by applying one or more result templates.\n *\n * @slot default - The default slot where the result templates are inserted.\n * @part result-list - The element containing every result of a result list\n * @part outline - The element displaying an outline or a divider around a result\n * @part result-list-grid-clickable-container - The parent of the result & the clickable link encompassing it, when results are displayed as a grid\n * @part result-list-grid-clickable - The clickable link encompassing the result when results are displayed as a grid\n * @part result-table - The element of the result table containing a heading and a body\n * @part result-table-heading - The element containing the row of cells in the result table's heading\n * @part result-table-heading-row - The element containing cells of the result table's heading\n * @part result-table-heading-cell - The element representing a cell of the result table's heading\n * @part result-table-body - The element containing the rows of the result table's body\n * @part result-table-row - The element containing the cells of a row in the result table's body\n * @part result-table-row-odd - The element containing the cells of an odd row in the result table's body\n * @part result-table-row-even - The element containing the cells of an even row in the result table's body\n * @part result-table-cell - The element representing a cell of the result table's body\n */\n@Component({\n tag: 'atomic-result-list',\n styleUrl: 'atomic-result-list.pcss',\n shadow: true,\n})\nexport class AtomicResultList implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n public resultList!: ResultList;\n public resultsPerPage!: ResultsPerPage;\n private loadingFlag = randomID('firstResultLoaded-');\n private itemRenderingFunction: ItemRenderingFunction;\n private nextNewResultTarget?: FocusTargetController;\n private itemTemplateProvider!: ItemTemplateProvider;\n private resultListCommon!: ItemListCommon;\n\n @Element() public host!: HTMLDivElement;\n\n @BindStateToController('resultList')\n @State()\n private resultListState!: ResultListState;\n @BindStateToController('resultsPerPage')\n @State()\n private resultsPerPageState!: ResultsPerPageState;\n public tabManager!: TabManager;\n @BindStateToController('tabManager')\n @State()\n public tabManagerState!: TabManagerState;\n @State() private resultTemplateRegistered = false;\n @State() public error!: Error;\n @State() private isAppLoaded = false;\n\n @State() private templateHasError = false;\n\n /**\n * The desired layout to use when displaying results. Layouts affect how many results to display per row and how visually distinct they are from each other.\n */\n @Prop({reflect: true}) public display: ItemDisplayLayout = 'list';\n /**\n * The spacing of various elements in the result list, including the gap between results, the gap between parts of a result, and the font sizes of different parts in a result.\n */\n @Prop({reflect: true}) public density: ItemDisplayDensity = 'normal';\n\n /**\n * The expected size of the image displayed in the results.\n */\n @Prop({reflect: true, mutable: true})\n public imageSize: ItemDisplayImageSize = 'icon';\n\n /**\n * The tabs on which the result list can be displayed. This property should not be used at the same time as `tabs-excluded`.\n *\n * Set this property as a stringified JSON array, e.g.,\n * ```html\n * <atomic-result-list tabs-included='[\"tabIDA\", \"tabIDB\"]'></atomic-result-list snippet>\n * ```\n * If you don't set this property, the result list can be displayed on any tab. Otherwise, the result list can only be displayed on the specified tabs.\n */\n @ArrayProp()\n @Prop({reflect: true, mutable: true})\n public tabsIncluded: string[] | string = '[]';\n\n /**\n * The tabs on which this result list must not be displayed. This property should not be used at the same time as `tabs-included`.\n *\n * Set this property as a stringified JSON array, e.g.,\n * ```html\n * <atomic-result-list tabs-excluded='[\"tabIDA\", \"tabIDB\"]'></atomic-result-list>\n * ```\n * If you don't set this property, the result list can be displayed on any tab. Otherwise, the result list won't be displayed on any of the specified tabs.\n */\n @ArrayProp()\n @Prop({reflect: true, mutable: true})\n public tabsExcluded: string[] | string = '[]';\n\n /**\n * Sets a rendering function to bypass the standard HTML template mechanism for rendering results.\n * You can use this function while working with web frameworks that don't use plain HTML syntax, e.g., React, Angular or Vue.\n *\n * Do not use this method if you integrate Atomic in a plain HTML deployment.\n *\n * @param resultRenderingFunction\n */\n @Method() public async setRenderFunction(\n resultRenderingFunction: ItemRenderingFunction\n ) {\n this.itemRenderingFunction = resultRenderingFunction;\n }\n\n public get focusTarget() {\n if (!this.nextNewResultTarget) {\n this.nextNewResultTarget = new FocusTargetController(this);\n }\n return this.nextNewResultTarget;\n }\n\n public initialize() {\n if (this.host.innerHTML.includes('<atomic-result-children')) {\n console.warn(\n 'Folded results will not render any children for the \"atomic-result-list\". Please use \"atomic-folded-result-list\" instead.'\n );\n }\n this.tabManager = buildTabManager(this.bindings.engine);\n this.resultList = buildResultList(this.bindings.engine);\n this.resultsPerPage = buildResultsPerPage(this.bindings.engine);\n this.itemTemplateProvider = new ItemTemplateProvider({\n includeDefaultTemplate: true,\n templateElements: Array.from(\n this.host.querySelectorAll('atomic-result-template')\n ),\n getResultTemplateRegistered: () => this.resultTemplateRegistered,\n getTemplateHasError: () => this.templateHasError,\n setResultTemplateRegistered: (value: boolean) => {\n this.resultTemplateRegistered = value;\n },\n setTemplateHasError: (value: boolean) => {\n this.templateHasError = value;\n },\n bindings: this.bindings,\n });\n\n this.resultListCommon = new ItemListCommon({\n engineSubscribe: this.bindings.engine.subscribe,\n getCurrentNumberOfItems: () => this.resultListState.results.length,\n getIsLoading: () => this.resultListState.isLoading,\n host: this.host,\n loadingFlag: this.loadingFlag,\n nextNewItemTarget: this.focusTarget,\n store: this.bindings.store,\n });\n createAppLoadedListener(this.bindings.store, (isAppLoaded) => {\n this.isAppLoaded = isAppLoaded;\n });\n }\n\n @Watch('tabManagerState')\n watchTabManagerState(\n newValue: {activeTab: string},\n oldValue: {activeTab: string}\n ) {\n if (newValue?.activeTab !== oldValue?.activeTab) {\n this.bindings.store.unsetLoadingFlag(this.loadingFlag);\n }\n }\n\n public render() {\n this.resultListCommon.updateBreakpoints();\n const listClasses = this.computeListDisplayClasses();\n\n return (\n <TabGuard\n tabsIncluded={this.tabsIncluded}\n tabsExcluded={this.tabsExcluded}\n activeTab={this.tabManagerState.activeTab}\n >\n <ItemListGuard\n hasError={this.resultListState.hasError}\n hasTemplate={this.resultTemplateRegistered}\n templateHasError={this.itemTemplateProvider.hasError}\n firstRequestExecuted={this.resultListState.firstSearchExecuted}\n hasItems={this.resultListState.hasResults}\n >\n <DisplayWrapper display={this.display} listClasses={listClasses}>\n <ResultsPlaceholdersGuard\n density={this.density}\n display={this.display}\n imageSize={this.imageSize}\n displayPlaceholders={!this.isAppLoaded}\n numberOfPlaceholders={this.resultsPerPageState.numberOfResults}\n ></ResultsPlaceholdersGuard>\n <ItemDisplayGuard\n firstRequestExecuted={this.resultListState.firstSearchExecuted}\n hasItems={this.resultListState.hasResults}\n >\n {this.display === 'table'\n ? this.renderAsTable()\n : this.display === 'grid'\n ? this.renderAsGrid()\n : this.renderAsList()}\n </ItemDisplayGuard>\n </DisplayWrapper>\n </ItemListGuard>\n </TabGuard>\n );\n }\n\n private getPropsForAtomicResult(result: Result) {\n return {\n interactiveResult: buildInteractiveResult(this.bindings.engine, {\n options: {result},\n }),\n result,\n renderingFunction: this.itemRenderingFunction,\n loadingFlag: this.loadingFlag,\n key: this.resultListCommon.getResultId(\n result.uniqueId,\n this.resultListState.searchResponseId,\n this.density,\n this.imageSize\n ),\n content: this.itemTemplateProvider.getTemplateContent(result),\n linkContent:\n this.display === 'grid'\n ? this.itemTemplateProvider.getLinkTemplateContent(result)\n : this.itemTemplateProvider.getEmptyLinkTemplateContent(),\n store: this.bindings.store,\n density: this.density,\n imageSize: this.imageSize,\n display: this.display,\n };\n }\n\n private computeListDisplayClasses() {\n const displayPlaceholders = !this.isAppLoaded;\n\n return getItemListDisplayClasses(\n this.display,\n this.density,\n this.imageSize,\n this.resultListState.firstSearchExecuted &&\n this.resultListState.isLoading,\n displayPlaceholders\n );\n }\n\n private renderAsGrid() {\n return this.resultListState.results.map((result, i) => {\n const propsForAtomicResult = this.getPropsForAtomicResult(result);\n return (\n <DisplayGrid\n selectorForItem=\"atomic-result\"\n item={result}\n {...propsForAtomicResult.interactiveResult}\n setRef={(element) =>\n element && this.resultListCommon.setNewResultRef(element, i)\n }\n >\n <atomic-result {...this} {...propsForAtomicResult}></atomic-result>\n </DisplayGrid>\n );\n });\n }\n\n private renderAsTable() {\n if (!this.resultListState.hasResults) {\n return;\n }\n const listClasses = this.computeListDisplayClasses();\n const firstItem = this.resultListState.results[0];\n\n const propsForTableColumns = {\n firstItem,\n templateContentForFirstItem:\n this.itemTemplateProvider.getTemplateContent(firstItem),\n };\n\n return (\n <DisplayTable\n {...propsForTableColumns}\n listClasses={listClasses}\n logger={this.bindings.engine.logger}\n itemRenderingFunction={this.itemRenderingFunction}\n host={this.host}\n >\n {this.resultListState.results.map((result, i) => {\n const propsForAtomicResult = this.getPropsForAtomicResult(result);\n return (\n <DisplayTableRow\n {...propsForAtomicResult}\n rowIndex={i}\n setRef={(element) =>\n element && this.resultListCommon.setNewResultRef(element, i)\n }\n >\n <DisplayTableData\n {...propsForTableColumns}\n {...propsForAtomicResult}\n renderItem={(content) => {\n return (\n <atomic-result\n {...propsForAtomicResult}\n content={content}\n ></atomic-result>\n );\n }}\n ></DisplayTableData>\n </DisplayTableRow>\n );\n })}\n </DisplayTable>\n );\n }\n\n private renderAsList() {\n return this.resultListState.results.map((result, i) => {\n const propsForAtomicResult = this.getPropsForAtomicResult(result);\n return (\n <atomic-result\n {...propsForAtomicResult}\n ref={(element) =>\n element && this.resultListCommon.setNewResultRef(element, i)\n }\n part=\"outline\"\n ></atomic-result>\n );\n });\n }\n}\n"],"mappings":"u5BA4BA,MAAMA,EAAwBC,IAC5B,GAAIA,EAAMC,sBAAuB,CAC/B,OAAOC,EAA0CF,E,CAEnD,OAAOG,EAAqCH,EAAM,EAGpD,MAAME,EACJF,IAEA,MAAMI,EAA6BC,SAASC,cAAc,OAE1D,MAAMC,EAAqCP,EAAMC,sBAC/CD,EAAMQ,UACNH,SAASC,cAAc,QAEzBF,EAA2BK,UAAYF,EAEvC,OAAOG,MAAMC,KACXP,EAA2BQ,iBAAiBC,GAC7C,EAGH,MAAMV,EACJH,GAEAU,MAAMC,KACJX,EAAMc,4BAA4BF,iBAAiBC,IAGhD,MAAME,EAAuD,CAClEf,EACAgB,KAEA,MAAMC,EAAelB,EAAqBC,GAE1C,IAAKiB,EAAaC,OAAQ,CACxBlB,EAAMmB,OAAOC,MACX,4EACApB,EAAMqB,K,CAIV,OACEC,EAAA,SAAOC,MAAO,aAAavB,EAAMwB,cAAeC,KAAK,gBACnDH,EAAA,SAAOG,KAAK,wBACVH,EAAA,MAAIG,KAAK,4BACNR,EAAaS,KAAKC,GACjBL,EAAA,MAAIG,KAAK,6BACPH,EAAA,eAAaM,MAAOD,EAAOE,aAAa,gBAKhDP,EAAA,SAAOG,KAAK,wBAAwBT,GAC9B,EAIL,MAAMc,EAA6D,EACvEC,MAAKC,WAAUC,UAChBjB,IAGEM,EAAA,MACES,IAAKA,EACLN,KACE,qBACCO,EAAW,IAAM,EAAI,wBAA0B,wBAElDE,IAAMC,GAAYF,EAAOE,OAErBnB,GAKH,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FiltersOnTabChange","initialize","tabManager","buildTabManager","bindings","engine","tabElements","Array","from","host","querySelectorAll","length","error","Error","forEach","tabElement","name","tabController","buildTab","options","expression","id","push","label","render","h","Host","key","role","part","class","map","tab","active","tabManagerState","activeTab","i18n","t","defaultValue","select","state","isActive","__decorate","InitializeBindings","BindStateToController"],"sources":["src/components/search/tabs/atomic-tab-manager/atomic-tab-manager.pcss?tag=atomic-tab-manager&encapsulation=shadow","src/components/search/tabs/atomic-tab-manager/atomic-tab-manager.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n\n:host {\n atomic-tab-bar::part(popover-button) {\n @apply m-0 px-2 pb-1 text-left text-xl font-normal text-black sm:px-6;\n }\n\n atomic-tab-bar::part(value-label) {\n @apply font-normal;\n }\n\n ::part(popover-tab) {\n @apply font-normal;\n }\n}\n","import {\n TabManager,\n TabManagerState,\n buildTabManager,\n Tab,\n buildTab,\n} from '@coveo/headless';\nimport {Component, h, Element, State, Prop, Host} from '@stencil/core';\nimport {\n BindStateToController,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\n\n/**\n * The `atomic-tab-manager` component manages a collection of tabs,\n * allowing users to switch between them. Each child `atomic-tab` represents an\n * individual tab within the manager.\n *\n * @part button-container - The container for the tab button.\n * @part button-container-active - The container for the active tab button.\n * @part tab-button - The tab button.\n * @part tab-button-active - The container for the active tab button.\n * @part dropdown-area - The dropdown area.\n * @part tab-area - The tab area.\n * @slot default\n */\n@Component({\n tag: 'atomic-tab-manager',\n styleUrl: 'atomic-tab-manager.pcss',\n shadow: true,\n})\nexport class AtomicTabManager {\n @InitializeBindings() public bindings!: Bindings;\n @BindStateToController('tabManager')\n @State()\n private tabManagerState!: TabManagerState;\n @Element()\n private host!: HTMLElement;\n public tabManager!: TabManager;\n\n private tabs: {label: string; name: string; tabController: Tab}[] = [];\n\n /**\n * Whether to clear the filters when the active tab changes.\n */\n @Prop() clearFiltersOnTabChange?: boolean = false;\n\n @State() public error!: Error;\n\n public initialize() {\n this.tabManager = buildTabManager(this.bindings.engine);\n\n const tabElements = Array.from(this.host.querySelectorAll('atomic-tab'));\n\n if (tabElements.length === 0) {\n this.error = new Error(\n 'The \"atomic-tab-manager\" element requires at least one \"atomic-tab\" child.'\n );\n return;\n }\n\n tabElements.forEach((tabElement) => {\n if (!tabElement.name) {\n this.error = new Error(\n 'The \"name\" attribute must be defined on all \"atomic-tab\" children.'\n );\n return;\n }\n const tabController = buildTab(this.bindings.engine, {\n options: {\n expression: tabElement.expression,\n id: tabElement.name,\n clearFiltersOnTabChange: this.clearFiltersOnTabChange,\n },\n });\n\n this.tabs.push({\n label: tabElement.label,\n name: tabElement.name,\n tabController,\n });\n });\n }\n\n render() {\n return (\n <Host>\n <atomic-tab-bar>\n <div\n role=\"list\"\n aria-label=\"tab-area\"\n part=\"tab-area\"\n class=\"border-neutral mb-2 flex w-full flex-row border-b\"\n >\n {this.tabs.map((tab) => (\n <atomic-tab-button\n active={this.tabManagerState.activeTab === tab.name}\n label={this.bindings.i18n.t(tab.label, {\n defaultValue: tab.label,\n })}\n select={() => {\n if (!tab.tabController.state.isActive) {\n tab.tabController.select();\n }\n }}\n ></atomic-tab-button>\n ))}\n </div>\n </atomic-tab-bar>\n </Host>\n );\n }\n}\n"],"mappings":"oQAAA,MAAMA,EAAsB,6+2DAC5B,MAAAC,EAAeD,E,iXC+BFE,EAAgB,M,yBASnBC,KAAAC,KAA4D,GAK5DD,KAAAE,wBAAoC,M,4DAAA,M,qBAIrC,UAAAC,GACLH,KAAKI,WAAaC,EAAgBL,KAAKM,SAASC,QAEhD,MAAMC,EAAcC,MAAMC,KAAKV,KAAKW,KAAKC,iBAAiB,eAE1D,GAAIJ,EAAYK,SAAW,EAAG,CAC5Bb,KAAKc,MAAQ,IAAIC,MACf,8EAEF,M,CAGFP,EAAYQ,SAASC,IACnB,IAAKA,EAAWC,KAAM,CACpBlB,KAAKc,MAAQ,IAAIC,MACf,sEAEF,M,CAEF,MAAMI,EAAgBC,EAASpB,KAAKM,SAASC,OAAQ,CACnDc,QAAS,CACPC,WAAYL,EAAWK,WACvBC,GAAIN,EAAWC,KACfhB,wBAAyBF,KAAKE,2BAIlCF,KAAKC,KAAKuB,KAAK,CACbC,MAAOR,EAAWQ,MAClBP,KAAMD,EAAWC,KACjBC,iBACA,G,CAIN,MAAAO,GACE,OACEC,EAACC,EAAI,CAAAC,IAAA,4CACHF,EAAA,kBAAAE,IAAA,4CACEF,EAAA,OAAAE,IAAA,2CACEC,KAAK,OAAM,aACA,WACXC,KAAK,WACLC,MAAM,qDAELhC,KAAKC,KAAKgC,KAAKC,GACdP,EAAA,qBACEQ,OAAQnC,KAAKoC,gBAAgBC,YAAcH,EAAIhB,KAC/CO,MAAOzB,KAAKM,SAASgC,KAAKC,EAAEL,EAAIT,MAAO,CACrCe,aAAcN,EAAIT,QAEpBgB,OAAQ,KACN,IAAKP,EAAIf,cAAcuB,MAAMC,SAAU,CACrCT,EAAIf,cAAcsB,Q,sCAtEPG,EAAA,CAA5BC,K,+BAGOD,EAAA,CAFPE,EAAsB,e","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["atomicIpxResultLinkCss","AtomicIpxResultLinkStyle0","AtomicIPXResultLink","initialize","this","host","dispatchEvent","buildCustomEvent","stopPropagation","actionsHistoryActions","loadIPXActionsHistoryActions","bindings","engine","connectedCallback","slotName","hasDefaultSlot","getDefaultSlotFromHost","linkAttributes","getAttributesFromLinkSlot","onSelect","resultPermanentId","result","raw","permanentid","action","addPageViewEntryInActionsHistory","dispatch","interactiveResult","select","render","href","isUndefined","hrefTemplate","clickUri","buildStringTemplateFromResult","h","LinkWithItemAnalytics","key","onBeginDelayedSelect","beginDelayedSelect","onCancelPendingSelect","cancelPendingSelect","attributes","field","default","__decorate","InitializeBindings","ResultContext","InteractiveResultContext"],"sources":["src/components/ipx/atomic-ipx-result-link/atomic-ipx-result-link.pcss?tag=atomic-ipx-result-link","src/components/ipx/atomic-ipx-result-link/atomic-ipx-result-link.tsx"],"sourcesContent":["@import '../../../global/global.pcss';\n@import '../../../utils/tailwind-utilities/link-style.tw.css';\n\natomic-ipx-result-link {\n a {\n @apply link-style;\n }\n}\n","import {isUndefined} from '@coveo/bueno';\nimport {\n IPXActionsHistoryActionCreators,\n InteractiveResult,\n loadIPXActionsHistoryActions,\n} from '@coveo/headless';\nimport {Component, h, Prop, Element} from '@stencil/core';\nimport {buildCustomEvent} from '../../../utils/event-utils';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../utils/initialization-utils';\nimport {buildStringTemplateFromResult} from '../../../utils/result-utils';\nimport {getDefaultSlotFromHost} from '../../../utils/slot-utils';\nimport {AnyUnfoldedItem} from '../../common/interface/item';\nimport {getAttributesFromLinkSlot} from '../../common/item-link/attributes-slot';\nimport {LinkWithItemAnalytics} from '../../common/item-link/stencil-item-link';\nimport {RecsBindings} from '../../recommendations/atomic-recs-interface/atomic-recs-interface';\nimport {\n ResultContext,\n InteractiveResultContext,\n} from '../../search/result-template-components/result-template-decorators';\n\n/**\n * The `atomic-ipx-result-link` component automatically transforms a search result title into a clickable link that points to the original item. It is an experimental internal component not intended for general use.\n * @slot default - Lets you display alternative content inside the link\n * @slot attributes - Lets you pass [attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attributes) down to the link element, overriding other attributes, to be used exclusively with an \"a\" tag such as `<a slot=\"attributes\" target=\"_blank\" download></a>`.\n * @internal\n */\n@Component({\n tag: 'atomic-ipx-result-link',\n styleUrl: 'atomic-ipx-result-link.pcss',\n shadow: false,\n})\nexport class AtomicIPXResultLink\n implements InitializableComponent<RecsBindings>\n{\n @InitializeBindings() public bindings!: RecsBindings;\n public error!: Error;\n\n @ResultContext() private result!: AnyUnfoldedItem;\n @InteractiveResultContext() private interactiveResult!: InteractiveResult;\n\n @Element() private host!: HTMLElement;\n\n /**\n * Specifies a template literal from which to generate the `href` attribute value (see\n * [Template literals](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals)).\n *\n * The template literal can reference any number of result properties from the parent result. It can also reference the window object.\n *\n * For example, the following markup generates an `href` value such as `http://uri.com?id=itemTitle`, using the result's `clickUri` and `itemtitle` fields.\n * ```html\n * <atomic-ipx-result-link href-template='${clickUri}?id=${raw.itemtitle}'></atomic-ipx-result-link>\n * ```\n */\n @Prop({reflect: true}) hrefTemplate?: string;\n\n private hasDefaultSlot!: boolean;\n private linkAttributes?: Attr[];\n private stopPropagation?: boolean;\n private actionsHistoryActions?: IPXActionsHistoryActionCreators;\n\n public initialize() {\n this.host.dispatchEvent(\n buildCustomEvent(\n 'atomic/resolveStopPropagation',\n (stopPropagation: boolean) => {\n this.stopPropagation = stopPropagation;\n }\n )\n );\n this.actionsHistoryActions = loadIPXActionsHistoryActions(\n this.bindings.engine\n );\n }\n\n public connectedCallback() {\n const slotName = 'attributes';\n this.hasDefaultSlot = !!getDefaultSlotFromHost(this.host);\n this.linkAttributes = getAttributesFromLinkSlot(this.host, slotName);\n }\n\n public async onSelect() {\n const resultPermanentId = this.result.raw.permanentid;\n if (resultPermanentId && this.actionsHistoryActions) {\n const action =\n this.actionsHistoryActions.addPageViewEntryInActionsHistory(\n resultPermanentId\n );\n this.bindings.engine.dispatch(action);\n }\n this.interactiveResult.select();\n }\n\n public render() {\n const href = isUndefined(this.hrefTemplate)\n ? this.result.clickUri\n : buildStringTemplateFromResult(\n this.hrefTemplate,\n this.result,\n this.bindings\n );\n\n return (\n <LinkWithItemAnalytics\n href={href}\n onSelect={() => this.onSelect()}\n onBeginDelayedSelect={() => this.interactiveResult.beginDelayedSelect()}\n onCancelPendingSelect={() =>\n this.interactiveResult.cancelPendingSelect()\n }\n attributes={this.linkAttributes}\n stopPropagation={this.stopPropagation}\n >\n {this.hasDefaultSlot ? (\n <slot />\n ) : (\n <atomic-result-text\n field=\"title\"\n default=\"no-title\"\n ></atomic-result-text>\n )}\n </LinkWithItemAnalytics>\n );\n }\n}\n"],"mappings":"uhBAAA,MAAMA,EAAyB,452DAC/B,MAAAC,EAAeD,E,iXCiCFE,EAAmB,M,qDA6BvB,UAAAC,GACLC,KAAKC,KAAKC,cACRC,EACE,iCACCC,IACCJ,KAAKI,gBAAkBA,CAAe,KAI5CJ,KAAKK,sBAAwBC,EAC3BN,KAAKO,SAASC,O,CAIX,iBAAAC,GACL,MAAMC,EAAW,aACjBV,KAAKW,iBAAmBC,EAAuBZ,KAAKC,MACpDD,KAAKa,eAAiBC,EAA0Bd,KAAKC,KAAMS,E,CAGtD,cAAMK,GACX,MAAMC,EAAoBhB,KAAKiB,OAAOC,IAAIC,YAC1C,GAAIH,GAAqBhB,KAAKK,sBAAuB,CACnD,MAAMe,EACJpB,KAAKK,sBAAsBgB,iCACzBL,GAEJhB,KAAKO,SAASC,OAAOc,SAASF,E,CAEhCpB,KAAKuB,kBAAkBC,Q,CAGlB,MAAAC,GACL,MAAMC,EAAOC,EAAY3B,KAAK4B,cAC1B5B,KAAKiB,OAAOY,SACZC,EACE9B,KAAK4B,aACL5B,KAAKiB,OACLjB,KAAKO,UAGX,OACEwB,EAACC,EAAqB,CAAAC,IAAA,2CACpBP,KAAMA,EACNX,SAAU,IAAMf,KAAKe,WACrBmB,qBAAsB,IAAMlC,KAAKuB,kBAAkBY,qBACnDC,sBAAuB,IACrBpC,KAAKuB,kBAAkBc,sBAEzBC,WAAYtC,KAAKa,eACjBT,gBAAiBJ,KAAKI,iBAErBJ,KAAKW,eACJoB,EAAA,aAEAA,EAAA,sBACEQ,MAAM,QACNC,QAAQ,a,6BAnFWC,EAAA,CAA5BC,K,+BAGwBD,EAAA,CAAxBE,K,6BACmCF,EAAA,CAAnCG,K","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["atomicInsightResultChildrenCss","AtomicInsightResultChildrenStyle0","childTemplateComponent","componentTag","AtomicResultChildren","this","resultTemplateRegistered","templateHasError","showInitialChildren","inheritTemplates","noResultText","toggleShowInitialChildren","foldedResultList","logShowMoreFoldedResults","result","logShowLessFoldedResults","resolveChildTemplates","event","preventDefault","detail","itemTemplateProvider","initialize","childrenTemplates","Array","from","host","querySelectorAll","filter","template","elementHasAncestorTag","length","error","Error","ItemTemplateProvider","includeDefaultTemplate","templateElements","getResultTemplateRegistered","getTemplateHasError","setResultTemplateRegistered","value","setTemplateHasError","bindings","renderChild","child","isLast","content","getTemplateContent","key","uniqueId","children","map","h","interactiveResult","buildInsightInteractiveResult","engine","options","extractUnfoldedItem","store","density","displayConfig","imageSize","classes","trim","componentWillRender","initialChildren","collection","foldedResultListState","results","find","r","loadFullCollection","dispatchEvent","buildCustomEvent","renderCollection","CollectionGuard","isLoadingMoreResults","moreResultsAvailable","hasChildren","numberOfChildren","i18n","t","ShowHideButton","loadAllResults","collapseResults","ChildrenWrapper","i","renderFoldedResult","render","ResultChildrenGuard","__decorate","InitializeBindings","ChildTemplatesContext","FoldedItemListContext","ItemContext","folded","parentName","ItemDisplayConfigContext","FoldedItemListStateContext"],"sources":["src/components/insight/result-templates/atomic-insight-result-children/atomic-insight-result-children.pcss?tag=atomic-insight-result-children&encapsulation=shadow","src/components/insight/result-templates/atomic-insight-result-children/atomic-insight-result-children.tsx"],"sourcesContent":["@import '../../../../components/common/result-children/result-children.pcss';\n\n[part='children-root'] {\n @apply border-neutral border-l;\n padding-left: 1rem;\n margin-top: 1rem;\n}\n","import {\n buildInteractiveResult as buildInsightInteractiveResult,\n FoldedResultListState as InsightFoldedResultListState,\n FoldedResult as InsightFoldedResult,\n FoldedResultList as InsightFoldedResultList,\n} from '@coveo/headless/insight';\nimport {Component, Element, State, h, Listen, Prop} from '@stencil/core';\nimport {buildCustomEvent} from '../../../../utils/event-utils';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {elementHasAncestorTag} from '../../../../utils/utils';\nimport {extractUnfoldedItem} from '../../../common/interface/item';\nimport {\n FoldedItemListContext,\n FoldedItemListStateContext,\n} from '../../../common/item-list/item-list-decorators';\nimport {ItemTemplateProvider} from '../../../common/item-list/item-template-provider';\nimport {\n ChildTemplatesContext,\n ChildTemplatesContextEvent,\n DisplayConfig,\n ItemContext,\n ItemDisplayConfigContext,\n} from '../../../common/item-list/stencil-item-decorators';\nimport {ItemDisplayImageSize} from '../../../common/layout/display-options';\nimport {ChildrenWrapper} from '../../../common/result-children/children-wrapper';\nimport {CollectionGuard} from '../../../common/result-children/collection-guard';\nimport {ResultChildrenGuard} from '../../../common/result-children/guard';\nimport {ShowHideButton} from '../../../common/result-children/show-hide-button';\nimport {InsightBindings} from '../../atomic-insight-interface/atomic-insight-interface';\n\nconst childTemplateComponent = 'atomic-insight-result-children-template';\nconst componentTag = 'atomic-insight-result-children';\n\n/**\n * @internal\n */\n@Component({\n tag: 'atomic-insight-result-children',\n styleUrl: 'atomic-insight-result-children.pcss',\n shadow: true,\n})\nexport class AtomicResultChildren\n implements InitializableComponent<InsightBindings>\n{\n @InitializeBindings() public bindings!: InsightBindings;\n @ChildTemplatesContext()\n public itemTemplateProvider?: ItemTemplateProvider;\n @FoldedItemListContext()\n private foldedResultList!: InsightFoldedResultList;\n @ItemContext({folded: true, parentName: 'atomic-insight-result'})\n private result!: InsightFoldedResult;\n @ItemDisplayConfigContext()\n private displayConfig!: DisplayConfig;\n private initialChildren!: InsightFoldedResult[];\n\n @Element() public host!: HTMLDivElement;\n @State() public error!: Error;\n @State() private resultTemplateRegistered = false;\n @State() private templateHasError = false;\n @FoldedItemListStateContext()\n @State()\n private foldedResultListState!: InsightFoldedResultListState;\n @State()\n private showInitialChildren = false;\n\n /**\n * Whether to inherit templates defined in a parent atomic-result-children. Only works for the second level of child nesting.\n */\n @Prop() inheritTemplates = false;\n /**\n * The expected size of the image displayed in the children results.\n */\n @Prop({reflect: true}) imageSize?: ItemDisplayImageSize;\n /**\n * The non-localized copy for an empty result state. An empty string will result in the component being hidden.\n */\n @Prop() public noResultText = 'no-documents-related';\n\n @Listen('atomic/resolveChildTemplates')\n public resolveChildTemplates(event: ChildTemplatesContextEvent) {\n event.preventDefault();\n event.detail(this.itemTemplateProvider);\n }\n\n public initialize() {\n if (this.inheritTemplates) {\n return;\n }\n\n const childrenTemplates = Array.from(\n this.host.querySelectorAll(childTemplateComponent)\n ).filter(\n (template) => !elementHasAncestorTag(template, childTemplateComponent)\n );\n\n if (!childrenTemplates.length) {\n this.error = new Error(\n `The \"${componentTag}\" component requires at least one \"${childTemplateComponent}\" component.`\n );\n return;\n }\n\n this.itemTemplateProvider = new ItemTemplateProvider({\n includeDefaultTemplate: false,\n templateElements: childrenTemplates,\n getResultTemplateRegistered: () => this.resultTemplateRegistered,\n getTemplateHasError: () => this.templateHasError,\n setResultTemplateRegistered: (value: boolean) => {\n this.resultTemplateRegistered = value;\n },\n setTemplateHasError: (value: boolean) => {\n this.templateHasError = value;\n },\n bindings: this.bindings,\n });\n }\n\n private renderChild(child: InsightFoldedResult, isLast: boolean) {\n const content = this.itemTemplateProvider?.getTemplateContent(child.result);\n\n if (!content) {\n return;\n }\n\n const key =\n child.result.uniqueId +\n child.children.map((child) => child.result.uniqueId);\n return (\n <atomic-insight-result\n key={key}\n content={content}\n result={child}\n interactiveResult={buildInsightInteractiveResult(this.bindings.engine, {\n options: {result: extractUnfoldedItem(child)},\n })}\n store={this.bindings.store}\n density={this.displayConfig.density}\n imageSize={this.imageSize || this.displayConfig.imageSize}\n classes={`child-result ${isLast ? 'last-child' : ''}`.trim()}\n ></atomic-insight-result>\n );\n }\n\n public componentWillRender() {\n if (this.initialChildren || !this.collection) {\n return;\n }\n\n this.initialChildren = this.collection.children;\n }\n\n private get collection() {\n return this.foldedResultListState.results.find((r) => {\n return r.result.uniqueId === this.result.result.uniqueId;\n });\n }\n\n private loadFullCollection() {\n this.host.dispatchEvent(\n buildCustomEvent('atomic/loadCollection', this.collection)\n );\n }\n private toggleShowInitialChildren = () => {\n this.showInitialChildren\n ? this.foldedResultList.logShowMoreFoldedResults(this.result.result)\n : this.foldedResultList.logShowLessFoldedResults();\n\n this.showInitialChildren = !this.showInitialChildren;\n };\n private renderCollection() {\n const collection = this.collection!;\n\n const children = this.showInitialChildren\n ? this.initialChildren\n : collection.children;\n\n return (\n <CollectionGuard\n isLoadingMoreResults={collection.isLoadingMoreResults}\n moreResultsAvailable={collection.moreResultsAvailable}\n hasChildren={collection.children.length > 0}\n numberOfChildren={collection.children.length}\n density={this.displayConfig.density}\n imageSize={this.imageSize || this.displayConfig.imageSize}\n noResultText={this.bindings.i18n.t(this.noResultText)}\n >\n <ShowHideButton\n moreResultsAvailable={collection.moreResultsAvailable}\n loadFullCollection={() => this.loadFullCollection()}\n showInitialChildren={this.showInitialChildren}\n toggleShowInitialChildren={this.toggleShowInitialChildren}\n loadAllResults={this.bindings.i18n.t('load-all-results')}\n collapseResults={this.bindings.i18n.t('collapse-results')}\n ></ShowHideButton>\n <ChildrenWrapper hasChildren={collection.children.length > 0}>\n {children.map((child, i) =>\n this.renderChild(child, i === children.length - 1)\n )}\n </ChildrenWrapper>\n </CollectionGuard>\n );\n }\n\n private renderFoldedResult() {\n if (this.result.children.length === 0) {\n return;\n }\n\n const children = this.result.children;\n\n return (\n <ChildrenWrapper hasChildren={children.length > 0}>\n {children.map((child, i) =>\n this.renderChild(child, i === children.length - 1)\n )}\n </ChildrenWrapper>\n );\n }\n\n public render() {\n return (\n <ResultChildrenGuard\n inheritTemplates={this.inheritTemplates}\n resultTemplateRegistered={this.resultTemplateRegistered}\n templateHasError={this.templateHasError}\n >\n {this.collection ? this.renderCollection() : this.renderFoldedResult()}\n </ResultChildrenGuard>\n );\n }\n}\n"],"mappings":"gpBAAA,MAAMA,EAAiC,s32DACvC,MAAAC,EAAeD,E,2WCgCf,MAAME,EAAyB,0CAC/B,MAAMC,EAAe,iC,MAURC,EAAoB,M,yBAgBdC,KAAAC,yBAA2B,MAC3BD,KAAAE,iBAAmB,MAK5BF,KAAAG,oBAAsB,MAKtBH,KAAAI,iBAAmB,MAQZJ,KAAAK,aAAe,uBAsFtBL,KAAAM,0BAA4B,KAClCN,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S,OAAOmC,SAE7B,OACEE,EAACiC,EAAe,CAACP,YAAa5B,EAASnB,OAAS,GAC7CmB,EAASC,KAAI,CAACP,EAAO0C,IACpBhF,KAAKqC,YAAYC,EAAO0C,IAAMpC,EAASnB,OAAS,K,CAMjD,MAAAyD,GACL,OACEpC,EAACqC,EAAmB,CAAAzC,IAAA,2CAClBtC,iBAAkBJ,KAAKI,iBACvBH,yBAA0BD,KAAKC,yBAC/BC,iBAAkBF,KAAKE,kBAEtBF,KAAK4D,WAAa5D,KAAKoE,mBAAqBpE,KAAKiF,qB,6BAtL3BG,EAAA,CAA5BC,K,+BAEMD,EAAA,CADNE,K,2CAGOF,EAAA,CADPG,K,uCAGOH,EAAA,CADPI,EAAY,CAACC,OAAQ,KAAMC,WAAY,2B,6BAGhCN,EAAA,CADPO,K,oCAUOP,EAAA,CAFPQ,K","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["atomicResultChildrenCss","AtomicResultChildrenStyle0","childTemplateComponent","componentTag","AtomicResultChildren","this","resultTemplateRegistered","templateHasError","showInitialChildren","inheritTemplates","noResultText","toggleShowInitialChildren","foldedResultList","logShowMoreFoldedResults","result","logShowLessFoldedResults","loadedFullCollection","resolveChildTemplates","event","preventDefault","detail","itemTemplateProvider","initialize","childrenTemplates","Array","from","host","querySelectorAll","filter","template","elementHasAncestorTag","length","error","Error","ItemTemplateProvider","includeDefaultTemplate","templateElements","getResultTemplateRegistered","getTemplateHasError","setResultTemplateRegistered","value","setTemplateHasError","bindings","renderChild","child","isLast","content","getTemplateContent","key","uniqueId","children","map","h","interactiveResult","buildInteractiveResult","engine","options","extractUnfoldedItem","store","density","displayConfig","imageSize","classes","trim","componentWillRender","initialChildren","collection","foldedResultListState","results","find","r","loadFullCollection","dispatchEvent","buildCustomEvent","renderCollection","showShouldButtons","moreResultsAvailable","Fragment","ShowHideButton","loadAllResults","i18n","t","collapseResults","CollectionGuard","isLoadingMoreResults","hasChildren","numberOfChildren","ChildrenWrapper","i","renderFoldedResult","render","ResultChildrenGuard","__decorate","InitializeBindings","ChildTemplatesContext","FoldedItemListContext","ResultContext","folded","ItemDisplayConfigContext","FoldedItemListStateContext"],"sources":["src/components/search/result-lists/atomic-result-children/atomic-result-children.pcss?tag=atomic-result-children&encapsulation=shadow","src/components/search/result-lists/atomic-result-children/atomic-result-children.tsx"],"sourcesContent":["@import '../../../../components/common/result-children/result-children.pcss';\n","import {\n buildInteractiveResult,\n FoldedResult,\n FoldedResultList,\n FoldedResultListState,\n} from '@coveo/headless';\nimport {\n Component,\n Element,\n State,\n h,\n Listen,\n Prop,\n Fragment,\n} from '@stencil/core';\nimport {buildCustomEvent} from '../../../../utils/event-utils';\nimport {\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {elementHasAncestorTag} from '../../../../utils/utils';\nimport {extractUnfoldedItem} from '../../../common/interface/item';\nimport {\n FoldedItemListContext,\n FoldedItemListStateContext,\n} from '../../../common/item-list/item-list-decorators';\nimport {ItemTemplateProvider} from '../../../common/item-list/item-template-provider';\nimport {\n ChildTemplatesContext,\n ChildTemplatesContextEvent,\n DisplayConfig,\n ItemDisplayConfigContext,\n} from '../../../common/item-list/stencil-item-decorators';\nimport {ItemDisplayImageSize} from '../../../common/layout/display-options';\nimport {ChildrenWrapper} from '../../../common/result-children/children-wrapper';\nimport {CollectionGuard} from '../../../common/result-children/collection-guard';\nimport {ResultChildrenGuard} from '../../../common/result-children/guard';\nimport {ShowHideButton} from '../../../common/result-children/show-hide-button';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\nimport {ResultContext} from '../../result-template-components/result-template-decorators';\n\nconst childTemplateComponent = 'atomic-result-children-template';\nconst componentTag = 'atomic-result-children';\n\n/**\n * The `atomic-result-children` component is responsible for displaying child results by applying one or more child result templates.\n * Includes two slots, \"before-children\" and \"after-children\", which allow for rendering content before and after the list of children,\n * only when children exist.\n * @part children-root - The wrapper for the message when there are child results\n * @part no-result-root - The wrapper for the message when there are no results.\n * @part show-hide-button - The button that allows to collapse or show all child results.\n * @slot before-children - Slot that allows rendering content before the list of children, only when children exist.\n * @slot after-children - Slot that allows rendering content after the list of children, only when children exist.\n */\n@Component({\n tag: 'atomic-result-children',\n styleUrl: 'atomic-result-children.pcss',\n shadow: true,\n})\nexport class AtomicResultChildren implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n @ChildTemplatesContext()\n public itemTemplateProvider?: ItemTemplateProvider;\n @FoldedItemListContext()\n private foldedResultList!: FoldedResultList;\n @ResultContext({folded: true})\n private result!: FoldedResult;\n @ItemDisplayConfigContext()\n private displayConfig!: DisplayConfig;\n private initialChildren!: FoldedResult[];\n\n @Element() public host!: HTMLDivElement;\n @State() public error!: Error;\n @State() private resultTemplateRegistered = false;\n @State() private templateHasError = false;\n @FoldedItemListStateContext()\n @State()\n private foldedResultListState!: FoldedResultListState;\n @State()\n private showInitialChildren = false;\n\n /**\n * Whether to inherit templates defined in a parent atomic-result-children. Only works for the second level of child nesting.\n */\n @Prop() inheritTemplates = false;\n /**\n * The expected size of the image displayed in the children results.\n */\n @Prop({reflect: true}) imageSize?: ItemDisplayImageSize;\n /**\n * The non-localized copy for an empty result state. An empty string will result in the component being hidden.\n */\n @Prop() public noResultText = 'no-documents-related';\n\n @Listen('atomic/resolveChildTemplates')\n public resolveChildTemplates(event: ChildTemplatesContextEvent) {\n event.preventDefault();\n event.detail(this.itemTemplateProvider);\n }\n\n public initialize() {\n if (this.inheritTemplates) {\n return;\n }\n\n const childrenTemplates = Array.from(\n this.host.querySelectorAll(childTemplateComponent)\n ).filter(\n (template) => !elementHasAncestorTag(template, childTemplateComponent)\n );\n\n if (!childrenTemplates.length) {\n this.error = new Error(\n `The \"${componentTag}\" component requires at least one \"${childTemplateComponent}\" component.`\n );\n return;\n }\n\n this.itemTemplateProvider = new ItemTemplateProvider({\n includeDefaultTemplate: false,\n templateElements: childrenTemplates,\n getResultTemplateRegistered: () => this.resultTemplateRegistered,\n getTemplateHasError: () => this.templateHasError,\n setResultTemplateRegistered: (value: boolean) => {\n this.resultTemplateRegistered = value;\n },\n setTemplateHasError: (value: boolean) => {\n this.templateHasError = value;\n },\n bindings: this.bindings,\n });\n }\n\n private renderChild(child: FoldedResult, isLast: boolean) {\n const content = this.itemTemplateProvider?.getTemplateContent(child.result);\n\n if (!content) {\n return;\n }\n\n const key =\n child.result.uniqueId +\n child.children.map((child) => child.result.uniqueId);\n return (\n <atomic-result\n key={key}\n content={content}\n result={child}\n interactiveResult={buildInteractiveResult(this.bindings.engine, {\n options: {result: extractUnfoldedItem(child)},\n })}\n store={this.bindings.store}\n density={this.displayConfig.density}\n imageSize={this.imageSize || this.displayConfig.imageSize}\n classes={`child-result ${isLast ? 'last-child' : ''}`.trim()}\n ></atomic-result>\n );\n }\n\n public componentWillRender() {\n if (this.initialChildren || !this.collection) {\n return;\n }\n\n this.initialChildren = this.collection.children;\n }\n\n private get collection() {\n return this.foldedResultListState.results.find((r) => {\n return r.result.uniqueId === this.result.result.uniqueId;\n });\n }\n private loadFullCollection() {\n this.loadedFullCollection = true;\n this.host.dispatchEvent(\n buildCustomEvent('atomic/loadCollection', this.collection)\n );\n }\n private toggleShowInitialChildren = () => {\n if (this.showInitialChildren) {\n this.foldedResultList.logShowMoreFoldedResults(this.result.result);\n } else {\n this.foldedResultList.logShowLessFoldedResults();\n }\n\n this.showInitialChildren = !this.showInitialChildren;\n };\n\n @State() private loadedFullCollection = false;\n\n private renderCollection() {\n const collection = this.collection!;\n\n const children = this.showInitialChildren\n ? this.initialChildren\n : collection.children;\n\n const showShouldButtons =\n this.loadedFullCollection || collection.moreResultsAvailable;\n\n return (\n <Fragment>\n {showShouldButtons && (\n <ShowHideButton\n moreResultsAvailable={collection.moreResultsAvailable}\n loadFullCollection={() => this.loadFullCollection()}\n showInitialChildren={this.showInitialChildren}\n toggleShowInitialChildren={this.toggleShowInitialChildren}\n loadAllResults={this.bindings.i18n.t('load-all-results')}\n collapseResults={this.bindings.i18n.t('collapse-results')}\n />\n )}\n\n <CollectionGuard\n isLoadingMoreResults={collection.isLoadingMoreResults}\n moreResultsAvailable={collection.moreResultsAvailable}\n hasChildren={collection.children.length > 0}\n numberOfChildren={collection.children.length}\n density={this.displayConfig.density}\n imageSize={this.imageSize || this.displayConfig.imageSize}\n noResultText={this.bindings.i18n.t(this.noResultText)}\n >\n <ChildrenWrapper hasChildren={collection.children.length > 0}>\n {children.map((child, i) =>\n this.renderChild(child, i === children.length - 1)\n )}\n </ChildrenWrapper>\n </CollectionGuard>\n </Fragment>\n );\n }\n\n private renderFoldedResult() {\n if (this.result.children.length === 0) {\n return;\n }\n\n const children = this.result.children;\n\n return (\n <ChildrenWrapper hasChildren={children.length > 0}>\n {children.map((child, i) =>\n this.renderChild(child, i === children.length - 1)\n )}\n </ChildrenWrapper>\n );\n }\n\n public render() {\n return (\n <ResultChildrenGuard\n inheritTemplates={this.inheritTemplates}\n resultTemplateRegistered={this.resultTemplateRegistered}\n templateHasError={this.templateHasError}\n >\n {this.collection ? this.renderCollection() : this.renderFoldedResult()}\n </ResultChildrenGuard>\n );\n }\n}\n"],"mappings":"opBAAA,MAAMA,EAA0B,0r2DAChC,MAAAC,EAAeD,E,2WCwCf,MAAME,EAAyB,kCAC/B,MAAMC,EAAe,yB,MAiBRC,EAAoB,M,yBAcdC,KAAAC,yBAA2B,MAC3BD,KAAAE,iBAAmB,MAK5BF,KAAAG,oBAAsB,MAKtBH,KAAAI,iBAAmB,MAQZJ,KAAAK,aAAe,uBAsFtBL,KAAAM,0BAA4B,KAClC,GAAIN,KAAKG,oBAAqB,CAC5BH,KAAKO,iBAAiBC,yBAAyBR,KAAKS,OAAOA,O,KACtD,CACLT,KAAKO,iBAAiBG,0B,CAGxBV,KAAKG,qBAAuBH,KAAKG,mBAAmB,EAGrCH,KAAAW,qBAAuB,M,mDAnHI,M,sBACR,M,8DAKN,M,sBAKH,M,2CAQG,uB,0BAgGU,K,CA7FjC,qBAAAC,CAAsBC,GAC3BA,EAAMC,i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,KAAKsC,YAAYC,EAAO4C,IAAMtC,EAASnB,OAAS,K,CAMjD,MAAA2D,GACL,OACEtC,EAACuC,EAAmB,CAAA3C,IAAA,2CAClBvC,iBAAkBJ,KAAKI,iBACvBH,yBAA0BD,KAAKC,yBAC/BC,iBAAkBF,KAAKE,kBAEtBF,KAAK6D,WAAa7D,KAAKqE,mBAAqBrE,KAAKoF,qB,6BAnM3BG,EAAA,CAA5BC,K,+BAEMD,EAAA,CADNE,K,2CAGOF,EAAA,CADPG,K,uCAGOH,EAAA,CADPI,EAAc,CAACC,OAAQ,Q,6BAGhBL,EAAA,CADPM,K,oCAUON,EAAA,CAFPO,K","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["atomicFoldedResultListCss","AtomicFoldedResultListStyle0","AtomicFoldedResultList","this","loadingFlag","randomID","display","resultTemplateRegistered","templateHasError","isAppLoaded","density","imageSize","tabsIncluded","tabsExcluded","numberOfFoldedResults","setRenderFunction","resultRenderingFunction","resolveFoldedResultList","event","preventDefault","stopPropagation","detail","foldedResultList","loadCollection","focusTarget","nextNewResultTarget","FocusTargetController","initialize","initFolding","resultsPerPage","buildResultsPerPage","bindings","engine","e","error","itemTemplateProvider","ItemTemplateProvider","includeDefaultTemplate","templateElements","Array","from","host","querySelectorAll","getResultTemplateRegistered","getTemplateHasError","setResultTemplateRegistered","value","setTemplateHasError","itemListCommon","ItemListCommon","engineSubscribe","subscribe","getCurrentNumberOfItems","foldedResultListState","results","length","getIsLoading","isLoading","nextNewItemTarget","store","tabManager","buildTabManager","createAppLoadedListener","props","options","buildFoldedResultList","folding","collectionField","parentField","childField","watchTabManagerState","newValue","oldValue","activeTab","unsetLoadingFlag","render","shouldDisplayOnCurrentTab","tabManagerState","h","Hidden","updateBreakpoints","listClasses","computeListDisplayClasses","ItemListGuard","hasError","firstRequestExecuted","firstSearchExecuted","hasItems","hasResults","hasTemplate","DisplayWrapper","ResultsPlaceholdersGuard","displayPlaceholders","numberOfPlaceholders","resultsPerPageState","numberOfResults","ItemDisplayGuard","map","collection","i","propsForAtomicResult","getPropsForAtomicResult","part","ref","element","setNewResultRef","getItemListDisplayClasses","result","extractUnfoldedItem","interactiveResult","buildInteractiveResult","renderingFunction","key","getResultId","uniqueId","searchResponseId","content","getTemplateContent","__decorate","InitializeBindings","BindStateToController","ArrayProp"],"sources":["src/components/search/result-lists/atomic-folded-result-list/atomic-folded-result-list.pcss?tag=atomic-folded-result-list&encapsulation=shadow","src/components/search/result-lists/atomic-folded-result-list/atomic-folded-result-list.tsx"],"sourcesContent":["@import '../../../../global/global.pcss';\n@import '../../../common/item-list/styles/placeholders.pcss';\n@import '../../../common/item-list/styles/list-display.pcss';\natomic-result:not(.hydrated) {\n visibility: hidden;\n}\n","import {FoldedItemListStateContextEvent} from '@/src/components/common/item-list/item-list-decorators';\nimport {\n ResultsPerPageState,\n ResultsPerPage,\n buildFoldedResultList,\n FoldedResultList,\n FoldedResultListState,\n buildResultsPerPage,\n ResultListProps,\n FoldedCollection,\n buildInteractiveResult,\n TabManager,\n TabManagerState,\n buildTabManager,\n} from '@coveo/headless';\nimport {\n Component,\n Element,\n State,\n Prop,\n Listen,\n Method,\n h,\n Watch,\n} from '@stencil/core';\nimport {\n BindStateToController,\n InitializableComponent,\n InitializeBindings,\n} from '../../../../utils/initialization-utils';\nimport {ArrayProp} from '../../../../utils/props-utils';\nimport {FocusTargetController} from '../../../../utils/stencil-accessibility-utils';\nimport {shouldDisplayOnCurrentTab} from '../../../../utils/tab-utils';\nimport {randomID} from '../../../../utils/utils';\nimport {ResultsPlaceholdersGuard} from '../../../common/atomic-result-placeholder/stencil-placeholders';\nimport {extractUnfoldedItem} from '../../../common/interface/item';\nimport {createAppLoadedListener} from '../../../common/interface/store';\nimport {ItemDisplayGuard} from '../../../common/item-list/item-display-guard';\nimport {ItemListGuard} from '../../../common/item-list/item-list-guard';\nimport {ItemTemplateProvider} from '../../../common/item-list/item-template-provider';\nimport {DisplayWrapper} from '../../../common/item-list/stencil-display-wrapper';\nimport {\n ItemListCommon,\n ItemRenderingFunction,\n} from '../../../common/item-list/stencil-item-list-common';\nimport {\n ItemDisplayDensity,\n ItemDisplayImageSize,\n ItemDisplayLayout,\n getItemListDisplayClasses,\n} from '../../../common/layout/display-options';\nimport {Hidden} from '../../../common/stencil-hidden';\nimport {Bindings} from '../../atomic-search-interface/atomic-search-interface';\n\n/**\n * The `atomic-folded-result-list` component is responsible for displaying folded query results, by applying one or more result templates for up to three layers (i.e., to the result, child and grandchild).\n * @slot default - The default slot where the result templates are inserted.\n * @part result-list - The element containing every result of a result list\n * @part outline - The element displaying an outline or a divider around a result\n */\n@Component({\n tag: 'atomic-folded-result-list',\n styleUrl: 'atomic-folded-result-list.pcss',\n shadow: true,\n})\nexport class AtomicFoldedResultList implements InitializableComponent {\n @InitializeBindings() public bindings!: Bindings;\n public foldedResultList!: FoldedResultList;\n public resultsPerPage!: ResultsPerPage;\n private resultRenderingFunction: ItemRenderingFunction;\n private loadingFlag = randomID('firstResultLoaded-');\n private itemTemplateProvider!: ItemTemplateProvider;\n private nextNewResultTarget?: FocusTargetController;\n private itemListCommon!: ItemListCommon;\n private display: ItemDisplayLayout = 'list';\n\n @Element() public host!: HTMLDivElement;\n\n @BindStateToController('foldedResultList')\n @State()\n public foldedResultListState!: FoldedResultListState;\n @BindStateToController('resultsPerPage')\n @State()\n public resultsPerPageState!: ResultsPerPageState;\n public tabManager!: TabManager;\n @BindStateToController('tabManager')\n @State()\n public tabManagerState!: TabManagerState;\n @State() private resultTemplateRegistered = false;\n @State() public error!: Error;\n @State() private templateHasError = false;\n @State() private isAppLoaded = false;\n\n /**\n * The spacing of various elements in the result list, including the gap between results, the gap between parts of a result, and the font sizes of different parts in a result.\n */\n @Prop({reflect: true}) density: ItemDisplayDensity = 'normal';\n /**\n * The expected size of the image displayed in the results.\n */\n @Prop({reflect: true}) imageSize: ItemDisplayImageSize = 'icon';\n /**\n * The tabs on which the folded result list can be displayed. This property should not be used at the same time as `tabs-excluded`.\n *\n * Set this property as a stringified JSON array, e.g.,\n * ```html\n * <atomic-folded-result-list tabs-included='[\"tabIDA\", \"tabIDB\"]'></atomic-folded-result-list snippet>\n * ```\n * If you don't set this property, the folded result list can be displayed on any tab. Otherwise, the folded result list can only be displayed on the specified tabs.\n */\n @ArrayProp()\n @Prop({reflect: true, mutable: true})\n public tabsIncluded: string[] | string = '[]';\n\n /**\n * The tabs on which this folded result list must not be displayed. This property should not be used at the same time as `tabs-included`.\n *\n * Set this property as a stringified JSON array, e.g.,\n * ```html\n * <atomic-folded-result-list tabs-excluded='[\"tabIDA\", \"tabIDB\"]'></atomic-folded-result-list>\n * ```\n * If you don't set this property, the folded result list can be displayed on any tab. Otherwise, the folded result list won't be displayed on any of the specified tabs.\n */\n @ArrayProp()\n @Prop({reflect: true, mutable: true})\n public tabsExcluded: string[] | string = '[]';\n /**\n * The name of the field on which to do the folding. The folded result list component will use the values of this field to resolve the collections of result items.\n *\n * @defaultValue `foldingcollection`\n */\n @Prop({reflect: true}) public collectionField?: string;\n /**\n * The name of the field that determines whether a certain result is a top result containing other child results within a collection.\n *\n * @defaultValue `foldingparent`\n */\n @Prop({reflect: true}) public parentField?: string;\n /**\n * The name of the field that uniquely identifies a result within a collection.\n *\n * @defaultValue `foldingchild`\n */\n @Prop({reflect: true}) public childField?: string;\n\n /**\n * The initial number of child results to request for each folded collection, before expansion.\n *\n * @defaultValue `2`\n *\n * @example For an email thread with a total of 20 messages, using the default value of `2` will request the top two child messages, based on the current sort criteria and query, to be returned as children of the parent message.\n * The user can then click to expand the collection and see the remaining messages that match the current query (i.e., not necessarily all remaining 18 messages). Those messages will be sorted based on the current sort criteria (i.e., not necessarily by date).\n * For more info on Result Folding, see [Result Folding](https://docs.coveo.com/en/1884).\n **/\n @Prop({reflect: true}) public numberOfFoldedResults = 2;\n\n /**\n * Sets a rendering function to bypass the standard HTML template mechanism for rendering results.\n * You can use this function while working with web frameworks that don't use plain HTML syntax, e.g., React, Angular or Vue.\n *\n * Do not use this method if you integrate Atomic in a plain HTML deployment.\n */\n @Method() public async setRenderFunction(\n resultRenderingFunction: ItemRenderingFunction\n ) {\n this.resultRenderingFunction = resultRenderingFunction;\n }\n\n @Listen('atomic/resolveFoldedResultList')\n resolveFoldedResultList(event: FoldedItemListStateContextEvent) {\n event.preventDefault();\n event.stopPropagation();\n event.detail(this.foldedResultList);\n }\n\n @Listen('atomic/loadCollection')\n loadCollection(event: CustomEvent<FoldedCollection>) {\n event.preventDefault();\n event.stopPropagation();\n this.foldedResultList.loadCollection(event.detail);\n }\n\n public get focusTarget() {\n if (!this.nextNewResultTarget) {\n this.nextNewResultTarget = new FocusTargetController(this);\n }\n return this.nextNewResultTarget;\n }\n\n public initialize() {\n try {\n this.foldedResultList = this.initFolding();\n this.resultsPerPage = buildResultsPerPage(this.bindings.engine);\n } catch (e) {\n this.error = e as Error;\n }\n\n this.itemTemplateProvider = new ItemTemplateProvider({\n includeDefaultTemplate: true,\n templateElements: Array.from(\n this.host.querySelectorAll('atomic-result-template')\n ),\n getResultTemplateRegistered: () => this.resultTemplateRegistered,\n getTemplateHasError: () => this.templateHasError,\n setResultTemplateRegistered: (value: boolean) => {\n this.resultTemplateRegistered = value;\n },\n setTemplateHasError: (value: boolean) => {\n this.templateHasError = value;\n },\n bindings: this.bindings,\n });\n\n this.itemListCommon = new ItemListCommon({\n engineSubscribe: this.bindings.engine.subscribe,\n getCurrentNumberOfItems: () => this.foldedResultListState.results.length,\n getIsLoading: () => this.foldedResultListState.isLoading,\n host: this.host,\n loadingFlag: this.loadingFlag,\n nextNewItemTarget: this.focusTarget,\n store: this.bindings.store,\n });\n this.tabManager = buildTabManager(this.bindings.engine);\n\n createAppLoadedListener(this.bindings.store, (isAppLoaded) => {\n this.isAppLoaded = isAppLoaded;\n });\n }\n\n private initFolding(\n props: ResultListProps = {options: {}}\n ): FoldedResultList {\n return buildFoldedResultList(this.bindings.engine, {\n options: {\n ...props.options,\n folding: {\n collectionField: this.collectionField,\n parentField: this.parentField,\n childField: this.childField,\n numberOfFoldedResults: this.numberOfFoldedResults,\n },\n },\n });\n }\n\n @Watch('tabManagerState')\n watchTabManagerState(\n newValue: {activeTab: string},\n oldValue: {activeTab: string}\n ) {\n if (newValue?.activeTab !== oldValue?.activeTab) {\n this.bindings.store.unsetLoadingFlag(this.loadingFlag);\n }\n }\n\n public render() {\n if (\n !shouldDisplayOnCurrentTab(\n [...this.tabsIncluded],\n [...this.tabsExcluded],\n this.tabManagerState.activeTab\n )\n ) {\n return <Hidden></Hidden>;\n }\n this.itemListCommon.updateBreakpoints();\n const listClasses = this.computeListDisplayClasses();\n\n return (\n <ItemListGuard\n hasError={this.foldedResultListState.hasError}\n firstRequestExecuted={this.foldedResultListState.firstSearchExecuted}\n hasItems={this.foldedResultListState.hasResults}\n hasTemplate={this.resultTemplateRegistered}\n templateHasError={this.itemTemplateProvider.hasError}\n >\n <DisplayWrapper listClasses={listClasses} display={this.display}>\n <ResultsPlaceholdersGuard\n density={this.density}\n imageSize={this.imageSize}\n display={this.display}\n displayPlaceholders={!this.isAppLoaded}\n numberOfPlaceholders={this.resultsPerPageState.numberOfResults}\n ></ResultsPlaceholdersGuard>\n <ItemDisplayGuard\n firstRequestExecuted={\n this.foldedResultListState.firstSearchExecuted\n }\n hasItems={this.foldedResultListState.hasResults}\n >\n {this.foldedResultListState.results.map((collection, i) => {\n const propsForAtomicResult =\n this.getPropsForAtomicResult(collection);\n return (\n <atomic-result\n {...propsForAtomicResult}\n part=\"outline\"\n ref={(element) =>\n element && this.itemListCommon.setNewResultRef(element, i)\n }\n ></atomic-result>\n );\n })}\n </ItemDisplayGuard>\n </DisplayWrapper>\n </ItemListGuard>\n );\n }\n\n private computeListDisplayClasses() {\n const displayPlaceholders = !this.isAppLoaded;\n\n return getItemListDisplayClasses(\n this.display,\n this.density,\n this.imageSize,\n this.foldedResultListState.firstSearchExecuted &&\n this.foldedResultListState.isLoading,\n displayPlaceholders\n );\n }\n\n private getPropsForAtomicResult(collection: FoldedCollection) {\n const result = extractUnfoldedItem(collection);\n\n return {\n interactiveResult: buildInteractiveResult(this.bindings.engine, {\n options: {result},\n }),\n result: collection,\n renderingFunction: this.resultRenderingFunction,\n loadingFlag: this.loadingFlag,\n key: this.itemListCommon.getResultId(\n result.uniqueId,\n this.foldedResultListState.searchResponseId,\n this.density,\n this.imageSize\n ),\n content: this.itemTemplateProvider.getTemplateContent(result),\n store: this.bindings.store,\n density: this.density,\n imageSize: this.imageSize,\n display: this.display,\n };\n }\n}\n"],"mappings":"k3BAAA,MAAMA,EAA4B,y6wEAClC,MAAAC,EAAeD,E,iXCgEFE,EAAsB,M,yBAKzBC,KAAAC,YAAcC,EAAS,sBAIvBF,KAAAG,QAA6B,OAcpBH,KAAAI,yBAA2B,MAE3BJ,KAAAK,iBAAmB,MACnBL,KAAAM,YAAc,MAKRN,KAAAO,QAA8B,SAI9BP,KAAAQ,UAAkC,OAYlDR,KAAAS,aAAkC,KAalCT,KAAAU,aAAkC,KA6BXV,KAAAW,sBAAwB,E,qIAlEV,M,2CAER,M,iBACL,M,aAKsB,S,eAII,O,kBAYhB,K,kBAaA,K,+GA6Ba,C,CAQrC,uBAAMC,CACrBC,GAEAb,KAAKa,wBAA0BA,C,CAIjC,uBAAAC,CAAwBC,GACtBA,EAAMC,iBACND,EAAME,kBACNF,EAAMG,OAAOlB,KAAKmB,iB,CAIpB,cAAAC,CAAeL,GACbA,EAAMC,iBACND,EAAME,kBACNjB,KAAKmB,iBAAiBC,eAAeL,EAAMG,O,CAG7C,eAAWG,GACT,IAAKrB,KAAKsB,oBAAqB,CAC7BtB,KAAKsB,oBAAsB,IAAIC,EAAsBvB,K,CAEvD,OAAOA,KAAKsB,mB,CAGP,UAAAE,GACL,IACExB,KAAKmB,iBAAmBnB,KAAKyB,cAC7BzB,KAAK0B,eAAiBC,EAAoB3B,KAAK4B,SAASC,O,CACxD,MAAOC,GACP9B,KAAK+B,MAAQD,C,CAGf9B,KAAKgC,qBAAuB,IAAIC,EAAq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D,QAASP,KAAKO,QACdC,UAAWR,KAAKQ,UAChBL,QAASH,KAAKG,Q,oGApRWgH,EAAA,CAA5BC,K,+BAcMD,EAAA,CAFNE,EAAsB,qB,4CAKhBF,EAAA,CAFNE,EAAsB,mB,0CAMhBF,EAAA,CAFNE,EAAsB,e,sCA2BhBF,EAAA,CAFNG,K,mCAeMH,EAAA,CAFNG,K","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["MapProp","opts","component","variableName","componentWillLoad","console","error","prefix","attributePrefix","variable","this","attributes","getElement","mapAttributesToProp","Array","from","splitValues","call","ArrayProp","attributeWithBrackets","camelToKebab","value","isArray","valueAsArray","JSON","parse","e","splitAttributeValueOnCommas","attributeValue","splitButIgnoreEscapeSymbolsExpression","valuesWithEscapeSymbols","matchAll","removeEscapeSymbolsExpression","map","replace","mapVariable","attributesToStringMap","Object","assign","stringMapToStringArrayMap","entries","reduce","acc","key","subValue","trim","kebabPrefix","i","length","attribute","name","indexOf","property","kebabToCamel"],"sources":["src/utils/props-utils.ts"],"sourcesContent":["import {isArray} from '@coveo/bueno';\nimport {type ComponentInterface, getElement} from '@stencil/core';\nimport type {ReactiveElement} from 'lit';\nimport {camelToKebab, kebabToCamel} from './utils';\n\ninterface MapPropOptions {\n attributePrefix?: string;\n splitValues?: boolean;\n}\n\nexport function mapProperty<Element extends ReactiveElement>(\n options?: MapPropOptions\n) {\n return <\n Instance extends Element & Record<string, unknown>,\n K extends keyof Instance,\n >(\n proto: ReactiveElement,\n propertyKey: K\n ) => {\n const ctor = proto.constructor as typeof ReactiveElement;\n ctor.addInitializer((instance) => {\n const props = {};\n const prefix =\n options?.attributePrefix || camelToKebab(propertyKey.toString());\n\n mapAttributesToProp(\n prefix,\n props,\n Array.from(instance.attributes),\n options?.splitValues ?? false\n );\n\n (instance as Instance)[propertyKey] = props as Instance[K];\n });\n };\n}\n\n/**\n * @deprecated Use the `mapProperty` decorator instead.\n */\nexport function MapProp(opts?: MapPropOptions) {\n return (component: ComponentInterface, variableName: string) => {\n const {componentWillLoad} = component;\n if (!componentWillLoad) {\n console.error(\n 'The \"componentWillLoad\" lifecycle method has to be defined for the MapProp decorator to work.'\n );\n return;\n }\n\n component.componentWillLoad = function () {\n const prefix = opts?.attributePrefix || variableName;\n const variable = this[variableName];\n const attributes = getElement(this).attributes;\n mapAttributesToProp(\n prefix,\n variable,\n Array.from(attributes),\n opts?.splitValues ?? false\n );\n componentWillLoad.call(this);\n };\n };\n}\n\nexport function ArrayProp() {\n return (component: ComponentInterface, variableName: string) => {\n const {componentWillLoad} = component;\n\n const attributeWithBrackets = camelToKebab(variableName);\n\n component.componentWillLoad = function () {\n const value = this[variableName];\n if (!value || isArray(value)) {\n componentWillLoad?.call(this);\n return;\n }\n\n try {\n const valueAsArray = JSON.parse(value);\n if (isArray(valueAsArray)) {\n this[variableName] = valueAsArray;\n } else {\n console.error(\n `Property ${attributeWithBrackets} should be an array`,\n getElement(this)\n );\n }\n } catch (e) {\n console.error(\n `Error while parsing attribute ${attributeWithBrackets} as array`,\n e\n );\n }\n\n componentWillLoad?.call(this);\n };\n };\n}\n\nfunction splitAttributeValueOnCommas(attributeValue: string) {\n const splitButIgnoreEscapeSymbolsExpression = /(?:\\\\.|[^,])+/g;\n const [...valuesWithEscapeSymbols] =\n attributeValue.matchAll(splitButIgnoreEscapeSymbolsExpression) ?? [];\n\n const removeEscapeSymbolsExpression = /\\\\(.)/g;\n return valuesWithEscapeSymbols.map(([valuesWithEscapeSymbols]) =>\n valuesWithEscapeSymbols.replace(removeEscapeSymbolsExpression, '$1')\n );\n}\n\nexport function mapAttributesToProp(\n prefix: string,\n mapVariable: Record<string, string | string[]>,\n attributes: {name: string; value: string}[],\n splitValues: boolean\n) {\n const map = attributesToStringMap(prefix, attributes);\n Object.assign(\n mapVariable,\n splitValues ? stringMapToStringArrayMap(map) : map\n );\n}\n\nfunction stringMapToStringArrayMap(map: Record<string, string>) {\n return Object.entries(map).reduce(\n (acc, [key, value]) => ({\n // biome-ignore lint/performance/noAccumulatingSpread: <>\n ...acc,\n [key]: splitAttributeValueOnCommas(value).map((subValue) =>\n subValue.trim()\n ),\n }),\n {}\n );\n}\n\nfunction attributesToStringMap(\n prefix: string,\n attributes: {name: string; value: string}[]\n) {\n const mapVariable: Record<string, string> = {};\n const kebabPrefix = `${camelToKebab(prefix)}-`;\n for (let i = 0; i < attributes.length; i++) {\n const attribute = attributes[i];\n if (attribute.name.indexOf(kebabPrefix) !== 0) {\n continue;\n }\n\n const property = kebabToCamel(attribute.name.replace(kebabPrefix, ''));\n mapVariable[property] = `${attribute.value}`;\n }\n return mapVariable;\n}\n"],"mappings":"+HAyCgBA,EAAQC,GACtB,MAAO,CAACC,EAA+BC,KACrC,MAAMC,kBAACA,GAAqBF,EAC5B,IAAKE,EAAmB,CACtBC,QAAQC,MACN,iGAEF,M,CAGFJ,EAAUE,kBAAoB,WAC5B,MAAMG,EAASN,GAAMO,iBAAmBL,EACxC,MAAMM,EAAWC,KAAKP,GACtB,MAAMQ,EAAaC,EAAWF,MAAMC,WACpCE,EACEN,EACAE,EACAK,MAAMC,KAAKJ,GACXV,GAAMe,aAAe,OAEvBZ,EAAkBa,KAAKP,K,CACxB,CAEL,C,SAEgBQ,IACd,MAAO,CAAChB,EAA+BC,KACrC,MAAMC,kBAACA,GAAqBF,EAE5B,MAAMiB,EAAwBC,EAAajB,GAE3CD,EAAUE,kBAAoB,WAC5B,MAAMiB,EAAQX,KAAKP,GACnB,IAAKkB,GAASC,EAAQD,GAAQ,CAC5BjB,GAAmBa,KAAKP,MACxB,M,CAGF,IACE,MAAMa,EAAeC,KAAKC,MAAMJ,GAChC,GAAIC,EAAQC,GAAe,CACzBb,KAAKP,GAAgBoB,C,KAChB,CACLlB,QAAQC,MACN,YAAYa,uBACZP,EAAWF,M,EAGf,MAAOgB,GACPrB,QAAQC,MACN,iCAAiCa,aACjCO,E,CAIJtB,GAAmBa,KAAKP,K,CACzB,CAEL,CAEA,SAASiB,EAA4BC,GACnC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