@empathyco/x-components 7.3.1 → 7.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (264) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/browse/index.d.ts +1 -0
  3. package/browse/index.js +15 -0
  4. package/core/index.js.map +1 -1
  5. package/docs/API-reference/api/x-components.basexapi.browse.md +54 -0
  6. package/docs/API-reference/api/x-components.basexapi.md +14 -0
  7. package/docs/API-reference/api/x-components.browseactioncontext.md +15 -0
  8. package/docs/API-reference/api/x-components.browseactions.cancelfetchandsavebrowseresponse.md +13 -0
  9. package/docs/API-reference/api/x-components.browseactions.fetchandsavebrowseresponse.md +13 -0
  10. package/docs/API-reference/api/x-components.browseactions.fetchandsaveresultsenrichment.md +13 -0
  11. package/docs/API-reference/api/x-components.browseactions.fetchbrowseresponse.md +13 -0
  12. package/docs/API-reference/api/x-components.browseactions.increasepageappendingresults.md +18 -0
  13. package/docs/API-reference/api/x-components.browseactions.md +210 -0
  14. package/docs/API-reference/api/x-components.browseactions.resetrequestonrefinement.md +13 -0
  15. package/docs/API-reference/api/x-components.browseactions.savebrowseresponse.md +13 -0
  16. package/docs/API-reference/api/x-components.browseactions.saveorigin.md +13 -0
  17. package/docs/API-reference/api/x-components.browseactions.seturlparams.md +13 -0
  18. package/docs/API-reference/api/x-components.browseconfig.md +75 -0
  19. package/docs/API-reference/api/x-components.browseconfig.pagemode.md +11 -0
  20. package/docs/API-reference/api/x-components.browseconfig.pagesize.md +13 -0
  21. package/docs/API-reference/api/x-components.browsegetters.md +58 -0
  22. package/docs/API-reference/api/x-components.browsegetters.request.md +13 -0
  23. package/docs/API-reference/api/x-components.browsemutations.appendresults.md +13 -0
  24. package/docs/API-reference/api/x-components.browsemutations.md +458 -0
  25. package/docs/API-reference/api/x-components.browsemutations.resetstate.md +13 -0
  26. package/docs/API-reference/api/x-components.browsemutations.resetstateforreload.md +13 -0
  27. package/docs/API-reference/api/x-components.browsemutations.setbanners.md +13 -0
  28. package/docs/API-reference/api/x-components.browsemutations.setbrowsetagging.md +13 -0
  29. package/docs/API-reference/api/x-components.browsemutations.setdisplaybrowsetagging.md +13 -0
  30. package/docs/API-reference/api/x-components.browsemutations.setfacets.md +13 -0
  31. package/docs/API-reference/api/x-components.browsemutations.setfromnoresultswithfilters.md +13 -0
  32. package/docs/API-reference/api/x-components.browsemutations.setisappendresults.md +13 -0
  33. package/docs/API-reference/api/x-components.browsemutations.setisnoresults.md +13 -0
  34. package/docs/API-reference/api/x-components.browsemutations.setorigin.md +13 -0
  35. package/docs/API-reference/api/x-components.browsemutations.setpage.md +13 -0
  36. package/docs/API-reference/api/x-components.browsemutations.setparams.md +13 -0
  37. package/docs/API-reference/api/x-components.browsemutations.setpromoteds.md +13 -0
  38. package/docs/API-reference/api/x-components.browsemutations.setresults.md +13 -0
  39. package/docs/API-reference/api/x-components.browsemutations.setselectedcategory.md +13 -0
  40. package/docs/API-reference/api/x-components.browsemutations.setselectedfilters.md +13 -0
  41. package/docs/API-reference/api/x-components.browsemutations.setsort.md +13 -0
  42. package/docs/API-reference/api/x-components.browsemutations.setstats.md +13 -0
  43. package/docs/API-reference/api/x-components.browsemutations.settotalresults.md +13 -0
  44. package/docs/API-reference/api/x-components.browsemutations.updateresult.md +13 -0
  45. package/docs/API-reference/api/x-components.browsemutations.updateresultsfromenrichment.md +13 -0
  46. package/docs/API-reference/api/x-components.browserequest.md +13 -0
  47. package/docs/API-reference/api/x-components.browseresultslist.md +31 -0
  48. package/docs/API-reference/api/x-components.browsesortpickerlist.md +45 -0
  49. package/docs/API-reference/api/x-components.browsestate.banners.md +13 -0
  50. package/docs/API-reference/api/x-components.browsestate.browsetagging.md +13 -0
  51. package/docs/API-reference/api/x-components.browsestate.config.md +13 -0
  52. package/docs/API-reference/api/x-components.browsestate.displaybrowsetagging.md +13 -0
  53. package/docs/API-reference/api/x-components.browsestate.facets.md +13 -0
  54. package/docs/API-reference/api/x-components.browsestate.fromnoresultswithfilters.md +13 -0
  55. package/docs/API-reference/api/x-components.browsestate.isappendresults.md +13 -0
  56. package/docs/API-reference/api/x-components.browsestate.isnoresults.md +13 -0
  57. package/docs/API-reference/api/x-components.browsestate.md +382 -0
  58. package/docs/API-reference/api/x-components.browsestate.origin.md +13 -0
  59. package/docs/API-reference/api/x-components.browsestate.page.md +13 -0
  60. package/docs/API-reference/api/x-components.browsestate.params.md +13 -0
  61. package/docs/API-reference/api/x-components.browsestate.promoteds.md +13 -0
  62. package/docs/API-reference/api/x-components.browsestate.results.md +13 -0
  63. package/docs/API-reference/api/x-components.browsestate.selectedcategory.md +13 -0
  64. package/docs/API-reference/api/x-components.browsestate.selectedfilters.md +13 -0
  65. package/docs/API-reference/api/x-components.browsestate.sort.md +13 -0
  66. package/docs/API-reference/api/x-components.browsestate.stats.md +13 -0
  67. package/docs/API-reference/api/x-components.browsestate.totalresults.md +13 -0
  68. package/docs/API-reference/api/x-components.browsexevents.browserequestchanged.md +13 -0
  69. package/docs/API-reference/api/x-components.browsexevents.browserequestupdated.md +18 -0
  70. package/docs/API-reference/api/x-components.browsexevents.browseresponsechanged.md +13 -0
  71. package/docs/API-reference/api/x-components.browsexevents.browsetaggingchanged.md +13 -0
  72. package/docs/API-reference/api/x-components.browsexevents.md +172 -0
  73. package/docs/API-reference/api/x-components.browsexevents.selectedbrowsesortprovided.md +18 -0
  74. package/docs/API-reference/api/x-components.browsexevents.userbrowsedtocategory.md +13 -0
  75. package/docs/API-reference/api/x-components.browsexevents.userclickedabrowsesort.md +13 -0
  76. package/docs/API-reference/api/x-components.browsexmodule.md +13 -0
  77. package/docs/API-reference/api/x-components.browsexstoremodule.md +15 -0
  78. package/docs/API-reference/api/x-components.cancelfetchandsavebrowseresponse.md +17 -0
  79. package/docs/API-reference/api/x-components.cancelfetchandsavebrowseresponsewire.md +13 -0
  80. package/docs/API-reference/api/x-components.clearbrowsequery.md +13 -0
  81. package/docs/API-reference/api/x-components.fetchandsavebrowseresponse.md +66 -0
  82. package/docs/API-reference/api/x-components.fetchandsavebrowseresponsewire.md +13 -0
  83. package/docs/API-reference/api/x-components.fetchandsavebrowseresultsenrichment.md +66 -0
  84. package/docs/API-reference/api/x-components.fetchandsavebrowseresultsenrichmentwire.md +13 -0
  85. package/docs/API-reference/api/x-components.fetchbrowseresponse.md +13 -0
  86. package/docs/API-reference/api/x-components.hierarchicalfilter.md +7 -0
  87. package/docs/API-reference/api/x-components.increasebrowsepageappendingresults.md +13 -0
  88. package/docs/API-reference/api/x-components.increasebrowsepageappendingresultswire.md +13 -0
  89. package/docs/API-reference/api/x-components.internalbrowserequest.md +59 -0
  90. package/docs/API-reference/api/x-components.internalbrowserequest.page.md +13 -0
  91. package/docs/API-reference/api/x-components.internalbrowseresponse.md +78 -0
  92. package/docs/API-reference/api/x-components.internalbrowseresponse.request.md +13 -0
  93. package/docs/API-reference/api/x-components.internalbrowseresponse.status.md +13 -0
  94. package/docs/API-reference/api/x-components.md +499 -0
  95. package/docs/API-reference/api/x-components.resetbrowseappending.md +13 -0
  96. package/docs/API-reference/api/x-components.resetbrowserequestonrefinement.md +13 -0
  97. package/docs/API-reference/api/x-components.resetbrowserequestonrefinementwire.md +13 -0
  98. package/docs/API-reference/api/x-components.resetbrowsestateforreloadwire.md +13 -0
  99. package/docs/API-reference/api/x-components.resetbrowsestateifnorequestwire.md +13 -0
  100. package/docs/API-reference/api/x-components.resetfromnobrowseresultswithfilters.md +13 -0
  101. package/docs/API-reference/api/x-components.resetisnobrowseresults.md +13 -0
  102. package/docs/API-reference/api/x-components.reseturlbrowsecategory.md +13 -0
  103. package/docs/API-reference/api/x-components.savebrowseorigin.md +13 -0
  104. package/docs/API-reference/api/x-components.savebrowseoriginwire.md +13 -0
  105. package/docs/API-reference/api/x-components.savebrowseresponse.md +13 -0
  106. package/docs/API-reference/api/x-components.setbrowsecategory.md +13 -0
  107. package/docs/API-reference/api/x-components.setbrowseextraparams.md +13 -0
  108. package/docs/API-reference/api/x-components.setbrowsepage.md +13 -0
  109. package/docs/API-reference/api/x-components.setbrowseselectedfilters.md +13 -0
  110. package/docs/API-reference/api/x-components.setbrowsesort.md +13 -0
  111. package/docs/API-reference/api/x-components.setbrowseurlparams.md +13 -0
  112. package/docs/API-reference/api/x-components.setbrowseurlparamswire.md +13 -0
  113. package/docs/API-reference/api/x-components.seturlbrowsecategory.md +13 -0
  114. package/docs/API-reference/api/x-components.simplefilter.md +7 -0
  115. package/docs/API-reference/api/x-components.snippetcallbacks.md +7 -0
  116. package/docs/API-reference/api/x-components.urlmutations.md +19 -0
  117. package/docs/API-reference/api/x-components.urlmutations.setbrowsecategory.md +13 -0
  118. package/docs/API-reference/api/x-components.urlparams.browsefield.md +11 -0
  119. package/docs/API-reference/api/x-components.urlparams.browsevalue.md +11 -0
  120. package/docs/API-reference/api/x-components.urlparams.md +34 -0
  121. package/docs/API-reference/api/x-components.usealiasapi.browsetotalresults.md +13 -0
  122. package/docs/API-reference/api/x-components.usealiasapi.md +21 -0
  123. package/docs/API-reference/api/x-components.watchedinternalbrowserequest.md +73 -0
  124. package/docs/API-reference/api/x-components.watchedinternalbrowserequest.newrequest.md +11 -0
  125. package/docs/API-reference/api/x-components.watchedinternalbrowserequest.oldrequest.md +11 -0
  126. package/docs/API-reference/api/x-components.xapi.browse.md +13 -0
  127. package/docs/API-reference/api/x-components.xapi.md +19 -0
  128. package/docs/API-reference/api/x-components.xeventstypes.md +2 -2
  129. package/docs/API-reference/api/x-components.xmodulestree.browse.md +11 -0
  130. package/docs/API-reference/api/x-components.xmodulestree.md +17 -0
  131. package/docs/API-reference/api/x-types.xcomponentsadapter.browse.md +11 -0
  132. package/docs/API-reference/api/x-types.xcomponentsadapter.md +17 -0
  133. package/docs/API-reference/components/browse/x-components.browse-results-list.md +21 -0
  134. package/docs/API-reference/components/browse/x-components.browse-sort-picker-list.md +24 -0
  135. package/js/composables/use-alias-api.js +3 -0
  136. package/js/composables/use-alias-api.js.map +1 -1
  137. package/js/index.js +16 -1
  138. package/js/index.js.map +1 -1
  139. package/js/wiring/namespaced-wires.factory.js +1 -1
  140. package/js/x-installer/api/base-api.js +12 -0
  141. package/js/x-installer/api/base-api.js.map +1 -1
  142. package/js/x-modules/browse/components/browse-results-list.vue.js +46 -0
  143. package/js/x-modules/browse/components/browse-results-list.vue.js.map +1 -0
  144. package/js/x-modules/browse/components/browse-results-list.vue2.js +6 -0
  145. package/js/x-modules/browse/components/browse-results-list.vue2.js.map +1 -0
  146. package/js/x-modules/browse/components/browse-sort-picker-list.vue.js +73 -0
  147. package/js/x-modules/browse/components/browse-sort-picker-list.vue.js.map +1 -0
  148. package/js/x-modules/browse/components/browse-sort-picker-list.vue2.js +6 -0
  149. package/js/x-modules/browse/components/browse-sort-picker-list.vue2.js.map +1 -0
  150. package/js/x-modules/browse/store/actions/fetch-and-save-browse-response.action.js +57 -0
  151. package/js/x-modules/browse/store/actions/fetch-and-save-browse-response.action.js.map +1 -0
  152. package/js/x-modules/browse/store/actions/fetch-and-save-results-enrichment.action.js +21 -0
  153. package/js/x-modules/browse/store/actions/fetch-and-save-results-enrichment.action.js.map +1 -0
  154. package/js/x-modules/browse/store/actions/fetch-browse-response.action.js +16 -0
  155. package/js/x-modules/browse/store/actions/fetch-browse-response.action.js.map +1 -0
  156. package/js/x-modules/browse/store/actions/increase-page-apending-results.action.js +18 -0
  157. package/js/x-modules/browse/store/actions/increase-page-apending-results.action.js.map +1 -0
  158. package/js/x-modules/browse/store/actions/reset-request-on-refinement.action.js +36 -0
  159. package/js/x-modules/browse/store/actions/reset-request-on-refinement.action.js.map +1 -0
  160. package/js/x-modules/browse/store/actions/save-browse-response.action.js +42 -0
  161. package/js/x-modules/browse/store/actions/save-browse-response.action.js.map +1 -0
  162. package/js/x-modules/browse/store/actions/save-origin.action.js +16 -0
  163. package/js/x-modules/browse/store/actions/save-origin.action.js.map +1 -0
  164. package/js/x-modules/browse/store/actions/set-url-params.action.js +20 -0
  165. package/js/x-modules/browse/store/actions/set-url-params.action.js.map +1 -0
  166. package/js/x-modules/browse/store/emitters.js +48 -0
  167. package/js/x-modules/browse/store/emitters.js.map +1 -0
  168. package/js/x-modules/browse/store/getters/request.getter.js +27 -0
  169. package/js/x-modules/browse/store/getters/request.getter.js.map +1 -0
  170. package/js/x-modules/browse/store/module.js +163 -0
  171. package/js/x-modules/browse/store/module.js.map +1 -0
  172. package/js/x-modules/browse/wiring.js +213 -0
  173. package/js/x-modules/browse/wiring.js.map +1 -0
  174. package/js/x-modules/browse/x-module.js +21 -0
  175. package/js/x-modules/browse/x-module.js.map +1 -0
  176. package/js/x-modules/url/components/url-handler.vue.js.map +1 -1
  177. package/js/x-modules/url/components/url-handler.vue2.js +4 -1
  178. package/js/x-modules/url/components/url-handler.vue2.js.map +1 -1
  179. package/js/x-modules/url/store/initial-state.js +2 -0
  180. package/js/x-modules/url/store/initial-state.js.map +1 -1
  181. package/js/x-modules/url/store/module.js +4 -0
  182. package/js/x-modules/url/store/module.js.map +1 -1
  183. package/js/x-modules/url/wiring.js +34 -1
  184. package/js/x-modules/url/wiring.js.map +1 -1
  185. package/package.json +4 -4
  186. package/report/x-components.api.json +4505 -192
  187. package/report/x-components.api.md +432 -6
  188. package/report/x-types.api.json +50 -0
  189. package/types/src/components/snippet-callbacks.vue.d.ts +7 -0
  190. package/types/src/components/snippet-callbacks.vue.d.ts.map +1 -1
  191. package/types/src/composables/use-alias-api.d.ts +2 -0
  192. package/types/src/composables/use-alias-api.d.ts.map +1 -1
  193. package/types/src/index.d.ts +1 -0
  194. package/types/src/index.d.ts.map +1 -1
  195. package/types/src/types/url-params.d.ts +2 -0
  196. package/types/src/types/url-params.d.ts.map +1 -1
  197. package/types/src/wiring/events.types.d.ts +2 -1
  198. package/types/src/wiring/events.types.d.ts.map +1 -1
  199. package/types/src/x-installer/api/api.types.d.ts +9 -0
  200. package/types/src/x-installer/api/api.types.d.ts.map +1 -1
  201. package/types/src/x-installer/api/base-api.d.ts +9 -0
  202. package/types/src/x-installer/api/base-api.d.ts.map +1 -1
  203. package/types/src/x-modules/browse/components/browse-results-list.vue.d.ts +30 -0
  204. package/types/src/x-modules/browse/components/browse-results-list.vue.d.ts.map +1 -0
  205. package/types/src/x-modules/browse/components/browse-sort-picker-list.vue.d.ts +50 -0
  206. package/types/src/x-modules/browse/components/browse-sort-picker-list.vue.d.ts.map +1 -0
  207. package/types/src/x-modules/browse/components/index.d.ts +3 -0
  208. package/types/src/x-modules/browse/components/index.d.ts.map +1 -0
  209. package/types/src/x-modules/browse/config.types.d.ts +14 -0
  210. package/types/src/x-modules/browse/config.types.d.ts.map +1 -0
  211. package/types/src/x-modules/browse/events.types.d.ts +55 -0
  212. package/types/src/x-modules/browse/events.types.d.ts.map +1 -0
  213. package/types/src/x-modules/browse/index.d.ts +8 -0
  214. package/types/src/x-modules/browse/index.d.ts.map +1 -0
  215. package/types/src/x-modules/browse/store/actions/fetch-and-save-browse-response.action.d.ts +15 -0
  216. package/types/src/x-modules/browse/store/actions/fetch-and-save-browse-response.action.d.ts.map +1 -0
  217. package/types/src/x-modules/browse/store/actions/fetch-and-save-results-enrichment.action.d.ts +17 -0
  218. package/types/src/x-modules/browse/store/actions/fetch-and-save-results-enrichment.action.d.ts.map +1 -0
  219. package/types/src/x-modules/browse/store/actions/fetch-browse-response.action.d.ts +13 -0
  220. package/types/src/x-modules/browse/store/actions/fetch-browse-response.action.d.ts.map +1 -0
  221. package/types/src/x-modules/browse/store/actions/increase-page-apending-results.action.d.ts +11 -0
  222. package/types/src/x-modules/browse/store/actions/increase-page-apending-results.action.d.ts.map +1 -0
  223. package/types/src/x-modules/browse/store/actions/index.d.ts +9 -0
  224. package/types/src/x-modules/browse/store/actions/index.d.ts.map +1 -0
  225. package/types/src/x-modules/browse/store/actions/reset-request-on-refinement.action.d.ts +11 -0
  226. package/types/src/x-modules/browse/store/actions/reset-request-on-refinement.action.d.ts.map +1 -0
  227. package/types/src/x-modules/browse/store/actions/save-browse-response.action.d.ts +11 -0
  228. package/types/src/x-modules/browse/store/actions/save-browse-response.action.d.ts.map +1 -0
  229. package/types/src/x-modules/browse/store/actions/save-origin.action.d.ts +11 -0
  230. package/types/src/x-modules/browse/store/actions/save-origin.action.d.ts.map +1 -0
  231. package/types/src/x-modules/browse/store/actions/set-url-params.action.d.ts +11 -0
  232. package/types/src/x-modules/browse/store/actions/set-url-params.action.d.ts.map +1 -0
  233. package/types/src/x-modules/browse/store/emitters.d.ts +35 -0
  234. package/types/src/x-modules/browse/store/emitters.d.ts.map +1 -0
  235. package/types/src/x-modules/browse/store/getters/index.d.ts +2 -0
  236. package/types/src/x-modules/browse/store/getters/index.d.ts.map +1 -0
  237. package/types/src/x-modules/browse/store/getters/request.getter.d.ts +13 -0
  238. package/types/src/x-modules/browse/store/getters/request.getter.d.ts.map +1 -0
  239. package/types/src/x-modules/browse/store/index.d.ts +6 -0
  240. package/types/src/x-modules/browse/store/index.d.ts.map +1 -0
  241. package/types/src/x-modules/browse/store/module.d.ts +41 -0
  242. package/types/src/x-modules/browse/store/module.d.ts.map +1 -0
  243. package/types/src/x-modules/browse/store/types.d.ts +273 -0
  244. package/types/src/x-modules/browse/store/types.d.ts.map +1 -0
  245. package/types/src/x-modules/browse/types.d.ts +35 -0
  246. package/types/src/x-modules/browse/types.d.ts.map +1 -0
  247. package/types/src/x-modules/browse/wiring.d.ts +172 -0
  248. package/types/src/x-modules/browse/wiring.d.ts.map +1 -0
  249. package/types/src/x-modules/browse/x-module.d.ts +16 -0
  250. package/types/src/x-modules/browse/x-module.d.ts.map +1 -0
  251. package/types/src/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts +7 -0
  252. package/types/src/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts.map +1 -1
  253. package/types/src/x-modules/facets/components/filters/simple-filter.vue.d.ts +7 -0
  254. package/types/src/x-modules/facets/components/filters/simple-filter.vue.d.ts.map +1 -1
  255. package/types/src/x-modules/url/components/url-handler.vue.d.ts.map +1 -1
  256. package/types/src/x-modules/url/store/initial-state.d.ts.map +1 -1
  257. package/types/src/x-modules/url/store/module.d.ts.map +1 -1
  258. package/types/src/x-modules/url/store/types.d.ts +7 -1
  259. package/types/src/x-modules/url/store/types.d.ts.map +1 -1
  260. package/types/src/x-modules/url/wiring.d.ts +30 -0
  261. package/types/src/x-modules/url/wiring.d.ts.map +1 -1
  262. package/types/src/x-modules/x-modules.types.d.ts +2 -0
  263. package/types/src/x-modules/x-modules.types.d.ts.map +1 -1
  264. package/url/index.js +1 -1
@@ -138,6 +138,9 @@ function useAliasApi() {
138
138
  get totalResults() {
139
139
  return store.state.x.search?.totalResults ?? 0;
140
140
  },
141
+ get browseTotalResults() {
142
+ return store.state.x.browse?.totalResults ?? 0;
143
+ },
141
144
  get selectedSort() {
142
145
  return store.state.x.search?.sort ?? '';
143
146
  },
@@ -1 +1 @@
1
- {"version":3,"file":"use-alias-api.js","sources":["../../../src/composables/use-alias-api.ts"],"sourcesContent":["import type {\n Facet,\n Filter,\n HistoryQuery,\n NextQuery,\n PartialResult,\n Redirection,\n RelatedPrompt,\n RelatedTag,\n Result,\n SemanticQuery,\n Suggestion,\n} from '@empathyco/x-types'\nimport type { RequestStatus } from '../store/utils/status-store.utils'\nimport type { ScrollComponentState } from '../x-modules/scroll/store/types'\nimport type { InputStatus } from '../x-modules/search-box/store/types'\nimport { useStore } from 'vuex'\nimport { getGetterPath } from '../plugins/index'\n\n/* eslint-disable ts/no-unsafe-return,ts/no-unsafe-member-access,ts/no-unsafe-assignment */\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 lowResults() {\n return (\n store.state.x.search?.totalResults > 0 &&\n store.state.x.search?.totalResults < store.state.x.search?.config?.threshold\n )\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 selectedPrompt() {\n return store.state.x.relatedPrompts?.selectedPrompt ?? -1\n },\n get semanticQueries() {\n return store.state.x.semanticQueries?.semanticQueries ?? []\n },\n get relatedPrompts() {\n return store.state.x.relatedPrompts?.relatedPrompts ?? []\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} low results situation. */\n readonly lowResults: 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 RelatedPromptsXModule} selected prompt. */\n readonly selectedPrompt: number\n /** The {@link SemanticQueriesXModule} queries. */\n readonly semanticQueries: ReadonlyArray<SemanticQuery>\n /** The {@link RelatedPromptsXModule} related prompts. */\n readonly relatedPrompts: ReadonlyArray<RelatedPrompt>\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\n/* eslint-enable ts/no-unsafe-return,ts/no-unsafe-member-access,ts/no-unsafe-assignment */\n"],"names":[],"mappings":";;;;;;AAmBA;AAEA;;;;;;AAMG;SACa,WAAW,GAAA;AACzB,IAAA,MAAM,YAAY,GAAG;QACnB,QAAQ;QACR,WAAW;QACX,aAAa;QACb,kBAAkB;QAClB,aAAa;QACb,QAAQ;KACA;AACV,IAAA,MAAM,aAAa,GAAG;QACpB,mBAAmB;QACnB,aAAa;QACb,iBAAiB;QACjB,kBAAkB;QAClB,iBAAiB;QACjB,aAAa;QACb,QAAQ;KACA;AAEV,IAAA,MAAM,KAAK,GAAG,QAAQ,EAAE;IAExB,MAAM,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,UAAU,KAAI;AACpD,QAAA,OAAO,MAAM,CAAC,cAAc,CAAC,G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AK,CAAC,CAAC,CAAC,WAAW,EAAE,mBAAmB,IAAI,EAAE;QAC7D,CAAC;AACD,QAAA,IAAI,cAAc,GAAA;AAChB,YAAA,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,cAAc,EAAE,cAAc,IAAI,EAAE;QAC3D,CAAC;AACD,QAAA,IAAI,eAAe,GAAA;YACjB,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,eAAe,EAAE,eAAe,IAAI,EAAE;QAC7D,CAAC;AACD,QAAA,IAAI,cAAc,GAAA;YAChB,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,cAAc,EAAE,cAAc,IAAI,EAAE;QAC3D,CAAC;AACD,QAAA,IAAI,iBAAiB,GAAA;YACnB,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,iBAAiB,IAAI,IAAI;QACxD,CAAC;AACD,QAAA,IAAI,YAAY,GAAA;YACd,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,YAAY,IAAI,CAAC;QAChD,CAAC;AACD,QAAA,IAAI,YAAY,GAAA;YACd,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,IAAI,EAAE;QACzC,CAAC;AACD,QAAA,IAAI,UAAU,GAAA;AACZ,YAAA,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE;QACjD,CAAC;KACF;AACH;AAsHA;;;;"}
1
+ {"version":3,"file":"use-alias-api.js","sources":["../../../src/composables/use-alias-api.ts"],"sourcesContent":["import type {\n Facet,\n Filter,\n HistoryQuery,\n NextQuery,\n PartialResult,\n Redirection,\n RelatedPrompt,\n RelatedTag,\n Result,\n SemanticQuery,\n Suggestion,\n} from '@empathyco/x-types'\nimport type { RequestStatus } from '../store/utils/status-store.utils'\nimport type { ScrollComponentState } from '../x-modules/scroll/store/types'\nimport type { InputStatus } from '../x-modules/search-box/store/types'\nimport { useStore } from 'vuex'\nimport { getGetterPath } from '../plugins/index'\n\n/* eslint-disable ts/no-unsafe-return,ts/no-unsafe-member-access,ts/no-unsafe-assignment */\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 lowResults() {\n return (\n store.state.x.search?.totalResults > 0 &&\n store.state.x.search?.totalResults < store.state.x.search?.config?.threshold\n )\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 selectedPrompt() {\n return store.state.x.relatedPrompts?.selectedPrompt ?? -1\n },\n get semanticQueries() {\n return store.state.x.semanticQueries?.semanticQueries ?? []\n },\n get relatedPrompts() {\n return store.state.x.relatedPrompts?.relatedPrompts ?? []\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 browseTotalResults() {\n return store.state.x.browse?.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} low results situation. */\n readonly lowResults: 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 RelatedPromptsXModule} selected prompt. */\n readonly selectedPrompt: number\n /** The {@link SemanticQueriesXModule} queries. */\n readonly semanticQueries: ReadonlyArray<SemanticQuery>\n /** The {@link RelatedPromptsXModule} related prompts. */\n readonly relatedPrompts: ReadonlyArray<RelatedPrompt>\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 BrowseXModule} total results. */\n readonly browseTotalResults: 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\n/* eslint-enable ts/no-unsafe-return,ts/no-unsafe-member-access,ts/no-unsafe-assignment */\n"],"names":[],"mappings":";;;;;;AAmBA;AAEA;;;;;;AAMG;SACa,WAAW,GAAA;AACzB,IAAA,MAAM,YAAY,GAAG;QACnB,QAAQ;QACR,WAAW;QACX,aAAa;QACb,kBAAkB;QAClB,aAAa;QACb,QAAQ;KACA;AACV,IAAA,MAAM,aAAa,GAAG;QACpB,mBAAmB;QACnB,aAAa;QACb,iBAAiB;QACjB,kBAAkB;QAClB,iBAAiB;QACjB,aAAa;QACb,QAAQ;KACA;AAEV,IAAA,MAAM,KAAK,GAAG,QAAQ,EAAE;IAExB,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;YAC/C,CAAC;AACD,YAAA,UAAU,EAAE,IAAI;AACjB,SAAA,CAAC;IACJ,CAAC,EAAE,EAAsB,CAAC;IAE1B,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;YAC1C,CAAC;AACD,YAAA,UAAU,EAAE,IAAI;AACjB,SAAA,CAAC;IACJ,CAAC,EAAE,EAAuB,CAAC;IAE3B,OAAO;QACL,KAAK;QACL,MAAM;AACN,QAAA,IAAI,MAAM,GAAA;YACR,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,IA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AA,IAAI,kBAAkB,GAAA;YACpB,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,YAAY,IAAI,CAAC;QAChD,CAAC;AACD,QAAA,IAAI,YAAY,GAAA;YACd,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,IAAI,EAAE;QACzC,CAAC;AACD,QAAA,IAAI,UAAU,GAAA;AACZ,YAAA,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE;QACjD,CAAC;KACF;AACH;AAwHA;;;;"}
package/js/index.js CHANGED
@@ -210,6 +210,21 @@ export { suggestionsSearchRequest as aiSuggestionsSearchRequest } from './x-modu
210
210
  export { aiXStoreModule } from './x-modules/ai/store/module.js';
211
211
  export { aiWiring } from './x-modules/ai/wiring.js';
212
212
  export { aiXModule } from './x-modules/ai/x-module.js';
213
+ export { default as BrowseResultsList } from './x-modules/browse/components/browse-results-list.vue.js';
214
+ export { default as BrowseSortPickerList } from './x-modules/browse/components/browse-sort-picker-list.vue.js';
215
+ export { cancelFetchAndSaveBrowseResponse, fetchAndSaveBrowseResponse } from './x-modules/browse/store/actions/fetch-and-save-browse-response.action.js';
216
+ export { fetchAndSaveResultsEnrichment as fetchAndSaveBrowseResultsEnrichment } from './x-modules/browse/store/actions/fetch-and-save-results-enrichment.action.js';
217
+ export { fetchBrowseResponse } from './x-modules/browse/store/actions/fetch-browse-response.action.js';
218
+ export { increasePageAppendingResults as increaseBrowsePageAppendingResults } from './x-modules/browse/store/actions/increase-page-apending-results.action.js';
219
+ export { resetRequestOnRefinement as resetBrowseRequestOnRefinement } from './x-modules/browse/store/actions/reset-request-on-refinement.action.js';
220
+ export { saveBrowseResponse } from './x-modules/browse/store/actions/save-browse-response.action.js';
221
+ export { saveOrigin as saveBrowseOrigin } from './x-modules/browse/store/actions/save-origin.action.js';
222
+ export { setUrlParams as setBrowseUrlParams } from './x-modules/browse/store/actions/set-url-params.action.js';
223
+ export { browseEmitters } from './x-modules/browse/store/emitters.js';
224
+ export { request as browseRequest } from './x-modules/browse/store/getters/request.getter.js';
225
+ export { browseXStoreModule, resettableBrowseState } from './x-modules/browse/store/module.js';
226
+ export { browseWiring, cancelFetchAndSaveBrowseResponseWire, clearBrowseQuery, fetchAndSaveBrowseResponseWire, fetchAndSaveBrowseResultsEnrichmentWire, increaseBrowsePageAppendingResultsWire, resetBrowseAppending, resetBrowseRequestOnRefinementWire, resetBrowseStateForReloadWire, resetBrowseStateIfNoRequestWire, resetFromNoBrowseResultsWithFilters, resetIsNoBrowseResults, saveBrowseOriginWire, setBrowseCategory, setBrowseExtraParams, setBrowsePage, setBrowseSelectedFilters, setBrowseSort, setBrowseUrlParamsWire } from './x-modules/browse/wiring.js';
227
+ export { browseXModule } from './x-modules/browse/x-module.js';
213
228
  export { default as DeviceDetector } from './x-modules/device/components/device-detector.vue.js';
214
229
  export { deviceEmitters } from './x-modules/device/store/emitters.js';
215
230
  export { deviceXStoreModule } from './x-modules/device/store/module.js';
@@ -442,6 +457,6 @@ export { taggingXModule } from './x-modules/tagging/x-module.js';
442
457
  export { default as UrlHandler } from './x-modules/url/components/url-handler.vue.js';
443
458
  export { replaceableParams, urlEmitters } from './x-modules/url/store/emitters.js';
444
459
  export { urlXStoreModule } from './x-modules/url/store/module.js';
445
- export { setInitialExtraParams, setParams, setUrlFilters, setUrlPage, setUrlParamsFromPreview, setUrlPrompt, setUrlQuery, setUrlQueryFromPreview, setUrlRelatedTags, setUrlScroll, setUrlSelectedFiltersFromPreview, setUrlSort, urlWiring } from './x-modules/url/wiring.js';
460
+ export { resetUrlBrowseCategory, setInitialExtraParams, setParams, setUrlBrowseCategory, setUrlFilters, setUrlPage, setUrlParamsFromPreview, setUrlPrompt, setUrlQuery, setUrlQueryFromPreview, setUrlRelatedTags, setUrlScroll, setUrlSelectedFiltersFromPreview, setUrlSort, urlWiring } from './x-modules/url/wiring.js';
446
461
  export { urlXModule } from './x-modules/url/x-module.js';
447
462
  //# sourceMappingURL=index.js.map
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,4 +1,4 @@
1
- import { wireCommit, wireDispatch, wireDispatchWithoutPayload, wireCommitWithoutPayload } from './wires.factory.js';
1
+ import { wireCommit, wireDispatchWithoutPayload, wireCommitWithoutPayload, wireDispatch } from './wires.factory.js';
2
2
  import { getStateAndGettersFromModule } from './wiring.utils.js';
3
3
 
4
4
  /**
@@ -81,6 +81,18 @@ class BaseXAPI {
81
81
  }
82
82
  void this.bus?.emit('UserClickedOpenX', undefined);
83
83
  }
84
+ /**
85
+ * Browses the browseField and browseValue parameters as a selected category.
86
+ *
87
+ * @param browseCategory - browseField and browseValue to be browsed.
88
+ *
89
+ * @public
90
+ */
91
+ browse(browseCategory) {
92
+ if (browseCategory) {
93
+ void this.bus?.emit('UserBrowsedToCategory', browseCategory);
94
+ }
95
+ }
84
96
  /**
85
97
  * Initializes the Application passing the {@link SnippetConfig}.
86
98
  *
@@ -1 +1 @@
1
- {"version":3,"file":"base-api.js","sources":["../../../../src/x-installer/api/base-api.ts"],"sourcesContent":["import type { WireMetadata, XEventsTypes } from '../../wiring/index'\nimport type { XBus } from '../../x-bus'\nimport type { NormalisedSnippetConfig, SnippetConfig, XAPI } from './api.types'\n\n/**\n * Default implementation for {@link XAPI}.\n *\n * @public\n */\nexport class BaseXAPI implements XAPI {\n /**\n * Flag to check if the initialization was already done.\n *\n * @internal\n */\n protected isXInitialized = false\n\n /**\n * Bus for emitting and listening events.\n *\n * @internal\n */\n protected bus!: XBus<XEventsTypes, WireMetadata>\n\n /**\n * The callback to call from the init method. The logic of initialization is out of this API\n * since this API is just a facade.\n *\n * @internal\n */\n protected initCallback!: (config: SnippetConfig) => any\n\n /**\n * Getter for the snippet config object.\n *\n * @returns The {@link NormalisedSnippetConfig | snippetConfig} object.\n *\n * @public\n */\n public getSnippetConfig!: () => SnippetConfig\n\n /**\n * Callback that allows to update the snippet config. The logic of initialization is out of this\n * API since this API is just a facade.\n *\n * @internal\n */\n protected snippetCallback!: (config: Partial<SnippetConfig>) => void\n\n /**\n * Tracks that a product was added to cart from PDP.\n *\n * @param productId - The product id that was added to cart.\n */\n addProductToCart(productId?: string): void {\n void this.bus?.emit('UserClickedPDPAddToCart', productId)\n }\n\n /**\n * Setter for the XBus.\n *\n * @param bus - The XBus received to emit events.\n *\n * @internal\n */\n setBus(bus: XBus<XEventsTypes, WireMetadata>): void {\n this.bus = bus\n }\n\n /**\n * Setter for the callback to call in the init method.\n *\n * @param initCallback - The callback to call.\n */\n setInitCallback(initCallback: (config: SnippetConfig) => any): void {\n this.initCallback = initCallback\n }\n\n /**\n * Setter for the callback to modify the snippet config.\n *\n * @param snippetCallback - The callback to call.\n *\n * @internal\n */\n setSnippetConfigCallback(snippetCallback: (config: Partial<SnippetConfig>) => void): void {\n this.snippetCallback = snippetCallback\n }\n\n /**\n * Sets or updates the snippet config getter.\n *\n * @param snippetConfigGetter - A function that returns the snippet config.\n *\n * @internal\n */\n setSnippetConfigGetter(snippetConfigGetter: () => NormalisedSnippetConfig): void {\n this.getSnippetConfig = snippetConfigGetter\n }\n\n /**\n * Sets or updates the snippet config.\n *\n * @param config - A part or all the snippet config.\n *\n * @public\n */\n setSnippetConfig(config: Partial<SnippetConfig>): void {\n this?.snippetCallback(config)\n }\n\n /**\n * Searches the query parameter as user query.\n *\n * @param query - Query to be searched.\n *\n * @public\n */\n search(query?: string): void {\n if (query) {\n void this.bus?.emit('UserAcceptedAQuery', query)\n }\n void this.bus?.emit('UserClickedOpenX', undefined)\n }\n\n /**\n * Initializes the Application passing the {@link SnippetConfig}.\n *\n * @param config - The config coming from the customer snippet.\n *\n * @returns A promise that will be resolved once x components are initialized.\n *\n * @public\n */\n async init(config: SnippetConfig): Promise<void> {\n if (!this.isXInitialized) {\n this.isXInitialized = true\n await this?.initCallback(config)\n } else {\n console.warn('We know X is awesome, but you only need to initialize it once.')\n }\n }\n\n /**\n * Closes the Application.\n *\n * @public\n */\n close(): void {\n void this.bus?.em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M,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC;QAClC;aAAO;AACL,YAAA,OAAO,CAAC,IAAI,CAAC,gEAAgE,CAAC;QAChF;IACF;AAEA;;;;AAIG;IACH,KAAK,GAAA;QACH,KAAK,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,mBAAmB,EAAE,SAAS,CAAC;IACrD;AACD;;;;"}
1
+ {"version":3,"file":"base-api.js","sources":["../../../../src/x-installer/api/base-api.ts"],"sourcesContent":["import type { BrowsableRequest } from '@empathyco/x-types'\nimport type { WireMetadata, XEventsTypes } from '../../wiring/index'\nimport type { XBus } from '../../x-bus'\nimport type { NormalisedSnippetConfig, SnippetConfig, XAPI } from './api.types'\n\n/**\n * Default implementation for {@link XAPI}.\n *\n * @public\n */\nexport class BaseXAPI implements XAPI {\n /**\n * Flag to check if the initialization was already done.\n *\n * @internal\n */\n protected isXInitialized = false\n\n /**\n * Bus for emitting and listening events.\n *\n * @internal\n */\n protected bus!: XBus<XEventsTypes, WireMetadata>\n\n /**\n * The callback to call from the init method. The logic of initialization is out of this API\n * since this API is just a facade.\n *\n * @internal\n */\n protected initCallback!: (config: SnippetConfig) => any\n\n /**\n * Getter for the snippet config object.\n *\n * @returns The {@link NormalisedSnippetConfig | snippetConfig} object.\n *\n * @public\n */\n public getSnippetConfig!: () => SnippetConfig\n\n /**\n * Callback that allows to update the snippet config. The logic of initialization is out of this\n * API since this API is just a facade.\n *\n * @internal\n */\n protected snippetCallback!: (config: Partial<SnippetConfig>) => void\n\n /**\n * Tracks that a product was added to cart from PDP.\n *\n * @param productId - The product id that was added to cart.\n */\n addProductToCart(productId?: string): void {\n void this.bus?.emit('UserClickedPDPAddToCart', productId)\n }\n\n /**\n * Setter for the XBus.\n *\n * @param bus - The XBus received to emit events.\n *\n * @internal\n */\n setBus(bus: XBus<XEventsTypes, WireMetadata>): void {\n this.bus = bus\n }\n\n /**\n * Setter for the callback to call in the init method.\n *\n * @param initCallback - The callback to call.\n */\n setInitCallback(initCallback: (config: SnippetConfig) => any): void {\n this.initCallback = initCallback\n }\n\n /**\n * Setter for the callback to modify the snippet config.\n *\n * @param snippetCallback - The callback to call.\n *\n * @internal\n */\n setSnippetConfigCallback(snippetCallback: (config: Partial<SnippetConfig>) => void): void {\n this.snippetCallback = snippetCallback\n }\n\n /**\n * Sets or updates the snippet config getter.\n *\n * @param snippetConfigGetter - A function that returns the snippet config.\n *\n * @internal\n */\n setSnippetConfigGetter(snippetConfigGetter: () => NormalisedSnippetConfig): void {\n this.getSnippetConfig = snippetConfigGetter\n }\n\n /**\n * Sets or updates the snippet config.\n *\n * @param config - A part or all the snippet config.\n *\n * @public\n */\n setSnippetConfig(config: Partial<SnippetConfig>): void {\n this?.snippetCallback(config)\n }\n\n /**\n * Searches the query parameter as user query.\n *\n * @param query - Query to be searched.\n *\n * @public\n */\n search(query?: string): void {\n if (query) {\n void this.bus?.emit('UserAcceptedAQuery', query)\n }\n void this.bus?.emit('UserClickedOpenX', undefined)\n }\n\n /**\n * Browses the browseField and browseValue parameters as a selected category.\n *\n * @param browseCategory - browseField and browseValue to be browsed.\n *\n * @public\n */\n browse(browseCategory?: BrowsableRequest): void {\n if (browseCategory) {\n void this.bus?.emit('UserBrowsedToCategory', browseCategory)\n }\n }\n\n /**\n * Initializes the Application passing the {@link SnippetConfig}.\n *\n * @param config - The config coming from the customer snippet.\n *\n * @returns A promise that will be resolved once x components are initialized.\n *\n * @public\n */\n async init(config: SnippetConfig): Promise<void> {\n if (!this.isXInitialized) {\n this.isXInitialized = true\n await this?.initCallback(config)\n } else {\n console.warn('We know X is awesome, but you only need to initialize it once.')\n }\n }\n\n /**\n * Closes the Application.\n *\n * @public\n */\n close(): void {\n void this.bus?.emit('UserClickedCloseX', undefined)\n }\n}\n"],"names":[],"mappings":"AAKA;;;;AAIG;MACU,QAAQ,CAAA;AAArB,IAAA,WAAA,GAAA;AACE;;;;AAIG;QACO,IAAA,CAAA,cAAc,GAAG,KAAK;IAqJlC;AAnHE;;;;AA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EAAE,YAAY,CAAC,MAAM,CAAC;QAClC;aAAO;AACL,YAAA,OAAO,CAAC,IAAI,CAAC,gEAAgE,CAAC;QAChF;IACF;AAEA;;;;AAIG;IACH,KAAK,GAAA;QACH,KAAK,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,mBAAmB,EAAE,SAAS,CAAC;IACrD;AACD;;;;"}
@@ -0,0 +1,46 @@
1
+ import { defineComponent, provide, h } from 'vue';
2
+ import { LIST_ITEMS_KEY } from '../../../components/decorators/injection.consts.js';
3
+ import ItemsList from '../../../components/items-list.vue.js';
4
+ import { useState } from '../../../composables/use-state.js';
5
+ import { AnimationProp } from '../../../types/animation-prop.js';
6
+ import { browseXModule } from '../x-module.js';
7
+
8
+ /**
9
+ * It renders a {@link ItemsList} list with the results from {@link SearchState.results} by
10
+ * default.
11
+ *
12
+ * The component provides a default slot which wraps the whole component with the `results` bound.
13
+ *
14
+ * It also provides the slot result to customize the item, which is within the default slot, with
15
+ * the result bound.
16
+ *
17
+ * @public
18
+ */
19
+ var _sfc_main = defineComponent({
20
+ name: 'BrowseResultsList',
21
+ xModule: browseXModule.name,
22
+ props: {
23
+ /** Animation component that will be used to animate the results. */
24
+ animation: {
25
+ type: AnimationProp,
26
+ default: 'ul',
27
+ },
28
+ },
29
+ setup(props, { slots }) {
30
+ /**
31
+ * The results to render from the state.
32
+ *
33
+ * @remarks The results list are provided with `items` key.
34
+ */
35
+ const { results: items } = useState('browse');
36
+ provide(LIST_ITEMS_KEY, items);
37
+ return () => {
38
+ const innerProps = { items: items.value, animation: props.animation };
39
+ // https://vue-land.github.io/faq/forwarding-slots#passing-all-slots
40
+ return slots.default?.(innerProps)[0] ?? h(ItemsList, innerProps, slots);
41
+ };
42
+ },
43
+ });
44
+
45
+ export { _sfc_main as default };
46
+ //# sourceMappingURL=browse-results-list.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browse-results-list.vue.js","sources":["../../../../../src/x-modules/browse/components/browse-results-list.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent, h, provide } from 'vue'\nimport { LIST_ITEMS_KEY } from '../../../components/decorators/injection.consts'\nimport ItemsList from '../../../components/items-list.vue'\nimport { useState } from '../../../composables/use-state'\nimport { AnimationProp } from '../../../types'\nimport { browseXModule } from '../x-module'\n\n/**\n * It renders a {@link ItemsList} list with the results from {@link SearchState.results} by\n * default.\n *\n * The component provides a default slot which wraps the whole component with the `results` bound.\n *\n * It also provides the slot result to customize the item, which is within the default slot, with\n * the result bound.\n *\n * @public\n */\nexport default defineComponent({\n name: 'BrowseResultsList',\n xModule: browseXModule.name,\n props: {\n /** Animation component that will be used to animate the results. */\n animation: {\n type: AnimationProp,\n default: 'ul',\n },\n },\n setup(props, { slots }) {\n /**\n * The results to render from the state.\n *\n * @remarks The results list are provided with `items` key.\n */\n const { results: items } = useState('browse')\n\n provide(LIST_ITEMS_KEY as string, items)\n\n return () => {\n const innerProps = { items: items.value, animation: props.animation }\n // https://vue-land.github.io/faq/forwarding-slots#passing-all-slots\n return slots.default?.(innerProps)[0] ?? h(ItemsList, innerProps, slots)\n }\n },\n})\n</script>\n"],"names":[],"mappings":";;;;;;;AAQA;;;;;;;;;;AAUE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,aAAa,CAAC,IAAI;AAC3B,IAAA,KAAK,EAAE;;AAEL,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,OAAO,EAAE,IAAI;AACd,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAE,EAAE,KAAI,EAAG,EAAA;AACpB;;;;AAIE;QACF,MAAM,EAAE,OAAO,EAAE,KAAI,EAAE,GAAI,QAAQ,CAAC,QAAQ,CAAA;AAE5C,QAAA,OAAO,CAAC,cAAwB,EAAE,KAAK,CAAA;AAEvC,QAAA,OAAO,MAAI;AACT,YAAA,MAAM,UAAS,GAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,SAAQ,EAAE;;AAEpE,YAAA,OAAO,KAAK,CAAC,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,CAAA,IAAK,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,KAAK,CAAA;AACzE,QAAA,CAAA;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
@@ -0,0 +1,6 @@
1
+ import _sfc_main from './browse-results-list.vue.js';
2
+
3
+
4
+
5
+ export { _sfc_main as default };
6
+ //# sourceMappingURL=browse-results-list.vue2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browse-results-list.vue2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,73 @@
1
+ import { defineComponent, watch, computed, openBlock, createBlock, resolveDynamicComponent, withCtx, createElementBlock, Fragment, renderList, unref, normalizeClass, renderSlot, mergeProps, createTextVNode, toDisplayString } from 'vue';
2
+ import BaseEventButton from '../../../components/base-event-button.vue.js';
3
+ import { use$x } from '../../../composables/use-_x.js';
4
+ import { useState } from '../../../composables/use-state.js';
5
+ import { browseXModule } from '../x-module.js';
6
+
7
+ /**
8
+ * The `SortPickerList` component allows user to select the browse results order. This component
9
+ * also allows to change the selected sort programmatically.
10
+ */
11
+ var _sfc_main = /*@__PURE__*/ defineComponent({
12
+ ...{
13
+ xModule: browseXModule.name,
14
+ },
15
+ __name: 'browse-sort-picker-list',
16
+ props: {
17
+ animation: { type: null, required: false, default: 'ul' },
18
+ items: { type: Array, required: true },
19
+ buttonClass: { type: String, required: true }
20
+ },
21
+ setup(__props) {
22
+ const props = __props;
23
+ const $x = use$x();
24
+ const { sort: selectedSort } = useState('browse');
25
+ watch(selectedSort, (value) => $x.emit('SelectedBrowseSortProvided', value), {
26
+ immediate: true,
27
+ });
28
+ /**
29
+ * Sort list items.
30
+ *
31
+ * @returns A list of items with their css class and the event associate to it.
32
+ */
33
+ const listItems = computed(() => props.items.map((item) => ({
34
+ item,
35
+ cssClasses: {
36
+ 'xds:selected': item === selectedSort.value,
37
+ },
38
+ event: { UserClickedABrowseSort: item },
39
+ })));
40
+ return (_ctx, _cache) => {
41
+ return (openBlock(), createBlock(resolveDynamicComponent(__props.animation), {
42
+ tag: "div",
43
+ class: "x-sort-picker-list",
44
+ "data-test": "sort-picker",
45
+ role: "list"
46
+ }, {
47
+ default: withCtx(() => [
48
+ (openBlock(true), createElementBlock(Fragment, null, renderList(listItems.value, ({ item, cssClasses, event }) => {
49
+ return (openBlock(), createBlock(BaseEventButton, {
50
+ key: item,
51
+ class: normalizeClass([cssClasses, __props.buttonClass]),
52
+ "data-test": "sort-picker-button",
53
+ events: event,
54
+ "aria-pressed": item === unref(selectedSort) || null,
55
+ role: "listitem"
56
+ }, {
57
+ default: withCtx(() => [
58
+ renderSlot(_ctx.$slots, "default", mergeProps({ ref_for: true }, { item, isSelected: item === unref(selectedSort) }), () => [
59
+ createTextVNode(toDisplayString(item), 1 /* TEXT */)
60
+ ])
61
+ ]),
62
+ _: 2 /* DYNAMIC */
63
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["class", "events", "aria-pressed"]));
64
+ }), 128 /* KEYED_FRAGMENT */))
65
+ ]),
66
+ _: 3 /* FORWARDED */
67
+ }));
68
+ };
69
+ }
70
+ });
71
+
72
+ export { _sfc_main as default };
73
+ //# sourceMappingURL=browse-sort-picker-list.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browse-sort-picker-list.vue.js","sources":["../../../../../src/x-modules/browse/components/browse-sort-picker-list.vue"],"sourcesContent":["<template>\n <component\n :is=\"animation\"\n tag=\"div\"\n class=\"x-sort-picker-list\"\n data-test=\"sort-picker\"\n role=\"list\"\n >\n <BaseEventButton\n v-for=\"{ item, cssClasses, event } in listItems\"\n :key=\"item\"\n :class=\"[cssClasses, buttonClass]\"\n data-test=\"sort-picker-button\"\n :events=\"event\"\n :aria-pressed=\"item === selectedSort || null\"\n role=\"listitem\"\n >\n <slot v-bind=\"{ item, isSelected: item === selectedSort }\">\n {{ item }}\n </slot>\n </BaseEventButton>\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport type { Sort } from '@empathyco/x-types'\nimport type { Component } from 'vue'\nimport type { VueCSSClasses } from '../../../utils/types'\nimport type { XEventsTypes } from '../../../wiring/events.types'\nimport { computed, watch } from 'vue'\nimport BaseEventButton from '../../../components/base-event-button.vue'\nimport { use$x } from '../../../composables/use-$x'\nimport { useState } from '../../../composables/use-state'\nimport { browseXModule } from '../x-module'\n\n/**\n * Sort Picker item options.\n */\nexport interface SortPickerItem {\n item: Sort\n cssClasses: VueCSSClasses\n event: Partial<XEventsTypes>\n}\n\n/**\n * The `SortPickerList` component allows user to select the browse results order. This component\n * also allows to change the selected sort programmatically.\n */\n\ndefineOptions({\n xModule: browseXModule.name,\n})\n\nconst props = withDefaults(\n defineProps<{ animation?: string | Component; items: Sort[]; buttonClass: string }>(),\n { animation: 'ul' },\n)\n\nconst $x = use$x()\n\nconst { sort: selectedSort } = useState('browse')\n\nwatch(selectedSort, (value: Sort) => $x.emit('SelectedBrowseSortProvided', value), {\n immediate: true,\n})\n\n/**\n * Sort list items.\n *\n * @returns A list of items with their css class and the event associate to it.\n */\nconst listItems = computed<SortPickerItem[]>(() =>\n props.items.map((item: string) => ({\n item,\n cssClasses: {\n 'xds:selected': item === selectedSort.value,\n },\n event: { UserClickedABrowseSort: item },\n })),\n)\n</script>\n"],"names":["_openBlock","_createBlock","_resolveDynamicComponent","_createElementBlock","_Fragment","_normalizeClass","_unref","_renderSlot","_mergeProps"],"mappings":";;;;;;AA4CA;;;AAGE;;;;;;;;;;;;QAMF,MAAM,KAAK,GAAG,OAAA;AAKd,QAAA,MAAM,EAAE,GAAG,KAAK,EAAC;QAEjB,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,QAAQ,CAAC,QAAQ,CAAA;AAEhD,QAAA,KAAK,CAAC,YAAY,EAAE,CAAC,KAAW,KAAK,EAAE,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,CAAA,YAAA,CAAY,EAAA,CAAA,EAAvD,MAEO;oEADF,IAAI,CAAA,EAAA,CAAA;;;;;;;;;;;;;;;"}
@@ -0,0 +1,6 @@
1
+ import _sfc_main from './browse-sort-picker-list.vue.js';
2
+
3
+
4
+
5
+ export { _sfc_main as default };
6
+ //# sourceMappingURL=browse-sort-picker-list.vue2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browse-sort-picker-list.vue2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,57 @@
1
+ import { createFetchAndSaveActions } from '../../../../store/utils/fetch-and-save-action.utils.js';
2
+
3
+ const { fetchAndSave, cancelPrevious } = createFetchAndSaveActions({
4
+ async fetch({ dispatch, state }, request) {
5
+ return request && request.browseField !== '' && request.browseValue !== ''
6
+ ? dispatch('fetchBrowseResponse', enrichRequest(request, state))
7
+ : Promise.resolve(null);
8
+ },
9
+ onSuccess({ dispatch }, response) {
10
+ if (response !== null) {
11
+ void dispatch('saveBrowseResponse', response);
12
+ }
13
+ },
14
+ });
15
+ /**
16
+ * Enriches the {@link BrowseRequest} object with the origin and page properties taken from the
17
+ * {@link BrowseState | browse state}.
18
+ *
19
+ * @param request - The {@link InternalBrowseRequest}.
20
+ * @param state - {@link BrowseState}.
21
+ *
22
+ * @returns The browse request.
23
+ * @internal
24
+ */
25
+ function enrichRequest(request, state) {
26
+ const { page, ...restRequest } = request;
27
+ const { config: { pageSize, pageMode }, origin, results, } = state;
28
+ let start;
29
+ if (pageMode === 'infinite_scroll') {
30
+ start = page === 1 ? 0 : results.length;
31
+ }
32
+ else {
33
+ start = state.config.pageSize * (page - 1);
34
+ }
35
+ const rows = pageMode === 'infinite_scroll' ? pageSize * page - start : pageSize;
36
+ return {
37
+ ...restRequest,
38
+ ...(origin && { origin }),
39
+ start,
40
+ rows,
41
+ };
42
+ }
43
+ /**
44
+ * Default implementation for {@link BrowseActions.fetchAndSaveBrowseResponse} action.
45
+ *
46
+ * @public
47
+ */
48
+ const fetchAndSaveBrowseResponse = fetchAndSave;
49
+ /**
50
+ * Default implementation for {@link BrowseActions.cancelFetchAndSaveBrowseResponse} action.
51
+ *
52
+ * @public
53
+ */
54
+ const cancelFetchAndSaveBrowseResponse = cancelPrevious;
55
+
56
+ export { cancelFetchAndSaveBrowseResponse, fetchAndSaveBrowseResponse };
57
+ //# sourceMappingURL=fetch-and-save-browse-response.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch-and-save-browse-response.action.js","sources":["../../../../../../src/x-modules/browse/store/actions/fetch-and-save-browse-response.action.ts"],"sourcesContent":["import type { BrowseRequest, BrowseResponse } from '@empathyco/x-types'\nimport type { InternalBrowseRequest } from '../../types'\nimport type { BrowseActionContext, BrowseState } from '../types'\nimport { createFetchAndSaveActions } from '../../../../store/utils/fetch-and-save-action.utils'\n\nconst { fetchAndSave, cancelPrevious } = createFetchAndSaveActions<\n BrowseActionContext,\n InternalBrowseRequest | null,\n BrowseResponse | null\n>({\n async fetch({ dispatch, state }, request) {\n return request && request.browseField !== '' && request.browseValue !== ''\n ? dispatch('fetchBrowseResponse', enrichRequest(request, state))\n : Promise.resolve(null)\n },\n onSuccess({ dispatch }, response) {\n if (response !== null) {\n void dispatch('saveBrowseResponse', response)\n }\n },\n})\n\n/**\n * Enriches the {@link BrowseRequest} object with the origin and page properties taken from the\n * {@link BrowseState | browse state}.\n *\n * @param request - The {@link InternalBrowseRequest}.\n * @param state - {@link BrowseState}.\n *\n * @returns The browse request.\n * @internal\n */\nfunction enrichRequest(request: InternalBrowseRequest, state: BrowseState): BrowseRequest {\n const { page, ...restRequest } = request\n const {\n config: { pageSize, pageMode },\n origin,\n results,\n } = state\n\n let start\n if (pageMode === 'infinite_scroll') {\n start = page === 1 ? 0 : results.length\n } else {\n start = state.config.pageSize * (page - 1)\n }\n\n const rows = pageMode === 'infinite_scroll' ? pageSize * page - start : pageSize\n\n return {\n ...restRequest,\n ...(origin && { origin }),\n start,\n rows,\n }\n}\n\n/**\n * Default implementation for {@link BrowseActions.fetchAndSaveBrowseResponse} action.\n *\n * @public\n */\nexport const fetchAndSaveBrowseResponse = fetchAndSave\n\n/**\n * Default implementation for {@link BrowseActions.cancelFetchAndSaveBrowseResponse} action.\n *\n * @public\n */\nexport const cancelFetchAndSaveBrowseResponse = cancelPrevious\n"],"names":[],"mappings":";;AAKA,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,yBAAyB,CAIhE;IACA,MAAM,KAAK,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,OAAO,EAAA;AACtC,QAAA,OAAO,OAAO,IAAI,OAAO,CAAC,WAAW,KAAK,EAAE,IAAI,OAAO,CAAC,WAAW,KAAK;cACpE,QAAQ,CAAC,qBAAqB,EAAE,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC;AAC/D,cAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;IAC3B,CAAC;AACD,IAAA,SAAS,CAAC,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAA;AAC9B,QAAA,IAAI,QAAQ,KAAK,IAAI,EAAE;AACrB,YAAA,KAAK,QAAQ,CAAC,oBAAoB,EAAE,QAAQ,CAAC;QAC/C;IACF,CAAC;AACF,CAAA,CAAC;AAEF;;;;;;;;;AASG;AACH,SAAS,aAAa,CAAC,OAA8B,EAAE,KAAkB,EAAA;IACvE,MAAM,EAAE,IAAI,EAAE,GAAG,WAAW,EAAE,GAAG,OAAO;AACxC,IAAA,MAAM,EACJ,MAAM,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAC9B,MAAM,EACN,OAAO,GACR,GAAG,KAAK;AAET,IAAA,IAAI,KAAK;AACT,IAAA,IAAI,QAAQ,KAAK,iBAAiB,EAAE;AAClC,QAAA,KAAK,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM;IACzC;SAAO;AACL,QAAA,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,IAAI,IAAI,GAAG,CAAC,CAAC;IAC5C;AAEA,IAAA,MAAM,IAAI,GAAG,QAAQ,KAAK,iBAAiB,GAAG,QAAQ,GAAG,IAAI,GAAG,KAAK,GAAG,QAAQ;IAEhF,OAAO;AACL,QAAA,GAAG,WAAW;AACd,QAAA,IAAI,MAAM,IAAI,EAAE,MAAM,EAAE,CAAC;QACzB,KAAK;QACL,IAAI;KACL;AACH;AAEA;;;;AAIG;AACI,MAAM,0BAA0B,GAAG;AAE1C;;;;AAIG;AACI,MAAM,gCAAgC,GAAG;;;;"}
@@ -0,0 +1,21 @@
1
+ import { DefaultResultsEnrichmentService } from '../../../../services/results-enrichment.service.js';
2
+ import { createFetchAndSaveActions } from '../../../../store/utils/fetch-and-save-action.utils.js';
3
+
4
+ const { fetchAndSave, cancelPrevious } = createFetchAndSaveActions({
5
+ async fetch(_, results) {
6
+ return results.length > 0 ? DefaultResultsEnrichmentService.instance.fetchResults(results) : [];
7
+ },
8
+ onSuccess({ commit }, enrichmentResults) {
9
+ commit('updateResultsFromEnrichment', enrichmentResults);
10
+ },
11
+ });
12
+ /**
13
+ * Default implementation for {@link BrowseActions.fetchAndSaveResultsEnrichment}
14
+ * action.
15
+ *
16
+ * @public
17
+ */
18
+ const fetchAndSaveResultsEnrichment = fetchAndSave;
19
+
20
+ export { fetchAndSaveResultsEnrichment };
21
+ //# sourceMappingURL=fetch-and-save-results-enrichment.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch-and-save-results-enrichment.action.js","sources":["../../../../../../src/x-modules/browse/store/actions/fetch-and-save-results-enrichment.action.ts"],"sourcesContent":["import type { Result } from '@empathyco/x-types'\n\nimport type { BrowseActionContext } from '../types'\nimport { DefaultResultsEnrichmentService } from '../../../../services/results-enrichment.service'\nimport { createFetchAndSaveActions } from '../../../../store/utils/fetch-and-save-action.utils'\n\nconst { fetchAndSave, cancelPrevious } = createFetchAndSaveActions<\n BrowseActionContext,\n Result[],\n any[]\n>({\n async fetch(_, results) {\n return results.length > 0 ? DefaultResultsEnrichmentService.instance.fetchResults(results) : []\n },\n onSuccess({ commit }, enrichmentResults) {\n commit('updateResultsFromEnrichment', enrichmentResults)\n },\n})\n\n/**\n * Default implementation for {@link BrowseActions.fetchAndSaveResultsEnrichment}\n * action.\n *\n * @public\n */\nexport const fetchAndSaveResultsEnrichment = fetchAndSave\n\n/**\n * Default implementation for {@link BrowseActions.cancelFetchAndSaveResultsEnrichment}\n * action.\n *\n * @public\n */\nexport const cancelFetchAndSaveResultsEnrichment = cancelPrevious\n"],"names":[],"mappings":";;;AAMA,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,yBAAyB,CAIhE;AACA,IAAA,MAAM,KAAK,CAAC,CAAC,EAAE,OAAO,EAAA;QACpB,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,GAAG,+BAA+B,CAAC,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE;IACjG,CAAC;AACD,IAAA,SAAS,CAAC,EAAE,MAAM,EAAE,EAAE,iBAAiB,EAAA;AACrC,QAAA,MAAM,CAAC,6BAA6B,EAAE,iBAAiB,CAAC;IAC1D,CAAC;AACF,CAAA,CAAC;AAEF;;;;;AAKG;AACI,MAAM,6BAA6B,GAAG;;;;"}
@@ -0,0 +1,16 @@
1
+ import { XPlugin } from '../../../../plugins/x-plugin.js';
2
+
3
+ /**
4
+ * Default implementation for the {@link BrowseActions.fetchBrowseResponse}.
5
+ *
6
+ * @param _context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,
7
+ * provided by Vuex.
8
+ * @param request - The browse request to make.
9
+ * @returns A Promise of browse response that resolves when it fetches browse response.
10
+ *
11
+ * @public
12
+ */
13
+ const fetchBrowseResponse = async (_context, request) => XPlugin.adapter.browse(request);
14
+
15
+ export { fetchBrowseResponse };
16
+ //# sourceMappingURL=fetch-browse-response.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch-browse-response.action.js","sources":["../../../../../../src/x-modules/browse/store/actions/fetch-browse-response.action.ts"],"sourcesContent":["import type { BrowseXStoreModule } from '../types'\nimport { XPlugin } from '../../../../plugins/x-plugin'\n\n/**\n * Default implementation for the {@link BrowseActions.fetchBrowseResponse}.\n *\n * @param _context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,\n * provided by Vuex.\n * @param request - The browse request to make.\n * @returns A Promise of browse response that resolves when it fetches browse response.\n *\n * @public\n */\nexport const fetchBrowseResponse: BrowseXStoreModule['actions']['fetchBrowseResponse'] = async (\n _context,\n request,\n) => XPlugin.adapter.browse(request)\n"],"names":[],"mappings":";;AAGA;;;;;;;;;AASG;MACU,mBAAmB,GAAyD,OACvF,QAAQ,EACR,OAAO,KACJ,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO;;;;"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Default implementation for the {@link BrowseActions.increasePageAppendingResults}.
3
+ *
4
+ * @param context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,
5
+ * provided by Vuex.
6
+ *
7
+ * @public
8
+ */
9
+ const increasePageAppendingResults = ({ commit, state }) => {
10
+ const newPage = state.page + 1;
11
+ if (newPage >= 1 && state.page * state.config.pageSize < state.totalResults) {
12
+ commit('setPage', newPage);
13
+ commit('setIsAppendResults', true);
14
+ }
15
+ };
16
+
17
+ export { increasePageAppendingResults };
18
+ //# sourceMappingURL=increase-page-apending-results.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"increase-page-apending-results.action.js","sources":["../../../../../../src/x-modules/browse/store/actions/increase-page-apending-results.action.ts"],"sourcesContent":["import type { BrowseXStoreModule } from '../types'\n\n/**\n * Default implementation for the {@link BrowseActions.increasePageAppendingResults}.\n *\n * @param context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,\n * provided by Vuex.\n *\n * @public\n */\n\nexport const increasePageAppendingResults: BrowseXStoreModule['actions']['increasePageAppendingResults'] =\n ({ commit, state }) => {\n const newPage = state.page + 1\n if (newPage >= 1 && state.page * state.config.pageSize < state.totalResults) {\n commit('setPage', newPage)\n commit('setIsAppendResults', true)\n }\n }\n"],"names":[],"mappings":"AAEA;;;;;;;AAOG;AAEI,MAAM,4BAA4B,GACvC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,KAAI;AACpB,IAAA,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,GAAG,CAAC;AAC9B,IAAA,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAC,YAAY,EAAE;AAC3E,QAAA,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC;AAC1B,QAAA,MAAM,CAAC,oBAAoB,EAAE,IAAI,CAAC;IACpC;AACF;;;;"}
@@ -0,0 +1,36 @@
1
+ import { getNewAndUpdatedKeys } from '@empathyco/x-utils';
2
+ import { isArrayEmpty } from '../../../../utils/array.js';
3
+
4
+ /**
5
+ * Default implementation for the {@link BrowseActions.resetRequestOnRefinement}.
6
+ *
7
+ * @param context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,
8
+ * provided by Vuex.
9
+ * @param watchedRequest - The {@link WatchedInternalBrowseRequest} object.
10
+ * @public
11
+ */
12
+ const resetRequestOnRefinement = ({ commit, state }, { newRequest, oldRequest }) => {
13
+ if (state.fromNoResultsWithFilters && state.results.length) {
14
+ commit('setFromNoResultsWithFilters', false);
15
+ }
16
+ // is refining request
17
+ if (!!newRequest && !!oldRequest) {
18
+ const changedKeys = getNewAndUpdatedKeys(newRequest, oldRequest).filter(value => value !== 'extraParams');
19
+ const changedExtraParams = getNewAndUpdatedKeys(newRequest.extraParams, oldRequest.extraParams);
20
+ if (!isArrayEmpty(changedKeys)) {
21
+ if (!changedKeys.includes('page')) {
22
+ commit('setPage', 1);
23
+ }
24
+ if (changedKeys.includes('browseField') && changedKeys.includes('browseValue')) {
25
+ commit('setSort', '');
26
+ }
27
+ }
28
+ if (!isArrayEmpty(changedExtraParams)) {
29
+ commit('setPage', 1);
30
+ commit('setSort', '');
31
+ }
32
+ }
33
+ };
34
+
35
+ export { resetRequestOnRefinement };
36
+ //# sourceMappingURL=reset-request-on-refinement.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reset-request-on-refinement.action.js","sources":["../../../../../../src/x-modules/browse/store/actions/reset-request-on-refinement.action.ts"],"sourcesContent":["import type { BrowseXStoreModule } from '../types'\nimport { getNewAndUpdatedKeys } from '@empathyco/x-utils'\nimport { isArrayEmpty } from '../../../../utils/array'\n\n/**\n * Default implementation for the {@link BrowseActions.resetRequestOnRefinement}.\n *\n * @param context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,\n * provided by Vuex.\n * @param watchedRequest - The {@link WatchedInternalBrowseRequest} object.\n * @public\n */\nexport const resetRequestOnRefinement: BrowseXStoreModule['actions']['resetRequestOnRefinement'] = (\n { commit, state },\n { newRequest, oldRequest },\n) => {\n if (state.fromNoResultsWithFilters && state.results.length) {\n commit('setFromNoResultsWithFilters', false)\n }\n // is refining request\n if (!!newRequest && !!oldRequest) {\n const changedKeys = getNewAndUpdatedKeys(newRequest, oldRequest).filter(\n value => value !== 'extraParams',\n )\n const changedExtraParams = getNewAndUpdatedKeys(newRequest.extraParams, oldRequest.extraParams)\n\n if (!isArrayEmpty(changedKeys)) {\n if (!changedKeys.includes('page')) {\n commit('setPage', 1)\n }\n if (changedKeys.includes('browseField') && changedKeys.includes('browseValue')) {\n commit('setSort', '')\n }\n }\n if (!isArrayEmpty(changedExtraParams)) {\n commit('setPage', 1)\n commit('setSort', '')\n }\n }\n}\n"],"names":[],"mappings":";;;AAIA;;;;;;;AAOG;AACI,MAAM,wBAAwB,GAA8D,CACjG,EAAE,MAAM,EAAE,KAAK,EAAE,EACjB,EAAE,UAAU,EAAE,UAAU,EAAE,KACxB;IACF,IAAI,KAAK,CAAC,wBAAwB,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE;AAC1D,QAAA,MAAM,CAAC,6BAA6B,EAAE,KAAK,CAAC;IAC9C;;IAEA,IAAI,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,UAAU,EAAE;AAChC,QAAA,MAAM,WAAW,GAAG,oBAAoB,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,MAAM,CACrE,KAAK,IAAI,KAAK,KAAK,aAAa,CACjC;AACD,QAAA,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,WAAW,CAAC;AAE/F,QAAA,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE;YAC9B,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AACjC,gBAAA,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;YACtB;AACA,YAAA,IAAI,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE;AAC9E,gBAAA,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC;YACvB;QACF;AACA,QAAA,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,EAAE;AACrC,YAAA,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;AACpB,YAAA,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC;QACvB;IACF;AACF;;;;"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Default implementation for the {@link BrowseActions.saveBrowseResponse}.
3
+ *
4
+ * @param context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,
5
+ * provided by Vuex.
6
+ * @param response - The {@link @empathyco/x-types#BrowseResponse} to save.
7
+ * @public
8
+ */
9
+ const saveBrowseResponse = ({ commit, state, getters }, { results, facets, banners, promoteds, totalResults, browseTagging, displayBrowseTagging, stats }) => {
10
+ if (totalResults === 0) {
11
+ commit('setIsNoResults', true);
12
+ if (getters.request && Object.keys(getters.request.filters).length > 0) {
13
+ commit('setSelectedFilters', []);
14
+ commit('setFromNoResultsWithFilters', true);
15
+ }
16
+ }
17
+ else {
18
+ commit('setIsNoResults', false);
19
+ }
20
+ if (state.isAppendResults) {
21
+ commit('appendResults', results);
22
+ }
23
+ else {
24
+ commit('setResults', results);
25
+ commit('setBanners', banners ?? []);
26
+ commit('setPromoteds', promoteds ?? []);
27
+ }
28
+ if (facets) {
29
+ commit('setFacets', facets);
30
+ }
31
+ if (browseTagging) {
32
+ commit('setBrowseTagging', browseTagging);
33
+ }
34
+ if (displayBrowseTagging) {
35
+ commit('setDisplayBrowseTagging', displayBrowseTagging);
36
+ }
37
+ commit('setTotalResults', totalResults);
38
+ commit('setStats', stats);
39
+ };
40
+
41
+ export { saveBrowseResponse };
42
+ //# sourceMappingURL=save-browse-response.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"save-browse-response.action.js","sources":["../../../../../../src/x-modules/browse/store/actions/save-browse-response.action.ts"],"sourcesContent":["import type { Stats } from '@empathyco/x-types'\nimport type { BrowseXStoreModule } from '../types'\n\n/**\n * Default implementation for the {@link BrowseActions.saveBrowseResponse}.\n *\n * @param context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,\n * provided by Vuex.\n * @param response - The {@link @empathyco/x-types#BrowseResponse} to save.\n * @public\n */\nexport const saveBrowseResponse: BrowseXStoreModule['actions']['saveBrowseResponse'] = (\n { commit, state, getters },\n { results, facets, banners, promoteds, totalResults, browseTagging, displayBrowseTagging, stats },\n) => {\n if (totalResults === 0) {\n commit('setIsNoResults', true)\n if (getters.request && Object.keys(getters.request.filters!).length > 0) {\n commit('setSelectedFilters', [])\n commit('setFromNoResultsWithFilters', true)\n }\n } else {\n commit('setIsNoResults', false)\n }\n\n if (state.isAppendResults) {\n commit('appendResults', results)\n } else {\n commit('setResults', results)\n commit('setBanners', banners ?? [])\n commit('setPromoteds', promoteds ?? [])\n }\n\n if (facets) {\n commit('setFacets', facets)\n }\n\n if (browseTagging) {\n commit('setBrowseTagging', browseTagging)\n }\n\n if (displayBrowseTagging) {\n commit('setDisplayBrowseTagging', displayBrowseTagging)\n }\n\n commit('setTotalResults', totalResults)\n commit('setStats', stats as Stats)\n}\n"],"names":[],"mappings":"AAGA;;;;;;;AAOG;AACI,MAAM,kBAAkB,GAAwD,CACrF,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAC1B,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,KAAK,EAAE,KAC/F;AACF,IAAA,IAAI,YAAY,KAAK,CAAC,EAAE;AACtB,QAAA,MAAM,CAAC,gBAAgB,EAAE,IAAI,CAAC;AAC9B,QAAA,IAAI,OAAO,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAQ,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;AACvE,YAAA,MAAM,CAAC,oBAAoB,EAAE,EAAE,CAAC;AAChC,YAAA,MAAM,CAAC,6BAA6B,EAAE,IAAI,CAAC;QAC7C;IACF;SAAO;AACL,QAAA,MAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC;IACjC;AAEA,IAAA,IAAI,KAAK,CAAC,eAAe,EAAE;AACzB,QAAA,MAAM,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC;SAAO;AACL,QAAA,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC;AAC7B,QAAA,MAAM,CAAC,YAAY,EAAE,OAAO,IAAI,EAAE,CAAC;AACnC,QAAA,MAAM,CAAC,cAAc,EAAE,SAAS,IAAI,EAAE,CAAC;IACzC;IAEA,IAAI,MAAM,EAAE;AACV,QAAA,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B;IAEA,IAAI,aAAa,EAAE;AACjB,QAAA,MAAM,CAAC,kBAAkB,EAAE,aAAa,CAAC;IAC3C;IAEA,IAAI,oBAAoB,EAAE;AACxB,QAAA,MAAM,CAAC,yBAAyB,EAAE,oBAAoB,CAAC;IACzD;AAEA,IAAA,MAAM,CAAC,iBAAiB,EAAE,YAAY,CAAC;AACvC,IAAA,MAAM,CAAC,UAAU,EAAE,KAAc,CAAC;AACpC;;;;"}
@@ -0,0 +1,16 @@
1
+ import { createOrigin } from '../../../../utils/origin.js';
2
+
3
+ /**
4
+ * Default implementation for the {@link BrowseActions.saveOrigin}.
5
+ *
6
+ * @param context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,
7
+ * provided by Vuex.
8
+ * @param queryOriginInit - The object to create the {@link QueryOrigin} with.
9
+ * @public
10
+ */
11
+ const saveOrigin = ({ commit }, queryOriginInit) => {
12
+ commit('setOrigin', createOrigin(queryOriginInit));
13
+ };
14
+
15
+ export { saveOrigin };
16
+ //# sourceMappingURL=save-origin.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"save-origin.action.js","sources":["../../../../../../src/x-modules/browse/store/actions/save-origin.action.ts"],"sourcesContent":["import type { QueryOrigin } from '../../../../types/origin'\nimport type { BrowseXStoreModule } from '../types'\nimport { createOrigin } from '../../../../utils/origin'\n\n/**\n * Default implementation for the {@link BrowseActions.saveOrigin}.\n *\n * @param context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,\n * provided by Vuex.\n * @param queryOriginInit - The object to create the {@link QueryOrigin} with.\n * @public\n */\nexport const saveOrigin: BrowseXStoreModule['actions']['saveOrigin'] = (\n { commit },\n queryOriginInit,\n) => {\n commit('setOrigin', createOrigin(queryOriginInit) as QueryOrigin | null)\n}\n"],"names":[],"mappings":";;AAIA;;;;;;;AAOG;AACI,MAAM,UAAU,GAAgD,CACrE,EAAE,MAAM,EAAE,EACV,eAAe,KACb;IACF,MAAM,CAAC,WAAW,EAAE,YAAY,CAAC,eAAe,CAAuB,CAAC;AAC1E;;;;"}