@empathyco/x-components 6.0.0-alpha.2 → 6.0.0-alpha.20

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 (335) hide show
  1. package/CHANGELOG.md +202 -1
  2. package/core/index.js +1 -0
  3. package/core/index.js.map +1 -1
  4. package/design-system/deprecated-full-theme.css +1555 -1555
  5. package/docs/API-reference/api/x-adapter-platform.md +9 -0
  6. package/docs/API-reference/api/x-adapter-platform.platformadapter.relatedprompts.md +11 -0
  7. package/docs/API-reference/api/x-adapter-platform.platformrelatedprompt.md +22 -0
  8. package/docs/API-reference/api/x-adapter-platform.platformrelatedprompt.nextqueries.md +11 -0
  9. package/docs/API-reference/api/x-adapter-platform.platformrelatedprompt.suggestiontext.md +11 -0
  10. package/docs/API-reference/api/x-adapter-platform.platformrelatedprompt.type.md +11 -0
  11. package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptsrequest.md +15 -0
  12. package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptsresponse.data.md +13 -0
  13. package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptsresponse.md +21 -0
  14. package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptsresponse.status.md +11 -0
  15. package/docs/API-reference/api/x-adapter-platform.platformsearchresponse.catalog.md +6 -0
  16. package/docs/API-reference/api/x-adapter-platform.platformsearchresponse.md +1 -1
  17. package/docs/API-reference/api/x-adapter-platform.relatedpromptschema.md +13 -0
  18. package/docs/API-reference/api/x-adapter-platform.relatedpromptsendpointadapter.md +13 -0
  19. package/docs/API-reference/api/x-adapter-platform.relatedpromptsrequestmapper.md +13 -0
  20. package/docs/API-reference/api/x-adapter-platform.relatedpromptsrequestschema.md +13 -0
  21. package/docs/API-reference/api/x-adapter-platform.relatedpromptsresponsemapper.md +13 -0
  22. package/docs/API-reference/api/x-adapter-platform.relatedpromptsresponseschema.md +13 -0
  23. package/docs/API-reference/api/x-components.animationprop.md +6 -1
  24. package/docs/API-reference/api/x-components.bannerslist.md +3 -3
  25. package/docs/API-reference/api/x-components.basedropdown.md +5 -5
  26. package/docs/API-reference/api/x-components.baseeventsmodal.md +2 -2
  27. package/docs/API-reference/api/x-components.basegrid.md +3 -3
  28. package/docs/API-reference/api/x-components.baseheadertogglepanel.md +5 -5
  29. package/docs/API-reference/api/x-components.baseidmodal.md +2 -2
  30. package/docs/API-reference/api/x-components.baseidtogglepanel.md +5 -5
  31. package/docs/API-reference/api/x-components.basemodal.md +10 -10
  32. package/docs/API-reference/api/x-components.baseresultimage.md +9 -9
  33. package/docs/API-reference/api/x-components.baseslider.md +70 -0
  34. package/docs/API-reference/api/x-components.basesuggestions.md +3 -3
  35. package/docs/API-reference/api/x-components.basetabspanel.md +8 -8
  36. package/docs/API-reference/api/x-components.basetogglepanel.md +3 -3
  37. package/docs/API-reference/api/x-components.basevariablecolumngrid.md +3 -3
  38. package/docs/API-reference/api/x-components.cancelfetchandsaverelatedprompts.md +13 -0
  39. package/docs/API-reference/api/x-components.empathize.md +5 -5
  40. package/docs/API-reference/api/x-components.facets.md +3 -3
  41. package/docs/API-reference/api/x-components.fetchandsaverelatedprompts.md +13 -0
  42. package/docs/API-reference/api/x-components.fetchrelatedprompts.md +13 -0
  43. package/docs/API-reference/api/x-components.filterslist.md +3 -3
  44. package/docs/API-reference/api/x-components.globalxbus.md +6 -0
  45. package/docs/API-reference/api/x-components.hierarchicalfilter.md +5 -2
  46. package/docs/API-reference/api/x-components.identifierresults.md +3 -3
  47. package/docs/API-reference/api/x-components.itemslist.md +3 -3
  48. package/docs/API-reference/api/x-components.mainmodal.md +2 -2
  49. package/docs/API-reference/api/x-components.md +17 -0
  50. package/docs/API-reference/api/x-components.multicolumnmaxwidthlayout.md +5 -5
  51. package/docs/API-reference/api/x-components.myhistory.md +3 -3
  52. package/docs/API-reference/api/x-components.nextqueriesgroup.md +22 -0
  53. package/docs/API-reference/api/x-components.nextqueriesgroup.modelname.md +11 -0
  54. package/docs/API-reference/api/x-components.nextqueriesgroup.nextqueries.md +11 -0
  55. package/docs/API-reference/api/x-components.nextquerieslist.md +3 -3
  56. package/docs/API-reference/api/x-components.partialresultslist.md +3 -3
  57. package/docs/API-reference/api/x-components.promotedslist.md +3 -3
  58. package/docs/API-reference/api/x-components.querypreviewlist.md +3 -3
  59. package/docs/API-reference/api/x-components.recommendations.md +3 -3
  60. package/docs/API-reference/api/x-components.relatedprompt.md +38 -0
  61. package/docs/API-reference/api/x-components.relatedpromptrequest.md +13 -0
  62. package/docs/API-reference/api/x-components.relatedpromptsactioncontext.md +15 -0
  63. package/docs/API-reference/api/x-components.relatedpromptsactions.cancelfetchandsaverelatedprompts.md +17 -0
  64. package/docs/API-reference/api/x-components.relatedpromptsactions.fetchandsaverelatedprompts.md +24 -0
  65. package/docs/API-reference/api/x-components.relatedpromptsactions.fetchrelatedprompts.md +24 -0
  66. package/docs/API-reference/api/x-components.relatedpromptsactions.md +22 -0
  67. package/docs/API-reference/api/x-components.relatedpromptsgetters.md +20 -0
  68. package/docs/API-reference/api/x-components.relatedpromptsgetters.request.md +13 -0
  69. package/docs/API-reference/api/x-components.relatedpromptslist.md +72 -0
  70. package/docs/API-reference/api/x-components.relatedpromptsmutations.md +25 -0
  71. package/docs/API-reference/api/x-components.relatedpromptsmutations.resetrelatedpromptsstate.md +17 -0
  72. package/docs/API-reference/api/x-components.relatedpromptsmutations.setparams.md +24 -0
  73. package/docs/API-reference/api/x-components.relatedpromptsmutations.setrelatedpromptsproducts.md +24 -0
  74. package/docs/API-reference/api/x-components.relatedpromptsmutations.setselectedprompt.md +24 -0
  75. package/docs/API-reference/api/x-components.relatedpromptsmutations.setselectedquery.md +24 -0
  76. package/docs/API-reference/api/x-components.relatedpromptsstate.md +24 -0
  77. package/docs/API-reference/api/x-components.relatedpromptsstate.params.md +13 -0
  78. package/docs/API-reference/api/x-components.relatedpromptsstate.relatedprompts.md +13 -0
  79. package/docs/API-reference/api/x-components.relatedpromptsstate.selectedprompt.md +13 -0
  80. package/docs/API-reference/api/x-components.relatedpromptsstate.selectedquery.md +13 -0
  81. package/docs/API-reference/api/x-components.relatedpromptsxevents.md +22 -0
  82. package/docs/API-reference/api/x-components.relatedpromptsxevents.relatedpromptsrequestupdated.md +13 -0
  83. package/docs/API-reference/api/x-components.relatedpromptsxevents.userselectedarelatedprompt.md +13 -0
  84. package/docs/API-reference/api/x-components.relatedpromptsxevents.userselectedarelatedpromptquery.md +13 -0
  85. package/docs/API-reference/api/x-components.relatedpromptsxmodule.md +13 -0
  86. package/docs/API-reference/api/x-components.relatedpromptsxstoremodule.md +15 -0
  87. package/docs/API-reference/api/x-components.relatedtags.md +3 -3
  88. package/docs/API-reference/api/x-components.resultslist.md +3 -3
  89. package/docs/API-reference/api/x-components.scrolltotop.md +5 -5
  90. package/docs/API-reference/api/x-components.searchinputplaceholder.md +3 -3
  91. package/docs/API-reference/api/x-components.searchmutations.md +1 -0
  92. package/docs/API-reference/api/x-components.searchmutations.setstats.md +24 -0
  93. package/docs/API-reference/api/x-components.searchstate.md +1 -0
  94. package/docs/API-reference/api/x-components.searchstate.stats.md +13 -0
  95. package/docs/API-reference/api/x-components.selectedfilterslist.md +3 -3
  96. package/docs/API-reference/api/x-components.simplefilter.md +3 -0
  97. package/docs/API-reference/api/x-components.singlecolumnlayout.md +3 -3
  98. package/docs/API-reference/api/x-components.snippetcallbacks.md +3 -0
  99. package/docs/API-reference/api/x-components.snippetconfigextraparams.md +1 -1
  100. package/docs/API-reference/api/x-components.sortdropdown.md +1 -1
  101. package/docs/API-reference/api/x-components.tagging.md +17 -4
  102. package/docs/API-reference/api/x-components.usealiasapi.md +1 -0
  103. package/docs/API-reference/api/x-components.usealiasapi.pricestats.md +16 -0
  104. package/docs/API-reference/api/x-components.xeventstypes.md +3 -3
  105. package/docs/API-reference/api/x-components.xmodulestree.md +1 -0
  106. package/docs/API-reference/api/x-components.xmodulestree.relatedprompts.md +11 -0
  107. package/docs/API-reference/api/x-types.md +4 -0
  108. package/docs/API-reference/api/x-types.relatedprompt.md +23 -0
  109. package/docs/API-reference/api/x-types.relatedprompt.nextqueries.md +13 -0
  110. package/docs/API-reference/api/x-types.relatedprompt.suggestiontext.md +13 -0
  111. package/docs/API-reference/api/x-types.relatedprompt.type.md +13 -0
  112. package/docs/API-reference/api/x-types.relatedpromptsrequest.md +15 -0
  113. package/docs/API-reference/api/x-types.relatedpromptsresponse.md +20 -0
  114. package/docs/API-reference/api/x-types.relatedpromptsresponse.relatedprompts.md +11 -0
  115. package/docs/API-reference/api/x-types.searchresponse.md +1 -0
  116. package/docs/API-reference/api/x-types.searchresponse.stats.md +11 -0
  117. package/docs/API-reference/api/x-types.stats.md +22 -0
  118. package/docs/API-reference/api/x-types.stats.price.md +14 -0
  119. package/docs/API-reference/api/x-types.xcomponentsadapter.md +1 -0
  120. package/docs/API-reference/api/x-types.xcomponentsadapter.relatedprompts.md +11 -0
  121. package/docs/API-reference/components/common/result/x-components.base-result-image.md +2 -2
  122. package/docs/API-reference/components/common/x-components.base-slider.md +189 -0
  123. package/docs/API-reference/components/common/x-components.items-list.md +1 -1
  124. package/docs/API-reference/components/facets/x-components.facets/facets.md +1 -1
  125. package/docs/API-reference/components/facets/x-components.lists/selected-filters-list.md +1 -1
  126. package/docs/API-reference/components/related-prompts/x-components.related-prompt.md +29 -0
  127. package/docs/API-reference/components/related-prompts/x-components.related-prompts-list.md +196 -0
  128. package/docs/API-reference/components/search/x-components.results-list.md +1 -1
  129. package/docs/API-reference/components/tagging/x-components.tagging.md +2 -2
  130. package/js/components/base-grid.vue.js.map +1 -1
  131. package/js/components/base-grid.vue2.js.map +1 -1
  132. package/js/components/base-grid.vue3.js +1 -1
  133. package/js/components/base-slider.vue.js +66 -0
  134. package/js/components/base-slider.vue.js.map +1 -0
  135. package/js/components/base-slider.vue2.js +109 -0
  136. package/js/components/base-slider.vue2.js.map +1 -0
  137. package/js/components/base-slider.vue3.js +7 -0
  138. package/js/components/base-slider.vue3.js.map +1 -0
  139. package/js/components/icons/cross-tiny.vue.js +2 -2
  140. package/js/components/icons/plus.vue.js +2 -2
  141. package/js/components/items-list.vue.js.map +1 -1
  142. package/js/components/items-list.vue2.js +2 -2
  143. package/js/components/items-list.vue2.js.map +1 -1
  144. package/js/components/result/base-result-image.vue.js.map +1 -1
  145. package/js/components/result/base-result-image.vue2.js +3 -3
  146. package/js/components/result/base-result-image.vue2.js.map +1 -1
  147. package/js/components/scroll/use-scroll.js +1 -1
  148. package/js/components/scroll/use-scroll.js.map +1 -1
  149. package/js/components/sliding-panel.vue.js +2 -2
  150. package/js/composables/use-alias-api.js +3 -0
  151. package/js/composables/use-alias-api.js.map +1 -1
  152. package/js/index.js +10 -0
  153. package/js/index.js.map +1 -1
  154. package/js/types/animation-prop.js +5 -0
  155. package/js/types/animation-prop.js.map +1 -1
  156. package/js/x-modules/empathize/components/empathize.vue2.js +2 -0
  157. package/js/x-modules/empathize/components/empathize.vue2.js.map +1 -1
  158. package/js/x-modules/extra-params/components/snippet-config-extra-params.vue.js.map +1 -1
  159. package/js/x-modules/extra-params/components/snippet-config-extra-params.vue2.js +1 -1
  160. package/js/x-modules/extra-params/components/snippet-config-extra-params.vue2.js.map +1 -1
  161. package/js/x-modules/facets/components/facets/facets.vue.js.map +1 -1
  162. package/js/x-modules/facets/components/facets/facets.vue2.js +2 -2
  163. package/js/x-modules/facets/components/facets/facets.vue2.js.map +1 -1
  164. package/js/x-modules/facets/components/lists/selected-filters-list.vue.js.map +1 -1
  165. package/js/x-modules/facets/components/lists/selected-filters-list.vue2.js +2 -2
  166. package/js/x-modules/facets/components/lists/selected-filters-list.vue2.js.map +1 -1
  167. package/js/x-modules/queries-preview/components/query-preview-button.vue2.js +2 -0
  168. package/js/x-modules/queries-preview/components/query-preview-button.vue2.js.map +1 -1
  169. package/js/x-modules/queries-preview/components/query-preview-list.vue.js.map +1 -1
  170. package/js/x-modules/queries-preview/components/query-preview-list.vue2.js +15 -2
  171. package/js/x-modules/queries-preview/components/query-preview-list.vue2.js.map +1 -1
  172. package/js/x-modules/queries-preview/components/query-preview.vue.js.map +1 -1
  173. package/js/x-modules/queries-preview/components/query-preview.vue2.js +3 -1
  174. package/js/x-modules/queries-preview/components/query-preview.vue2.js.map +1 -1
  175. package/js/x-modules/queries-preview/store/actions/fetch-and-save-query-preview.action.js +2 -1
  176. package/js/x-modules/queries-preview/store/actions/fetch-and-save-query-preview.action.js.map +1 -1
  177. package/js/x-modules/queries-preview/store/module.js +1 -1
  178. package/js/x-modules/queries-preview/store/module.js.map +1 -1
  179. package/js/x-modules/queries-preview/utils/get-hash-from-query-preview.js +6 -4
  180. package/js/x-modules/queries-preview/utils/get-hash-from-query-preview.js.map +1 -1
  181. package/js/x-modules/related-prompts/components/related-prompt.vue.js +90 -0
  182. package/js/x-modules/related-prompts/components/related-prompt.vue.js.map +1 -0
  183. package/js/x-modules/related-prompts/components/related-prompt.vue2.js +54 -0
  184. package/js/x-modules/related-prompts/components/related-prompt.vue2.js.map +1 -0
  185. package/js/x-modules/related-prompts/components/related-prompt.vue3.js +7 -0
  186. package/js/x-modules/related-prompts/components/related-prompt.vue3.js.map +1 -0
  187. package/js/x-modules/related-prompts/components/related-prompts-list.vue.js +154 -0
  188. package/js/x-modules/related-prompts/components/related-prompts-list.vue.js.map +1 -0
  189. package/js/x-modules/related-prompts/components/related-prompts-list.vue2.js +6 -0
  190. package/js/x-modules/related-prompts/components/related-prompts-list.vue2.js.map +1 -0
  191. package/js/x-modules/related-prompts/store/actions/fetch-and-save-related-prompts.action.js +29 -0
  192. package/js/x-modules/related-prompts/store/actions/fetch-and-save-related-prompts.action.js.map +1 -0
  193. package/js/x-modules/related-prompts/store/actions/fetch-related-prompts.action.js +20 -0
  194. package/js/x-modules/related-prompts/store/actions/fetch-related-prompts.action.js.map +1 -0
  195. package/js/x-modules/related-prompts/store/emitters.js +14 -0
  196. package/js/x-modules/related-prompts/store/emitters.js.map +1 -0
  197. package/js/x-modules/related-prompts/store/getters/request.getter.js +16 -0
  198. package/js/x-modules/related-prompts/store/getters/request.getter.js.map +1 -0
  199. package/js/x-modules/related-prompts/store/module.js +53 -0
  200. package/js/x-modules/related-prompts/store/module.js.map +1 -0
  201. package/js/x-modules/related-prompts/wiring.js +88 -0
  202. package/js/x-modules/related-prompts/wiring.js.map +1 -0
  203. package/js/x-modules/related-prompts/x-module.js +21 -0
  204. package/js/x-modules/related-prompts/x-module.js.map +1 -0
  205. package/js/x-modules/scroll/components/scroll-to-top.vue2.js +2 -0
  206. package/js/x-modules/scroll/components/scroll-to-top.vue2.js.map +1 -1
  207. package/js/x-modules/search/components/results-list.vue.js +2 -2
  208. package/js/x-modules/search/components/results-list.vue.js.map +1 -1
  209. package/js/x-modules/search/store/actions/save-search-response.action.js +2 -1
  210. package/js/x-modules/search/store/actions/save-search-response.action.js.map +1 -1
  211. package/js/x-modules/search/store/module.js +5 -1
  212. package/js/x-modules/search/store/module.js.map +1 -1
  213. package/js/x-modules/tagging/components/tagging.vue.js +8 -2
  214. package/js/x-modules/tagging/components/tagging.vue.js.map +1 -1
  215. package/package.json +7 -6
  216. package/related-prompts/index.d.ts +1 -0
  217. package/related-prompts/index.js +9 -0
  218. package/report/x-adapter-platform.api.json +575 -1
  219. package/report/x-components.api.json +4236 -7917
  220. package/report/x-components.api.md +445 -155
  221. package/report/x-types.api.json +334 -0
  222. package/tools/inject-css.js +5 -3
  223. package/types/adapter/e2e-adapter.d.ts.map +1 -1
  224. package/types/adapter/mocked-responses.d.ts +3 -0
  225. package/types/adapter/mocked-responses.d.ts.map +1 -1
  226. package/types/components/base-dropdown.vue.d.ts +5 -5
  227. package/types/components/base-grid.vue.d.ts +3 -3
  228. package/types/components/base-slider.vue.d.ts +74 -0
  229. package/types/components/base-slider.vue.d.ts.map +1 -0
  230. package/types/components/base-variable-column-grid.vue.d.ts +3 -3
  231. package/types/components/global-x-bus.vue.d.ts +6 -0
  232. package/types/components/global-x-bus.vue.d.ts.map +1 -1
  233. package/types/components/index.d.ts +1 -0
  234. package/types/components/index.d.ts.map +1 -1
  235. package/types/components/items-list.vue.d.ts +3 -3
  236. package/types/components/layouts/multi-column-max-width-layout.vue.d.ts +5 -5
  237. package/types/components/layouts/single-column-layout.vue.d.ts +3 -3
  238. package/types/components/modals/base-events-modal.vue.d.ts +2 -2
  239. package/types/components/modals/base-id-modal.vue.d.ts +2 -2
  240. package/types/components/modals/base-modal.vue.d.ts +10 -10
  241. package/types/components/modals/main-modal.vue.d.ts +2 -2
  242. package/types/components/panels/base-header-toggle-panel.vue.d.ts +5 -5
  243. package/types/components/panels/base-id-toggle-panel.vue.d.ts +5 -5
  244. package/types/components/panels/base-tabs-panel.vue.d.ts +8 -8
  245. package/types/components/panels/base-toggle-panel.vue.d.ts +3 -3
  246. package/types/components/result/base-result-image.vue.d.ts +10 -10
  247. package/types/components/result/base-result-image.vue.d.ts.map +1 -1
  248. package/types/components/snippet-callbacks.vue.d.ts +3 -0
  249. package/types/components/snippet-callbacks.vue.d.ts.map +1 -1
  250. package/types/components/suggestions/base-suggestions.vue.d.ts +3 -3
  251. package/types/composables/use-alias-api.d.ts +5 -0
  252. package/types/composables/use-alias-api.d.ts.map +1 -1
  253. package/types/index.d.ts +1 -0
  254. package/types/index.d.ts.map +1 -1
  255. package/types/tailwind/plugin-options.d.ts +1 -2
  256. package/types/tailwind/plugin-options.d.ts.map +1 -1
  257. package/types/types/animation-prop.d.ts +6 -2
  258. package/types/types/animation-prop.d.ts.map +1 -1
  259. package/types/views/home/types.d.ts +3 -0
  260. package/types/views/home/types.d.ts.map +1 -1
  261. package/types/wiring/events.types.d.ts +3 -1
  262. package/types/wiring/events.types.d.ts.map +1 -1
  263. package/types/x-modules/empathize/components/empathize.vue.d.ts +5 -5
  264. package/types/x-modules/extra-params/components/snippet-config-extra-params.vue.d.ts +1 -1
  265. package/types/x-modules/facets/components/facets/facets.vue.d.ts +3 -3
  266. package/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts +5 -2
  267. package/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts.map +1 -1
  268. package/types/x-modules/facets/components/filters/simple-filter.vue.d.ts +3 -0
  269. package/types/x-modules/facets/components/filters/simple-filter.vue.d.ts.map +1 -1
  270. package/types/x-modules/facets/components/lists/filters-list.vue.d.ts +3 -3
  271. package/types/x-modules/facets/components/lists/selected-filters-list.vue.d.ts +3 -3
  272. package/types/x-modules/history-queries/components/my-history.vue.d.ts +3 -3
  273. package/types/x-modules/identifier-results/components/identifier-results.vue.d.ts +3 -3
  274. package/types/x-modules/next-queries/components/next-queries-list.vue.d.ts +3 -3
  275. package/types/x-modules/next-queries/index.d.ts +1 -0
  276. package/types/x-modules/next-queries/index.d.ts.map +1 -1
  277. package/types/x-modules/queries-preview/components/query-preview-list.vue.d.ts +3 -3
  278. package/types/x-modules/queries-preview/components/query-preview-list.vue.d.ts.map +1 -1
  279. package/types/x-modules/queries-preview/components/query-preview.vue.d.ts.map +1 -1
  280. package/types/x-modules/queries-preview/store/actions/fetch-and-save-query-preview.action.d.ts.map +1 -1
  281. package/types/x-modules/queries-preview/store/module.d.ts.map +1 -1
  282. package/types/x-modules/queries-preview/utils/get-hash-from-query-preview.d.ts +4 -2
  283. package/types/x-modules/queries-preview/utils/get-hash-from-query-preview.d.ts.map +1 -1
  284. package/types/x-modules/recommendations/components/recommendations.vue.d.ts +3 -3
  285. package/types/x-modules/related-prompts/components/index.d.ts +3 -0
  286. package/types/x-modules/related-prompts/components/index.d.ts.map +1 -0
  287. package/types/x-modules/related-prompts/components/related-prompt.vue.d.ts +37 -0
  288. package/types/x-modules/related-prompts/components/related-prompt.vue.d.ts.map +1 -0
  289. package/types/x-modules/related-prompts/components/related-prompts-list.vue.d.ts +106 -0
  290. package/types/x-modules/related-prompts/components/related-prompts-list.vue.d.ts.map +1 -0
  291. package/types/x-modules/related-prompts/events.types.d.ts +26 -0
  292. package/types/x-modules/related-prompts/events.types.d.ts.map +1 -0
  293. package/types/x-modules/related-prompts/index.d.ts +6 -0
  294. package/types/x-modules/related-prompts/index.d.ts.map +1 -0
  295. package/types/x-modules/related-prompts/store/actions/fetch-and-save-related-prompts.action.d.ts +17 -0
  296. package/types/x-modules/related-prompts/store/actions/fetch-and-save-related-prompts.action.d.ts.map +1 -0
  297. package/types/x-modules/related-prompts/store/actions/fetch-related-prompts.action.d.ts +13 -0
  298. package/types/x-modules/related-prompts/store/actions/fetch-related-prompts.action.d.ts.map +1 -0
  299. package/types/x-modules/related-prompts/store/emitters.d.ts +9 -0
  300. package/types/x-modules/related-prompts/store/emitters.d.ts.map +1 -0
  301. package/types/x-modules/related-prompts/store/getters/request.getter.d.ts +13 -0
  302. package/types/x-modules/related-prompts/store/getters/request.getter.d.ts.map +1 -0
  303. package/types/x-modules/related-prompts/store/index.d.ts +7 -0
  304. package/types/x-modules/related-prompts/store/index.d.ts.map +1 -0
  305. package/types/x-modules/related-prompts/store/module.d.ts +8 -0
  306. package/types/x-modules/related-prompts/store/module.d.ts.map +1 -0
  307. package/types/x-modules/related-prompts/store/types.d.ts +104 -0
  308. package/types/x-modules/related-prompts/store/types.d.ts.map +1 -0
  309. package/types/x-modules/related-prompts/types.d.ts +10 -0
  310. package/types/x-modules/related-prompts/types.d.ts.map +1 -0
  311. package/types/x-modules/related-prompts/wiring.d.ts +31 -0
  312. package/types/x-modules/related-prompts/wiring.d.ts.map +1 -0
  313. package/types/x-modules/related-prompts/x-module.d.ts +16 -0
  314. package/types/x-modules/related-prompts/x-module.d.ts.map +1 -0
  315. package/types/x-modules/related-tags/components/related-tags.vue.d.ts +3 -3
  316. package/types/x-modules/scroll/components/scroll-to-top.vue.d.ts +5 -5
  317. package/types/x-modules/search/components/banners-list.vue.d.ts +3 -3
  318. package/types/x-modules/search/components/partial-results-list.vue.d.ts +3 -3
  319. package/types/x-modules/search/components/promoteds-list.vue.d.ts +3 -3
  320. package/types/x-modules/search/components/results-list.vue.d.ts +3 -3
  321. package/types/x-modules/search/components/sort-dropdown.vue.d.ts +1 -1
  322. package/types/x-modules/search/store/actions/save-search-response.action.d.ts.map +1 -1
  323. package/types/x-modules/search/store/module.d.ts +2 -0
  324. package/types/x-modules/search/store/module.d.ts.map +1 -1
  325. package/types/x-modules/search/store/types.d.ts +9 -1
  326. package/types/x-modules/search/store/types.d.ts.map +1 -1
  327. package/types/x-modules/search-box/components/search-input-placeholder.vue.d.ts +3 -3
  328. package/types/x-modules/tagging/components/tagging.vue.d.ts +17 -4
  329. package/types/x-modules/tagging/components/tagging.vue.d.ts.map +1 -1
  330. package/types/x-modules/x-modules.types.d.ts +2 -0
  331. package/types/x-modules/x-modules.types.d.ts.map +1 -1
  332. package/js/utils/options-api.js +0 -4
  333. package/js/utils/options-api.js.map +0 -1
  334. package/types/utils/options-api.d.ts +0 -3
  335. package/types/utils/options-api.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"base-result-image.vue2.js","sources":["../../../../src/components/result/base-result-image.vue"],"sourcesContent":["<template>\n <!-- This is a div because using a picture causes the onload event of the image to fire twice. -->\n <!-- eslint-disable-next-line vuejs-accessibility/mouse-events-have-key-events -->\n <div\n @mouseenter.once=\"userHasHoveredImage = true\"\n @mouseenter=\"isHovering = true\"\n @mouseleave=\"isHovering = false\"\n class=\"x-result-picture x-picture\"\n data-test=\"result-picture\"\n >\n <img\n v-if=\"shouldLoadNextImage\"\n @load=\"flagImageLoaded\"\n @error=\"flagImageAsFailed\"\n loading=\"lazy\"\n :src=\"pendingImages[0]\"\n :style=\"loaderStyles\"\n class=\"x-picture-image\"\n data-test=\"result-picture-loader\"\n alt=\"\"\n role=\"presentation\"\n />\n <component :is=\"animation\" class=\"x-picture-image\" :appear=\"false\">\n <!-- @slot Fallback image content. It will be rendered when all the images failed -->\n <slot v-if=\"!loadedImages.length && !pendingImages.length\" name=\"fallback\" />\n\n <!-- @slot Loading image content. It will be rendered while the real image is not loaded -->\n <slot v-else-if=\"!loadedImages.length\" name=\"placeholder\" />\n\n <img\n v-else\n :key=\"imageSrc\"\n :alt=\"result.name\"\n :src=\"imageSrc\"\n class=\"x-result-picture-image\"\n data-test=\"result-picture-image\"\n />\n </component>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { Result } from '@empathyco/x-types';\n import { computed, DefineComponent, defineComponent, PropType, Ref, ref, watch } from 'vue';\n import { animationProp } from '../../utils/options-api';\n import { NoAnimation } from '../animations';\n\n /**\n * Component to be reused that renders an `<img>`.\n *\n * @public\n */\n export default defineComponent({\n name: 'BaseResultImage',\n props: {\n /** (Required) The {@link @empathyco/x-types#Result} information. */\n result: {\n type: Object as PropType<Result>,\n required: true\n },\n /**\n * Animation to use when switching between the placeholder, the loaded image, or the failed\n * image fallback.\n */\n loadAnimation: {\n type: animationProp,\n default: () => NoAnimation\n },\n /** Animation to use when switching between the loaded image and the hover image. */\n hoverAnimation: {\n type: animationProp\n },\n /**\n * Indicates if the next valid image should be displayed on hover.\n *\n * @public\n */\n showNextImageOnHover: {\n type: Boolean,\n default: false\n }\n },\n setup(props) {\n /**\n * Copy of the images of the result.\n *\n * It is used as a queue of images to load, once an image loads/fails to load, it is removed\n * from this array.\n *\n * @internal\n */\n const pendingImages: Ref<string[]> = ref([]);\n\n /**\n * Contains the images that have been loaded successfully.\n *\n * @internal\n */\n const loadedImages: Ref<string[]> = ref([]);\n\n /**\n * Indicates if the user is hovering the image.\n *\n * @internal\n */\n const isHovering = ref(false);\n\n /**\n * Indicates if the user has hovered the image.\n *\n * @internal\n */\n const userHasHoveredImage = ref(false);\n\n /**.\n * Styles to use inline in the image loader, to prevent override from CSS\n *\n * @internal\n */\n const loaderStyles: Partial<CSSStyleDeclaration> = {\n position: 'absolute !important',\n top: '0 !important',\n left: '0 !important',\n width: '100% !important',\n height: '100% !important',\n pointerEvents: 'none !important',\n visibility: 'hidden !important'\n };\n\n /**\n * Initializes images state and resets when the result's images change.\n *\n * @internal\n */\n watch(\n () => props.result.images,\n () => {\n pendingImages.value = [...(props.result.images ?? [])];\n loadedImages.value = pendingImages.value.filter(image =>\n loadedImages.value.includes(image)\n );\n },\n { immediate: true }\n );\n\n /**\n * Animation to be used.\n *\n * @returns The animation to be used, taking into account if the user has hovered the image.\n *\n * @internal\n */\n const animation = computed<DefineComponent | string>(() => {\n return userHasHoveredImage\n ? props.hoverAnimation ?? props.loadAnimation\n : props.loadAnimation;\n });\n\n /**\n * Gets the src from the result image.\n *\n * @returns The result image src.\n *\n * @internal\n */\n const imageSrc = computed<string>(() => {\n return loadedImages.value[\n !props.showNextImageOnHover || !isHovering.value ? 0 : loadedImages.value.length - 1\n ];\n });\n\n /**\n * Indicates if the loader should try to load the next image.\n *\n * @returns True if it should try to load the next image.\n *\n * @internal\n */\n const shouldLoadNextImage = computed<boolean>(() => {\n const numImagesToLoad = props.showNextImageOnHover && userHasHoveredImage ? 2 : 1;\n return !!pendingImages.value.length && loadedImages.value.length < numImagesToLoad;\n });\n\n /**\n * Sets an image as failed.\n *\n * @internal\n */\n const flagImageAsFailed = (): void => {\n pendingImages.value.shift();\n };\n\n /**\n * Sets an image as loaded.\n *\n * @internal\n */\n const flagImageLoaded = (): void => {\n const image = pendingImages.value.shift();\n if (image) {\n loadedImages.value.push(image);\n }\n };\n\n return {\n pendingImages,\n loadedImages,\n isHovering,\n userHasHoveredImage,\n loaderStyles,\n animation,\n imageSrc,\n shouldLoadNextImage,\n flagImageAsFailed,\n flagImageLoaded\n };\n }\n });\n</script>\n\n<style lang=\"css\" scoped>\n .x-result-picture {\n position: relative;\n min-width: 1px;\n min-height: 1px;\n }\n\n .x-result-picture-image {\n max-width: 100%;\n max-height: 100%;\n }\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\n### Basic example\n\nThis component is for the result image. It may be part of the search result page, recommendations or\nother section which needs to include results.\n\nThe result prop is required. It will render a `<img/>` with the result image:\n\n```vue\n<BaseResultImage :result=\"result\" />\n```\n\n### Showing the next image on hover\n\nIf a result has multiple images, it can show the next one on hover.\n\n```vue\n<BaseResultImage :result=\"result\" showNextImageOnHover />\n```\n\n### Customizing slots content\n\nFallback and placeholder contents can be customized.\n\nThe fallback slot allows you to replace the content of the fallback image.\n\nThe other slot is called `placeholder`, and allows you to set the image that its going to be\ndisplayed while the real one is loaded.\n\n```vue\n<BaseResultImage :result=\"result\">\n <template #placeholder>\n <img alt=\"Placeholder image\" src=\"./placeholder-image.svg\"/>\n </template>\n <template #fallback>\n <img alt=\"Fallback image\" src=\"./fallback-image.svg\"/>\n </template>\n</BaseResultImage>\n```\n\n### Customizing the animations\n\nTwo animations can be used this component.\n\nThe `loadAnimation` is used to transition between the placeholder, the fallback and the image.\n\nThe `hoverAnimation` is used to transition between the image and the hover image, if the\n`showNextImageOnHover` prop is `true`.\n\n`hoverAnimation` will default to `loadAnimation` if it is not provided.\n\n```vue\n<template>\n <BaseResultImage\n :result=\"result\"\n :loadAnimation=\"loadAnimation\"\n :hoverAnimation=\"hoverAnimation\"\n showNextImageOnHover\n />\n</template>\n\n<script>\n import { BaseResultImage } from '@empathyco/x-components';\n import { CrossFade, CollapseHeight } from '@empathyco/x-components/animations';\n\n export default {\n name: 'BaseResultImageAnimations',\n components: {\n BaseResultImage\n },\n data() {\n return {\n loadAnimation: CrossFade,\n hoverAnimation: CollapseHeight,\n result: {\n name: 'jacket',\n images: ['https://some-image', 'https://some-image-2']\n }\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":["NoAnimation"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA+CE;;;;AAIE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,iBAAiB;AACvB,IAAA,KAAK,EAAE;;AAEL,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,QAAQ,EAAE,IAAG;AACd,SAAA;AACD;;;AAGE;AACF,QAAA,aAAa,EAAE;AACb,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,OAAO,EAAE,MAAMA,WAAU;AAC1B,SAAA;;AAED,QAAA,cAAc,EAAE;AACd,YAAA,IAAI,EAAE,aAAY;AACnB,SAAA;AACD;;;;AAIE;AACF,QAAA,oBAAoB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AC5C,kBAAE,KAAK,CAAC,aAAa,CAAA;AACzB,SAAC,CAAC,CAAA;AAEF;;;;;;AAME;AACF,QAAA,MAAM,QAAS,GAAE,QAAQ,CAAS,MAAM;AACtC,YAAA,OAAO,YAAY,CAAC,KAAK,CACvB,CAAC,KAAK,CAAC,oBAAmB,IAAK,CAAC,UAAU,CAAC,KAAI,GAAI,CAAA,GAAI,YAAY,CAAC,KAAK,CAAC,SAAS,CAAA,CACpF,CAAA;AACH,SAAC,CAAC,CAAA;AAEF;;;;;;AAME;AACF,QAAA,MAAM,sBAAsB,QAAQ,CAAU,MAAM;AAClD,YAAA,MAAM,eAAgB,GAAE,KAAK,CAAC,oBAAmB,IAAK,mBAAkB,GAAI,CAAA,GAAI,CAAC,CAAA;AACjF,YAAA,OAAO,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,MAAO,IAAG,YAAY,CAAC,KAAK,CAAC,SAAS,eAAe,CAAA;AACpF,SAAC,CAAC,CAAA;AAEF;;;;AAIE;QACF,MAAM,iBAAgB,GAAI,MAAY;AACpC,YAAA,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;AAC7B,SAAC,CAAA;AAED;;;;AAIE;QACF,MAAM,eAAgB,GAAE,MAAY;YAClC,MAAM,KAAM,GAAE,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;AACzC,YAAA,IAAI,KAAK,EAAE;AACT,gBAAA,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAChC,aAAA;AACF,SAAC,CAAA;QAED,OAAO;YACL,aAAa;YACb,YAAY;YACZ,UAAU;YACV,mBAAmB;YACnB,YAAY;YACZ,SAAS;YACT,QAAQ;YACR,mBAAmB;YACnB,iBAAiB;YACjB,eAAc;SACf,CAAA;KACH;AACD,CAAA,CAAC;;;;"}
1
+ {"version":3,"file":"base-result-image.vue2.js","sources":["../../../../src/components/result/base-result-image.vue"],"sourcesContent":["<template>\n <!-- This is a div because using a picture causes the onload event of the image to fire twice. -->\n <!-- eslint-disable-next-line vuejs-accessibility/mouse-events-have-key-events -->\n <div\n @mouseenter.once=\"userHasHoveredImage = true\"\n @mouseenter=\"isHovering = true\"\n @mouseleave=\"isHovering = false\"\n class=\"x-result-picture x-picture\"\n data-test=\"result-picture\"\n >\n <img\n v-if=\"shouldLoadNextImage\"\n @load=\"flagImageLoaded\"\n @error=\"flagImageAsFailed\"\n loading=\"lazy\"\n :src=\"pendingImages[0]\"\n :style=\"loaderStyles\"\n class=\"x-picture-image\"\n data-test=\"result-picture-loader\"\n alt=\"\"\n role=\"presentation\"\n />\n <component :is=\"animation\" class=\"x-picture-image\" :appear=\"false\">\n <!-- @slot Fallback image content. It will be rendered when all the images failed -->\n <slot v-if=\"!loadedImages.length && !pendingImages.length\" name=\"fallback\" />\n\n <!-- @slot Loading image content. It will be rendered while the real image is not loaded -->\n <slot v-else-if=\"!loadedImages.length\" name=\"placeholder\" />\n\n <img\n v-else\n :key=\"imageSrc\"\n :alt=\"result.name\"\n :src=\"imageSrc\"\n class=\"x-result-picture-image\"\n data-test=\"result-picture-image\"\n />\n </component>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { Result } from '@empathyco/x-types';\n import { computed, defineComponent, PropType, Ref, ref, watch } from 'vue';\n import { NoAnimation } from '../animations';\n import { AnimationProp } from '../../types';\n\n /**\n * Component to be reused that renders an `<img>`.\n *\n * @public\n */\n export default defineComponent({\n name: 'BaseResultImage',\n props: {\n /** (Required) The {@link @empathyco/x-types#Result} information. */\n result: {\n type: Object as PropType<Result>,\n required: true\n },\n /**\n * Animation to use when switching between the placeholder, the loaded image, or the failed\n * image fallback.\n */\n loadAnimation: {\n type: AnimationProp,\n default: () => NoAnimation\n },\n /** Animation to use when switching between the loaded image and the hover image. */\n hoverAnimation: {\n type: AnimationProp\n },\n /**\n * Indicates if the next valid image should be displayed on hover.\n *\n * @public\n */\n showNextImageOnHover: {\n type: Boolean,\n default: false\n }\n },\n setup(props) {\n /**\n * Copy of the images of the result.\n *\n * It is used as a queue of images to load, once an image loads/fails to load, it is removed\n * from this array.\n *\n * @internal\n */\n const pendingImages: Ref<string[]> = ref([]);\n\n /**\n * Contains the images that have been loaded successfully.\n *\n * @internal\n */\n const loadedImages: Ref<string[]> = ref([]);\n\n /**\n * Indicates if the user is hovering the image.\n *\n * @internal\n */\n const isHovering = ref(false);\n\n /**\n * Indicates if the user has hovered the image.\n *\n * @internal\n */\n const userHasHoveredImage = ref(false);\n\n /**.\n * Styles to use inline in the image loader, to prevent override from CSS\n *\n * @internal\n */\n const loaderStyles: Partial<CSSStyleDeclaration> = {\n position: 'absolute !important',\n top: '0 !important',\n left: '0 !important',\n width: '100% !important',\n height: '100% !important',\n pointerEvents: 'none !important',\n visibility: 'hidden !important'\n };\n\n /**\n * Initializes images state and resets when the result's images change.\n *\n * @internal\n */\n watch(\n () => props.result.images,\n () => {\n pendingImages.value = [...(props.result.images ?? [])];\n loadedImages.value = pendingImages.value.filter(image =>\n loadedImages.value.includes(image)\n );\n },\n { immediate: true }\n );\n\n /**\n * Animation to be used.\n *\n * @returns The animation to be used, taking into account if the user has hovered the image.\n *\n * @internal\n */\n const animation = computed(() => {\n return userHasHoveredImage\n ? props.hoverAnimation ?? props.loadAnimation\n : props.loadAnimation;\n });\n\n /**\n * Gets the src from the result image.\n *\n * @returns The result image src.\n *\n * @internal\n */\n const imageSrc = computed(() => {\n return loadedImages.value[\n !props.showNextImageOnHover || !isHovering.value ? 0 : loadedImages.value.length - 1\n ];\n });\n\n /**\n * Indicates if the loader should try to load the next image.\n *\n * @returns True if it should try to load the next image.\n *\n * @internal\n */\n const shouldLoadNextImage = computed(() => {\n const numImagesToLoad = props.showNextImageOnHover && userHasHoveredImage ? 2 : 1;\n return !!pendingImages.value.length && loadedImages.value.length < numImagesToLoad;\n });\n\n /**\n * Sets an image as failed.\n *\n * @internal\n */\n const flagImageAsFailed = () => {\n pendingImages.value.shift();\n };\n\n /**\n * Sets an image as loaded.\n *\n * @internal\n */\n const flagImageLoaded = () => {\n const image = pendingImages.value.shift();\n if (image) {\n loadedImages.value.push(image);\n }\n };\n\n return {\n pendingImages,\n loadedImages,\n isHovering,\n userHasHoveredImage,\n loaderStyles,\n animation,\n imageSrc,\n shouldLoadNextImage,\n flagImageAsFailed,\n flagImageLoaded\n };\n }\n });\n</script>\n\n<style lang=\"css\" scoped>\n .x-result-picture {\n position: relative;\n min-width: 1px;\n min-height: 1px;\n }\n\n .x-result-picture-image {\n max-width: 100%;\n max-height: 100%;\n }\n</style>\n\n<docs lang=\"mdx\">\n## Examples\n\n### Basic example\n\nThis component is for the result image. It may be part of the search result page, recommendations or\nother section which needs to include results.\n\nThe result prop is required. It will render a `<img/>` with the result image:\n\n```vue\n<BaseResultImage :result=\"result\" />\n```\n\n### Showing the next image on hover\n\nIf a result has multiple images, it can show the next one on hover.\n\n```vue\n<BaseResultImage :result=\"result\" showNextImageOnHover />\n```\n\n### Customizing slots content\n\nFallback and placeholder contents can be customized.\n\nThe fallback slot allows you to replace the content of the fallback image.\n\nThe other slot is called `placeholder`, and allows you to set the image that its going to be\ndisplayed while the real one is loaded.\n\n```vue\n<BaseResultImage :result=\"result\">\n <template #placeholder>\n <img alt=\"Placeholder image\" src=\"./placeholder-image.svg\"/>\n </template>\n <template #fallback>\n <img alt=\"Fallback image\" src=\"./fallback-image.svg\"/>\n </template>\n</BaseResultImage>\n```\n\n### Customizing the animations\n\nTwo animations can be used this component.\n\nThe `loadAnimation` is used to transition between the placeholder, the fallback and the image.\n\nThe `hoverAnimation` is used to transition between the image and the hover image, if the\n`showNextImageOnHover` prop is `true`.\n\n`hoverAnimation` will default to `loadAnimation` if it is not provided.\n\n```vue\n<template>\n <BaseResultImage\n :result=\"result\"\n :loadAnimation=\"loadAnimation\"\n :hoverAnimation=\"hoverAnimation\"\n showNextImageOnHover\n />\n</template>\n\n<script>\n import { BaseResultImage } from '@empathyco/x-components';\n import { CrossFade, CollapseHeight } from '@empathyco/x-components/animations';\n\n export default {\n name: 'BaseResultImageAnimations',\n components: {\n BaseResultImage\n },\n data() {\n return {\n loadAnimation: CrossFade,\n hoverAnimation: CollapseHeight,\n result: {\n name: 'jacket',\n images: ['https://some-image', 'https://some-image-2']\n }\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":["NoAnimation"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA+CE;;;;AAIE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,iBAAiB;AACvB,IAAA,KAAK,EAAE;;AAEL,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,QAAQ,EAAE,IAAG;AACd,SAAA;AACD;;;AAGE;AACF,QAAA,aAAa,EAAE;AACb,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,OAAO,EAAE,MAAMA,WAAU;AAC1B,SAAA;;AAED,QAAA,cAAc,EAAE;AACd,YAAA,IAAI,EAAE,aAAY;AACnB,SAAA;AACD;;;;AAIE;AACF,QAAA,oBAAoB,EAAE;AACpB,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,KAAI;AACf,SAAA;AACD,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT;;;;;;;AAOE;AACF,QAAA,MAAM,aAAa,GAAkB,GAAG,CAAC,EAAE,CAAC,CAAA;AAE5C;;;;AAIE;AACF,QAAA,MAAM,YAAY,GAAkB,GAAG,CAAC,EAAE,CAAC,CAAA;AAE3C;;;;AAIE;AACF,QAAA,MAAM,UAAW,GAAE,GAAG,CAAC,KAAK,CAAC,CAAA;AAE7B;;;;AAIE;AACF,QAAA,MAAM,sBAAsB,GAAG,CAAC,KAAK,CAAC,CAAA;AAEtC;;;;AAIE;AACF,QAAA,MAAM,YAAY,GAAiC;AACjD,YAAA,QAAQ,EAAE,qBAAqB;AAC/B,YAAA,GAAG,EAAE,cAAc;AACnB,YAAA,IAAI,EAAE,cAAc;AACpB,YAAA,KAAK,EAAE,iBAAiB;AACxB,YAA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A;AAEF;;;;AAIE;QACF,MAAM,iBAAgB,GAAI,MAAM;AAC9B,YAAA,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;AAC7B,SAAC,CAAA;AAED;;;;AAIE;QACF,MAAM,kBAAkB,MAAM;YAC5B,MAAM,KAAM,GAAE,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;AACzC,YAAA,IAAI,KAAK,EAAE;AACT,gBAAA,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAChC,aAAA;AACF,SAAC,CAAA;QAED,OAAO;YACL,aAAa;YACb,YAAY;YACZ,UAAU;YACV,mBAAmB;YACnB,YAAY;YACZ,SAAS;YACT,QAAQ;YACR,mBAAmB;YACnB,iBAAiB;YACjB,eAAc;SACf,CAAA;KACH;AACD,CAAA,CAAC;;;;"}
@@ -67,9 +67,9 @@ function useScroll(props, { emit }, scrollEl) {
67
67
  */
68
68
  const storeScrollData = () => {
69
69
  if (scrollEl.value) {
70
- currentPosition.value = scrollEl.value.scrollTop;
71
70
  scrollHeight.value = scrollEl.value.scrollHeight;
72
71
  clientHeight.value = scrollEl.value.clientHeight;
72
+ currentPosition.value = scrollEl.value.scrollTop;
73
73
  }
74
74
  };
75
75
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"use-scroll.js","sources":["../../../../src/components/scroll/use-scroll.ts"],"sourcesContent":["import { computed, nextTick, onMounted, Ref, ref, SetupContext, watch } from 'vue';\nimport { isArray } from '@empathyco/x-utils';\nimport { XEvent } from '../../wiring/events.types';\nimport { throttle } from '../../utils/throttle';\nimport { use$x } from '../../composables/use-$x';\nimport { ScrollDirection } from './scroll.types';\n\n/**\n * Composable to share Scroll logic.\n *\n * @param props - Composable props.\n * @param context - Component setup context.\n * @param scrollEl - The scrolling container reference.\n * @returns A throttled version of the function to store the scroll data.\n * @public\n */\nexport function useScroll(\n props: {\n /**\n * Distance to the end of the scroll that when reached will emit the\n * `scroll:about-to-end` event.\n *\n * @public\n */\n distanceToBottom: number;\n /**\n * Positive vertical distance to still consider that the element is the first one visible.\n * For example, if set to 100, after scrolling 100 pixels, the first rendered element\n * will still be considered the first one.\n */\n firstElementThresholdPx: number;\n /**\n * Time duration to ignore the subsequent scroll events after an emission.\n * Higher values will decrease events precision but can prevent performance issues.\n *\n * @public\n */\n throttleMs: number;\n /**\n * If true (default), sets the scroll position to the top when certain events are emitted.\n *\n * @public\n */\n resetOnChange: boolean;\n /**\n * List of events that should reset the scroll when emitted.\n *\n * @public\n */\n resetOn: XEvent | XEvent[];\n },\n { emit }: SetupContext<any>,\n scrollEl: Ref<HTMLElement | undefined>\n) {\n /**\n * Property for getting the client height of scroll.\n *\n * @internal\n */\n const clientHeight = ref(0);\n\n /**\n * Property for getting the current position of scroll.\n *\n * @internal\n */\n const currentPosition = ref(0);\n\n /**\n * Property for getting the previous position of scroll.\n *\n * @internal\n */\n const previousPosition = ref(0);\n\n /**\n * Property for getting the scroll height.\n *\n * @internal\n */\n const scrollHeight = ref(0);\n /**\n * Flag to know if the property clientHeight is changing or gets the final value.\n *\n * @internal\n */\n const isClientHeightChanging = ref(false);\n\n /**\n * Property for setting the direction of scroll.\n *\n * @internal\n */\n const scrollDirection: Ref<ScrollDirection> = ref('UP');\n\n /**\n * Restores the clientHeight flag when clientHeight property stops changing.\n * Also sets a new previous position, before update the current one.\n *\n * @internal\n */\n const restoreClientHeightFlag = (): void => {\n isClientHeightChanging.value = false;\n previousPosition.value = currentPosition.value;\n };\n\n const throtteledCall = throttle(restoreClientHeightFlag, 100);\n\n /**\n * Updates scroll related properties.\n *\n * @internal\n */\n const storeScrollData = () => {\n if (scrollEl.value) {\n currentPosition.value = scrollEl.value.scrollTop;\n scrollHeight.value = scrollEl.value.scrollHeight;\n clientHeight.value = scrollEl.value.clientHeight;\n }\n };\n\n /**\n * Throttled version of the function that stores the DOM scroll related properties.\n * The duration of the throttle is configured through the `throttleMs` prop passed as parameter.\n *\n * @returns A throttled version of the function to store the scroll data.\n * @internal\n */\n const throttledStoreScrollData = computed(() => throttle(storeScrollData, props.throttleMs));\n\n /**\n * Returns end position of scroll.\n *\n * @returns A number for knowing end position of scroll.\n * @internal\n */\n const scrollEndPosition = computed(() => scrollHeight.value - clientHeight.value);\n\n /**\n * Returns distance missing to endPosition position.\n *\n * @returns A number for knowing the distance missing to endPosition position.\n * @internal\n */\n const distanceToEnd = computed(() => scrollEndPosition.value - currentPosition.value);\n\n /**\n * Returns `true` when there is no more content to scroll.\n *\n * @returns A boolean for knowing if the user scrolls to the end.\n * @internal\n */\n const hasScrollReachedEnd = computed(() => currentPosition.value === scrollEndPosition.value);\n\n /**\n * Returns `true` when the scroll is at the initial position.\n *\n * @returns A boolean for knowing if the user scrolls to the start.\n * @internal\n */\n const hasScrollReachedStart = computed(() => currentPosition.value === 0);\n\n /**\n * Returns `true` when the amount of pixels scrolled is greater than\n * the `distanceToBottom` prop passed as parameter.\n *\n * @returns A boolean for knowing if the user is about to reaching to the end.\n * @internal\n */\n const hasScrollAlmostReachedEnd = computed(\n () => !hasScrollReachedStart.value && props.distanceToBottom > distanceToEnd.value\n );\n\n onMounted(() => {\n nextTick().then(() => {\n if (!scrollEl.value) {\n // TODO Replace with Empathy's logger\n // eslint-disable-next-line no-console\n console.warn(\n '[useScroll]',\n // eslint-disable-next-line max-len\n 'Components using this composable must pass `scrollEl` as the HTML node that is scrolling.'\n );\n } else {\n storeScrollData();\n }\n });\n });\n\n /**\n * Change the isClientHeightChanging flag when the property clientHeight is changing and\n * calls throttleledCall method.\n *\n * @internal\n */\n watch(\n clientHeight,\n () => {\n isClientHeightChanging.value = true;\n\n throtteledCall();\n },\n { immediate: true }\n );\n\n /**\n * Emits the `scroll` event.\n *\n * @param _newScrollPosition - The new position of scroll.\n * @param oldScrollPosition - The old position of scroll.\n * @internal\n */\n watch(currentPosition, (_newScrollPosition: number, oldScrollPosition: number) => {\n emit('scroll', currentPosition.value);\n previousPosition.value = oldScrollPosition;\n });\n\n /**\n * Sets direction of scroll based in {@link ScrollDirection} when the current position\n * has changed.\n *\n * @internal\n */\n watch(currentPosition, () => {\n if (!isClientHeightChanging.value && currentPosition.value !== previousPosition.value) {\n scrollDirection.value = currentPosition.value > previousPosition.value ? 'DOWN' : 'UP';\n }\n });\n\n /**\n * Emits the 'scroll:almost-at-end' event when the user is about to reach to end.\n *\n * @param isScrollAlmostAtEnd - For knowing if the user is about to reach to end.\n * @internal\n */\n watch(hasScrollReachedStart, (isScrollAtStart: boolean) => {\n emit('scroll:at-start', isScrollAtStart);\n });\n\n /**\n * Sets direction of scroll based in {@link ScrollDirection} when the current position\n * has changed.\n *\n * @internal\n */\n watch(hasScrollAlmostReachedEnd, (isScrollAlmostAtEnd: boolean) => {\n emit('scroll:almost-at-end', isScrollAlmostAtEnd);\n });\n\n /**\n * Emits the 'scroll:at-end' event when the user reaches the end.\n *\n * @param isScrollAtEnd - For knowing if the user reaches at end.\n * @internal\n */\n watch(hasScrollReachedEnd, (isScrollAtEnd: boolean) => {\n emit('scroll:at-end', isScrollAtEnd);\n });\n\n /**\n * Emits the `scroll:direction-change` event when the scrolling direction has changed.\n *\n * @param direction - The new direction of scroll.\n * @internal\n */\n watch(scrollDirection, (direction: ScrollDirection) => {\n if (!isClientHeightChanging.value) {\n emit('scroll:direction-change', direction);\n }\n });\n\n /**\n * Resets the scroll position.\n *\n * @internal\n */\n const $x = use$x();\n const resetOnEvents = isArray(props.resetOn) ? props.resetOn : [props.resetOn];\n resetOnEvents.forEach(event =>\n $x.on(event, false).subscribe(() =>\n nextTick().then(() => {\n if (props.resetOnChange) {\n scrollEl.value?.scrollTo({ top: 0 });\n }\n })\n )\n );\n\n return { throttledStoreScrollData };\n}\n"],"names":[],"mappings":";;;;;AAOA;;;;;;;;AAQG;AACG,SAAU,SAAS,CACvB,KAiCC,EACD,EAAE,IAAI,EAAqB,EAC3B,QAAsC,EAAA;AAEtC;;;;AAIG;AACH,IAAA,MAAM,YAAY,GAAG,GAAG,CAAC,CAAC,CAAC,CA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EAAE,KAAK,CAAC,CAAC,SAAS,CAAC,MAC5B,QAAQ,EAAE,CAAC,IAAI,CAAC,MAAK;QACnB,IAAI,KAAK,CAAC,aAAa,EAAE;YACvB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;AACtC,SAAA;KACF,CAAC,CACH,CACF,CAAC;IAEF,OAAO,EAAE,wBAAwB,EAAE,CAAC;AACtC;;;;"}
1
+ {"version":3,"file":"use-scroll.js","sources":["../../../../src/components/scroll/use-scroll.ts"],"sourcesContent":["import { computed, nextTick, onMounted, Ref, ref, SetupContext, watch } from 'vue';\nimport { isArray } from '@empathyco/x-utils';\nimport { XEvent } from '../../wiring/events.types';\nimport { throttle } from '../../utils/throttle';\nimport { use$x } from '../../composables/use-$x';\nimport { ScrollDirection } from './scroll.types';\n\n/**\n * Composable to share Scroll logic.\n *\n * @param props - Composable props.\n * @param context - Component setup context.\n * @param scrollEl - The scrolling container reference.\n * @returns A throttled version of the function to store the scroll data.\n * @public\n */\nexport function useScroll(\n props: {\n /**\n * Distance to the end of the scroll that when reached will emit the\n * `scroll:about-to-end` event.\n *\n * @public\n */\n distanceToBottom: number;\n /**\n * Positive vertical distance to still consider that the element is the first one visible.\n * For example, if set to 100, after scrolling 100 pixels, the first rendered element\n * will still be considered the first one.\n */\n firstElementThresholdPx: number;\n /**\n * Time duration to ignore the subsequent scroll events after an emission.\n * Higher values will decrease events precision but can prevent performance issues.\n *\n * @public\n */\n throttleMs: number;\n /**\n * If true (default), sets the scroll position to the top when certain events are emitted.\n *\n * @public\n */\n resetOnChange: boolean;\n /**\n * List of events that should reset the scroll when emitted.\n *\n * @public\n */\n resetOn: XEvent | XEvent[];\n },\n { emit }: SetupContext<any>,\n scrollEl: Ref<HTMLElement | undefined>\n) {\n /**\n * Property for getting the client height of scroll.\n *\n * @internal\n */\n const clientHeight = ref(0);\n\n /**\n * Property for getting the current position of scroll.\n *\n * @internal\n */\n const currentPosition = ref(0);\n\n /**\n * Property for getting the previous position of scroll.\n *\n * @internal\n */\n const previousPosition = ref(0);\n\n /**\n * Property for getting the scroll height.\n *\n * @internal\n */\n const scrollHeight = ref(0);\n /**\n * Flag to know if the property clientHeight is changing or gets the final value.\n *\n * @internal\n */\n const isClientHeightChanging = ref(false);\n\n /**\n * Property for setting the direction of scroll.\n *\n * @internal\n */\n const scrollDirection: Ref<ScrollDirection> = ref('UP');\n\n /**\n * Restores the clientHeight flag when clientHeight property stops changing.\n * Also sets a new previous position, before update the current one.\n *\n * @internal\n */\n const restoreClientHeightFlag = (): void => {\n isClientHeightChanging.value = false;\n previousPosition.value = currentPosition.value;\n };\n\n const throtteledCall = throttle(restoreClientHeightFlag, 100);\n\n /**\n * Updates scroll related properties.\n *\n * @internal\n */\n const storeScrollData = () => {\n if (scrollEl.value) {\n scrollHeight.value = scrollEl.value.scrollHeight;\n clientHeight.value = scrollEl.value.clientHeight;\n currentPosition.value = scrollEl.value.scrollTop;\n }\n };\n\n /**\n * Throttled version of the function that stores the DOM scroll related properties.\n * The duration of the throttle is configured through the `throttleMs` prop passed as parameter.\n *\n * @returns A throttled version of the function to store the scroll data.\n * @internal\n */\n const throttledStoreScrollData = computed(() => throttle(storeScrollData, props.throttleMs));\n\n /**\n * Returns end position of scroll.\n *\n * @returns A number for knowing end position of scroll.\n * @internal\n */\n const scrollEndPosition = computed(() => scrollHeight.value - clientHeight.value);\n\n /**\n * Returns distance missing to endPosition position.\n *\n * @returns A number for knowing the distance missing to endPosition position.\n * @internal\n */\n const distanceToEnd = computed(() => scrollEndPosition.value - currentPosition.value);\n\n /**\n * Returns `true` when there is no more content to scroll.\n *\n * @returns A boolean for knowing if the user scrolls to the end.\n * @internal\n */\n const hasScrollReachedEnd = computed(() => currentPosition.value === scrollEndPosition.value);\n\n /**\n * Returns `true` when the scroll is at the initial position.\n *\n * @returns A boolean for knowing if the user scrolls to the start.\n * @internal\n */\n const hasScrollReachedStart = computed(() => currentPosition.value === 0);\n\n /**\n * Returns `true` when the amount of pixels scrolled is greater than\n * the `distanceToBottom` prop passed as parameter.\n *\n * @returns A boolean for knowing if the user is about to reaching to the end.\n * @internal\n */\n const hasScrollAlmostReachedEnd = computed(\n () => !hasScrollReachedStart.value && props.distanceToBottom > distanceToEnd.value\n );\n\n onMounted(() => {\n nextTick().then(() => {\n if (!scrollEl.value) {\n // TODO Replace with Empathy's logger\n // eslint-disable-next-line no-console\n console.warn(\n '[useScroll]',\n // eslint-disable-next-line max-len\n 'Components using this composable must pass `scrollEl` as the HTML node that is scrolling.'\n );\n } else {\n storeScrollData();\n }\n });\n });\n\n /**\n * Change the isClientHeightChanging flag when the property clientHeight is changing and\n * calls throttleledCall method.\n *\n * @internal\n */\n watch(\n clientHeight,\n () => {\n isClientHeightChanging.value = true;\n\n throtteledCall();\n },\n { immediate: true }\n );\n\n /**\n * Emits the `scroll` event.\n *\n * @param _newScrollPosition - The new position of scroll.\n * @param oldScrollPosition - The old position of scroll.\n * @internal\n */\n watch(currentPosition, (_newScrollPosition: number, oldScrollPosition: number) => {\n emit('scroll', currentPosition.value);\n previousPosition.value = oldScrollPosition;\n });\n\n /**\n * Sets direction of scroll based in {@link ScrollDirection} when the current position\n * has changed.\n *\n * @internal\n */\n watch(currentPosition, () => {\n if (!isClientHeightChanging.value && currentPosition.value !== previousPosition.value) {\n scrollDirection.value = currentPosition.value > previousPosition.value ? 'DOWN' : 'UP';\n }\n });\n\n /**\n * Emits the 'scroll:almost-at-end' event when the user is about to reach to end.\n *\n * @param isScrollAlmostAtEnd - For knowing if the user is about to reach to end.\n * @internal\n */\n watch(hasScrollReachedStart, (isScrollAtStart: boolean) => {\n emit('scroll:at-start', isScrollAtStart);\n });\n\n /**\n * Sets direction of scroll based in {@link ScrollDirection} when the current position\n * has changed.\n *\n * @internal\n */\n watch(hasScrollAlmostReachedEnd, (isScrollAlmostAtEnd: boolean) => {\n emit('scroll:almost-at-end', isScrollAlmostAtEnd);\n });\n\n /**\n * Emits the 'scroll:at-end' event when the user reaches the end.\n *\n * @param isScrollAtEnd - For knowing if the user reaches at end.\n * @internal\n */\n watch(hasScrollReachedEnd, (isScrollAtEnd: boolean) => {\n emit('scroll:at-end', isScrollAtEnd);\n });\n\n /**\n * Emits the `scroll:direction-change` event when the scrolling direction has changed.\n *\n * @param direction - The new direction of scroll.\n * @internal\n */\n watch(scrollDirection, (direction: ScrollDirection) => {\n if (!isClientHeightChanging.value) {\n emit('scroll:direction-change', direction);\n }\n });\n\n /**\n * Resets the scroll position.\n *\n * @internal\n */\n const $x = use$x();\n const resetOnEvents = isArray(props.resetOn) ? props.resetOn : [props.resetOn];\n resetOnEvents.forEach(event =>\n $x.on(event, false).subscribe(() =>\n nextTick().then(() => {\n if (props.resetOnChange) {\n scrollEl.value?.scrollTo({ top: 0 });\n }\n })\n )\n );\n\n return { throttledStoreScrollData };\n}\n"],"names":[],"mappings":";;;;;AAOA;;;;;;;;AAQG;AACG,SAAU,SAAS,CACvB,KAiCC,EACD,EAAE,IAAI,EAAqB,EAC3B,QAAsC,EAAA;AAEtC;;;;AAIG;AACH,IAAA,MAAM,YAAY,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;AAE5B;;;;AAIG;AACH,IAAA,MAAM,eAAe,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;AAE/B;;;;AAIG;AACH,IAAA,MAAM,gBAAgB,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;AAEhC;;;;AAIG;AACH,IAAA,MAAM,YAAY,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;AAC5B;;;;AAIG;AACH,IAAA,MAAM,sBAAsB,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC;AAE1C;;;;AAIG;AACH,IAAA,MAAM,eAAe,GAAyB,GAAG,CAAC,IAAI,CAAC,CAAC;AAExD;;;;;AAKG;IACH,MAAM,uBAAuB,GAAG,MAAW;AACzC,QAAA,sBAAsB,CAAC,KAAK,GAAG,KAAK,CAAC;AACrC,QAAA,gBA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AC,mBAA4B,KAAI;AAChE,QAAA,IAAI,CAAC,sBAAsB,EAAE,mBAAmB,CAAC,CAAC;AACpD,KAAC,CAAC,CAAC;AAEH;;;;;AAKG;AACH,IAAA,KAAK,CAAC,mBAAmB,EAAE,CAAC,aAAsB,KAAI;AACpD,QAAA,IAAI,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;AACvC,KAAC,CAAC,CAAC;AAEH;;;;;AAKG;AACH,IAAA,KAAK,CAAC,eAAe,EAAE,CAAC,SAA0B,KAAI;AACpD,QAAA,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE;AACjC,YAAA,IAAI,CAAC,yBAAyB,EAAE,SAAS,CAAC,CAAC;AAC5C,SAAA;AACH,KAAC,CAAC,CAAC;AAEH;;;;AAIG;AACH,IAAA,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;IACnB,MAAM,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,OAAO,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC/E,aAAa,CAAC,OAAO,CAAC,KAAK,IACzB,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,SAAS,CAAC,MAC5B,QAAQ,EAAE,CAAC,IAAI,CAAC,MAAK;QACnB,IAAI,KAAK,CAAC,aAAa,EAAE;YACvB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;AACtC,SAAA;KACF,CAAC,CACH,CACF,CAAC;IAEF,OAAO,EAAE,wBAAwB,EAAE,CAAC;AACtC;;;;"}
@@ -68,7 +68,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
68
68
  /* CLASS */
69
69
  )) : createCommentVNode("v-if", true);
70
70
  }
71
- var slidingPanel = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-9402d5ce"]]);
71
+ var SlidingPanel = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-9402d5ce"]]);
72
72
 
73
- export { slidingPanel as default };
73
+ export { SlidingPanel as default };
74
74
  //# sourceMappingURL=sliding-panel.vue.js.map
@@ -134,6 +134,9 @@ function useAliasApi() {
134
134
  },
135
135
  get selectedSort() {
136
136
  return store.state.x.search?.sort ?? '';
137
+ },
138
+ get priceStats() {
139
+ return store.state.x.search?.stats?.price ?? {};
137
140
  }
138
141
  };
139
142
  }
@@ -1 +1 @@
1
- {"version":3,"file":"use-alias-api.js","sources":["../../../src/composables/use-alias-api.ts"],"sourcesContent":["import {\n Facet,\n Filter,\n HistoryQuery,\n NextQuery,\n PartialResult,\n Redirection,\n RelatedTag,\n Result,\n SemanticQuery,\n Suggestion\n} from '@empathyco/x-types';\nimport { ScrollComponentState } from '../x-modules/scroll/store/types';\nimport { InputStatus } from '../x-modules/search-box/store/types';\nimport { RequestStatus } from '../store/utils/status-store.utils';\nimport { getGetterPath } from '../plugins/index';\nimport { useStore } from './use-store';\n\n/**\n * Creates an object containing the alias part of {@link XComponentAPI}.\n *\n * @returns An object containing the alias part of the {@link XComponentAPI}.\n *\n * @internal\n */\nexport function useAliasApi(): UseAliasAPI {\n const queryModules = [\n 'facets',\n 'searchBox',\n 'nextQueries',\n 'querySuggestions',\n 'relatedTags',\n 'search'\n ] as const;\n const statusModules = [\n 'identifierResults',\n 'nextQueries',\n 'popularSearches',\n 'querySuggestions',\n 'recommendations',\n 'relatedTags',\n 'search'\n ] as const;\n\n const store = useStore();\n\n const query = queryModules.reduce((acc, moduleName) => {\n return Object.defineProperty(acc, moduleName, {\n get(): string {\n return store.state.x[moduleName]?.query ?? '';\n },\n enumerable: true\n });\n }, {} as UseAliasQueryAPI);\n\n const status = statusModules.reduce((acc, moduleName) => {\n return Object.defineProperty(acc, moduleName, {\n get(): RequestStatus | undefined {\n return store.state.x[moduleName]?.status;\n },\n enumerable: true\n });\n }, {} as UseAliasStatusAPI);\n\n return {\n query,\n status,\n get device() {\n return store.state.x.device?.name ?? null;\n },\n get facets() {\n return store.getters[getGetterPath('facets', 'facets')] ?? {};\n },\n get historyQueries() {\n return store.getters[getGetterPath('historyQueries', 'historyQueries')] ?? [];\n },\n get historyQueriesWithResults() {\n return store.getters[getGetterPath('historyQueries', 'historyQueriesWithResults')] ?? [];\n },\n get fullHistoryQueries() {\n return store.state.x.historyQueries?.historyQueries ?? [];\n },\n get isHistoryQueriesEnabled() {\n return store.state.x.historyQueries?.isEnabled ?? false;\n },\n get fromNoResultsWithFilters() {\n return store.state.x.search?.fromNoResultsWithFilters ?? false;\n },\n get identifierResults() {\n return store.state.x.identifierResults?.identifierResults ?? [];\n },\n get searchBoxStatus() {\n return store.state.x.searchBox?.inputStatus ?? undefined;\n },\n get isEmpathizeOpen() {\n return store.state.x.empathize?.isOpen ?? false;\n },\n get nextQueries() {\n return store.getters[getGetterPath('nextQueries', 'nextQueries')] ?? [];\n },\n get noResults() {\n return store.state.x.search?.isNoResults ?? false;\n },\n get partialResults() {\n return store.state.x.search?.partialResults ?? [];\n },\n get popularSearches() {\n return store.state.x.popularSearches?.popularSearches ?? [];\n },\n get querySuggestions() {\n return store.getters[getGetterPath('querySuggestions', 'querySuggestions')] ?? [];\n },\n get fullQuerySuggestions() {\n return store.state.x.querySuggestions?.suggestions ?? [];\n },\n get recommendations() {\n return store.state.x.recommendations?.recommendations ?? [];\n },\n get redirections() {\n return store.state.x.search?.redirections ?? [];\n },\n get relatedTags() {\n return store.getters[getGetterPath('relatedTags', 'relatedTags')] ?? [];\n },\n get results() {\n return store.state.x.search?.results ?? [];\n },\n get scroll() {\n return store.state.x.scroll?.data ?? {};\n },\n get selectedFilters() {\n return store.getters[getGetterPath('facets', 'selectedFilters')] ?? [];\n },\n get selectedRelatedTags() {\n return store.state.x.relatedTags?.selectedRelatedTags ?? [];\n },\n get semanticQueries() {\n return store.state.x.semanticQueries?.semanticQueries ?? [];\n },\n get spellcheckedQuery() {\n return store.state.x.search?.spellcheckedQuery ?? null;\n },\n get totalResults() {\n return store.state.x.search?.totalResults ?? 0;\n },\n get selectedSort() {\n return store.state.x.search?.sort ?? '';\n }\n };\n}\n\n/**\n * Alias to facilitate retrieving values from the store.\n *\n * @public\n */\nexport interface UseAliasAPI {\n /** The {@link DeviceXModule} detected device. */\n readonly device: string | null;\n /** The {@link FacetsXModule} facets. */\n readonly facets: Record<Facet['id'], Facet>;\n /** The {@link HistoryQueriesXModule} history queries matching the query. */\n readonly historyQueries: ReadonlyArray<HistoryQuery>;\n /** The {@link HistoryQueriesXModule} history queries with 1 or more results. */\n readonly historyQueriesWithResults: ReadonlyArray<HistoryQuery>;\n /** The {@link HistoryQueriesXModule} history queries. */\n readonly fullHistoryQueries: ReadonlyArray<HistoryQuery>;\n /** The {@link HistoryQueriesXModule} history queries enabled flag. */\n readonly isHistoryQueriesEnabled: Readonly<boolean>;\n /** The {@link SearchXModule} no results with filters flag. */\n readonly fromNoResultsWithFilters: Readonly<boolean>;\n /** The {@link IdentifierResultsXModule} results. */\n readonly identifierResults: ReadonlyArray<Result>;\n /** The {@link SearchBoxXModule } input status. */\n readonly searchBoxStatus: InputStatus | undefined;\n /** The {@link Empathize} is open state. */\n readonly isEmpathizeOpen: boolean;\n /** The {@link NextQueriesXModule} next queries. */\n readonly nextQueries: ReadonlyArray<NextQuery>;\n /** The {@link SearchXModule} no results situation. */\n readonly noResults: boolean;\n /** The {@link SearchXModule} partial results. */\n readonly partialResults: ReadonlyArray<PartialResult>;\n /** The {@link PopularSearchesXModule} popular searches. */\n readonly popularSearches: ReadonlyArray<Suggestion>;\n /** The query value of the different modules. */\n readonly query: UseAliasQueryAPI;\n /** The {@link QuerySuggestionsXModule} query suggestions that should be displayed. */\n readonly querySuggestions: ReadonlyArray<Suggestion>;\n /** The {@link QuerySuggestionsXModule} query suggestions. */\n readonly fullQuerySuggestions: ReadonlyArray<Suggestion>;\n /** The {@link RecommendationsXModule} recommendations. */\n readonly recommendations: ReadonlyArray<Result>;\n /** The {@link SearchXModule} redirections. */\n readonly redirections: ReadonlyArray<Redirection>;\n /** The {@link RelatedTagsXModule} related tags (Both selected and deselected). */\n readonly relatedTags: ReadonlyArray<RelatedTag>;\n /** The {@link SearchXModule} search results. */\n readonly results: ReadonlyArray<Result>;\n /** The {@link ScrollXModule} data state. */\n readonly scroll: Record<string, ScrollComponentState>;\n /** The {@link FacetsXModule} selected filters. */\n readonly selectedFilters: Filter[];\n /** The {@link RelatedTagsXModule} selected related tags. */\n readonly selectedRelatedTags: ReadonlyArray<RelatedTag>;\n /** The {@link SemanticQueriesXModule} queries. */\n readonly semanticQueries: ReadonlyArray<SemanticQuery>;\n /** The {@link SearchXModule} spellchecked query. */\n readonly spellcheckedQuery: string | null;\n /** The status value of the different modules. */\n readonly status: UseAliasStatusAPI;\n /** The {@link SearchXModule} total results. */\n readonly totalResults: number;\n /** The {@link SearchXModule} selected sort. */\n readonly selectedSort: string;\n}\n\n/**\n * Alias to facilitate retrieving the modules with query.\n *\n * @public\n */\nexport interface UseAliasQueryAPI {\n /** The {@link FacetsXModule} query. */\n readonly facets: string;\n /** The {@link SearchBoxXModule} query. */\n readonly searchBox: string;\n /** The {@link NextQueriesXModule} query. */\n readonly nextQueries: string;\n /** The {@link QuerySuggestionsXModule} query. */\n readonly querySuggestions: string;\n /** The {@link RelatedTagsXModule} query. */\n readonly relatedTags: string;\n /** The {@link SearchXModule} query. */\n readonly search: string;\n}\n\n/**\n * Alias to facilitate retrieving the modules with status.\n *\n * @public\n */\nexport interface UseAliasStatusAPI {\n /** The {@link IdentifierResultsXModule} status. */\n readonly identifierResults: RequestStatus | undefined;\n /** The {@link NextQueriesXModule} status. */\n readonly nextQueries: RequestStatus | undefined;\n /** The {@link PopularSearchesXModule} status. */\n readonly popularSearches: RequestStatus | undefined;\n /** The {@link QuerySuggestionsXModule} status. */\n readonly querySuggestions: RequestStatus | undefined;\n /** The {@link RecommendationsXModule} status. */\n readonly recommendations: RequestStatus | undefined;\n /** The {@link RelatedTagsXModule} status. */\n readonly relatedTags: RequestStatus | undefined;\n /** The {@link SearchXModule} status. */\n readonly search: RequestStatus | undefined;\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAkBA;;;;;;AAMG;SACa,WAAW,GAAA;AACzB,IAAA,MAAM,YAAY,GAAG;QACnB,QAAQ;QACR,WAAW;QACX,aAAa;QACb,kBAAkB;QAClB,aAAa;QACb,QAAQ;KACA,CAAC;AACX,IAAA,MAAM,aAAa,GAAG;QACpB,mBAAmB;QACnB,aAAa;QACb,iBAAiB;QACjB,kBAAkB;QAClB,iBAAiB;QACjB,aAAa;QACb,QAAQ;KACA,CAAC;AAEX,IAAA,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IAEzB,MAAM,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,UAAU,KAAI;AACpD,QAAA,OAAO,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,UAAU,EAAE;YAC5C,GAAG,GAAA;AACD,gBAAA,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,KAAK,IAAI,EAAE,CAAC;aAC/C;AACD,YAAA,UAAU,EAAE,IAAI;AACjB,SAAA,CAAC,CAAC;KACJ,EAAE,EAAsB,CAAC,CAAC;IAE3B,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,UAAU,KAAI;AACtD,QAAA,OAAO,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,UAAU,EAAE;YAC5C,GAAG,GAAA;gBACD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;aAC1C;AACD,YAAA,UAAU,EAAE,IAAI;AACjB,SAAA,CAAC,CAAC;KACJ,EAAE,EAAuB,CAAC,CAAC;IAE5B,OAAO;QACL,KAAK;QACL,MAAM;AACN,QAAA,IAAI,MAAM,GAAA;YACR,OAAO,KAAK,CAAC,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AAI,EAAE,CAAC;SAC5C;AACD,QAAA,IAAI,MAAM,GAAA;YACR,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,IAAI,EAAE,CAAC;SACzC;AACD,QAAA,IAAI,eAAe,GAAA;AACjB,YAAA,OAAO,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC,IAAI,EAAE,CAAC;SACxE;AACD,QAAA,IAAI,mBAAmB,GAAA;YACrB,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,EAAE,mBAAmB,IAAI,EAAE,CAAC;SAC7D;AACD,QAAA,IAAI,eAAe,GAAA;YACjB,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,eAAe,EAAE,eAAe,IAAI,EAAE,CAAC;SAC7D;AACD,QAAA,IAAI,iBAAiB,GAAA;YACnB,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,iBAAiB,IAAI,IAAI,CAAC;SACxD;AACD,QAAA,IAAI,YAAY,GAAA;YACd,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,YAAY,IAAI,CAAC,CAAC;SAChD;AACD,QAAA,IAAI,YAAY,GAAA;YACd,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,IAAI,EAAE,CAAC;SACzC;KACF,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"use-alias-api.js","sources":["../../../src/composables/use-alias-api.ts"],"sourcesContent":["import {\n Facet,\n Filter,\n HistoryQuery,\n NextQuery,\n PartialResult,\n Redirection,\n RelatedTag,\n Result,\n SemanticQuery,\n Suggestion\n} from '@empathyco/x-types';\nimport { ScrollComponentState } from '../x-modules/scroll/store/types';\nimport { InputStatus } from '../x-modules/search-box/store/types';\nimport { RequestStatus } from '../store/utils/status-store.utils';\nimport { getGetterPath } from '../plugins/index';\nimport { useStore } from './use-store';\n\n/**\n * Creates an object containing the alias part of {@link XComponentAPI}.\n *\n * @returns An object containing the alias part of the {@link XComponentAPI}.\n *\n * @internal\n */\nexport function useAliasApi(): UseAliasAPI {\n const queryModules = [\n 'facets',\n 'searchBox',\n 'nextQueries',\n 'querySuggestions',\n 'relatedTags',\n 'search'\n ] as const;\n const statusModules = [\n 'identifierResults',\n 'nextQueries',\n 'popularSearches',\n 'querySuggestions',\n 'recommendations',\n 'relatedTags',\n 'search'\n ] as const;\n\n const store = useStore();\n\n const query = queryModules.reduce((acc, moduleName) => {\n return Object.defineProperty(acc, moduleName, {\n get(): string {\n return store.state.x[moduleName]?.query ?? '';\n },\n enumerable: true\n });\n }, {} as UseAliasQueryAPI);\n\n const status = statusModules.reduce((acc, moduleName) => {\n return Object.defineProperty(acc, moduleName, {\n get(): RequestStatus | undefined {\n return store.state.x[moduleName]?.status;\n },\n enumerable: true\n });\n }, {} as UseAliasStatusAPI);\n\n return {\n query,\n status,\n get device() {\n return store.state.x.device?.name ?? null;\n },\n get facets() {\n return store.getters[getGetterPath('facets', 'facets')] ?? {};\n },\n get historyQueries() {\n return store.getters[getGetterPath('historyQueries', 'historyQueries')] ?? [];\n },\n get historyQueriesWithResults() {\n return store.getters[getGetterPath('historyQueries', 'historyQueriesWithResults')] ?? [];\n },\n get fullHistoryQueries() {\n return store.state.x.historyQueries?.historyQueries ?? [];\n },\n get isHistoryQueriesEnabled() {\n return store.state.x.historyQueries?.isEnabled ?? false;\n },\n get fromNoResultsWithFilters() {\n return store.state.x.search?.fromNoResultsWithFilters ?? false;\n },\n get identifierResults() {\n return store.state.x.identifierResults?.identifierResults ?? [];\n },\n get searchBoxStatus() {\n return store.state.x.searchBox?.inputStatus ?? undefined;\n },\n get isEmpathizeOpen() {\n return store.state.x.empathize?.isOpen ?? false;\n },\n get nextQueries() {\n return store.getters[getGetterPath('nextQueries', 'nextQueries')] ?? [];\n },\n get noResults() {\n return store.state.x.search?.isNoResults ?? false;\n },\n get partialResults() {\n return store.state.x.search?.partialResults ?? [];\n },\n get popularSearches() {\n return store.state.x.popularSearches?.popularSearches ?? [];\n },\n get querySuggestions() {\n return store.getters[getGetterPath('querySuggestions', 'querySuggestions')] ?? [];\n },\n get fullQuerySuggestions() {\n return store.state.x.querySuggestions?.suggestions ?? [];\n },\n get recommendations() {\n return store.state.x.recommendations?.recommendations ?? [];\n },\n get redirections() {\n return store.state.x.search?.redirections ?? [];\n },\n get relatedTags() {\n return store.getters[getGetterPath('relatedTags', 'relatedTags')] ?? [];\n },\n get results() {\n return store.state.x.search?.results ?? [];\n },\n get scroll() {\n return store.state.x.scroll?.data ?? {};\n },\n get selectedFilters() {\n return store.getters[getGetterPath('facets', 'selectedFilters')] ?? [];\n },\n get selectedRelatedTags() {\n return store.state.x.relatedTags?.selectedRelatedTags ?? [];\n },\n get semanticQueries() {\n return store.state.x.semanticQueries?.semanticQueries ?? [];\n },\n get spellcheckedQuery() {\n return store.state.x.search?.spellcheckedQuery ?? null;\n },\n get totalResults() {\n return store.state.x.search?.totalResults ?? 0;\n },\n get selectedSort() {\n return store.state.x.search?.sort ?? '';\n },\n get priceStats() {\n return store.state.x.search?.stats?.price ?? {};\n }\n };\n}\n\n/**\n * Alias to facilitate retrieving values from the store.\n *\n * @public\n */\nexport interface UseAliasAPI {\n /** The {@link DeviceXModule} detected device. */\n readonly device: string | null;\n /** The {@link FacetsXModule} facets. */\n readonly facets: Record<Facet['id'], Facet>;\n /** The {@link HistoryQueriesXModule} history queries matching the query. */\n readonly historyQueries: ReadonlyArray<HistoryQuery>;\n /** The {@link HistoryQueriesXModule} history queries with 1 or more results. */\n readonly historyQueriesWithResults: ReadonlyArray<HistoryQuery>;\n /** The {@link HistoryQueriesXModule} history queries. */\n readonly fullHistoryQueries: ReadonlyArray<HistoryQuery>;\n /** The {@link HistoryQueriesXModule} history queries enabled flag. */\n readonly isHistoryQueriesEnabled: Readonly<boolean>;\n /** The {@link SearchXModule} no results with filters flag. */\n readonly fromNoResultsWithFilters: Readonly<boolean>;\n /** The {@link IdentifierResultsXModule} results. */\n readonly identifierResults: ReadonlyArray<Result>;\n /** The {@link SearchBoxXModule } input status. */\n readonly searchBoxStatus: InputStatus | undefined;\n /** The {@link Empathize} is open state. */\n readonly isEmpathizeOpen: boolean;\n /** The {@link NextQueriesXModule} next queries. */\n readonly nextQueries: ReadonlyArray<NextQuery>;\n /** The {@link SearchXModule} no results situation. */\n readonly noResults: boolean;\n /** The {@link SearchXModule} partial results. */\n readonly partialResults: ReadonlyArray<PartialResult>;\n /** The {@link PopularSearchesXModule} popular searches. */\n readonly popularSearches: ReadonlyArray<Suggestion>;\n /** The query value of the different modules. */\n readonly query: UseAliasQueryAPI;\n /** The {@link QuerySuggestionsXModule} query suggestions that should be displayed. */\n readonly querySuggestions: ReadonlyArray<Suggestion>;\n /** The {@link QuerySuggestionsXModule} query suggestions. */\n readonly fullQuerySuggestions: ReadonlyArray<Suggestion>;\n /** The {@link RecommendationsXModule} recommendations. */\n readonly recommendations: ReadonlyArray<Result>;\n /** The {@link SearchXModule} redirections. */\n readonly redirections: ReadonlyArray<Redirection>;\n /** The {@link RelatedTagsXModule} related tags (Both selected and deselected). */\n readonly relatedTags: ReadonlyArray<RelatedTag>;\n /** The {@link SearchXModule} search results. */\n readonly results: ReadonlyArray<Result>;\n /** The {@link ScrollXModule} data state. */\n readonly scroll: Record<string, ScrollComponentState>;\n /** The {@link FacetsXModule} selected filters. */\n readonly selectedFilters: Filter[];\n /** The {@link RelatedTagsXModule} selected related tags. */\n readonly selectedRelatedTags: ReadonlyArray<RelatedTag>;\n /** The {@link SemanticQueriesXModule} queries. */\n readonly semanticQueries: ReadonlyArray<SemanticQuery>;\n /** The {@link SearchXModule} spellchecked query. */\n readonly spellcheckedQuery: string | null;\n /** The status value of the different modules. */\n readonly status: UseAliasStatusAPI;\n /** The {@link SearchXModule} total results. */\n readonly totalResults: number;\n /** The {@link SearchXModule} selected sort. */\n readonly selectedSort: string;\n /** The {@link SearchXModule} price specific stats. */\n readonly priceStats: { min: number; max: number };\n}\n\n/**\n * Alias to facilitate retrieving the modules with query.\n *\n * @public\n */\nexport interface UseAliasQueryAPI {\n /** The {@link FacetsXModule} query. */\n readonly facets: string;\n /** The {@link SearchBoxXModule} query. */\n readonly searchBox: string;\n /** The {@link NextQueriesXModule} query. */\n readonly nextQueries: string;\n /** The {@link QuerySuggestionsXModule} query. */\n readonly querySuggestions: string;\n /** The {@link RelatedTagsXModule} query. */\n readonly relatedTags: string;\n /** The {@link SearchXModule} query. */\n readonly search: string;\n}\n\n/**\n * Alias to facilitate retrieving the modules with status.\n *\n * @public\n */\nexport interface UseAliasStatusAPI {\n /** The {@link IdentifierResultsXModule} status. */\n readonly identifierResults: RequestStatus | undefined;\n /** The {@link NextQueriesXModule} status. */\n readonly nextQueries: RequestStatus | undefined;\n /** The {@link PopularSearchesXModule} status. */\n readonly popularSearches: RequestStatus | undefined;\n /** The {@link QuerySuggestionsXModule} status. */\n readonly querySuggestions: RequestStatus | undefined;\n /** The {@link RecommendationsXModule} status. */\n readonly recommendations: RequestStatus | undefined;\n /** The {@link RelatedTagsXModule} status. */\n readonly relatedTags: RequestStatus | undefined;\n /** The {@link SearchXModule} status. */\n readonly search: RequestStatus | undefined;\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAkBA;;;;;;AAMG;SACa,WAAW,GAAA;AACzB,IAAA,MAAM,YAAY,GAAG;QACnB,QAAQ;QACR,WAAW;QACX,aAAa;QACb,kBAAkB;QAClB,aAAa;QACb,QAAQ;KACA,CAAC;AACX,IAAA,MAAM,aAAa,GAAG;QACpB,mBAAmB;QACnB,aAAa;QACb,iBAAiB;QACjB,kBAAkB;QAClB,iBAAiB;QACjB,aAAa;QACb,QAAQ;KACA,CAAC;AAEX,IAAA,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IAEzB,MAAM,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,UAAU,KAAI;AACpD,QAAA,OAAO,MAA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YACnB,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,iBAAiB,IAAI,IAAI,CAAC;SACxD;AACD,QAAA,IAAI,YAAY,GAAA;YACd,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,YAAY,IAAI,CAAC,CAAC;SAChD;AACD,QAAA,IAAI,YAAY,GAAA;YACd,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,IAAI,EAAE,CAAC;SACzC;AACD,QAAA,IAAI,UAAU,GAAA;AACZ,YAAA,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE,CAAC;SACjD;KACF,CAAC;AACJ;;;;"}
package/js/index.js CHANGED
@@ -128,6 +128,7 @@ export { default as BaseEventButton } from './components/base-event-button.vue.j
128
128
  export { default as BaseGrid } from './components/base-grid.vue.js';
129
129
  export { default as BaseKeyboardNavigation } from './components/base-keyboard-navigation.vue.js';
130
130
  export { default as BaseRating } from './components/base-rating.vue.js';
131
+ export { default as BaseSlider } from './components/base-slider.vue.js';
131
132
  export { default as BaseSwitch } from './components/base-switch.vue.js';
132
133
  export { default as BaseVariableColumnGrid } from './components/base-variable-column-grid.vue.js';
133
134
  export { default as DisplayEmitter } from './components/display-emitter.vue.js';
@@ -325,6 +326,15 @@ export { request as recommendationsRequest } from './x-modules/recommendations/s
325
326
  export { recommendationsXStoreModule } from './x-modules/recommendations/store/module.js';
326
327
  export { recommendationsWiring, setRecommendationsExtraParams } from './x-modules/recommendations/wiring.js';
327
328
  export { recommendationsXModule } from './x-modules/recommendations/x-module.js';
329
+ export { default as RelatedPrompt } from './x-modules/related-prompts/components/related-prompt.vue.js';
330
+ export { default as RelatedPromptsList } from './x-modules/related-prompts/components/related-prompts-list.vue.js';
331
+ export { cancelFetchAndSaveRelatedPrompts, fetchAndSaveRelatedPrompts } from './x-modules/related-prompts/store/actions/fetch-and-save-related-prompts.action.js';
332
+ export { fetchRelatedPrompts } from './x-modules/related-prompts/store/actions/fetch-related-prompts.action.js';
333
+ export { request as relatedPromptRequest } from './x-modules/related-prompts/store/getters/request.getter.js';
334
+ export { relatedPromptsStoreEmitters } from './x-modules/related-prompts/store/emitters.js';
335
+ export { relatedPromptsXStoreModule } from './x-modules/related-prompts/store/module.js';
336
+ export { relatedPromptsWiring } from './x-modules/related-prompts/wiring.js';
337
+ export { relatedPromptsXModule } from './x-modules/related-prompts/x-module.js';
328
338
  export { default as RelatedTag } from './x-modules/related-tags/components/related-tag.vue.js';
329
339
  export { default as RelatedTags } from './x-modules/related-tags/components/related-tags.vue.js';
330
340
  export { cancelFetchAndSaveRelatedTags, fetchAndSaveRelatedTags } from './x-modules/related-tags/store/actions/fetch-and-save-related-tags.action.js';
package/js/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,11 @@
1
1
  /**
2
2
  * Type for animations props.
3
3
  *
4
+ * @remarks
5
+ * String for 'ul'
6
+ * Object for `DefineComponent` type
7
+ * Function for `() => NoElement`
8
+ *
4
9
  * @public
5
10
  */
6
11
  const AnimationProp = [String, Object, Function];
@@ -1 +1 @@
1
- {"version":3,"file":"animation-prop.js","sources":["../../../src/types/animation-prop.ts"],"sourcesContent":["import { DefineComponent, PropType } from 'vue';\n\n/**\n * Type for animations props.\n *\n * @public\n */\nexport const AnimationProp = [String, Object, Function] as PropType<DefineComponent | string>;\n"],"names":[],"mappings":"AAEA;;;;AAIG;AACU,MAAA,aAAa,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ;;;;"}
1
+ {"version":3,"file":"animation-prop.js","sources":["../../../src/types/animation-prop.ts"],"sourcesContent":["/**\n * Type for animations props.\n *\n * @remarks\n * String for 'ul'\n * Object for `DefineComponent` type\n * Function for `() => NoElement`\n *\n * @public\n */\nexport const AnimationProp = [String, Object, Function];\n"],"names":[],"mappings":"AAAA;;;;;;;;;AASG;AACU,MAAA,aAAa,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ;;;;"}
@@ -75,6 +75,8 @@ import '../../../components/base-grid.vue3.js';
75
75
  import '../../../components/base-keyboard-navigation.vue2.js';
76
76
  import '../../../components/base-rating.vue2.js';
77
77
  import '../../../components/base-rating.vue3.js';
78
+ import '../../../components/base-slider.vue2.js';
79
+ import '../../../components/base-slider.vue3.js';
78
80
  import '../../../components/base-switch.vue2.js';
79
81
  import '../../../components/base-switch.vue3.js';
80
82
  import '../../../components/base-variable-column-grid.vue2.js';
@@ -1 +1 @@
1
- {"version":3,"file":"empathize.vue2.js","sources":["../../../../../src/x-modules/empathize/components/empathize.vue"],"sourcesContent":["<template>\n <component :is=\"animation\">\n <div\n v-show=\"isOpen && hasContent\"\n ref=\"empathizeRef\"\n @mousedown.prevent\n @focusin=\"open\"\n @focusout=\"close\"\n class=\"x-empathize\"\n data-test=\"empathize\"\n >\n <!-- @slot (Required) Modal container content -->\n <slot />\n </div>\n </component>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent, PropType, ref } from 'vue';\n import { NoAnimation } from '../../../components';\n import { use$x, useDebounce } from '../../../composables';\n import { AnimationProp } from '../../../types';\n import { XEvent } from '../../../wiring';\n import { empathizeXModule } from '../x-module';\n import { getActiveElement } from '../../../utils/html';\n\n /**\n * Component containing the empathize. It has a required slot to define its content and two props\n * to define when to open and close it: `eventsToOpenEmpathize` and `eventsToCloseEmpathize`.\n *\n * @public\n */\n export default defineComponent({\n name: 'Empathize',\n xModule: empathizeXModule.name,\n props: {\n /** Array of {@link XEvent} to open the empathize. */\n eventsToOpenEmpathize: {\n type: Array as PropType<XEvent[]>,\n default: () => ['UserFocusedSearchBox', 'UserIsTypingAQuery', 'UserClickedSearchBox']\n },\n /** Array of {@link XEvent} to close the empathize. */\n eventsToCloseEmpathize: {\n type: Array as PropType<XEvent[]>,\n default: () => [\n 'UserClosedEmpathize',\n 'UserSelectedASuggestion',\n 'UserPressedEnterKey',\n 'UserBlurredSearchBox'\n ]\n },\n /** Animation component that will be used to animate the empathize. */\n animation: {\n type: AnimationProp,\n default: () => NoAnimation\n }\n },\n setup(props) {\n const $x = use$x();\n\n const empathizeRef = ref<HTMLDivElement>();\n\n const isOpen = ref(false);\n const hasContent = ref(!!empathizeRef.value?.children.length);\n\n /**\n * Changes the state of {@link Empathize.isOpen} assigning to it the value of `newOpen`\n * parameter. Also emits the {@link XEvent} `EmpathizeOpened` or `EmpathizeClosed` if\n * the state really changes.\n *\n * @param newOpen - The new open state to assign to {@link Empathize.isOpen}.\n */\n const changeOpen = useDebounce((newOpen: boolean) => {\n if (isOpen.value !== newOpen) {\n isOpen.value = newOpen;\n const empathizeEvent = isOpen.value ? 'EmpathizeOpened' : 'EmpathizeClosed';\n $x.emit(empathizeEvent, undefined, { target: empathizeRef.value });\n }\n }, 0);\n\n /**\n * Open empathize. This method will be executed on any event in\n * {@link Empathize.eventsToOpenEmpathize} and on DOM event `focusin` on Empathize root\n * element.\n */\n function open() {\n hasContent.value = !!empathizeRef.value?.children.length;\n if (hasContent.value) {\n changeOpen(true);\n }\n }\n\n /**\n * Close empathize. This method will be executed on any event in\n * {@link Empathize.eventsToCloseEmpathize} and on DOM event `focusout` on Empathize root\n * element.\n */\n function close() {\n const activeElement = getActiveElement();\n if (!empathizeRef.value?.contains(activeElement)) {\n changeOpen(false);\n }\n }\n\n props.eventsToOpenEmpathize.forEach(event => $x.on(event, false).subscribe(open));\n props.eventsToCloseEmpathize.forEach(event => $x.on(event, false).subscribe(close));\n\n return {\n close,\n empathizeRef,\n hasContent,\n isOpen,\n open\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`EmpathizeOpened`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after receiving an event to change the state `isOpen` to `true`. The event\n payload is undefined and can have a metadata with the module and the element that emitted it.\n- [`EmpathizeClosed`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after receiving an event to change the state `isOpen` to `false`. The event\n payload is undefined and can have a metadata with the module and the element that emitted it.\n\n## Examples\n\nThis component will listen to the configured events in `eventsToOpenEmpathize` and\n`eventsToCloseEmpathize` props and open/close itself accordingly. By default, those props values\nare:\n\n- Open: `UserFocusedSearchBox`, `'`UserIsTypingAQuery`, `'`UserClickedSearchBox` and\n- Close: `UserClosedEmpathize`, `UserSelectedASuggestion`, `UserPressedEnter`,\n 'UserBlurredSearchBox`\n\n### Basic examples\n\nThe component rendering the query suggestions, popular searches and history queries with keyboard\nnavigation.\n\n```vue\n<Empathize>\n <template #default>\n <BaseKeyboardNavigation>\n <QuerySuggestions/>\n <PopularSearches/>\n <HistoryQueries/>\n </BaseKeyboardNavigation>\n </template>\n</Empathize>\n```\n\nDefining custom values for the events to open and close the Empathize. For example opening it when\nthe search box loses the focus and closing it when the search box receives the focus:\n\n```vue\n<Empathize\n :eventsToOpenEmpathize=\"['UserBlurredSearchBox']\"\n :eventsToCloseEmpathize=\"['UserFocusedSearchBox']\"\n>\n <template #default>\n Please, type a query in the Search Box.\n </template>\n</Empathize>\n```\n\nAn animation can be used for the opening and closing using the `animation` prop. The animation, must\nbe a Component with a `Transition` with a slot inside:\n\n```vue\n<Empathize :animation=\"collapseFromTop\">\n <template #default>\n <PopularSearches/>\n </template>\n</Empathize>\n```\n</docs>\n"],"names":["NoAnimation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BE;;;;;AAKE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,gBAAgB,CAAC,IAAI;AAC9B,IAAA,KAAK,EAAE;;AAEL,QAAA,qBAAqB,EAAE;AACrB,YAAA,IAAI,EAAE,KAA2B;YACjC,OAAO,EAAE,MAAM,CAAC,sBAAsB,EAAE,oBAAoB,EAAE,sBAAsB,CAAA;AACrF,SAAA;;AAED,QAAA,sBAAsB,EAAE;AACtB,YAAA,IAAI,EAAE,KAA2B;YACjC,OAAO,EAAE,MAAM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xC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC,EAAE;gBAChD,UAAU,CAAC,KAAK,CAAC,CAAA;AACnB,aAAA;SACF;QAEA,KAAK,CAAC,qBAAqB,CAAC,OAAO,CAAC,KAAI,IAAK,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAA;QACjF,KAAK,CAAC,sBAAsB,CAAC,OAAO,CAAC,KAAI,IAAK,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAA;QAEnF,OAAO;YACL,KAAK;YACL,YAAY;YACZ,UAAU;YACV,MAAM;YACN,IAAG;SACJ,CAAA;KACH;AACD,CAAA,CAAC;;;;"}
1
+ {"version":3,"file":"empathize.vue2.js","sources":["../../../../../src/x-modules/empathize/components/empathize.vue"],"sourcesContent":["<template>\n <component :is=\"animation\">\n <div\n v-show=\"isOpen && hasContent\"\n ref=\"empathizeRef\"\n @mousedown.prevent\n @focusin=\"open\"\n @focusout=\"close\"\n class=\"x-empathize\"\n data-test=\"empathize\"\n >\n <!-- @slot (Required) Modal container content -->\n <slot />\n </div>\n </component>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent, PropType, ref } from 'vue';\n import { NoAnimation } from '../../../components';\n import { use$x, useDebounce } from '../../../composables';\n import { AnimationProp } from '../../../types';\n import { XEvent } from '../../../wiring';\n import { empathizeXModule } from '../x-module';\n import { getActiveElement } from '../../../utils/html';\n\n /**\n * Component containing the empathize. It has a required slot to define its content and two props\n * to define when to open and close it: `eventsToOpenEmpathize` and `eventsToCloseEmpathize`.\n *\n * @public\n */\n export default defineComponent({\n name: 'Empathize',\n xModule: empathizeXModule.name,\n props: {\n /** Array of {@link XEvent} to open the empathize. */\n eventsToOpenEmpathize: {\n type: Array as PropType<XEvent[]>,\n default: () => ['UserFocusedSearchBox', 'UserIsTypingAQuery', 'UserClickedSearchBox']\n },\n /** Array of {@link XEvent} to close the empathize. */\n eventsToCloseEmpathize: {\n type: Array as PropType<XEvent[]>,\n default: () => [\n 'UserClosedEmpathize',\n 'UserSelectedASuggestion',\n 'UserPressedEnterKey',\n 'UserBlurredSearchBox'\n ]\n },\n /** Animation component that will be used to animate the empathize. */\n animation: {\n type: AnimationProp,\n default: () => NoAnimation\n }\n },\n setup(props) {\n const $x = use$x();\n\n const empathizeRef = ref<HTMLDivElement>();\n\n const isOpen = ref(false);\n const hasContent = ref(!!empathizeRef.value?.children.length);\n\n /**\n * Changes the state of {@link Empathize.isOpen} assigning to it the value of `newOpen`\n * parameter. Also emits the {@link XEvent} `EmpathizeOpened` or `EmpathizeClosed` if\n * the state really changes.\n *\n * @param newOpen - The new open state to assign to {@link Empathize.isOpen}.\n */\n const changeOpen = useDebounce((newOpen: boolean) => {\n if (isOpen.value !== newOpen) {\n isOpen.value = newOpen;\n const empathizeEvent = isOpen.value ? 'EmpathizeOpened' : 'EmpathizeClosed';\n $x.emit(empathizeEvent, undefined, { target: empathizeRef.value });\n }\n }, 0);\n\n /**\n * Open empathize. This method will be executed on any event in\n * {@link Empathize.eventsToOpenEmpathize} and on DOM event `focusin` on Empathize root\n * element.\n */\n function open() {\n hasContent.value = !!empathizeRef.value?.children.length;\n if (hasContent.value) {\n changeOpen(true);\n }\n }\n\n /**\n * Close empathize. This method will be executed on any event in\n * {@link Empathize.eventsToCloseEmpathize} and on DOM event `focusout` on Empathize root\n * element.\n */\n function close() {\n const activeElement = getActiveElement();\n if (!empathizeRef.value?.contains(activeElement)) {\n changeOpen(false);\n }\n }\n\n props.eventsToOpenEmpathize.forEach(event => $x.on(event, false).subscribe(open));\n props.eventsToCloseEmpathize.forEach(event => $x.on(event, false).subscribe(close));\n\n return {\n close,\n empathizeRef,\n hasContent,\n isOpen,\n open\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`EmpathizeOpened`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after receiving an event to change the state `isOpen` to `true`. The event\n payload is undefined and can have a metadata with the module and the element that emitted it.\n- [`EmpathizeClosed`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after receiving an event to change the state `isOpen` to `false`. The event\n payload is undefined and can have a metadata with the module and the element that emitted it.\n\n## Examples\n\nThis component will listen to the configured events in `eventsToOpenEmpathize` and\n`eventsToCloseEmpathize` props and open/close itself accordingly. By default, those props values\nare:\n\n- Open: `UserFocusedSearchBox`, `'`UserIsTypingAQuery`, `'`UserClickedSearchBox` and\n- Close: `UserClosedEmpathize`, `UserSelectedASuggestion`, `UserPressedEnter`,\n 'UserBlurredSearchBox`\n\n### Basic examples\n\nThe component rendering the query suggestions, popular searches and history queries with keyboard\nnavigation.\n\n```vue\n<Empathize>\n <template #default>\n <BaseKeyboardNavigation>\n <QuerySuggestions/>\n <PopularSearches/>\n <HistoryQueries/>\n </BaseKeyboardNavigation>\n </template>\n</Empathize>\n```\n\nDefining custom values for the events to open and close the Empathize. For example opening it when\nthe search box loses the focus and closing it when the search box receives the focus:\n\n```vue\n<Empathize\n :eventsToOpenEmpathize=\"['UserBlurredSearchBox']\"\n :eventsToCloseEmpathize=\"['UserFocusedSearchBox']\"\n>\n <template #default>\n Please, type a query in the Search Box.\n </template>\n</Empathize>\n```\n\nAn animation can be used for the opening and closing using the `animation` prop. The animation, must\nbe a Component with a `Transition` with a slot inside:\n\n```vue\n<Empathize :animation=\"collapseFromTop\">\n <template #default>\n <PopularSearches/>\n </template>\n</Empathize>\n```\n</docs>\n"],"names":["NoAnimation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BE;;;;;AAKE;AACF,gBAAe,eAAe,CAAC;AAC7B,I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ACF,QAAA,SAAS,IAAI,GAAA;AACX,YAAA,UAAU,CAAC,KAAI,GAAI,CAAC,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAA;YACxD,IAAI,UAAU,CAAC,KAAK,EAAE;gBACpB,UAAU,CAAC,IAAI,CAAC,CAAA;AAClB,aAAA;SACF;AAEA;;;;AAIE;AACF,QAAA,SAAS,KAAK,GAAA;AACZ,YAAA,MAAM,aAAY,GAAI,gBAAgB,EAAE,CAAA;YACxC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC,EAAE;gBAChD,UAAU,CAAC,KAAK,CAAC,CAAA;AACnB,aAAA;SACF;QAEA,KAAK,CAAC,qBAAqB,CAAC,OAAO,CAAC,KAAI,IAAK,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAA;QACjF,KAAK,CAAC,sBAAsB,CAAC,OAAO,CAAC,KAAI,IAAK,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAA;QAEnF,OAAO;YACL,KAAK;YACL,YAAY;YACZ,UAAU;YACV,MAAM;YACN,IAAG;SACJ,CAAA;KACH;AACD,CAAA,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"snippet-config-extra-params.vue.js","sources":["../../../../../src/x-modules/extra-params/components/snippet-config-extra-params.vue"],"sourcesContent":["<template>\n <ExtraParams :values=\"extraParams\" />\n</template>\n\n<script lang=\"ts\">\n import { forEach, Dictionary } from '@empathyco/x-utils';\n import { defineComponent, inject, PropType, ref, watch } from 'vue';\n import { SnippetConfig } from '../../../x-installer/api/api.types';\n import { extraParamsXModule } from '../x-module';\n import ExtraParams from './extra-params.vue';\n\n export default defineComponent({\n name: 'SnippetConfigExtraParams',\n xModule: extraParamsXModule.name,\n components: {\n ExtraParams\n },\n props: {\n values: {\n type: Object as PropType<Dictionary<unknown>>\n },\n excludedExtraParams: {\n type: Array as PropType<Array<keyof SnippetConfig>>,\n default: (): Array<keyof SnippetConfig> => [\n 'callbacks',\n 'productId',\n 'uiLang',\n 'consent',\n 'documentDirection',\n 'filters',\n 'isSpa',\n 'queriesPreview'\n ]\n }\n },\n setup(props) {\n const snippetConfig = inject('snippetConfig') as SnippetConfig;\n const extraParams = ref({});\n\n watch(\n [() => snippetConfig, () => props.values],\n () => {\n forEach({ ...props.values, ...snippetConfig }, (name, value) => {\n if (!props.excludedExtraParams.includes(name)) {\n extraParams.value = { ...extraParams.value, [name]: value };\n }\n });\n },\n {\n deep: true,\n immediate: true\n }\n );\n\n return {\n extraParams\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## See it in action\n\n_See how the snippet config is injected and passed to the SnippetConfigExtraParams component._\n\n```vue\n<template>\n <Provider>\n <SnippetConfigExtraParams />\n </Provider>\n</template>\n\n<script>\n import { SnippetConfigExtraParams } from '@empathyco/x-components/extra-params';\n\n const Provider = {\n provide: {\n snippetConfig: {\n instance: 'demo',\n lang: 'es',\n warehouse: 1234\n }\n }\n };\n\n export default {\n name: 'SnippetConfigExtraParamsDemo',\n components: {\n Provider,\n SnippetConfigExtraParams\n }\n };\n</script>\n```\n</docs>\n"],"names":["_resolveComponent"],"mappings":";;;;;AACE,EAAA,MAAA,sBAAA,GAAAA,gBAAA,CAAqC,aAAvB,CAAA,CAAA;;;;;;;"}
1
+ {"version":3,"file":"snippet-config-extra-params.vue.js","sources":["../../../../../src/x-modules/extra-params/components/snippet-config-extra-params.vue"],"sourcesContent":["<template>\n <ExtraParams :values=\"extraParams\" />\n</template>\n\n<script lang=\"ts\">\n import { forEach, Dictionary } from '@empathyco/x-utils';\n import { defineComponent, inject, PropType, ref, watch } from 'vue';\n import { SnippetConfig } from '../../../x-installer/api/api.types';\n import { extraParamsXModule } from '../x-module';\n import ExtraParams from './extra-params.vue';\n\n export default defineComponent({\n name: 'SnippetConfigExtraParams',\n xModule: extraParamsXModule.name,\n components: {\n ExtraParams\n },\n props: {\n values: {\n type: Object as PropType<Dictionary<unknown>>\n },\n excludedExtraParams: {\n type: Array as PropType<Array<keyof SnippetConfig>>,\n default: (): Array<keyof SnippetConfig> => [\n 'callbacks',\n 'productId',\n 'uiLang',\n 'consent',\n 'documentDirection',\n 'filters',\n 'isSpa',\n 'queriesPreview'\n ]\n }\n },\n setup(props) {\n const snippetConfig = inject('snippetConfig') as SnippetConfig;\n const extraParams = ref<Record<string, any>>({});\n\n watch(\n [() => snippetConfig, () => props.values],\n () => {\n forEach({ ...props.values, ...snippetConfig }, (name, value) => {\n if (!props.excludedExtraParams.includes(name) && extraParams.value[name] !== value) {\n extraParams.value = { ...extraParams.value, [name]: value };\n }\n });\n },\n {\n deep: true,\n immediate: true\n }\n );\n\n return {\n extraParams\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## See it in action\n\n_See how the snippet config is injected and passed to the SnippetConfigExtraParams component._\n\n```vue\n<template>\n <Provider>\n <SnippetConfigExtraParams />\n </Provider>\n</template>\n\n<script>\n import { SnippetConfigExtraParams } from '@empathyco/x-components/extra-params';\n\n const Provider = {\n provide: {\n snippetConfig: {\n instance: 'demo',\n lang: 'es',\n warehouse: 1234\n }\n }\n };\n\n export default {\n name: 'SnippetConfigExtraParamsDemo',\n components: {\n Provider,\n SnippetConfigExtraParams\n }\n };\n</script>\n```\n</docs>\n"],"names":["_resolveComponent"],"mappings":";;;;;AACE,EAAA,MAAA,sBAAA,GAAAA,gBAAA,CAAqC,aAAvB,CAAA,CAAA;;;;;;;"}
@@ -32,7 +32,7 @@ var _sfc_main = defineComponent({
32
32
  const extraParams = ref({});
33
33
  watch([() => snippetConfig, () => props.values], () => {
34
34
  forEach({ ...props.values, ...snippetConfig }, (name, value) => {
35
- if (!props.excludedExtraParams.includes(name)) {
35
+ if (!props.excludedExtraParams.includes(name) && extraParams.value[name] !== value) {
36
36
  extraParams.value = { ...extraParams.value, [name]: value };
37
37
  }
38
38
  });
@@ -1 +1 @@
1
- {"version":3,"file":"snippet-config-extra-params.vue2.js","sources":["../../../../../src/x-modules/extra-params/components/snippet-config-extra-params.vue"],"sourcesContent":["<template>\n <ExtraParams :values=\"extraParams\" />\n</template>\n\n<script lang=\"ts\">\n import { forEach, Dictionary } from '@empathyco/x-utils';\n import { defineComponent, inject, PropType, ref, watch } from 'vue';\n import { SnippetConfig } from '../../../x-installer/api/api.types';\n import { extraParamsXModule } from '../x-module';\n import ExtraParams from './extra-params.vue';\n\n export default defineComponent({\n name: 'SnippetConfigExtraParams',\n xModule: extraParamsXModule.name,\n components: {\n ExtraParams\n },\n props: {\n values: {\n type: Object as PropType<Dictionary<unknown>>\n },\n excludedExtraParams: {\n type: Array as PropType<Array<keyof SnippetConfig>>,\n default: (): Array<keyof SnippetConfig> => [\n 'callbacks',\n 'productId',\n 'uiLang',\n 'consent',\n 'documentDirection',\n 'filters',\n 'isSpa',\n 'queriesPreview'\n ]\n }\n },\n setup(props) {\n const snippetConfig = inject('snippetConfig') as SnippetConfig;\n const extraParams = ref({});\n\n watch(\n [() => snippetConfig, () => props.values],\n () => {\n forEach({ ...props.values, ...snippetConfig }, (name, value) => {\n if (!props.excludedExtraParams.includes(name)) {\n extraParams.value = { ...extraParams.value, [name]: value };\n }\n });\n },\n {\n deep: true,\n immediate: true\n }\n );\n\n return {\n extraParams\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## See it in action\n\n_See how the snippet config is injected and passed to the SnippetConfigExtraParams component._\n\n```vue\n<template>\n <Provider>\n <SnippetConfigExtraParams />\n </Provider>\n</template>\n\n<script>\n import { SnippetConfigExtraParams } from '@empathyco/x-components/extra-params';\n\n const Provider = {\n provide: {\n snippetConfig: {\n instance: 'demo',\n lang: 'es',\n warehouse: 1234\n }\n }\n };\n\n export default {\n name: 'SnippetConfigExtraParamsDemo',\n components: {\n Provider,\n SnippetConfigExtraParams\n }\n };\n</script>\n```\n</docs>\n"],"names":["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ippet-config-extra-params.vue2.js","sources":["../../../../../src/x-modules/extra-params/components/snippet-config-extra-params.vue"],"sourcesContent":["<template>\n <ExtraParams :values=\"extraParams\" />\n</template>\n\n<script lang=\"ts\">\n import { forEach, Dictionary } from '@empathyco/x-utils';\n import { defineComponent, inject, PropType, ref, watch } from 'vue';\n import { SnippetConfig } from '../../../x-installer/api/api.types';\n import { extraParamsXModule } from '../x-module';\n import ExtraParams from './extra-params.vue';\n\n export default defineComponent({\n name: 'SnippetConfigExtraParams',\n xModule: extraParamsXModule.name,\n components: {\n ExtraParams\n },\n props: {\n values: {\n type: Object as PropType<Dictionary<unknown>>\n },\n excludedExtraParams: {\n type: Array as PropType<Array<keyof SnippetConfig>>,\n default: (): Array<keyof SnippetConfig> => [\n 'callbacks',\n 'productId',\n 'uiLang',\n 'consent',\n 'documentDirection',\n 'filters',\n 'isSpa',\n 'queriesPreview'\n ]\n }\n },\n setup(props) {\n const snippetConfig = inject('snippetConfig') as SnippetConfig;\n const extraParams = ref<Record<string, any>>({});\n\n watch(\n [() => snippetConfig, () => props.values],\n () => {\n forEach({ ...props.values, ...snippetConfig }, (name, value) => {\n if (!props.excludedExtraParams.includes(name) && extraParams.value[name] !== value) {\n extraParams.value = { ...extraParams.value, [name]: value };\n }\n });\n },\n {\n deep: true,\n immediate: true\n }\n );\n\n return {\n extraParams\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## See it in action\n\n_See how the snippet config is injected and passed to the SnippetConfigExtraParams component._\n\n```vue\n<template>\n <Provider>\n <SnippetConfigExtraParams />\n </Provider>\n</template>\n\n<script>\n import { SnippetConfigExtraParams } from '@empathyco/x-components/extra-params';\n\n const Provider = {\n provide: {\n snippetConfig: {\n instance: 'demo',\n lang: 'es',\n warehouse: 1234\n }\n }\n };\n\n export default {\n name: 'SnippetConfigExtraParamsDemo',\n components: {\n Provider,\n SnippetConfigExtraParams\n }\n };\n</script>\n```\n</docs>\n"],"names":["ExtraParams"],"mappings":";;;;;AAWE,gB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CAAA,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"facets.vue.js","sources":["../../../../../../src/x-modules/facets/components/facets/facets.vue"],"sourcesContent":["<template>\n <component :is=\"animation\" v-if=\"hasFacets\" class=\"x-facets-list\" data-test=\"facets\" tag=\"ul\">\n <li\n v-for=\"({ facet, slotNameById, slotNameByModelName }, facetId) in mappedFacets\"\n :key=\"facetId\"\n class=\"x-facets-list__item\"\n data-test=\"facets-facet\"\n >\n <!--\n @slot Customized Facet rendering. Specifying a slot with the facet's name will result in the\n facet using that slot composition to render.\n @binding {Facet} facet - Facet to render\n @binding {Filter[]} selectedFilters - List of selected filters of the given facet\n -->\n <slot\n v-if=\"hasSlot(slotNameById)\"\n v-bind=\"{\n facet,\n selectedFilters: selectedFiltersByFacet[facetId] || []\n }\"\n :name=\"slotNameById\"\n />\n <!--\n @slot Customized Facet rendering. Specifying a slot with the facet's modelName will result\n in the facet using that slot composition to render.\n @binding {Facet} facet - Facet to render\n @binding {Filter[]} selectedFilters - List of selected filters of the given facet\n -->\n <slot\n v-else-if=\"hasSlot(slotNameByModelName)\"\n v-bind=\"{\n facet,\n selectedFilters: selectedFiltersByFacet[facetId] || []\n }\"\n :name=\"slotNameByModelName\"\n />\n <!--\n @slot (required) Default Facet rendering. This slot will be used by default for rendering\n the facets without an specific slot implementation.\n @binding {Facet} facet - Facet to render\n @binding {Filter[]} selectedFilters - List of selected filters of the given facet\n -->\n <slot\n v-else\n v-bind=\"{\n facet,\n selectedFilters: selectedFiltersByFacet[facetId] || []\n }\"\n >\n This is the {{ facet.label }} facet. Pass something into its slot to display content.\n </slot>\n </li>\n </component>\n</template>\n\n<script lang=\"ts\">\n import { Facet } from '@empathyco/x-types';\n import { Dictionary, map, objectFilter } from '@empathyco/x-utils';\n import { computed, ComputedRef, defineComponent, PropType } from 'vue';\n import { useGetter } from '../../../../composables/use-getter';\n import { animationProp } from '../../../../utils/options-api';\n import { toKebabCase } from '../../../../utils/string';\n import { useFacets } from '../../composables/use-facets';\n import { facetsXModule } from '../../x-module';\n\n /**\n * Custom interface to provide a slot name to a Facet.\n *\n * @internal\n */\n interface RenderFacet {\n slotNameById: string;\n slotNameByModelName: string;\n facet: Facet;\n }\n\n /**\n * This component renders the list of facets stored in the Facets module. Facets can be rendered\n * differently based on their purpose and this can be achieved using the exposed slots:\n * - A default and required slot.\n * - A custom slot for each facet with the facetId as its name. This allows each facet to be\n * rendered differently based on its needs.\n *\n * @public\n */\n export default defineComponent({\n name: 'Facets',\n xModule: facetsXModule.name,\n props: {\n /** Array of facets ids used to get the selected filters for those facets. */\n facetsIds: Array as PropType<Array<Facet['id']>>,\n /** Flag to render the component even if there are no filters selected. */\n alwaysVisible: Boolean,\n /** Animation component that will be used to animate the facets. */\n animation: {\n type: animationProp,\n default: 'ul'\n },\n /**\n * Discriminates the facets rendered by this component. It expects a string containing facets\n * ids, comma separated. This property will include or exclude facets based on its value.\n * The default value is an empty string and the component will render all existing facets.\n *\n * @remarks\n * To behave as a `include`, simply set the facets ids, comma separated:\n * `existingFacets=[{ brand: ... }, category: { ... }, color: { ... }, price: { ... }]`\n * `renderableFacets=\"brand, category\"`\n *\n * The component will render brand and category facets.\n *\n * On the other hand, to simulate an `exclude` behaviour and exclude a facet from being\n * rendered, append a '!' before its id:\n * `existingFacets=[{ brand: ... }, category: { ... }, color: { ... }, price: { ... }]`\n * `renderableFacets=\"!brand,!price\"`\n *\n * The component will render category and color facets.\n */\n renderableFacets: String\n },\n setup: function (props, { slots }) {\n const { selectedFiltersByFacet } = useFacets(props);\n\n const { facets } = useGetter('facets', ['facets']) as {\n /** Dictionary of facets in the state. */\n facets: ComputedRef<Record<Facet['id'], Facet>>;\n };\n\n /**\n * The facets to be rendered after filtering {@link Facets.facets} by\n * {@link Facets.renderableFacets} content.\n *\n * @returns The list of facets to be rendered.\n */\n const facetsToRender = computed<Dictionary<Facet>>(() => {\n if (!props.renderableFacets) {\n return facets.value;\n } else {\n const excludedRegExp = /^!/;\n const facetIds: string[] = props.renderableFacets\n .split(',')\n .map(facetId => facetId.trim());\n const included: string[] = [];\n const excluded: string[] = [];\n facetIds.forEach(facetId => {\n if (excludedRegExp.test(facetId)) {\n excluded.push(facetId.replace(excludedRegExp, ''));\n } else {\n included.push(facetId);\n }\n });\n\n return filterFacetsToRender(included, excluded);\n }\n });\n\n /**\n * Transforms a dictionary of Facets including the slot name.\n *\n * @returns A dictionary of facets with the slot name.\n */\n const mappedFacets = computed<Dictionary<RenderFacet>>(() => {\n return map(facetsToRender.value, (facetId, facet) => ({\n slotNameById: toKebabCase(facetId),\n slotNameByModelName: toKebabCase(facet.modelName),\n facet\n }));\n });\n\n /**\n * Indicates if there are facets available to show.\n *\n * @returns True if there are facets available and false otherwise.\n */\n const hasFacets = computed<boolean>(() => !!Object.keys(facetsToRender.value).length);\n\n /**\n * Filter facets dictionary retrieving those included and/or removing excluded.\n *\n * @param included - List of facets to render.\n * @param excluded - List of not renderable facets.\n *\n * @returns The filtered list of facets to render.\n */\n function filterFacetsToRender(included: string[], excluded: string[]): Dictionary<Facet> {\n const hasAnyFacetIncluded = included.length > 0;\n return objectFilter(facets.value, facetKey => {\n const isIncluded = included.includes(String(facetKey));\n const isExcluded = excluded.includes(String(facetKey));\n\n return hasAnyFacetIncluded ? isIncluded && !isExcluded : !isExcluded;\n });\n }\n\n /**\n * Whether the slot is present in the template or not.\n *\n * @param name - The slot name.\n *\n * @returns True is the slot is present in the template. False otherwise.\n */\n function hasSlot(name: string): boolean {\n return !!slots[name];\n }\n\n return {\n selectedFiltersByFacet,\n hasFacets,\n mappedFacets,\n hasSlot\n };\n }\n });\n</script>\n\n<style lang=\"css\" scoped>\n .x-facets-list {\n display: flex;\n flex-flow: column nowrap;\n list-style-type: none;\n }\n</style>\n\n<docs lang=\"mdx\">\n## Example\n\nThis component renders the list of facets stored in the Facets module. Facets can be rendered\ndifferently based on their purpose and this can be achieved using the exposed slots:\n\n- A default and required slot.\n- A custom slot for each facet with the facetId as its name. This allows each facet to be rendered\n differently based on its needs.\n\nBelow, there are some examples showing how to use the component with its different configurations.\n\n### Default usage\n\nThe default slot of this component is mandatory. If no other slot is defined, every Facet will be\nrendered as specified in the default slot.\n\n```vue\n<template>\n <Facets>\n <template #default=\"{ facet, selectedFilters }\">\n <h1>{{ ${facet.label} }}</h1>\n <span v-if=\"selectedFilters.length > 0\">{{ `${selectedFilters.length} selected` }}</span>\n\n <ul>\n <li v-for=\"filter in facet.filters\" :key=\"filter.id\">\n {{ filter.label }}\n </li>\n </ul>\n </template>\n </Facets>\n</template>\n\n<script>\n import { Facets } from '@empathyco/x-components/facets';\n\n export default {\n components: {\n Facets\n }\n };\n</script>\n```\n\n### Customized usage\n\nCustomized compositions for a specific Facet can be achieved by using a slot with the same id as the\nfacet to customize. For example, the Facet with the id \"color\" requires a composition that differs\nfrom the rest of the Facets. Doing it in a slot with the name \"color\" will apply this customization\njust to the \"color\" Facet. The other facets will fallback to the composition of the default slot.\n\nIt is also possible to customize the Facet content by the facet \"model name\". For example, to\nconfigure different content for \"Hierarchical Facets\" the \"hierarchical-facet\" slot will apply that\ncustomization. This can be combined with the facets by facet id. If some hierarchical facet needs\nsome different customization from the rest of the hierarchical, it can be achieve using the slot\nwith the facet id.\n\n```vue\n<template>\n <Facets>\n <template #color=\"{ facet, selectedFilters }\">\n <span v-if=\"selectedFilters.length > 0\">{{ `${selectedFilters.length} colors chosen` }}</span>\n\n <ul v-for=\"filter in facet.filters\" :key=\"filter.id\">\n <li v-if=\"!filter.selected\">\n {{ filter.label }}\n </li>\n </ul>\n </template>\n\n <template #hierarchical-facet=\"{ facet, selectedFilters }\">\n <span v-if=\"selectedFilters.length > 0\">{{ `${selectedFilters.length} colors chosen` }}</span>\n\n <ul v-for=\"filter in facet.filters\" :key=\"filter.id\">\n <li v-if=\"!filter.selected\">\n {{ filter.label }}\n <ul v-for=\"childFilter in filter.children\" :key=\"filter.id\">\n <li v-if=\"!childFilter.selected\">\n {{ childFilter.label }}\n </li>\n </ul>\n </li>\n </ul>\n </template>\n\n <template #default=\"{ facet }\">\n <h1>{{ facet.label }}</h1>\n\n <ul>\n <li v-for=\"filter in facet.filters\" :key=\"filter.id\">\n {{ filter.label }}\n </li>\n </ul>\n </template>\n </Facets>\n</template>\n\n<script>\n import { Facets } from '@empathyco/x-components/facets';\n\n export default {\n components: {\n Facets\n }\n };\n</script>\n```\n\n### Render specific facets I\n\nBy default, this component will render all existing facets. However, it has the renderableFacets\nprop to filter which facets will be rendered. Its value is a string containing the different facets\nids. This value is treated as an include or exclude list (to exclude a facet from being rendered,\njust prefix its id with a `!`). The component will only render included facets and discard excluded\nones. In the following example, the component will only render color and category facets.\n\n```vue\n<template>\n <Facets renderableFacets=\"color, category\">\n <template #default=\"{ facet }\">\n <h1>{{ facet.label }}</h1>\n\n <ul>\n <li v-for=\"filter in facet.filters\" :key=\"filter.id\">\n {{ filter.label }}\n </li>\n </ul>\n </template>\n </Facets>\n</template>\n\n<script>\n import { Facets } from '@empathyco/x-components/facets';\n\n export default {\n components: {\n Facets\n }\n };\n</script>\n```\n\n### Render specific facets II\n\nExclude facets so the component does not render them. In the following example, the component will\nrender every facet except color and price.\n\n```vue\n<template>\n <Facets renderableFacets=\"!color, !price\">\n <template #default=\"{ facet }\">\n <h1>{{ facet.label }}</h1>\n\n <ul>\n <li v-for=\"filter in facet.filters\" :key=\"filter.id\">\n {{ filter.label }}\n </li>\n </ul>\n </template>\n </Facets>\n</template>\n\n<script>\n import { Facets } from '@empathyco/x-components/facets';\n\n export default {\n components: {\n Facets\n }\n };\n</script>\n```\n\n### Integrating with the filters components\n\nThere are many components that will help you build your own awesome filters list. `Facets` just\nrenders the list, but what to render for each facet is up to you. Below you can see an example. of\nthe `Facets` component using the `FiltersSearch` `MultiSelectFilters`, `SimpleFilter`, `Filters`,\n`HierarchicalFilter`, `NumberRangeFilter` and `BasePriceFilterLabel`.\n\n```vue\n<template>\n <Facets>\n <template #default=\"{ facet, selectedFilters }\">\n <h1>{{ facet.label }}</h1>\n <FiltersSearch :filters=\"facet.filters\">\n <MultiSelectFilters v-slot=\"{ filter }\">\n <SimpleFilter :filter=\"filter\" />\n </MultiSelectFilters>\n </FiltersSearch>\n </template>\n\n <template #category=\"{ facet }\">\n <h1>{{ facet.label }}</h1>\n <Filters v-slot=\"{ filter }\" :filters=\"facet.filters\">\n <HierarchicalFilter :filter=\"filter\" />\n </Filters>\n </template>\n\n <template #price=\"{ facet }\">\n <h1>{{ facet.label }}</h1>\n <Filters v-slot=\"{ filter }\" :filters=\"facet.filters\">\n <NumberRangeFilter :filter=\"filter\">\n <BasePriceFilterLabel :filter=\"filter\" />\n </NumberRangeFilter>\n </Filters>\n </template>\n </Facets>\n</template>\n\n<script>\n import {\n Facets,\n Filters,\n FiltersSearch,\n HierarchicalFilter,\n MultiSelectFilters,\n NumberRangeFilter,\n SimpleFilter\n } from '@empathyco/x-components/facets';\n\n import { BasePriceFilterLabel } from '@empathyco/x-components';\n\n export default {\n components: {\n Facets,\n MultiSelectFilters,\n FiltersSearch,\n SimpleFilter,\n Filters,\n HierarchicalFilter,\n NumberRangeFilter,\n BasePriceFilterLabel\n }\n };\n</script>\n```\n</docs>\n"],"names":["animation","_openBlock","_createBlock","_resolveDynamicComponent","_createElementBlock","_Fragment","_renderList","hasSlot","_createCommentVNode","_renderSlot","_mergeProps","selectedFiltersByFacet"],"mappings":";;;;;AACE,SAAA,WAAA,CAAA,IAAA,EAAA,MAAA,EADF,MACkBA,EAAAA,MAAAA,EAAAA,KAAAA,EAAAA,QAAAA,EAAAA;AADlB,EAAA,OAAA,IAAA,CAAA,SAAA,IAAAC,SAAA,EACmE,EAAAC,WAAA,CAAAC,uBAAA,CAAA,IAAA,CAAA,SAAA,CAAA,EAAA;AAAA,IAAC,GAAA,EAAA,CAAA;AAAA,IAAmB,KAAI,EAAA,eAAA;AAAA,IAAA,WAAA,EAAA,QAAA;AAD3F,IAAA,GAAA,EAAA,IAAA;AAAA,GAAA,EAAA;;iBAIY,IAAO,CAAA,EAAAC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uBD,UAAO,CAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAA;AAAA,kBAAA,KAAA;AA5C5F,kBAAA,eAAA,EAAA,IAAA,CAAA,sBAAA,CAgDO,OACa,CAAA,IAAA,EAAA;AAAA,iBAAA,CAAA,EAAA,MAAA;;;;;;;;;;;;AAjDpB,SAAA,CAAA;AAAA,QAAA,GAAA;AAAA;AAAA,OAAA;AAAA,KAAA,CAAA;AAAA,IAAA,CAAA,EAAA,CAAA;AAAA;AAAA,GAAA,CAAA,IAAAF,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA,CAAA;;;;;;"}
1
+ {"version":3,"file":"facets.vue.js","sources":["../../../../../../src/x-modules/facets/components/facets/facets.vue"],"sourcesContent":["<template>\n <component :is=\"animation\" v-if=\"hasFacets\" class=\"x-facets-list\" data-test=\"facets\" tag=\"ul\">\n <li\n v-for=\"({ facet, slotNameById, slotNameByModelName }, facetId) in mappedFacets\"\n :key=\"facetId\"\n class=\"x-facets-list__item\"\n data-test=\"facets-facet\"\n >\n <!--\n @slot Customized Facet rendering. Specifying a slot with the facet's name will result in the\n facet using that slot composition to render.\n @binding {Facet} facet - Facet to render\n @binding {Filter[]} selectedFilters - List of selected filters of the given facet\n -->\n <slot\n v-if=\"hasSlot(slotNameById)\"\n v-bind=\"{\n facet,\n selectedFilters: selectedFiltersByFacet[facetId] || []\n }\"\n :name=\"slotNameById\"\n />\n <!--\n @slot Customized Facet rendering. Specifying a slot with the facet's modelName will result\n in the facet using that slot composition to render.\n @binding {Facet} facet - Facet to render\n @binding {Filter[]} selectedFilters - List of selected filters of the given facet\n -->\n <slot\n v-else-if=\"hasSlot(slotNameByModelName)\"\n v-bind=\"{\n facet,\n selectedFilters: selectedFiltersByFacet[facetId] || []\n }\"\n :name=\"slotNameByModelName\"\n />\n <!--\n @slot (required) Default Facet rendering. This slot will be used by default for rendering\n the facets without an specific slot implementation.\n @binding {Facet} facet - Facet to render\n @binding {Filter[]} selectedFilters - List of selected filters of the given facet\n -->\n <slot\n v-else\n v-bind=\"{\n facet,\n selectedFilters: selectedFiltersByFacet[facetId] || []\n }\"\n >\n This is the {{ facet.label }} facet. Pass something into its slot to display content.\n </slot>\n </li>\n </component>\n</template>\n\n<script lang=\"ts\">\n import { Facet } from '@empathyco/x-types';\n import { Dictionary, map, objectFilter } from '@empathyco/x-utils';\n import { computed, ComputedRef, defineComponent, PropType } from 'vue';\n import { useGetter } from '../../../../composables/use-getter';\n import { toKebabCase } from '../../../../utils/string';\n import { useFacets } from '../../composables/use-facets';\n import { facetsXModule } from '../../x-module';\n import { AnimationProp } from '../../../../types';\n\n /**\n * Custom interface to provide a slot name to a Facet.\n *\n * @internal\n */\n interface RenderFacet {\n slotNameById: string;\n slotNameByModelName: string;\n facet: Facet;\n }\n\n /**\n * This component renders the list of facets stored in the Facets module. Facets can be rendered\n * differently based on their purpose and this can be achieved using the exposed slots:\n * - A default and required slot.\n * - A custom slot for each facet with the facetId as its name. This allows each facet to be\n * rendered differently based on its needs.\n *\n * @public\n */\n export default defineComponent({\n name: 'Facets',\n xModule: facetsXModule.name,\n props: {\n /** Array of facets ids used to get the selected filters for those facets. */\n facetsIds: Array as PropType<Array<Facet['id']>>,\n /** Flag to render the component even if there are no filters selected. */\n alwaysVisible: Boolean,\n /** Animation component that will be used to animate the facets. */\n animation: {\n type: AnimationProp,\n default: 'ul'\n },\n /**\n * Discriminates the facets rendered by this component. It expects a string containing facets\n * ids, comma separated. This property will include or exclude facets based on its value.\n * The default value is an empty string and the component will render all existing facets.\n *\n * @remarks\n * To behave as a `include`, simply set the facets ids, comma separated:\n * `existingFacets=[{ brand: ... }, category: { ... }, color: { ... }, price: { ... }]`\n * `renderableFacets=\"brand, category\"`\n *\n * The component will render brand and category facets.\n *\n * On the other hand, to simulate an `exclude` behaviour and exclude a facet from being\n * rendered, append a '!' before its id:\n * `existingFacets=[{ brand: ... }, category: { ... }, color: { ... }, price: { ... }]`\n * `renderableFacets=\"!brand,!price\"`\n *\n * The component will render category and color facets.\n */\n renderableFacets: String\n },\n setup: function (props, { slots }) {\n const { selectedFiltersByFacet } = useFacets(props);\n\n const { facets } = useGetter('facets', ['facets']) as {\n /** Dictionary of facets in the state. */\n facets: ComputedRef<Record<Facet['id'], Facet>>;\n };\n\n /**\n * The facets to be rendered after filtering {@link Facets.facets} by\n * {@link Facets.renderableFacets} content.\n *\n * @returns The list of facets to be rendered.\n */\n const facetsToRender = computed<Dictionary<Facet>>(() => {\n if (!props.renderableFacets) {\n return facets.value;\n } else {\n const excludedRegExp = /^!/;\n const facetIds: string[] = props.renderableFacets\n .split(',')\n .map(facetId => facetId.trim());\n const included: string[] = [];\n const excluded: string[] = [];\n facetIds.forEach(facetId => {\n if (excludedRegExp.test(facetId)) {\n excluded.push(facetId.replace(excludedRegExp, ''));\n } else {\n included.push(facetId);\n }\n });\n\n return filterFacetsToRender(included, excluded);\n }\n });\n\n /**\n * Transforms a dictionary of Facets including the slot name.\n *\n * @returns A dictionary of facets with the slot name.\n */\n const mappedFacets = computed<Dictionary<RenderFacet>>(() => {\n return map(facetsToRender.value, (facetId, facet) => ({\n slotNameById: toKebabCase(facetId),\n slotNameByModelName: toKebabCase(facet.modelName),\n facet\n }));\n });\n\n /**\n * Indicates if there are facets available to show.\n *\n * @returns True if there are facets available and false otherwise.\n */\n const hasFacets = computed<boolean>(() => !!Object.keys(facetsToRender.value).length);\n\n /**\n * Filter facets dictionary retrieving those included and/or removing excluded.\n *\n * @param included - List of facets to render.\n * @param excluded - List of not renderable facets.\n *\n * @returns The filtered list of facets to render.\n */\n function filterFacetsToRender(included: string[], excluded: string[]): Dictionary<Facet> {\n const hasAnyFacetIncluded = included.length > 0;\n return objectFilter(facets.value, facetKey => {\n const isIncluded = included.includes(String(facetKey));\n const isExcluded = excluded.includes(String(facetKey));\n\n return hasAnyFacetIncluded ? isIncluded && !isExcluded : !isExcluded;\n });\n }\n\n /**\n * Whether the slot is present in the template or not.\n *\n * @param name - The slot name.\n *\n * @returns True is the slot is present in the template. False otherwise.\n */\n function hasSlot(name: string): boolean {\n return !!slots[name];\n }\n\n return {\n selectedFiltersByFacet,\n hasFacets,\n mappedFacets,\n hasSlot\n };\n }\n });\n</script>\n\n<style lang=\"css\" scoped>\n .x-facets-list {\n display: flex;\n flex-flow: column nowrap;\n list-style-type: none;\n }\n</style>\n\n<docs lang=\"mdx\">\n## Example\n\nThis component renders the list of facets stored in the Facets module. Facets can be rendered\ndifferently based on their purpose and this can be achieved using the exposed slots:\n\n- A default and required slot.\n- A custom slot for each facet with the facetId as its name. This allows each facet to be rendered\n differently based on its needs.\n\nBelow, there are some examples showing how to use the component with its different configurations.\n\n### Default usage\n\nThe default slot of this component is mandatory. If no other slot is defined, every Facet will be\nrendered as specified in the default slot.\n\n```vue\n<template>\n <Facets>\n <template #default=\"{ facet, selectedFilters }\">\n <h1>{{ ${facet.label} }}</h1>\n <span v-if=\"selectedFilters.length > 0\">{{ `${selectedFilters.length} selected` }}</span>\n\n <ul>\n <li v-for=\"filter in facet.filters\" :key=\"filter.id\">\n {{ filter.label }}\n </li>\n </ul>\n </template>\n </Facets>\n</template>\n\n<script>\n import { Facets } from '@empathyco/x-components/facets';\n\n export default {\n components: {\n Facets\n }\n };\n</script>\n```\n\n### Customized usage\n\nCustomized compositions for a specific Facet can be achieved by using a slot with the same id as the\nfacet to customize. For example, the Facet with the id \"color\" requires a composition that differs\nfrom the rest of the Facets. Doing it in a slot with the name \"color\" will apply this customization\njust to the \"color\" Facet. The other facets will fallback to the composition of the default slot.\n\nIt is also possible to customize the Facet content by the facet \"model name\". For example, to\nconfigure different content for \"Hierarchical Facets\" the \"hierarchical-facet\" slot will apply that\ncustomization. This can be combined with the facets by facet id. If some hierarchical facet needs\nsome different customization from the rest of the hierarchical, it can be achieve using the slot\nwith the facet id.\n\n```vue\n<template>\n <Facets>\n <template #color=\"{ facet, selectedFilters }\">\n <span v-if=\"selectedFilters.length > 0\">{{ `${selectedFilters.length} colors chosen` }}</span>\n\n <ul v-for=\"filter in facet.filters\" :key=\"filter.id\">\n <li v-if=\"!filter.selected\">\n {{ filter.label }}\n </li>\n </ul>\n </template>\n\n <template #hierarchical-facet=\"{ facet, selectedFilters }\">\n <span v-if=\"selectedFilters.length > 0\">{{ `${selectedFilters.length} colors chosen` }}</span>\n\n <ul v-for=\"filter in facet.filters\" :key=\"filter.id\">\n <li v-if=\"!filter.selected\">\n {{ filter.label }}\n <ul v-for=\"childFilter in filter.children\" :key=\"filter.id\">\n <li v-if=\"!childFilter.selected\">\n {{ childFilter.label }}\n </li>\n </ul>\n </li>\n </ul>\n </template>\n\n <template #default=\"{ facet }\">\n <h1>{{ facet.label }}</h1>\n\n <ul>\n <li v-for=\"filter in facet.filters\" :key=\"filter.id\">\n {{ filter.label }}\n </li>\n </ul>\n </template>\n </Facets>\n</template>\n\n<script>\n import { Facets } from '@empathyco/x-components/facets';\n\n export default {\n components: {\n Facets\n }\n };\n</script>\n```\n\n### Render specific facets I\n\nBy default, this component will render all existing facets. However, it has the renderableFacets\nprop to filter which facets will be rendered. Its value is a string containing the different facets\nids. This value is treated as an include or exclude list (to exclude a facet from being rendered,\njust prefix its id with a `!`). The component will only render included facets and discard excluded\nones. In the following example, the component will only render color and category facets.\n\n```vue\n<template>\n <Facets renderableFacets=\"color, category\">\n <template #default=\"{ facet }\">\n <h1>{{ facet.label }}</h1>\n\n <ul>\n <li v-for=\"filter in facet.filters\" :key=\"filter.id\">\n {{ filter.label }}\n </li>\n </ul>\n </template>\n </Facets>\n</template>\n\n<script>\n import { Facets } from '@empathyco/x-components/facets';\n\n export default {\n components: {\n Facets\n }\n };\n</script>\n```\n\n### Render specific facets II\n\nExclude facets so the component does not render them. In the following example, the component will\nrender every facet except color and price.\n\n```vue\n<template>\n <Facets renderableFacets=\"!color, !price\">\n <template #default=\"{ facet }\">\n <h1>{{ facet.label }}</h1>\n\n <ul>\n <li v-for=\"filter in facet.filters\" :key=\"filter.id\">\n {{ filter.label }}\n </li>\n </ul>\n </template>\n </Facets>\n</template>\n\n<script>\n import { Facets } from '@empathyco/x-components/facets';\n\n export default {\n components: {\n Facets\n }\n };\n</script>\n```\n\n### Integrating with the filters components\n\nThere are many components that will help you build your own awesome filters list. `Facets` just\nrenders the list, but what to render for each facet is up to you. Below you can see an example. of\nthe `Facets` component using the `FiltersSearch` `MultiSelectFilters`, `SimpleFilter`, `Filters`,\n`HierarchicalFilter`, `NumberRangeFilter` and `BasePriceFilterLabel`.\n\n```vue\n<template>\n <Facets>\n <template #default=\"{ facet, selectedFilters }\">\n <h1>{{ facet.label }}</h1>\n <FiltersSearch :filters=\"facet.filters\">\n <MultiSelectFilters v-slot=\"{ filter }\">\n <SimpleFilter :filter=\"filter\" />\n </MultiSelectFilters>\n </FiltersSearch>\n </template>\n\n <template #category=\"{ facet }\">\n <h1>{{ facet.label }}</h1>\n <Filters v-slot=\"{ filter }\" :filters=\"facet.filters\">\n <HierarchicalFilter :filter=\"filter\" />\n </Filters>\n </template>\n\n <template #price=\"{ facet }\">\n <h1>{{ facet.label }}</h1>\n <Filters v-slot=\"{ filter }\" :filters=\"facet.filters\">\n <NumberRangeFilter :filter=\"filter\">\n <BasePriceFilterLabel :filter=\"filter\" />\n </NumberRangeFilter>\n </Filters>\n </template>\n </Facets>\n</template>\n\n<script>\n import {\n Facets,\n Filters,\n FiltersSearch,\n HierarchicalFilter,\n MultiSelectFilters,\n NumberRangeFilter,\n SimpleFilter\n } from '@empathyco/x-components/facets';\n\n import { BasePriceFilterLabel } from '@empathyco/x-components';\n\n export default {\n components: {\n Facets,\n MultiSelectFilters,\n FiltersSearch,\n SimpleFilter,\n Filters,\n HierarchicalFilter,\n NumberRangeFilter,\n BasePriceFilterLabel\n }\n };\n</script>\n```\n</docs>\n"],"names":["animation","_openBlock","_createBlock","_resolveDynamicComponent","_createElementBlock","_Fragment","_renderList","hasSlot","_createCommentVNode","_renderSlot","_mergeProps","selectedFiltersByFacet"],"mappings":";;;;;AACE,SAAA,WAAA,CAAA,IAAA,EAAA,MAAA,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C,UAAA,CAA6BE,IAA8B,CAAA,MAAA,EAAA,mBAAA,EAAAD,UAAA,CAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAA;AAAA,kBAAA,KAAA;;;;AAMtF,cAAA,IAAA;AAAA;AAAA,aAAA,KAAAT,SAAA,EAcO,EAAAG,kBAAA;AAAA,cAAAC,QAAA;AAAA,cARP,EA1CN,GAAA,EAAA,CAAA,EAAA;AAAA,cAAA;AAAA,gBA4CiCG,kBAAA,CAAA,+TAAA,CAAA;AAAA,gBAAAC,UAAA,CAA6BE,wBAAuBD,UAAO,CAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAA;AAAA,kBAAA,KAAA;AA5C5F,kBAAA,eAAA,EAAA,IAAA,CAAA,sBAAA,CAgDO,OACa,CAAA,IAAA,EAAA;AAAA,iBAAA,CAAA,EAAA,MAAA;;;;;;;;;;;;AAjDpB,SAAA,CAAA;AAAA,QAAA,GAAA;AAAA;AAAA,OAAA;AAAA,KAAA,CAAA;AAAA,IAAA,CAAA,EAAA,CAAA;AAAA;AAAA,GAAA,CAAA,IAAAF,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA,CAAA;;;;;;"}
@@ -1,10 +1,10 @@
1
1
  import { map, objectFilter } from '@empathyco/x-utils';
2
2
  import { defineComponent, computed } from 'vue';
3
3
  import { useGetter } from '../../../../composables/use-getter.js';
4
- import { animationProp } from '../../../../utils/options-api.js';
5
4
  import { toKebabCase } from '../../../../utils/string.js';
6
5
  import { useFacets } from '../../composables/use-facets.js';
7
6
  import { facetsXModule } from '../../x-module.js';
7
+ import { AnimationProp } from '../../../../types/animation-prop.js';
8
8
 
9
9
  /**
10
10
  * This component renders the list of facets stored in the Facets module. Facets can be rendered
@@ -25,7 +25,7 @@ var _sfc_main = defineComponent({
25
25
  alwaysVisible: Boolean,
26
26
  /** Animation component that will be used to animate the facets. */
27
27
  animation: {
28
- type: animationProp,
28
+ type: AnimationProp,
29
29
  default: 'ul'
30
30
  },
31
31
  /**