@empathyco/x-components 6.0.0-alpha.5 → 6.0.0-alpha.51

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 (761) hide show
  1. package/CHANGELOG.md +448 -0
  2. package/core/index.js +8 -1
  3. package/core/index.js.map +1 -1
  4. package/design-system/deprecated-full-theme.css +596 -596
  5. package/docs/API-reference/api/x-adapter-platform.md +12 -0
  6. package/docs/API-reference/api/x-adapter-platform.nextqueriesrelatedpromptsschema.md +11 -0
  7. package/docs/API-reference/api/x-adapter-platform.platformadapter.relatedprompts.md +11 -0
  8. package/docs/API-reference/api/x-adapter-platform.platformrelatedprompt.md +23 -0
  9. package/docs/API-reference/api/x-adapter-platform.platformrelatedprompt.nextqueries.md +11 -0
  10. package/docs/API-reference/api/x-adapter-platform.platformrelatedprompt.suggestiontext.md +11 -0
  11. package/docs/API-reference/api/x-adapter-platform.platformrelatedprompt.tagging.md +11 -0
  12. package/docs/API-reference/api/x-adapter-platform.platformrelatedprompt.type.md +11 -0
  13. package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptnextqueriestagging.md +22 -0
  14. package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptnextqueriestagging.toolingdisplay.md +11 -0
  15. package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptnextqueriestagging.toolingdisplayadd2cart.md +11 -0
  16. package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptnextqueriestagging.toolingdisplayclick.md +11 -0
  17. package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptsrequest.md +15 -0
  18. package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptsresponse.data.md +13 -0
  19. package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptsresponse.md +21 -0
  20. package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptsresponse.status.md +11 -0
  21. package/docs/API-reference/api/x-adapter-platform.platformrelatedprompttagging.md +22 -0
  22. package/docs/API-reference/api/x-adapter-platform.platformrelatedprompttagging.nextqueries.md +11 -0
  23. package/docs/API-reference/api/x-adapter-platform.platformrelatedprompttagging.toolingdisplay.md +11 -0
  24. package/docs/API-reference/api/x-adapter-platform.platformrelatedprompttagging.toolingdisplayclick.md +11 -0
  25. package/docs/API-reference/api/x-adapter-platform.platformsearchresponse.catalog.md +6 -0
  26. package/docs/API-reference/api/x-adapter-platform.platformsearchresponse.md +1 -1
  27. package/docs/API-reference/api/x-adapter-platform.relatedpromptschema.md +13 -0
  28. package/docs/API-reference/api/x-adapter-platform.relatedpromptsendpointadapter.md +13 -0
  29. package/docs/API-reference/api/x-adapter-platform.relatedpromptsrequestmapper.md +13 -0
  30. package/docs/API-reference/api/x-adapter-platform.relatedpromptsrequestschema.md +13 -0
  31. package/docs/API-reference/api/x-adapter-platform.relatedpromptsresponsemapper.md +13 -0
  32. package/docs/API-reference/api/x-adapter-platform.relatedpromptsresponseschema.md +13 -0
  33. package/docs/API-reference/api/x-components.animationprop.md +6 -1
  34. package/docs/API-reference/api/x-components.bannerslist.md +3 -3
  35. package/docs/API-reference/api/x-components.baseaddtocart.md +1 -0
  36. package/docs/API-reference/api/x-components.basedropdown.md +5 -5
  37. package/docs/API-reference/api/x-components.baseeventsmodal.md +2 -2
  38. package/docs/API-reference/api/x-components.basegrid.md +3 -3
  39. package/docs/API-reference/api/x-components.baseheadertogglepanel.md +5 -5
  40. package/docs/API-reference/api/x-components.baseidmodal.md +2 -2
  41. package/docs/API-reference/api/x-components.baseidtogglepanel.md +5 -5
  42. package/docs/API-reference/api/x-components.basemodal.md +10 -10
  43. package/docs/API-reference/api/x-components.baseresultimage.md +9 -9
  44. package/docs/API-reference/api/x-components.baseslider.md +70 -0
  45. package/docs/API-reference/api/x-components.basesuggestions.md +3 -3
  46. package/docs/API-reference/api/x-components.basetabspanel.md +8 -8
  47. package/docs/API-reference/api/x-components.basetogglepanel.md +3 -3
  48. package/docs/API-reference/api/x-components.basevariablecolumngrid.md +3 -3
  49. package/docs/API-reference/api/x-components.cancelfetchandsaverelatedprompts.md +13 -0
  50. package/docs/API-reference/api/x-components.configmutations.config.md +11 -0
  51. package/docs/API-reference/api/x-components.configmutations.md +29 -0
  52. package/docs/API-reference/api/x-components.configmutations.mergeconfig.md +24 -0
  53. package/docs/API-reference/api/x-components.configmutations.setconfig.md +24 -0
  54. package/docs/API-reference/api/x-components.createrelatedtagsquerygetter.md +26 -0
  55. package/docs/API-reference/api/x-components.createrelatedtagsquerygetteroptions.getrelatedtags.md +13 -0
  56. package/docs/API-reference/api/x-components.createrelatedtagsquerygetteroptions.md +20 -0
  57. package/docs/API-reference/api/x-components.createtrackrelatedprompttoolingdisplayclickwire.md +19 -0
  58. package/docs/API-reference/api/x-components.createtracktoolingadd2cartwire.md +19 -0
  59. package/docs/API-reference/api/x-components.createtracktoolingdisplaywire.md +19 -0
  60. package/docs/API-reference/api/{x-components.defaultpdpaddtocartservice._constructor_.md → x-components.defaultexternaltaggingservice._constructor_.md} +3 -3
  61. package/docs/API-reference/api/x-components.defaultexternaltaggingservice.add_to_cart_id_key.md +13 -0
  62. package/docs/API-reference/api/x-components.defaultexternaltaggingservice.instance.md +13 -0
  63. package/docs/API-reference/api/x-components.defaultexternaltaggingservice.localstorageservice.md +11 -0
  64. package/docs/API-reference/api/x-components.defaultexternaltaggingservice.md +43 -0
  65. package/docs/API-reference/api/{x-components.defaultpdpaddtocartservice.movetosessionstorage.md → x-components.defaultexternaltaggingservice.movetosessionstorage.md} +2 -2
  66. package/docs/API-reference/api/x-components.defaultexternaltaggingservice.result_clicked_id_key.md +13 -0
  67. package/docs/API-reference/api/x-components.defaultexternaltaggingservice.sessionstorageservice.md +11 -0
  68. package/docs/API-reference/api/x-components.defaultexternaltaggingservice.storagekey.md +11 -0
  69. package/docs/API-reference/api/x-components.defaultexternaltaggingservice.storagettlms.md +11 -0
  70. package/docs/API-reference/api/{x-components.defaultpdpaddtocartservice.store.md → x-components.defaultexternaltaggingservice.store.md} +2 -2
  71. package/docs/API-reference/api/x-components.defaultexternaltaggingservice.storeaddtocart.md +24 -0
  72. package/docs/API-reference/api/{x-components.defaultpdpaddtocartservice.storeresultclicked.md → x-components.defaultexternaltaggingservice.storeresultclicked.md} +3 -3
  73. package/docs/API-reference/api/{x-components.defaultpdpaddtocartservice.trackaddtocart.md → x-components.defaultexternaltaggingservice.trackaddtocart.md} +3 -3
  74. package/docs/API-reference/api/x-components.displayclickprovider.md +66 -0
  75. package/docs/API-reference/api/x-components.empathize.md +6 -6
  76. package/docs/API-reference/api/x-components.empathizemutations.md +1 -1
  77. package/docs/API-reference/api/x-components.externaltaggingservice.md +23 -0
  78. package/docs/API-reference/api/{x-components.pdpaddtocartservice.movetosessionstorage.md → x-components.externaltaggingservice.movetosessionstorage.md} +2 -2
  79. package/docs/API-reference/api/x-components.externaltaggingservice.storeaddtocart.md +24 -0
  80. package/docs/API-reference/api/{x-components.pdpaddtocartservice.storeresultclicked.md → x-components.externaltaggingservice.storeresultclicked.md} +3 -3
  81. package/docs/API-reference/api/{x-components.pdpaddtocartservice.trackaddtocart.md → x-components.externaltaggingservice.trackaddtocart.md} +3 -3
  82. package/docs/API-reference/api/x-components.facets.md +3 -3
  83. package/docs/API-reference/api/x-components.facetsmutations.md +1 -1
  84. package/docs/API-reference/api/x-components.featurelocation.md +1 -1
  85. package/docs/API-reference/api/x-components.fetchandsaverelatedprompts.md +13 -0
  86. package/docs/API-reference/api/x-components.fetchrelatedprompts.md +13 -0
  87. package/docs/API-reference/api/x-components.filterslist.md +3 -3
  88. package/docs/API-reference/api/x-components.globalxbus.md +12 -0
  89. package/docs/API-reference/api/x-components.hierarchicalfilter.md +8 -2
  90. package/docs/API-reference/api/x-components.historyqueriesmutations.md +1 -1
  91. package/docs/API-reference/api/x-components.historyqueriesstate.md +1 -1
  92. package/docs/API-reference/api/x-components.identifierresults.md +3 -3
  93. package/docs/API-reference/api/x-components.identifierresultsmutations.md +1 -1
  94. package/docs/API-reference/api/x-components.identifierresultsstate.md +1 -1
  95. package/docs/API-reference/api/x-components.installxoptions.domelement.md +1 -1
  96. package/docs/API-reference/api/x-components.installxoptions.installextraplugins.md +2 -2
  97. package/docs/API-reference/api/x-components.installxoptions.md +1 -1
  98. package/docs/API-reference/api/x-components.itemslist.md +3 -3
  99. package/docs/API-reference/api/x-components.mainmodal.md +2 -2
  100. package/docs/API-reference/api/x-components.md +38 -3
  101. package/docs/API-reference/api/x-components.mergeconfig.md +27 -0
  102. package/docs/API-reference/api/x-components.multicolumnmaxwidthlayout.md +5 -5
  103. package/docs/API-reference/api/x-components.myhistory.md +3 -3
  104. package/docs/API-reference/api/x-components.nextqueriesgroup.md +22 -0
  105. package/docs/API-reference/api/x-components.nextqueriesgroup.modelname.md +11 -0
  106. package/docs/API-reference/api/x-components.nextqueriesgroup.nextqueries.md +11 -0
  107. package/docs/API-reference/api/x-components.nextquerieslist.md +3 -3
  108. package/docs/API-reference/api/x-components.nextqueriesmutations.md +1 -1
  109. package/docs/API-reference/api/x-components.nextqueriesstate.md +1 -1
  110. package/docs/API-reference/api/x-components.pageselector.md +80 -0
  111. package/docs/API-reference/api/x-components.partialresultslist.md +3 -3
  112. package/docs/API-reference/api/x-components.popularsearchesmutations.md +1 -1
  113. package/docs/API-reference/api/x-components.promotedslist.md +3 -3
  114. package/docs/API-reference/api/x-components.queriespreviewmutations.md +1 -1
  115. package/docs/API-reference/api/x-components.queryfeature.md +1 -1
  116. package/docs/API-reference/api/x-components.querymutations.md +20 -0
  117. package/docs/API-reference/api/x-components.querymutations.setquery.md +24 -0
  118. package/docs/API-reference/api/x-components.querypreviewlist.md +3 -3
  119. package/docs/API-reference/api/x-components.querystate.md +20 -0
  120. package/docs/API-reference/api/x-components.querystate.query.md +13 -0
  121. package/docs/API-reference/api/x-components.querysuggestionsmutations.md +1 -1
  122. package/docs/API-reference/api/x-components.querysuggestionsstate.md +1 -1
  123. package/docs/API-reference/api/x-components.recommendations.md +3 -3
  124. package/docs/API-reference/api/x-components.recommendationsmutations.md +1 -1
  125. package/docs/API-reference/api/x-components.relatedprompt.md +33 -0
  126. package/docs/API-reference/api/x-components.relatedpromptrequest.md +13 -0
  127. package/docs/API-reference/api/x-components.relatedpromptsactioncontext.md +15 -0
  128. package/docs/API-reference/api/x-components.relatedpromptsactions.cancelfetchandsaverelatedprompts.md +17 -0
  129. package/docs/API-reference/api/x-components.relatedpromptsactions.fetchandsaverelatedprompts.md +24 -0
  130. package/docs/API-reference/api/x-components.relatedpromptsactions.fetchrelatedprompts.md +24 -0
  131. package/docs/API-reference/api/x-components.relatedpromptsactions.md +22 -0
  132. package/docs/API-reference/api/x-components.relatedpromptsgetters.md +20 -0
  133. package/docs/API-reference/api/x-components.relatedpromptsgetters.request.md +13 -0
  134. package/docs/API-reference/api/x-components.relatedpromptslist.md +72 -0
  135. package/docs/API-reference/api/x-components.relatedpromptsmutations.md +26 -0
  136. package/docs/API-reference/api/x-components.relatedpromptsmutations.resetrelatedpromptsstate.md +17 -0
  137. package/docs/API-reference/api/x-components.relatedpromptsmutations.resetselectedprompt.md +17 -0
  138. package/docs/API-reference/api/x-components.relatedpromptsmutations.setparams.md +24 -0
  139. package/docs/API-reference/api/x-components.relatedpromptsmutations.setrelatedpromptsproducts.md +24 -0
  140. package/docs/API-reference/api/x-components.relatedpromptsmutations.setselectedprompt.md +24 -0
  141. package/docs/API-reference/api/x-components.relatedpromptsmutations.setselectedquery.md +24 -0
  142. package/docs/API-reference/api/x-components.relatedpromptsstate.md +24 -0
  143. package/docs/API-reference/api/x-components.relatedpromptsstate.params.md +13 -0
  144. package/docs/API-reference/api/x-components.relatedpromptsstate.relatedprompts.md +13 -0
  145. package/docs/API-reference/api/x-components.relatedpromptsstate.selectedprompt.md +13 -0
  146. package/docs/API-reference/api/x-components.relatedpromptsstate.selectedquery.md +13 -0
  147. package/docs/API-reference/api/x-components.relatedpromptstaglist.md +73 -0
  148. package/docs/API-reference/api/x-components.relatedpromptsxevents.md +24 -0
  149. package/docs/API-reference/api/x-components.relatedpromptsxevents.relatedpromptsrequestupdated.md +13 -0
  150. package/docs/API-reference/api/x-components.relatedpromptsxevents.userclickedarelatedpromptadd2cart.md +13 -0
  151. package/docs/API-reference/api/x-components.relatedpromptsxevents.userclickedarelatedpromptresult.md +13 -0
  152. package/docs/API-reference/api/x-components.relatedpromptsxevents.userselectedarelatedprompt.md +13 -0
  153. package/docs/API-reference/api/x-components.relatedpromptsxevents.userselectedarelatedpromptquery.md +13 -0
  154. package/docs/API-reference/api/x-components.relatedpromptsxmodule.md +13 -0
  155. package/docs/API-reference/api/x-components.relatedpromptsxstoremodule.md +15 -0
  156. package/docs/API-reference/api/x-components.relatedtags.md +3 -3
  157. package/docs/API-reference/api/x-components.relatedtagsmutations.md +1 -1
  158. package/docs/API-reference/api/x-components.relatedtagsstate.md +1 -1
  159. package/docs/API-reference/api/x-components.resultslist.md +3 -3
  160. package/docs/API-reference/api/x-components.scrolltotop.md +5 -5
  161. package/docs/API-reference/api/x-components.searchboxmutations.md +1 -1
  162. package/docs/API-reference/api/x-components.searchboxstate.md +1 -1
  163. package/docs/API-reference/api/x-components.searchconfig.md +1 -0
  164. package/docs/API-reference/api/x-components.searchconfig.pagemode.md +11 -0
  165. package/docs/API-reference/api/x-components.searchinputplaceholder.md +3 -3
  166. package/docs/API-reference/api/x-components.searchmutations.md +2 -1
  167. package/docs/API-reference/api/x-components.searchmutations.setstats.md +24 -0
  168. package/docs/API-reference/api/x-components.searchstate.md +2 -1
  169. package/docs/API-reference/api/x-components.searchstate.stats.md +13 -0
  170. package/docs/API-reference/api/x-components.searchxevents.md +1 -0
  171. package/docs/API-reference/api/x-components.searchxevents.userselectedapage.md +13 -0
  172. package/docs/API-reference/api/x-components.selectedfilterslist.md +3 -3
  173. package/docs/API-reference/api/x-components.semanticqueriesmutations.md +1 -1
  174. package/docs/API-reference/api/x-components.semanticqueriesstate.md +1 -1
  175. package/docs/API-reference/api/x-components.setconfig.md +27 -0
  176. package/docs/API-reference/api/x-components.setquery.md +25 -0
  177. package/docs/API-reference/api/x-components.simplefilter.md +6 -0
  178. package/docs/API-reference/api/x-components.singlecolumnlayout.md +3 -3
  179. package/docs/API-reference/api/x-components.slidingpanel.md +13 -5
  180. package/docs/API-reference/api/x-components.snippetcallbacks.md +6 -0
  181. package/docs/API-reference/api/x-components.sortdropdown.md +1 -1
  182. package/docs/API-reference/api/x-components.tagging.md +6 -6
  183. package/docs/API-reference/api/x-components.taggingconfig.md +2 -2
  184. package/docs/API-reference/api/{x-components.taggingconfig.clickedresultstoragekey.md → x-components.taggingconfig.storagekey.md} +3 -3
  185. package/docs/API-reference/api/x-components.taggingconfig.storagettlms.md +13 -0
  186. package/docs/API-reference/api/x-components.taggingmutations.md +1 -1
  187. package/docs/API-reference/api/x-components.taggingxevents.md +1 -1
  188. package/docs/API-reference/api/x-components.taggingxevents.resulturltrackingenabled.md +1 -1
  189. package/docs/API-reference/api/x-components.trackrelatedprompttoolingdisplayclickwire.md +13 -0
  190. package/docs/API-reference/api/x-components.tracktoolingadd2cartwire.md +13 -0
  191. package/docs/API-reference/api/x-components.tracktoolingdisplayclickedwire.md +13 -0
  192. package/docs/API-reference/api/x-components.typing.md +13 -0
  193. package/docs/API-reference/api/x-components.typingoptions.md +22 -0
  194. package/docs/API-reference/api/x-components.typingoptions.speed.md +13 -0
  195. package/docs/API-reference/api/x-components.typingoptions.targetattr.md +18 -0
  196. package/docs/API-reference/api/x-components.typingoptions.text.md +13 -0
  197. package/docs/API-reference/api/x-components.urlmutations.md +1 -1
  198. package/docs/API-reference/api/x-components.urlstate.md +1 -1
  199. package/docs/API-reference/api/x-components.usealiasapi.md +1 -0
  200. package/docs/API-reference/api/x-components.usealiasapi.pricestats.md +16 -0
  201. package/docs/API-reference/api/x-components.xeventstypes.md +3 -3
  202. package/docs/API-reference/api/x-components.xmodulestree.md +1 -0
  203. package/docs/API-reference/api/x-components.xmodulestree.relatedprompts.md +11 -0
  204. package/docs/API-reference/api/x-types.md +5 -0
  205. package/docs/API-reference/api/x-types.relatedprompt.md +26 -0
  206. package/docs/API-reference/api/x-types.relatedprompt.nextqueries.md +13 -0
  207. package/docs/API-reference/api/x-types.relatedprompt.relatedpromptnextqueries.md +13 -0
  208. package/docs/API-reference/api/x-types.relatedprompt.suggestiontext.md +13 -0
  209. package/docs/API-reference/api/x-types.relatedprompt.tagging.md +17 -0
  210. package/docs/API-reference/api/x-types.relatedprompt.toolingdisplaytagging.md +13 -0
  211. package/docs/API-reference/api/x-types.relatedprompt.type.md +13 -0
  212. package/docs/API-reference/api/x-types.relatedpromptnextquery.md +23 -0
  213. package/docs/API-reference/api/x-types.relatedpromptnextquery.query.md +13 -0
  214. package/docs/API-reference/api/x-types.relatedpromptnextquery.toolingdisplayadd2carttagging.md +13 -0
  215. package/docs/API-reference/api/x-types.relatedpromptnextquery.toolingdisplayclicktagging.md +13 -0
  216. package/docs/API-reference/api/x-types.relatedpromptnextquery.toolingdisplaytagging.md +13 -0
  217. package/docs/API-reference/api/x-types.relatedpromptsrequest.md +15 -0
  218. package/docs/API-reference/api/x-types.relatedpromptsresponse.md +20 -0
  219. package/docs/API-reference/api/x-types.relatedpromptsresponse.relatedprompts.md +11 -0
  220. package/docs/API-reference/api/x-types.searchresponse.md +1 -0
  221. package/docs/API-reference/api/x-types.searchresponse.stats.md +11 -0
  222. package/docs/API-reference/api/x-types.stats.md +22 -0
  223. package/docs/API-reference/api/x-types.stats.price.md +14 -0
  224. package/docs/API-reference/api/x-types.xcomponentsadapter.md +1 -0
  225. package/docs/API-reference/api/x-types.xcomponentsadapter.relatedprompts.md +11 -0
  226. package/docs/API-reference/components/common/result/x-components.base-result-image.md +2 -2
  227. package/docs/API-reference/components/common/x-components.base-slider.md +189 -0
  228. package/docs/API-reference/components/common/x-components.display-click-provider.md +17 -0
  229. package/docs/API-reference/components/common/x-components.items-list.md +1 -1
  230. package/docs/API-reference/components/common/x-components.page-selector.md +136 -0
  231. package/docs/API-reference/components/common/x-components.sliding-panel.md +7 -7
  232. package/docs/API-reference/components/facets/x-components.facets/facets.md +1 -1
  233. package/docs/API-reference/components/facets/x-components.lists/selected-filters-list.md +1 -1
  234. package/docs/API-reference/components/related-prompts/x-components.related-prompt.md +22 -0
  235. package/docs/API-reference/components/related-prompts/x-components.related-prompts-list.md +196 -0
  236. package/docs/API-reference/components/related-prompts/x-components.related-prompts-tag-list.md +32 -0
  237. package/docs/API-reference/components/search/x-components.results-list.md +1 -1
  238. package/docs/API-reference/components/tagging/x-components.tagging.md +15 -16
  239. package/js/components/animations/fade-and-slide.vue.js +1 -2
  240. package/js/components/animations/fade-and-slide.vue.js.map +1 -1
  241. package/js/components/base-dropdown.vue.js +1 -3
  242. package/js/components/base-dropdown.vue.js.map +1 -1
  243. package/js/components/base-dropdown.vue2.js +1 -7
  244. package/js/components/base-dropdown.vue2.js.map +1 -1
  245. package/js/components/base-event-button.vue.js +1 -2
  246. package/js/components/base-event-button.vue.js.map +1 -1
  247. package/js/components/base-grid.vue.js +11 -18
  248. package/js/components/base-grid.vue.js.map +1 -1
  249. package/js/components/base-grid.vue2.js.map +1 -1
  250. package/js/components/base-grid.vue3.js +1 -1
  251. package/js/components/base-keyboard-navigation.vue.js +1 -2
  252. package/js/components/base-keyboard-navigation.vue.js.map +1 -1
  253. package/js/components/base-rating.vue.js +1 -3
  254. package/js/components/base-rating.vue.js.map +1 -1
  255. package/js/components/base-slider.vue.js +65 -0
  256. package/js/components/base-slider.vue.js.map +1 -0
  257. package/js/components/base-slider.vue2.js +109 -0
  258. package/js/components/base-slider.vue2.js.map +1 -0
  259. package/js/components/base-slider.vue3.js +7 -0
  260. package/js/components/base-slider.vue3.js.map +1 -0
  261. package/js/components/base-variable-column-grid.vue.js +1 -2
  262. package/js/components/base-variable-column-grid.vue.js.map +1 -1
  263. package/js/components/column-picker/base-column-picker-dropdown.vue.js +1 -3
  264. package/js/components/column-picker/base-column-picker-dropdown.vue.js.map +1 -1
  265. package/js/components/column-picker/base-column-picker-list.vue.js +1 -3
  266. package/js/components/column-picker/base-column-picker-list.vue.js.map +1 -1
  267. package/js/components/display-click-provider.vue.js +74 -0
  268. package/js/components/display-click-provider.vue.js.map +1 -0
  269. package/js/components/display-click-provider.vue2.js +6 -0
  270. package/js/components/display-click-provider.vue2.js.map +1 -0
  271. package/js/components/filters/labels/base-rating-filter-label.vue.js +1 -3
  272. package/js/components/filters/labels/base-rating-filter-label.vue.js.map +1 -1
  273. package/js/components/icons/cross-tiny.vue.js +2 -2
  274. package/js/components/icons/plus.vue.js +2 -2
  275. package/js/components/items-list.vue.js +1 -2
  276. package/js/components/items-list.vue.js.map +1 -1
  277. package/js/components/items-list.vue2.js +2 -2
  278. package/js/components/items-list.vue2.js.map +1 -1
  279. package/js/components/layouts/fixed-header-and-asides-layout.vue.js +1 -7
  280. package/js/components/layouts/fixed-header-and-asides-layout.vue.js.map +1 -1
  281. package/js/components/layouts/multi-column-max-width-layout.vue.js +1 -9
  282. package/js/components/layouts/multi-column-max-width-layout.vue.js.map +1 -1
  283. package/js/components/layouts/single-column-layout.vue.js +1 -9
  284. package/js/components/layouts/single-column-layout.vue.js.map +1 -1
  285. package/js/components/modals/base-events-modal-close.vue.js +1 -2
  286. package/js/components/modals/base-events-modal-close.vue.js.map +1 -1
  287. package/js/components/modals/base-events-modal-open.vue.js +1 -2
  288. package/js/components/modals/base-events-modal-open.vue.js.map +1 -1
  289. package/js/components/modals/base-id-modal-close.vue.js +1 -2
  290. package/js/components/modals/base-id-modal-close.vue.js.map +1 -1
  291. package/js/components/modals/base-id-modal-open.vue.js +1 -2
  292. package/js/components/modals/base-id-modal-open.vue.js.map +1 -1
  293. package/js/components/modals/base-modal.vue.js +1 -2
  294. package/js/components/modals/base-modal.vue.js.map +1 -1
  295. package/js/components/modals/base-modal.vue2.js +13 -6
  296. package/js/components/modals/base-modal.vue2.js.map +1 -1
  297. package/js/components/page-loader-button.vue.js +8 -10
  298. package/js/components/page-loader-button.vue.js.map +1 -1
  299. package/js/components/page-loader-button.vue2.js.map +1 -1
  300. package/js/components/page-loader-button.vue3.js +7 -0
  301. package/js/components/page-loader-button.vue3.js.map +1 -0
  302. package/js/components/page-selector.vue.js +78 -0
  303. package/js/components/page-selector.vue.js.map +1 -0
  304. package/js/components/page-selector.vue2.js +128 -0
  305. package/js/components/page-selector.vue2.js.map +1 -0
  306. package/js/components/page-selector.vue3.js +7 -0
  307. package/js/components/page-selector.vue3.js.map +1 -0
  308. package/js/components/panels/base-header-toggle-panel.vue.js +1 -5
  309. package/js/components/panels/base-header-toggle-panel.vue.js.map +1 -1
  310. package/js/components/panels/base-id-toggle-panel-button.vue.js +1 -2
  311. package/js/components/panels/base-id-toggle-panel-button.vue.js.map +1 -1
  312. package/js/components/panels/base-id-toggle-panel.vue.js +1 -2
  313. package/js/components/panels/base-id-toggle-panel.vue.js.map +1 -1
  314. package/js/components/panels/base-tabs-panel.vue.js +1 -4
  315. package/js/components/panels/base-tabs-panel.vue.js.map +1 -1
  316. package/js/components/panels/base-toggle-panel.vue.js +1 -2
  317. package/js/components/panels/base-toggle-panel.vue.js.map +1 -1
  318. package/js/components/result/base-result-add-to-cart.vue.js +3 -3
  319. package/js/components/result/base-result-add-to-cart.vue.js.map +1 -1
  320. package/js/components/result/base-result-add-to-cart.vue2.js +19 -5
  321. package/js/components/result/base-result-add-to-cart.vue2.js.map +1 -1
  322. package/js/components/result/base-result-current-price.vue.js +1 -2
  323. package/js/components/result/base-result-current-price.vue.js.map +1 -1
  324. package/js/components/result/base-result-image.vue.js +39 -59
  325. package/js/components/result/base-result-image.vue.js.map +1 -1
  326. package/js/components/result/base-result-image.vue2.js +5 -5
  327. package/js/components/result/base-result-image.vue2.js.map +1 -1
  328. package/js/components/result/base-result-link.vue.js +1 -2
  329. package/js/components/result/base-result-link.vue.js.map +1 -1
  330. package/js/components/result/base-result-previous-price.vue.js +1 -2
  331. package/js/components/result/base-result-previous-price.vue.js.map +1 -1
  332. package/js/components/result/base-result-rating.vue.js +1 -4
  333. package/js/components/result/base-result-rating.vue.js.map +1 -1
  334. package/js/components/result/result-variant-selector.vue.js +1 -3
  335. package/js/components/result/result-variant-selector.vue.js.map +1 -1
  336. package/js/components/sliding-panel.vue.js +3 -6
  337. package/js/components/sliding-panel.vue.js.map +1 -1
  338. package/js/components/sliding-panel.vue2.js +2 -2
  339. package/js/components/sliding-panel.vue2.js.map +1 -1
  340. package/js/components/suggestions/base-suggestion.vue.js +1 -2
  341. package/js/components/suggestions/base-suggestion.vue.js.map +1 -1
  342. package/js/components/suggestions/base-suggestions.vue.js +1 -2
  343. package/js/components/suggestions/base-suggestions.vue.js.map +1 -1
  344. package/js/composables/use-alias-api.js +4 -1
  345. package/js/composables/use-alias-api.js.map +1 -1
  346. package/js/composables/use-getter.js +1 -1
  347. package/js/composables/use-state.js +1 -1
  348. package/js/directives/typing.js +58 -0
  349. package/js/directives/typing.js.map +1 -0
  350. package/js/index.js +20 -3
  351. package/js/index.js.map +1 -1
  352. package/js/types/animation-prop.js +5 -0
  353. package/js/types/animation-prop.js.map +1 -1
  354. package/js/x-installer/x-installer/x-installer.js +3 -3
  355. package/js/x-installer/x-installer/x-installer.js.map +1 -1
  356. package/js/x-modules/device/store/emitters.js +1 -0
  357. package/js/x-modules/device/store/emitters.js.map +1 -1
  358. package/js/x-modules/empathize/components/empathize.vue.js +1 -2
  359. package/js/x-modules/empathize/components/empathize.vue.js.map +1 -1
  360. package/js/x-modules/empathize/components/empathize.vue2.js +8 -3
  361. package/js/x-modules/empathize/components/empathize.vue2.js.map +1 -1
  362. package/js/x-modules/empathize/store/emitters.js +1 -0
  363. package/js/x-modules/empathize/store/emitters.js.map +1 -1
  364. package/js/x-modules/experience-controls/store/emitters.js +1 -0
  365. package/js/x-modules/experience-controls/store/emitters.js.map +1 -1
  366. package/js/x-modules/extra-params/components/extra-params.vue.js +1 -1
  367. package/js/x-modules/extra-params/components/extra-params.vue.js.map +1 -1
  368. package/js/x-modules/extra-params/store/emitters.js +1 -0
  369. package/js/x-modules/extra-params/store/emitters.js.map +1 -1
  370. package/js/x-modules/facets/components/facets/facets.vue.js +20 -33
  371. package/js/x-modules/facets/components/facets/facets.vue.js.map +1 -1
  372. package/js/x-modules/facets/components/facets/facets.vue2.js +2 -2
  373. package/js/x-modules/facets/components/facets/facets.vue2.js.map +1 -1
  374. package/js/x-modules/facets/components/filters/all-filter.vue.js +1 -2
  375. package/js/x-modules/facets/components/filters/all-filter.vue.js.map +1 -1
  376. package/js/x-modules/facets/components/filters/editable-number-range-filter.vue.js +1 -6
  377. package/js/x-modules/facets/components/filters/editable-number-range-filter.vue.js.map +1 -1
  378. package/js/x-modules/facets/components/filters/hierarchical-filter.vue.js +1 -3
  379. package/js/x-modules/facets/components/filters/hierarchical-filter.vue.js.map +1 -1
  380. package/js/x-modules/facets/components/filters/number-range-filter.vue.js +1 -3
  381. package/js/x-modules/facets/components/filters/number-range-filter.vue.js.map +1 -1
  382. package/js/x-modules/facets/components/filters/simple-filter.vue.js +1 -3
  383. package/js/x-modules/facets/components/filters/simple-filter.vue.js.map +1 -1
  384. package/js/x-modules/facets/components/lists/filters-list.vue.js +1 -2
  385. package/js/x-modules/facets/components/lists/filters-list.vue.js.map +1 -1
  386. package/js/x-modules/facets/components/lists/filters-search.vue.js +1 -3
  387. package/js/x-modules/facets/components/lists/filters-search.vue.js.map +1 -1
  388. package/js/x-modules/facets/components/lists/selected-filters-list.vue.js +11 -18
  389. package/js/x-modules/facets/components/lists/selected-filters-list.vue.js.map +1 -1
  390. package/js/x-modules/facets/components/lists/selected-filters-list.vue2.js +2 -2
  391. package/js/x-modules/facets/components/lists/selected-filters-list.vue2.js.map +1 -1
  392. package/js/x-modules/facets/components/lists/sliced-filters.vue.js +1 -4
  393. package/js/x-modules/facets/components/lists/sliced-filters.vue.js.map +1 -1
  394. package/js/x-modules/history-queries/components/clear-history-queries.vue.js +1 -2
  395. package/js/x-modules/history-queries/components/clear-history-queries.vue.js.map +1 -1
  396. package/js/x-modules/history-queries/components/history-queries.vue.js +1 -10
  397. package/js/x-modules/history-queries/components/history-queries.vue.js.map +1 -1
  398. package/js/x-modules/history-queries/components/history-query.vue.js +1 -6
  399. package/js/x-modules/history-queries/components/history-query.vue.js.map +1 -1
  400. package/js/x-modules/history-queries/components/my-history.vue.js +1 -4
  401. package/js/x-modules/history-queries/components/my-history.vue.js.map +1 -1
  402. package/js/x-modules/history-queries/components/remove-history-query.vue.js +1 -2
  403. package/js/x-modules/history-queries/components/remove-history-query.vue.js.map +1 -1
  404. package/js/x-modules/history-queries/store/emitters.js +1 -0
  405. package/js/x-modules/history-queries/store/emitters.js.map +1 -1
  406. package/js/x-modules/identifier-results/components/identifier-results.vue.js +1 -2
  407. package/js/x-modules/identifier-results/components/identifier-results.vue.js.map +1 -1
  408. package/js/x-modules/identifier-results/store/emitters.js +1 -0
  409. package/js/x-modules/identifier-results/store/emitters.js.map +1 -1
  410. package/js/x-modules/next-queries/components/next-queries.vue.js +1 -7
  411. package/js/x-modules/next-queries/components/next-queries.vue.js.map +1 -1
  412. package/js/x-modules/next-queries/components/next-query-preview.vue.js +1 -3
  413. package/js/x-modules/next-queries/components/next-query-preview.vue.js.map +1 -1
  414. package/js/x-modules/next-queries/components/next-query.vue.js +1 -4
  415. package/js/x-modules/next-queries/components/next-query.vue.js.map +1 -1
  416. package/js/x-modules/next-queries/store/emitters.js +1 -0
  417. package/js/x-modules/next-queries/store/emitters.js.map +1 -1
  418. package/js/x-modules/popular-searches/components/popular-search.vue.js +1 -4
  419. package/js/x-modules/popular-searches/components/popular-search.vue.js.map +1 -1
  420. package/js/x-modules/popular-searches/components/popular-searches.vue.js +1 -7
  421. package/js/x-modules/popular-searches/components/popular-searches.vue.js.map +1 -1
  422. package/js/x-modules/queries-preview/components/query-preview-button.vue.js +1 -2
  423. package/js/x-modules/queries-preview/components/query-preview-button.vue.js.map +1 -1
  424. package/js/x-modules/queries-preview/components/query-preview-button.vue2.js +6 -0
  425. package/js/x-modules/queries-preview/components/query-preview-button.vue2.js.map +1 -1
  426. package/js/x-modules/queries-preview/components/query-preview-list.vue.js.map +1 -1
  427. package/js/x-modules/queries-preview/components/query-preview-list.vue2.js +15 -2
  428. package/js/x-modules/queries-preview/components/query-preview-list.vue2.js.map +1 -1
  429. package/js/x-modules/queries-preview/components/query-preview.vue.js +1 -2
  430. package/js/x-modules/queries-preview/components/query-preview.vue.js.map +1 -1
  431. package/js/x-modules/queries-preview/components/query-preview.vue2.js +7 -1
  432. package/js/x-modules/queries-preview/components/query-preview.vue2.js.map +1 -1
  433. package/js/x-modules/queries-preview/store/actions/fetch-and-save-query-preview.action.js +2 -1
  434. package/js/x-modules/queries-preview/store/actions/fetch-and-save-query-preview.action.js.map +1 -1
  435. package/js/x-modules/queries-preview/store/emitters.js +1 -0
  436. package/js/x-modules/queries-preview/store/emitters.js.map +1 -1
  437. package/js/x-modules/queries-preview/store/module.js +1 -1
  438. package/js/x-modules/queries-preview/store/module.js.map +1 -1
  439. package/js/x-modules/queries-preview/utils/get-hash-from-query-preview.js +6 -4
  440. package/js/x-modules/queries-preview/utils/get-hash-from-query-preview.js.map +1 -1
  441. package/js/x-modules/query-suggestions/components/query-suggestion.vue.js +1 -4
  442. package/js/x-modules/query-suggestions/components/query-suggestion.vue.js.map +1 -1
  443. package/js/x-modules/query-suggestions/components/query-suggestions.vue.js +1 -7
  444. package/js/x-modules/query-suggestions/components/query-suggestions.vue.js.map +1 -1
  445. package/js/x-modules/query-suggestions/store/emitters.js +1 -0
  446. package/js/x-modules/query-suggestions/store/emitters.js.map +1 -1
  447. package/js/x-modules/recommendations/components/recommendations.vue.js +1 -2
  448. package/js/x-modules/recommendations/components/recommendations.vue.js.map +1 -1
  449. package/js/x-modules/recommendations/store/emitters.js +1 -0
  450. package/js/x-modules/recommendations/store/emitters.js.map +1 -1
  451. package/js/x-modules/related-prompts/components/related-prompt.vue.js +26 -0
  452. package/js/x-modules/related-prompts/components/related-prompt.vue.js.map +1 -0
  453. package/js/x-modules/related-prompts/components/related-prompt.vue2.js +31 -0
  454. package/js/x-modules/related-prompts/components/related-prompt.vue2.js.map +1 -0
  455. package/js/x-modules/related-prompts/components/related-prompt.vue3.js +7 -0
  456. package/js/x-modules/related-prompts/components/related-prompt.vue3.js.map +1 -0
  457. package/js/x-modules/related-prompts/components/related-prompts-list.vue.js +154 -0
  458. package/js/x-modules/related-prompts/components/related-prompts-list.vue.js.map +1 -0
  459. package/js/x-modules/related-prompts/components/related-prompts-list.vue2.js +6 -0
  460. package/js/x-modules/related-prompts/components/related-prompts-list.vue2.js.map +1 -0
  461. package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue.js +98 -0
  462. package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue.js.map +1 -0
  463. package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue2.js +226 -0
  464. package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue2.js.map +1 -0
  465. package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue3.js +7 -0
  466. package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue3.js.map +1 -0
  467. package/js/x-modules/related-prompts/store/actions/fetch-and-save-related-prompts.action.js +29 -0
  468. package/js/x-modules/related-prompts/store/actions/fetch-and-save-related-prompts.action.js.map +1 -0
  469. package/js/x-modules/related-prompts/store/actions/fetch-related-prompts.action.js +20 -0
  470. package/js/x-modules/related-prompts/store/actions/fetch-related-prompts.action.js.map +1 -0
  471. package/js/x-modules/related-prompts/store/emitters.js +15 -0
  472. package/js/x-modules/related-prompts/store/emitters.js.map +1 -0
  473. package/js/x-modules/related-prompts/store/getters/request.getter.js +16 -0
  474. package/js/x-modules/related-prompts/store/getters/request.getter.js.map +1 -0
  475. package/js/x-modules/related-prompts/store/module.js +61 -0
  476. package/js/x-modules/related-prompts/store/module.js.map +1 -0
  477. package/js/x-modules/related-prompts/wiring.js +99 -0
  478. package/js/x-modules/related-prompts/wiring.js.map +1 -0
  479. package/js/x-modules/related-prompts/x-module.js +21 -0
  480. package/js/x-modules/related-prompts/x-module.js.map +1 -0
  481. package/js/x-modules/related-tags/components/related-tag.vue.js +1 -2
  482. package/js/x-modules/related-tags/components/related-tag.vue.js.map +1 -1
  483. package/js/x-modules/related-tags/components/related-tags.vue.js +1 -4
  484. package/js/x-modules/related-tags/components/related-tags.vue.js.map +1 -1
  485. package/js/x-modules/related-tags/store/emitters.js +1 -0
  486. package/js/x-modules/related-tags/store/emitters.js.map +1 -1
  487. package/js/x-modules/scroll/components/scroll-to-top.vue.js +1 -2
  488. package/js/x-modules/scroll/components/scroll-to-top.vue.js.map +1 -1
  489. package/js/x-modules/scroll/components/scroll-to-top.vue2.js +6 -0
  490. package/js/x-modules/scroll/components/scroll-to-top.vue2.js.map +1 -1
  491. package/js/x-modules/scroll/store/emitters.js +1 -0
  492. package/js/x-modules/scroll/store/emitters.js.map +1 -1
  493. package/js/x-modules/search/components/partial-results-list.vue.js +1 -2
  494. package/js/x-modules/search/components/partial-results-list.vue.js.map +1 -1
  495. package/js/x-modules/search/components/results-list.vue.js +2 -2
  496. package/js/x-modules/search/components/results-list.vue.js.map +1 -1
  497. package/js/x-modules/search/components/sort-dropdown.vue.js +1 -3
  498. package/js/x-modules/search/components/sort-dropdown.vue.js.map +1 -1
  499. package/js/x-modules/search/store/actions/fetch-and-save-search-response.action.js +10 -3
  500. package/js/x-modules/search/store/actions/fetch-and-save-search-response.action.js.map +1 -1
  501. package/js/x-modules/search/store/actions/save-search-response.action.js +3 -1
  502. package/js/x-modules/search/store/actions/save-search-response.action.js.map +1 -1
  503. package/js/x-modules/search/store/emitters.js +1 -0
  504. package/js/x-modules/search/store/emitters.js.map +1 -1
  505. package/js/x-modules/search/store/module.js +9 -3
  506. package/js/x-modules/search/store/module.js.map +1 -1
  507. package/js/x-modules/search/wiring.js +4 -0
  508. package/js/x-modules/search/wiring.js.map +1 -1
  509. package/js/x-modules/search-box/components/clear-search-input.vue.js +1 -2
  510. package/js/x-modules/search-box/components/clear-search-input.vue.js.map +1 -1
  511. package/js/x-modules/search-box/components/search-button.vue.js +1 -2
  512. package/js/x-modules/search-box/components/search-button.vue.js.map +1 -1
  513. package/js/x-modules/search-box/store/emitters.js +1 -0
  514. package/js/x-modules/search-box/store/emitters.js.map +1 -1
  515. package/js/x-modules/semantic-queries/components/semantic-queries.vue.js +1 -3
  516. package/js/x-modules/semantic-queries/components/semantic-queries.vue.js.map +1 -1
  517. package/js/x-modules/semantic-queries/components/semantic-query.vue.js +1 -4
  518. package/js/x-modules/semantic-queries/components/semantic-query.vue.js.map +1 -1
  519. package/js/x-modules/tagging/components/tagging.vue.js +8 -7
  520. package/js/x-modules/tagging/components/tagging.vue.js.map +1 -1
  521. package/js/x-modules/tagging/service/{pdp-add-to-cart.service.js → external-tagging.service.js} +56 -25
  522. package/js/x-modules/tagging/service/external-tagging.service.js.map +1 -0
  523. package/js/x-modules/tagging/store/emitters.js +1 -1
  524. package/js/x-modules/tagging/store/emitters.js.map +1 -1
  525. package/js/x-modules/tagging/store/module.js +7 -3
  526. package/js/x-modules/tagging/store/module.js.map +1 -1
  527. package/js/x-modules/tagging/wiring.js +105 -8
  528. package/js/x-modules/tagging/wiring.js.map +1 -1
  529. package/js/x-modules/url/components/url-handler.vue.js.map +1 -1
  530. package/js/x-modules/url/components/url-handler.vue2.js +2 -1
  531. package/js/x-modules/url/components/url-handler.vue2.js.map +1 -1
  532. package/js/x-modules/url/store/emitters.js +1 -0
  533. package/js/x-modules/url/store/emitters.js.map +1 -1
  534. package/package.json +50 -49
  535. package/related-prompts/index.d.ts +1 -0
  536. package/related-prompts/index.js +10 -0
  537. package/report/x-adapter-platform.api.json +936 -81
  538. package/report/x-components.api.json +16366 -17517
  539. package/report/x-components.api.md +806 -213
  540. package/report/x-types.api.json +577 -0
  541. package/tagging/index.js +2 -2
  542. package/types/adapter/e2e-adapter.d.ts.map +1 -1
  543. package/types/adapter/mocked-responses.d.ts +3 -0
  544. package/types/adapter/mocked-responses.d.ts.map +1 -1
  545. package/types/components/base-dropdown.vue.d.ts +5 -5
  546. package/types/components/base-dropdown.vue.d.ts.map +1 -1
  547. package/types/components/base-grid.vue.d.ts +3 -3
  548. package/types/components/base-slider.vue.d.ts +74 -0
  549. package/types/components/base-slider.vue.d.ts.map +1 -0
  550. package/types/components/base-variable-column-grid.vue.d.ts +3 -3
  551. package/types/components/display-click-provider.vue.d.ts +61 -0
  552. package/types/components/display-click-provider.vue.d.ts.map +1 -0
  553. package/types/components/global-x-bus.vue.d.ts +12 -0
  554. package/types/components/global-x-bus.vue.d.ts.map +1 -1
  555. package/types/components/index.d.ts +3 -0
  556. package/types/components/index.d.ts.map +1 -1
  557. package/types/components/items-list.vue.d.ts +3 -3
  558. package/types/components/layouts/multi-column-max-width-layout.vue.d.ts +5 -5
  559. package/types/components/layouts/single-column-layout.vue.d.ts +3 -3
  560. package/types/components/modals/base-events-modal.vue.d.ts +2 -2
  561. package/types/components/modals/base-id-modal.vue.d.ts +2 -2
  562. package/types/components/modals/base-modal.vue.d.ts +10 -10
  563. package/types/components/modals/base-modal.vue.d.ts.map +1 -1
  564. package/types/components/modals/main-modal.vue.d.ts +2 -2
  565. package/types/components/page-selector.vue.d.ts +125 -0
  566. package/types/components/page-selector.vue.d.ts.map +1 -0
  567. package/types/components/panels/base-header-toggle-panel.vue.d.ts +5 -5
  568. package/types/components/panels/base-id-toggle-panel.vue.d.ts +5 -5
  569. package/types/components/panels/base-tabs-panel.vue.d.ts +8 -8
  570. package/types/components/panels/base-toggle-panel.vue.d.ts +3 -3
  571. package/types/components/result/base-result-add-to-cart.vue.d.ts +2 -0
  572. package/types/components/result/base-result-add-to-cart.vue.d.ts.map +1 -1
  573. package/types/components/result/base-result-image.vue.d.ts +10 -10
  574. package/types/components/result/base-result-image.vue.d.ts.map +1 -1
  575. package/types/components/sliding-panel.vue.d.ts +15 -5
  576. package/types/components/sliding-panel.vue.d.ts.map +1 -1
  577. package/types/components/snippet-callbacks.vue.d.ts +6 -0
  578. package/types/components/snippet-callbacks.vue.d.ts.map +1 -1
  579. package/types/components/suggestions/base-suggestions.vue.d.ts +3 -3
  580. package/types/composables/use-alias-api.d.ts +5 -0
  581. package/types/composables/use-alias-api.d.ts.map +1 -1
  582. package/types/composables/use-store.d.ts +2 -2
  583. package/types/composables/use-store.d.ts.map +1 -1
  584. package/types/directives/index.d.ts +1 -0
  585. package/types/directives/index.d.ts.map +1 -1
  586. package/types/directives/typing.d.ts +35 -0
  587. package/types/directives/typing.d.ts.map +1 -0
  588. package/types/index.d.ts +1 -0
  589. package/types/index.d.ts.map +1 -1
  590. package/types/store/index.d.ts +4 -1
  591. package/types/store/index.d.ts.map +1 -1
  592. package/types/tailwind/plugin-options.d.ts +1 -2
  593. package/types/tailwind/plugin-options.d.ts.map +1 -1
  594. package/types/types/animation-prop.d.ts +6 -2
  595. package/types/types/animation-prop.d.ts.map +1 -1
  596. package/types/types/origin.d.ts +2 -2
  597. package/types/types/origin.d.ts.map +1 -1
  598. package/types/types/page-mode.d.ts +2 -0
  599. package/types/types/page-mode.d.ts.map +1 -0
  600. package/types/views/home/types.d.ts +3 -0
  601. package/types/views/home/types.d.ts.map +1 -1
  602. package/types/wiring/events.types.d.ts +3 -1
  603. package/types/wiring/events.types.d.ts.map +1 -1
  604. package/types/x-installer/x-installer/types.d.ts +2 -2
  605. package/types/x-installer/x-installer/types.d.ts.map +1 -1
  606. package/types/x-installer/x-installer/x-installer.d.ts +4 -4
  607. package/types/x-installer/x-installer/x-installer.d.ts.map +1 -1
  608. package/types/x-modules/empathize/components/empathize.vue.d.ts +6 -6
  609. package/types/x-modules/empathize/components/empathize.vue.d.ts.map +1 -1
  610. package/types/x-modules/facets/components/facets/facets.vue.d.ts +3 -3
  611. package/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts +8 -2
  612. package/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts.map +1 -1
  613. package/types/x-modules/facets/components/filters/simple-filter.vue.d.ts +6 -0
  614. package/types/x-modules/facets/components/filters/simple-filter.vue.d.ts.map +1 -1
  615. package/types/x-modules/facets/components/lists/filters-list.vue.d.ts +3 -3
  616. package/types/x-modules/facets/components/lists/selected-filters-list.vue.d.ts +3 -3
  617. package/types/x-modules/history-queries/components/my-history.vue.d.ts +3 -3
  618. package/types/x-modules/identifier-results/components/identifier-results.vue.d.ts +3 -3
  619. package/types/x-modules/next-queries/components/next-queries-list.vue.d.ts +3 -3
  620. package/types/x-modules/next-queries/index.d.ts +1 -0
  621. package/types/x-modules/next-queries/index.d.ts.map +1 -1
  622. package/types/x-modules/queries-preview/components/query-preview-list.vue.d.ts +3 -3
  623. package/types/x-modules/queries-preview/components/query-preview-list.vue.d.ts.map +1 -1
  624. package/types/x-modules/queries-preview/components/query-preview.vue.d.ts.map +1 -1
  625. package/types/x-modules/queries-preview/store/actions/fetch-and-save-query-preview.action.d.ts.map +1 -1
  626. package/types/x-modules/queries-preview/store/module.d.ts.map +1 -1
  627. package/types/x-modules/queries-preview/utils/get-hash-from-query-preview.d.ts +4 -2
  628. package/types/x-modules/queries-preview/utils/get-hash-from-query-preview.d.ts.map +1 -1
  629. package/types/x-modules/recommendations/components/recommendations.vue.d.ts +3 -3
  630. package/types/x-modules/related-prompts/components/index.d.ts +4 -0
  631. package/types/x-modules/related-prompts/components/index.d.ts.map +1 -0
  632. package/types/x-modules/related-prompts/components/related-prompt.vue.d.ts +28 -0
  633. package/types/x-modules/related-prompts/components/related-prompt.vue.d.ts.map +1 -0
  634. package/types/x-modules/related-prompts/components/related-prompts-list.vue.d.ts +106 -0
  635. package/types/x-modules/related-prompts/components/related-prompts-list.vue.d.ts.map +1 -0
  636. package/types/x-modules/related-prompts/components/related-prompts-tag-list.vue.d.ts +132 -0
  637. package/types/x-modules/related-prompts/components/related-prompts-tag-list.vue.d.ts.map +1 -0
  638. package/types/x-modules/related-prompts/events.types.d.ts +36 -0
  639. package/types/x-modules/related-prompts/events.types.d.ts.map +1 -0
  640. package/types/x-modules/related-prompts/index.d.ts +6 -0
  641. package/types/x-modules/related-prompts/index.d.ts.map +1 -0
  642. package/types/x-modules/related-prompts/store/actions/fetch-and-save-related-prompts.action.d.ts +17 -0
  643. package/types/x-modules/related-prompts/store/actions/fetch-and-save-related-prompts.action.d.ts.map +1 -0
  644. package/types/x-modules/related-prompts/store/actions/fetch-related-prompts.action.d.ts +13 -0
  645. package/types/x-modules/related-prompts/store/actions/fetch-related-prompts.action.d.ts.map +1 -0
  646. package/types/x-modules/related-prompts/store/emitters.d.ts +9 -0
  647. package/types/x-modules/related-prompts/store/emitters.d.ts.map +1 -0
  648. package/types/x-modules/related-prompts/store/getters/request.getter.d.ts +13 -0
  649. package/types/x-modules/related-prompts/store/getters/request.getter.d.ts.map +1 -0
  650. package/types/x-modules/related-prompts/store/index.d.ts +7 -0
  651. package/types/x-modules/related-prompts/store/index.d.ts.map +1 -0
  652. package/types/x-modules/related-prompts/store/module.d.ts +8 -0
  653. package/types/x-modules/related-prompts/store/module.d.ts.map +1 -0
  654. package/types/x-modules/related-prompts/store/types.d.ts +108 -0
  655. package/types/x-modules/related-prompts/store/types.d.ts.map +1 -0
  656. package/types/x-modules/related-prompts/types.d.ts +10 -0
  657. package/types/x-modules/related-prompts/types.d.ts.map +1 -0
  658. package/types/x-modules/related-prompts/wiring.d.ts +38 -0
  659. package/types/x-modules/related-prompts/wiring.d.ts.map +1 -0
  660. package/types/x-modules/related-prompts/x-module.d.ts +16 -0
  661. package/types/x-modules/related-prompts/x-module.d.ts.map +1 -0
  662. package/types/x-modules/related-tags/components/related-tags.vue.d.ts +3 -3
  663. package/types/x-modules/scroll/components/scroll-to-top.vue.d.ts +5 -5
  664. package/types/x-modules/search/components/banners-list.vue.d.ts +3 -3
  665. package/types/x-modules/search/components/partial-results-list.vue.d.ts +3 -3
  666. package/types/x-modules/search/components/promoteds-list.vue.d.ts +3 -3
  667. package/types/x-modules/search/components/results-list.vue.d.ts +3 -3
  668. package/types/x-modules/search/components/sort-dropdown.vue.d.ts +1 -1
  669. package/types/x-modules/search/config.types.d.ts +2 -0
  670. package/types/x-modules/search/config.types.d.ts.map +1 -1
  671. package/types/x-modules/search/events.types.d.ts +4 -0
  672. package/types/x-modules/search/events.types.d.ts.map +1 -1
  673. package/types/x-modules/search/store/actions/fetch-and-save-search-response.action.d.ts.map +1 -1
  674. package/types/x-modules/search/store/actions/save-search-response.action.d.ts.map +1 -1
  675. package/types/x-modules/search/store/module.d.ts +2 -0
  676. package/types/x-modules/search/store/module.d.ts.map +1 -1
  677. package/types/x-modules/search/store/types.d.ts +9 -1
  678. package/types/x-modules/search/store/types.d.ts.map +1 -1
  679. package/types/x-modules/search/wiring.d.ts +4 -0
  680. package/types/x-modules/search/wiring.d.ts.map +1 -1
  681. package/types/x-modules/search-box/components/search-input-placeholder.vue.d.ts +3 -3
  682. package/types/x-modules/tagging/components/tagging.vue.d.ts +14 -12
  683. package/types/x-modules/tagging/components/tagging.vue.d.ts.map +1 -1
  684. package/types/x-modules/tagging/config.types.d.ts +3 -3
  685. package/types/x-modules/tagging/config.types.d.ts.map +1 -1
  686. package/types/x-modules/tagging/events.types.d.ts +2 -2
  687. package/types/x-modules/tagging/service/{pdp-add-to-cart.service.d.ts → external-tagging.service.d.ts} +31 -13
  688. package/types/x-modules/tagging/service/external-tagging.service.d.ts.map +1 -0
  689. package/types/x-modules/tagging/service/index.d.ts +1 -1
  690. package/types/x-modules/tagging/service/index.d.ts.map +1 -1
  691. package/types/x-modules/tagging/service/types.d.ts +13 -4
  692. package/types/x-modules/tagging/service/types.d.ts.map +1 -1
  693. package/types/x-modules/tagging/store/module.d.ts.map +1 -1
  694. package/types/x-modules/tagging/wiring.d.ts +54 -2
  695. package/types/x-modules/tagging/wiring.d.ts.map +1 -1
  696. package/types/x-modules/url/components/url-handler.vue.d.ts.map +1 -1
  697. package/types/x-modules/x-modules.types.d.ts +2 -0
  698. package/types/x-modules/x-modules.types.d.ts.map +1 -1
  699. package/docs/API-reference/api/x-components.defaultpdpaddtocartservice.clickedresultstoragekey.md +0 -11
  700. package/docs/API-reference/api/x-components.defaultpdpaddtocartservice.clickedresultstoragettlms.md +0 -11
  701. package/docs/API-reference/api/x-components.defaultpdpaddtocartservice.instance.md +0 -13
  702. package/docs/API-reference/api/x-components.defaultpdpaddtocartservice.localstorageservice.md +0 -11
  703. package/docs/API-reference/api/x-components.defaultpdpaddtocartservice.md +0 -41
  704. package/docs/API-reference/api/x-components.defaultpdpaddtocartservice.result_clicked_id_key.md +0 -13
  705. package/docs/API-reference/api/x-components.defaultpdpaddtocartservice.sessionstorageservice.md +0 -11
  706. package/docs/API-reference/api/x-components.pdpaddtocartservice.md +0 -22
  707. package/docs/API-reference/api/x-components.taggingconfig.clickedresultstoragettlms.md +0 -13
  708. package/docs/API-reference/api/x-components.usestore.md +0 -19
  709. package/docs/assets/features/overview-my-history.svg +0 -279
  710. package/docs/assets/features/overview-product-results-card.svg +0 -128
  711. package/docs/assets/interface/build-search-ui.svg +0 -167
  712. package/docs/assets/interface/experience-search-intro.svg +0 -1
  713. package/docs/assets/interface/integration-guide.svg +0 -1
  714. package/docs/assets/interface/integration-video.png +0 -0
  715. package/docs/assets/interface/x-architecture.svg +0 -1
  716. package/docs/assets/interface/x-empathize.gif +0 -0
  717. package/docs/assets/interface/x-facets.gif +0 -0
  718. package/docs/assets/interface/x-facets.svg +0 -189
  719. package/docs/assets/interface/x-history-queries.gif +0 -0
  720. package/docs/assets/interface/x-id-results.gif +0 -0
  721. package/docs/assets/interface/x-next-queries.gif +0 -0
  722. package/docs/assets/interface/x-popular-searches.gif +0 -0
  723. package/docs/assets/interface/x-query-suggestions.gif +0 -0
  724. package/docs/assets/interface/x-recommendations.gif +0 -0
  725. package/docs/assets/interface/x-recommendations.svg +0 -472
  726. package/docs/assets/interface/x-related-tags.gif +0 -0
  727. package/docs/assets/interface/x-results-layout.svg +0 -259
  728. package/docs/assets/interface/x-search-box-elements.svg +0 -1
  729. package/docs/assets/interface/x-search-box.svg +0 -60
  730. package/docs/build-search-ui/README.md +0 -127
  731. package/docs/build-search-ui/sidebar.js +0 -7
  732. package/docs/build-search-ui/web-archetype-development-guide.md +0 -186
  733. package/docs/build-search-ui/web-archetype-integration-guide.md +0 -458
  734. package/docs/build-search-ui/web-how-to-use-x-components-guide.md +0 -200
  735. package/docs/build-search-ui/web-x-architecture.md +0 -83
  736. package/docs/build-search-ui/web-x-components-development-guide.md +0 -157
  737. package/docs/experience-search-and-discovery/README.md +0 -132
  738. package/docs/experience-search-and-discovery/empathize.md +0 -119
  739. package/docs/experience-search-and-discovery/facets-and-filters.md +0 -154
  740. package/docs/experience-search-and-discovery/history-queries.md +0 -70
  741. package/docs/experience-search-and-discovery/id-results.md +0 -49
  742. package/docs/experience-search-and-discovery/my-history.md +0 -60
  743. package/docs/experience-search-and-discovery/next-queries.md +0 -72
  744. package/docs/experience-search-and-discovery/popular-searches.md +0 -50
  745. package/docs/experience-search-and-discovery/product-results-ui.md +0 -82
  746. package/docs/experience-search-and-discovery/query-suggestions.md +0 -48
  747. package/docs/experience-search-and-discovery/recommendations.md +0 -134
  748. package/docs/experience-search-and-discovery/related-tags.md +0 -66
  749. package/docs/experience-search-and-discovery/search-box.md +0 -99
  750. package/docs/experience-search-and-discovery/serp-ui.md +0 -125
  751. package/docs/experience-search-and-discovery/sidebar.js +0 -17
  752. package/docs/experience-search-and-discovery/web-local-storage.md +0 -30
  753. package/docs/input-status-machine-state.png +0 -0
  754. package/js/composables/use-store.js +0 -15
  755. package/js/composables/use-store.js.map +0 -1
  756. package/js/utils/options-api.js +0 -4
  757. package/js/utils/options-api.js.map +0 -1
  758. package/js/x-modules/tagging/service/pdp-add-to-cart.service.js.map +0 -1
  759. package/types/utils/options-api.d.ts +0 -3
  760. package/types/utils/options-api.d.ts.map +0 -1
  761. package/types/x-modules/tagging/service/pdp-add-to-cart.service.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"sort-dropdown.vue.js","sources":["../../../../../src/x-modules/search/components/sort-dropdown.vue"],"sourcesContent":["<template>\n <BaseDropdown\n ref=\"rootRef\"\n @update:modelValue=\"emitUserClickedASort\"\n :items=\"items\"\n :modelValue=\"selectedSort\"\n :animation=\"animation\"\n class=\"x-sort-dropdown\"\n data-test=\"sort-dropdown\"\n aria-label=\"Select sorting\"\n >\n <template #toggle=\"{ isOpen, item }\">\n <!--\n @slot Used to render the contents of the dropdown toggle button. If not provided, it uses\n the item slot as fallback.\n @binding {Sort} item - The sort data to render.\n @binding {boolean} isOpen - True if the dropdown is opened, and false if it is closed.\n -->\n <slot v-bind=\"{ isOpen, item }\" name=\"toggle\">{{ item }}</slot>\n </template>\n <template #item=\"{ item, isHighlighted, isSelected }\">\n <!--\n @slot (required) Used to render each one of the items content, and as fallback\n for the toggle button content slot if it is not provided.\n @binding {Sort} item - Sort to render\n @binding {boolean} isHighlighted - True when the item has the focus.\n @binding {boolean} isSelected - True when the item is selected.\n -->\n <slot v-bind=\"{ item, isHighlighted, isSelected }\" name=\"item\">{{ item }}</slot>\n </template>\n </BaseDropdown>\n</template>\n\n<script lang=\"ts\">\n import { Sort } from '@empathyco/x-types';\n import Vue, { defineComponent, PropType, ref, watch } from 'vue';\n\n import BaseDropdown from '../../../components/base-dropdown.vue';\n import { use$x } from '../../../composables/use-$x';\n import { useState } from '../../../composables/use-state';\n import { searchXModule } from '../x-module';\n\n /**\n * The `SortDropdown` component allows user to select the search results order. This component\n * also allows to change the selected sort programmatically.\n */\n export default defineComponent({\n name: 'SortDropdown',\n xModule: searchXModule.name,\n components: { BaseDropdown },\n props: {\n /** The list of possible sort values. */\n items: {\n type: Array as PropType<Sort[]>,\n required: true\n },\n /** The transition to use for opening and closing the dropdown. */\n animation: [String, Object] as PropType<string | typeof Vue>\n },\n emits: ['change'],\n setup(_, { emit }) {\n const $x = use$x();\n\n const { sort: selectedSort } = useState('search', ['sort']);\n const rootRef = ref<typeof BaseDropdown>();\n\n watch(selectedSort, (value: Sort) => $x.emit('SelectedSortProvided', value), {\n immediate: true\n });\n\n /**\n * Emits the events related to the selection of a sort value.\n *\n * @remarks `(rootRef.value as any)?.$el` because rollup-plugin-vue understands\n * `ref<typeof BaseDropdown>` as VueConstructor which doesn't contain $el.\n *\n * @param sort - The selected sort.\n */\n function emitUserClickedASort(sort: Sort) {\n $x.emit('UserClickedASort', sort, { target: (rootRef.value as any)?.$el });\n emit('change', sort);\n }\n\n return {\n emitUserClickedASort,\n rootRef,\n selectedSort\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Sort Dropdown\n\nThe `SortDropdown` component can be used to change the way the search results are ordered.\n\nTo do so, the list of valid sort values has to be provided using the `items` prop. These are the\nvalues that can be received then in the `SearchAdapter`.\n\nThe component also optionally accepts the selected sort, which can be set using the `value` prop.\nThis prop allows changing programmatically the selected sort, as it will be synced with the store\nimmediately. If this prop is not provided, the first item from the `items` prop will be the one\nselected by default.\n\nThis component also allows customizing both the toggle button and each one of the possible sort\nvalues. This can be done with the`toggle` and `item` slots.\n\n## Events\n\nThis component emits 2 different events:\n\n- [`SelectedSortProvided`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n To sync the selected sort with the store state value. This event is emitted as soon as the list of\n items is received, whenever this list changes if there is no provided value, and when the provided\n value changes.\n- [`UserClickedASort`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n As its name suggest, the event is emitted after the user clicks one of the sort options. This does\n not mean that the sort has changed, only that the user has clicked it.\n\n## Examples\n\n### Only providing the list of items\n\n```vue\n<template>\n <SortDropdown :items=\"sortValues\">\n <template #toggle=\"{ item, isOpen }\">{{ item }} {{ isOpen ? '🔼' : '🔽' }}</template>\n <template #item=\"{ item, isHighlighted, isSelected }\">\n <span v-if=\"isSelected\">✅</span>\n <span v-if=\"isHighlighted\">🟢</span>\n {{ item }}\n </template>\n </SortDropdown>\n</template>\n\n<script>\n import { SortDropdown } from '@empathyco/x-components/search';\n\n export default {\n components: {\n SortDropdown\n },\n data() {\n return { sortValues: ['Relevance', 'Price asc', 'Price desc'] };\n }\n };\n</script>\n```\n\n### Providing also the selected value\n\n```vue\n<template>\n <SortDropdown v-model=\"selectedSort\" :items=\"sortValues\">\n <template #toggle=\"{ item, isOpen }\">{{ item }} {{ isOpen ? '🔼' : '🔽' }}</template>\n <template #item=\"{ item, isHighlighted, isSelected }\">\n <span v-if=\"isSelected\">✅</span>\n <span v-if=\"isHighlighted\">🟢</span>\n {{ item }}\n </template>\n </SortDropdown>\n</template>\n\n<script>\n import { SortDropdown } from '@empathyco/x-components/search';\n\n export default {\n components: {\n SortDropdown\n },\n data() {\n return {\n selectedSort: 'Price asc',\n sortValues: ['Relevance', 'Price asc', 'Price desc']\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":["_resolveComponent","_openBlock","_createBlock","emitUserClickedASort","selectedSort","animation","_withCtx","_createCommentVNode","_renderSlot","_normalizeProps","_guardReactiveProps"],"mappings":";;;;;kCACEA,gBA6Be,CAAA,cAAA,CAAA,CAAA;AA3BZ,EAAA,OAAAC,SAAA,EAAA,EAAAC,WAAA,CAAmBC,uBAAoB,EAAA;AAAA,IACvC,GAAK,EAAA,SAAA;AAAA,IACL,qBAAYC,EAAAA,IAAAA,CAAAA,oBAAAA;AAAAA,IACZ,KAAWC,EAAAA,IAAAA,CAAAA,KAAAA;AAAAA,IACZ,UAAM,EAAA,IAAA,CAAA,YAAA;AAAA,IACN,WAAS,IAAC,CAAA,SAAA;AAAA,IACV,KAAA,EAAA,iBAAA;AAAA,IAAA,WAAA,EAAA,eAAA;IAEW,YAAM,EAAA,gBAAA;AAAA,GAAA,EAAA;AAOf,IAAA,MAAA,EAAAC,OAAA,CAA+D,CAlBrE,EAAA,MAAA,EAAA,IAAA,EAAA,KAAA;AAAA,MAkB2DC,kBAAA,CAAA,sSAAA,CAAA;AAAA,MAAAC,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,QAAA,EAAAC,cAAA,CAAAC,kBAAA,CAAA,EAAA,MAAA,EAAA,IAAA,EAAA,CAAA,CAAA,EAAA,MAAA;;;;;;AAE5C,OAAA,CAAA;AAAA,KAAA,CAAA;AAQT,IAAA,IAAA,EAAAJ,OAAA,CAAgF,CA5BtF,EAAA,IAAA,EAAA,aAAA,EAAA,UAAA,EAAA,KAAA;AAAA,MA4B4EC,kBAAA,CAAA,2WAAA,CAAA;AAAA,MAAAC,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,MAAA,EAAAC,cAAA,CAAAC,kBAAA,CAAA,EAAA,IAAA,EAAA,aAAA,EAAA,UAAA,EAAA,CAAA,CAAA,EAAA,MAAA;;;;;;AA5B5E,OAAA,CAAA;AAAA,KAAA,CAAA;;;;;;;;;"}
1
+ {"version":3,"file":"sort-dropdown.vue.js","sources":["../../../../../src/x-modules/search/components/sort-dropdown.vue"],"sourcesContent":["<template>\n <BaseDropdown\n ref=\"rootRef\"\n @update:modelValue=\"emitUserClickedASort\"\n :items=\"items\"\n :modelValue=\"selectedSort\"\n :animation=\"animation\"\n class=\"x-sort-dropdown\"\n data-test=\"sort-dropdown\"\n aria-label=\"Select sorting\"\n >\n <template #toggle=\"{ isOpen, item }\">\n <!--\n @slot Used to render the contents of the dropdown toggle button. If not provided, it uses\n the item slot as fallback.\n @binding {Sort} item - The sort data to render.\n @binding {boolean} isOpen - True if the dropdown is opened, and false if it is closed.\n -->\n <slot v-bind=\"{ isOpen, item }\" name=\"toggle\">{{ item }}</slot>\n </template>\n <template #item=\"{ item, isHighlighted, isSelected }\">\n <!--\n @slot (required) Used to render each one of the items content, and as fallback\n for the toggle button content slot if it is not provided.\n @binding {Sort} item - Sort to render\n @binding {boolean} isHighlighted - True when the item has the focus.\n @binding {boolean} isSelected - True when the item is selected.\n -->\n <slot v-bind=\"{ item, isHighlighted, isSelected }\" name=\"item\">{{ item }}</slot>\n </template>\n </BaseDropdown>\n</template>\n\n<script lang=\"ts\">\n import { Sort } from '@empathyco/x-types';\n import Vue, { defineComponent, PropType, ref, watch } from 'vue';\n\n import BaseDropdown from '../../../components/base-dropdown.vue';\n import { use$x } from '../../../composables/use-$x';\n import { useState } from '../../../composables/use-state';\n import { searchXModule } from '../x-module';\n\n /**\n * The `SortDropdown` component allows user to select the search results order. This component\n * also allows to change the selected sort programmatically.\n */\n export default defineComponent({\n name: 'SortDropdown',\n xModule: searchXModule.name,\n components: { BaseDropdown },\n props: {\n /** The list of possible sort values. */\n items: {\n type: Array as PropType<Sort[]>,\n required: true\n },\n /** The transition to use for opening and closing the dropdown. */\n animation: [String, Object] as PropType<string | typeof Vue>\n },\n emits: ['change'],\n setup(_, { emit }) {\n const $x = use$x();\n\n const { sort: selectedSort } = useState('search', ['sort']);\n const rootRef = ref<typeof BaseDropdown>();\n\n watch(selectedSort, (value: Sort) => $x.emit('SelectedSortProvided', value), {\n immediate: true\n });\n\n /**\n * Emits the events related to the selection of a sort value.\n *\n * @remarks `(rootRef.value as any)?.$el` because rollup-plugin-vue understands\n * `ref<typeof BaseDropdown>` as VueConstructor which doesn't contain $el.\n *\n * @param sort - The selected sort.\n */\n function emitUserClickedASort(sort: Sort) {\n $x.emit('UserClickedASort', sort, { target: (rootRef.value as any)?.$el });\n emit('change', sort);\n }\n\n return {\n emitUserClickedASort,\n rootRef,\n selectedSort\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Sort Dropdown\n\nThe `SortDropdown` component can be used to change the way the search results are ordered.\n\nTo do so, the list of valid sort values has to be provided using the `items` prop. These are the\nvalues that can be received then in the `SearchAdapter`.\n\nThe component also optionally accepts the selected sort, which can be set using the `value` prop.\nThis prop allows changing programmatically the selected sort, as it will be synced with the store\nimmediately. If this prop is not provided, the first item from the `items` prop will be the one\nselected by default.\n\nThis component also allows customizing both the toggle button and each one of the possible sort\nvalues. This can be done with the`toggle` and `item` slots.\n\n## Events\n\nThis component emits 2 different events:\n\n- [`SelectedSortProvided`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n To sync the selected sort with the store state value. This event is emitted as soon as the list of\n items is received, whenever this list changes if there is no provided value, and when the provided\n value changes.\n- [`UserClickedASort`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n As its name suggest, the event is emitted after the user clicks one of the sort options. This does\n not mean that the sort has changed, only that the user has clicked it.\n\n## Examples\n\n### Only providing the list of items\n\n```vue\n<template>\n <SortDropdown :items=\"sortValues\">\n <template #toggle=\"{ item, isOpen }\">{{ item }} {{ isOpen ? '🔼' : '🔽' }}</template>\n <template #item=\"{ item, isHighlighted, isSelected }\">\n <span v-if=\"isSelected\">✅</span>\n <span v-if=\"isHighlighted\">🟢</span>\n {{ item }}\n </template>\n </SortDropdown>\n</template>\n\n<script>\n import { SortDropdown } from '@empathyco/x-components/search';\n\n export default {\n components: {\n SortDropdown\n },\n data() {\n return { sortValues: ['Relevance', 'Price asc', 'Price desc'] };\n }\n };\n</script>\n```\n\n### Providing also the selected value\n\n```vue\n<template>\n <SortDropdown v-model=\"selectedSort\" :items=\"sortValues\">\n <template #toggle=\"{ item, isOpen }\">{{ item }} {{ isOpen ? '🔼' : '🔽' }}</template>\n <template #item=\"{ item, isHighlighted, isSelected }\">\n <span v-if=\"isSelected\">✅</span>\n <span v-if=\"isHighlighted\">🟢</span>\n {{ item }}\n </template>\n </SortDropdown>\n</template>\n\n<script>\n import { SortDropdown } from '@empathyco/x-components/search';\n\n export default {\n components: {\n SortDropdown\n },\n data() {\n return {\n selectedSort: 'Price asc',\n sortValues: ['Relevance', 'Price asc', 'Price desc']\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":["_resolveComponent","_openBlock","_createBlock","emitUserClickedASort","selectedSort","animation","_withCtx","_renderSlot","_normalizeProps","_guardReactiveProps"],"mappings":";;;;;kCACEA,gBA6Be,CAAA,cAAA,CAAA,CAAA;AA3BZ,EAAA,OAAAC,SAAA,EAAA,EAAAC,WAAA,CAAmBC,uBAAoB,EAAA;AAAA,IACvC,GAAK,EAAA,SAAA;AAAA,IACL,qBAAYC,EAAAA,IAAAA,CAAAA,oBAAAA;AAAAA,IACZ,KAAWC,EAAAA,IAAAA,CAAAA,KAAAA;AAAAA,IACZ,UAAM,EAAA,IAAA,CAAA,YAAA;AAAA,IACN,WAAS,IAAC,CAAA,SAAA;AAAA,IACV,KAAA,EAAA,iBAAA;AAAA,IAAA,WAAA,EAAA,eAAA;IAEW,YAAM,EAAA,gBAAA;AAAA,GAAA,EAAA;YAXrBC,OAkBuD,CAAA,CAAA,EAAA,MAAA,EAAA,IAAA,EAAA,KAAA;AAAA,MAAAC,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,QAAA,EAAAC,cAAA,CAAAC,kBAAA,CAAA,EAAA,MAAA,EAAA,IAAA,EAAA,CAAA,CAAA,EAAA,MAAA;;;;;;AAExC,OAAA,CAAA;AAAA,KAAA,CAAA;AApBf,IAAA,IAAA,EAAAH,OAAA,CAAA,CAAA,EAAA,IAAA,EAAA,aAAA,EA4BwE,UAAI,EAAA,KAAA;AAAA,MAAAC,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,MAAA,EAAAC,cAAA,CAAAC,kBAAA,CAAA,EAAA,IAAA,EAAA,aAAA,EAAA,UAAA,EAAA,CAAA,CAAA,EAAA,MAAA;;;;;;AA5B5E,OAAA,CAAA;AAAA,KAAA,CAAA;;;;;;;;;"}
@@ -24,13 +24,20 @@ const { fetchAndSave, cancelPrevious } = createFetchAndSaveActions({
24
24
  */
25
25
  function enrichRequest(request, state) {
26
26
  const { page, ...restRequest } = request;
27
- const { config: { pageSize }, origin, results } = state;
28
- const start = page === 1 ? 0 : results.length;
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;
29
36
  return {
30
37
  ...restRequest,
31
38
  ...(origin && { origin }),
32
39
  start,
33
- rows: pageSize * page - start
40
+ rows
34
41
  };
35
42
  }
36
43
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"fetch-and-save-search-response.action.js","sources":["../../../../../../src/x-modules/search/store/actions/fetch-and-save-search-response.action.ts"],"sourcesContent":["import { SearchRequest, SearchResponse } from '@empathyco/x-types';\nimport { createFetchAndSaveActions } from '../../../../store/utils/fetch-and-save-action.utils';\nimport { InternalSearchRequest } from '../../types';\nimport { SearchActionContext, SearchState } from '../types';\n\nconst { fetchAndSave, cancelPrevious } = createFetchAndSaveActions<\n SearchActionContext,\n InternalSearchRequest | null,\n SearchResponse | null\n>({\n fetch({ dispatch, state }, request) {\n return request\n ? dispatch('fetchSearchResponse', enrichRequest(request, state))\n : Promise.resolve(null);\n },\n onSuccess({ dispatch }, response) {\n if (response !== null) {\n dispatch('saveSearchResponse', response);\n }\n }\n});\n\n/**\n * Enriches the {@link SearchRequest} object with the origin and page properties taken from the\n * {@link SearchState | search state}.\n *\n * @param request - The {@link InternalSearchRequest}.\n * @param state - {@link SearchState}.\n *\n * @returns The search request.\n * @internal\n */\nfunction enrichRequest(request: InternalSearchRequest, state: SearchState): SearchRequest {\n const { page, ...restRequest } = request;\n const {\n config: { pageSize },\n origin,\n results\n } = state;\n const start = page === 1 ? 0 : results.length;\n\n return {\n ...restRequest,\n ...(origin && { origin }),\n start,\n rows: pageSize * page - start\n };\n}\n\n/**\n * Default implementation for {@link SearchActions.fetchAndSaveSearchResponse} action.\n *\n * @public\n */\nexport const fetchAndSaveSearchResponse = fetchAndSave;\n\n/**\n * Default implementation for {@link SearchActions.cancelFetchAndSaveSearchResponse} action.\n *\n * @public\n */\nexport const cancelFetchAndSaveSearchResponse = cancelPrevious;\n"],"names":[],"mappings":";;AAKA,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,yBAAyB,CAIhE;AACA,IAAA,KAAK,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,OAAO,EAAA;AAChC,QAAA,OAAO,OAAO;cACV,QAAQ,CAAC,qBAAqB,EAAE,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAChE,cAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KAC3B;AACD,IAAA,SAAS,CAAC,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAA;QAC9B,IAAI,QAAQ,KAAK,IAAI,EAAE;AACrB,YAAA,QAAQ,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAC;AAC1C,SAAA;KACF;AACF,CAAA,CAAC,CAAC;AAEH;;;;;;;;;AASG;AACH,SAAS,aAAa,CAAC,OAA8B,EAAE,KAAkB,EAAA;IACvE,MAAM,EAAE,IAAI,EAAE,GAAG,WAAW,EAAE,GAAG,OAAO,CAAC;AACzC,IAAA,MAAM,EACJ,MAAM,EAAE,EAAE,QAAQ,EAAE,EACpB,MAAM,EACN,OAAO,EACR,GAAG,KAAK,CAAC;AACV,IAAA,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IAE9C,OAAO;AACL,QAAA,GAAG,WAAW;AACd,QAAA,IAAI,MAAM,IAAI,EAAE,MAAM,EAAE;QACxB,KAAK;AACL,QAAA,IAAI,EAAE,QAAQ,GAAG,IAAI,GAAG,KAAK;KAC9B,CAAC;AACJ,CAAC;AAED;;;;AAIG;AACI,MAAM,0BAA0B,GAAG,aAAa;AAEvD;;;;AAIG;AACI,MAAM,gCAAgC,GAAG;;;;"}
1
+ {"version":3,"file":"fetch-and-save-search-response.action.js","sources":["../../../../../../src/x-modules/search/store/actions/fetch-and-save-search-response.action.ts"],"sourcesContent":["import { SearchRequest, SearchResponse } from '@empathyco/x-types';\nimport { createFetchAndSaveActions } from '../../../../store/utils/fetch-and-save-action.utils';\nimport { InternalSearchRequest } from '../../types';\nimport { SearchActionContext, SearchState } from '../types';\n\nconst { fetchAndSave, cancelPrevious } = createFetchAndSaveActions<\n SearchActionContext,\n InternalSearchRequest | null,\n SearchResponse | null\n>({\n fetch({ dispatch, state }, request) {\n return request\n ? dispatch('fetchSearchResponse', enrichRequest(request, state))\n : Promise.resolve(null);\n },\n onSuccess({ dispatch }, response) {\n if (response !== null) {\n dispatch('saveSearchResponse', response);\n }\n }\n});\n\n/**\n * Enriches the {@link SearchRequest} object with the origin and page properties taken from the\n * {@link SearchState | search state}.\n *\n * @param request - The {@link InternalSearchRequest}.\n * @param state - {@link SearchState}.\n *\n * @returns The search request.\n * @internal\n */\nfunction enrichRequest(request: InternalSearchRequest, state: SearchState): SearchRequest {\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 SearchActions.fetchAndSaveSearchResponse} action.\n *\n * @public\n */\nexport const fetchAndSaveSearchResponse = fetchAndSave;\n\n/**\n * Default implementation for {@link SearchActions.cancelFetchAndSaveSearchResponse} action.\n *\n * @public\n */\nexport const cancelFetchAndSaveSearchResponse = cancelPrevious;\n"],"names":[],"mappings":";;AAKA,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,yBAAyB,CAIhE;AACA,IAAA,KAAK,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,OAAO,EAAA;AAChC,QAAA,OAAO,OAAO;cACV,QAAQ,CAAC,qBAAqB,EAAE,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAChE,cAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KAC3B;AACD,IAAA,SAAS,CAAC,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAA;QAC9B,IAAI,QAAQ,KAAK,IAAI,EAAE;AACrB,YAAA,QAAQ,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAC;AAC1C,SAAA;KACF;AACF,CAAA,CAAC,CAAC;AAEH;;;;;;;;;AASG;AACH,SAAS,aAAa,CAAC,OAA8B,EAAE,KAAkB,EAAA;IACvE,MAAM,EAAE,IAAI,EAAE,GAAG,WAAW,EAAE,GAAG,OAAO,CAAC;AACzC,IAAA,MAAM,EACJ,MAAM,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAC9B,MAAM,EACN,OAAO,EACR,GAAG,KAAK,CAAC;AAEV,IAAA,IAAI,KAAK,CAAC;IACV,IAAI,QAAQ,KAAK,iBAAiB,EAAE;AAClC,QAAA,KAAK,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;AACzC,KAAA;AAAM,SAAA;AACL,QAAA,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC;AAC5C,KAAA;AAED,IAAA,MAAM,IAAI,GAAG,QAAQ,KAAK,iBAAiB,GAAG,QAAQ,GAAG,IAAI,GAAG,KAAK,GAAG,QAAQ,CAAC;IAEjF,OAAO;AACL,QAAA,GAAG,WAAW;AACd,QAAA,IAAI,MAAM,IAAI,EAAE,MAAM,EAAE;QACxB,KAAK;QACL,IAAI;KACL,CAAC;AACJ,CAAC;AAED;;;;AAIG;AACI,MAAM,0BAA0B,GAAG,aAAa;AAEvD;;;;AAIG;AACI,MAAM,gCAAgC,GAAG;;;;"}
@@ -7,10 +7,11 @@
7
7
  *
8
8
  * @public
9
9
  */
10
- const saveSearchResponse = ({ commit, state, getters }, { results, partialResults, facets, banners, promoteds, totalResults, spellcheck, redirections, queryTagging, displayTagging }) => {
10
+ const saveSearchResponse = ({ commit, state, getters }, { results, partialResults, facets, banners, promoteds, totalResults, spellcheck, redirections, queryTagging, displayTagging, stats }) => {
11
11
  if (totalResults === 0) {
12
12
  commit('setIsNoResults', true);
13
13
  if (getters.request && Object.keys(getters.request.filters).length > 0) {
14
+ commit('setSelectedFilters', []);
14
15
  commit('setFromNoResultsWithFilters', true);
15
16
  }
16
17
  }
@@ -38,6 +39,7 @@ const saveSearchResponse = ({ commit, state, getters }, { results, partialResult
38
39
  }
39
40
  commit('setTotalResults', totalResults);
40
41
  commit('setSpellcheck', spellcheck ?? '');
42
+ commit('setStats', stats);
41
43
  };
42
44
 
43
45
  export { saveSearchResponse };
@@ -1 +1 @@
1
- {"version":3,"file":"save-search-response.action.js","sources":["../../../../../../src/x-modules/search/store/actions/save-search-response.action.ts"],"sourcesContent":["import { SearchXStoreModule } from '../types';\n\n/**\n * Default implementation for the {@link SearchActions.saveSearchResponse}.\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#SearchResponse} to save.\n *\n * @public\n */\nexport const saveSearchResponse: SearchXStoreModule['actions']['saveSearchResponse'] = (\n { commit, state, getters },\n {\n results,\n partialResults,\n facets,\n banners,\n promoteds,\n totalResults,\n spellcheck,\n redirections,\n queryTagging,\n displayTagging\n }\n) => {\n if (totalResults === 0) {\n commit('setIsNoResults', true);\n if (getters.request && Object.keys(getters.request.filters!).length > 0) {\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 commit('setRedirections', redirections ?? []);\n }\n\n commit('setPartialResults', partialResults ?? []);\n\n if (facets) {\n commit('setFacets', facets);\n }\n\n if (queryTagging) {\n commit('setQueryTagging', queryTagging);\n }\n\n if (displayTagging) {\n commit('setDisplayTagging', displayTagging);\n }\n\n commit('setTotalResults', totalResults);\n commit('setSpellcheck', spellcheck ?? '');\n};\n"],"names":[],"mappings":"AAEA;;;;;;;;AAQG;AACI,MAAM,kBAAkB,GAAwD,CACrF,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAC1B,EACE,OAAO,EACP,cAAc,EACd,MAAM,EACN,OAAO,EACP,SAAS,EACT,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,cAAc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AU,IAAI,EAAE,CAAC,CAAC;AAC5C;;;;"}
1
+ {"version":3,"file":"save-search-response.action.js","sources":["../../../../../../src/x-modules/search/store/actions/save-search-response.action.ts"],"sourcesContent":["import { Stats } from '@empathyco/x-types';\nimport { SearchXStoreModule } from '../types';\n\n/**\n * Default implementation for the {@link SearchActions.saveSearchResponse}.\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#SearchResponse} to save.\n *\n * @public\n */\nexport const saveSearchResponse: SearchXStoreModule['actions']['saveSearchResponse'] = (\n { commit, state, getters },\n {\n results,\n partialResults,\n facets,\n banners,\n promoteds,\n totalResults,\n spellcheck,\n redirections,\n queryTagging,\n displayTagging,\n stats\n }\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 commit('setRedirections', redirections ?? []);\n }\n\n commit('setPartialResults', partialResults ?? []);\n\n if (facets) {\n commit('setFacets', facets);\n }\n\n if (queryTagging) {\n commit('setQueryTagging', queryTagging);\n }\n\n if (displayTagging) {\n commit('setDisplayTagging', displayTagging);\n }\n\n commit('setTotalResults', totalResults);\n commit('setSpellcheck', spellcheck ?? '');\n commit('setStats', stats as Stats);\n};\n"],"names":[],"mappings":"AAGA;;;;;;;;AAQG;AACU,MAAA,kBAAkB,GAAwD,CACrF,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAC1B,EACE,OAAO,EACP,cAAc,EACd,MAAM,EACN,OAAO,EACP,SAAS,EACT,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,KAAK,EACN,KACC;IACF,I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;AACxC,IAAA,MAAM,CAAC,eAAe,EAAE,UAAU,IAAI,EAAE,CAAC,CAAC;AAC1C,IAAA,MAAM,CAAC,UAAU,EAAE,KAAc,CAAC,CAAC;AACrC;;;;"}
@@ -1,3 +1,4 @@
1
+ import '@empathyco/x-utils';
1
2
  import { createStoreEmitters } from '../../../store/utils/store-emitters.utils.js';
2
3
  import { isStringEmpty } from '../../../utils/string.js';
3
4
  import { searchXStoreModule } from './module.js';
@@ -1 +1 @@
1
- {"version":3,"file":"emitters.js","sources":["../../../../../src/x-modules/search/store/emitters.ts"],"sourcesContent":["import { createStoreEmitters } from '../../../store';\nimport { isStringEmpty } from '../../../utils/string';\nimport { searchXStoreModule } from './module';\n\n/**\n * {@link StoreEmitters} For the search module.\n *\n * @internal\n */\nexport const searchEmitters = createStoreEmitters(searchXStoreModule, {\n FacetsChanged: {\n selector: state => state.facets,\n filter(newValue, oldValue): boolean {\n return newValue.length !== 0 || oldValue.length !== 0;\n }\n },\n PageChanged: state => state.page,\n ResultsChanged: state => state.results,\n SearchRequestChanged: (_, getters) => getters.request,\n SearchRequestUpdated: (_, getters) => getters.request,\n SearchResponseChanged: {\n selector: (state, getters) => {\n return {\n request: getters.request!,\n status: state.status,\n banners: state.banners,\n facets: state.facets,\n partialResults: state.partialResults,\n promoteds: state.promoteds,\n queryTagging: state.queryTagging,\n displayTagging: state.displayTagging,\n redirections: state.redirections,\n results: state.results,\n spellcheck: state.spellcheckedQuery,\n totalResults: state.totalResults\n };\n },\n filter: (newValue, oldValue) => {\n return (\n newValue.status !== oldValue.status && oldValue.status === 'loading' && !!newValue.request\n );\n }\n },\n SearchTaggingChanged: {\n selector: state => state.queryTagging,\n filter: ({ url }) => !isStringEmpty(url)\n },\n SpellcheckChanged: state => state.spellcheckedQuery,\n SortChanged: state => state.sort\n});\n"],"names":[],"mappings":";;;;AAIA;;;;AAIG;AACU,MAAA,cAAc,GAAG,mBAAmB,CAAC,kBAAkB,EAAE;AACpE,IAAA,aAAa,EA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A,oBAAoB,EAAE;AACpB,QAAA,QAAQ,EAAE,KAAK,IAAI,KAAK,CAAC,YAAY;AACrC,QAAA,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC;AACzC,KAAA;AACD,IAAA,iBAAiB,EAAE,KAAK,IAAI,KAAK,CAAC,iBAAiB;AACnD,IAAA,WAAW,EAAE,KAAK,IAAI,KAAK,CAAC,IAAI;AACjC,CAAA;;;;"}
1
+ {"version":3,"file":"emitters.js","sources":["../../../../../src/x-modules/search/store/emitters.ts"],"sourcesContent":["import { createStoreEmitters } from '../../../store';\nimport { isStringEmpty } from '../../../utils/string';\nimport { searchXStoreModule } from './module';\n\n/**\n * {@link StoreEmitters} For the search module.\n *\n * @internal\n */\nexport const searchEmitters = createStoreEmitters(searchXStoreModule, {\n FacetsChanged: {\n selector: state => state.facets,\n filter(newValue, oldValue): boolean {\n return newValue.length !== 0 || oldValue.length !== 0;\n }\n },\n PageChanged: state => state.page,\n ResultsChanged: state => state.results,\n SearchRequestChanged: (_, getters) => getters.request,\n SearchRequestUpdated: (_, getters) => getters.request,\n SearchResponseChanged: {\n selector: (state, getters) => {\n return {\n request: getters.request!,\n status: state.status,\n banners: state.banners,\n facets: state.facets,\n partialResults: state.partialResults,\n promoteds: state.promoteds,\n queryTagging: state.queryTagging,\n displayTagging: state.displayTagging,\n redirections: state.redirections,\n results: state.results,\n spellcheck: state.spellcheckedQuery,\n totalResults: state.totalResults\n };\n },\n filter: (newValue, oldValue) => {\n return (\n newValue.status !== oldValue.status && oldValue.status === 'loading' && !!newValue.request\n );\n }\n },\n SearchTaggingChanged: {\n selector: state => state.queryTagging,\n filter: ({ url }) => !isStringEmpty(url)\n },\n SpellcheckChanged: state => state.spellcheckedQuery,\n SortChanged: state => state.sort\n});\n"],"names":[],"mappings":";;;;;AAIA;;;;AAIG;AACU,MAAA,cAAc,GAAG,mBAAmB,CAAC,kBAAkB,EAAE;AACpE,IAAA,aAAa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IAAA,oBAAoB,EAAE;AACpB,QAAA,QAAQ,EAAE,KAAK,IAAI,KAAK,CAAC,YAAY;AACrC,QAAA,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC;AACzC,KAAA;AACD,IAAA,iBAAiB,EAAE,KAAK,IAAI,KAAK,CAAC,iBAAiB;AACnD,IAAA,WAAW,EAAE,KAAK,IAAI,KAAK,CAAC,IAAI;AACjC,CAAA;;;;"}
@@ -1,8 +1,9 @@
1
1
  import { isFacetFilter } from '@empathyco/x-types';
2
2
  import { setQuery } from '../../../store/utils/query.utils.js';
3
+ import { setConfig, mergeConfig } from '../../../store/utils/config-store.utils.js';
4
+ import '@empathyco/x-utils';
3
5
  import { setStatus } from '../../../store/utils/status-store.utils.js';
4
6
  import { groupItemsBy } from '../../../utils/array.js';
5
- import { setConfig, mergeConfig } from '../../../store/utils/config-store.utils.js';
6
7
  import { UNKNOWN_FACET_KEY } from '../../facets/store/constants.js';
7
8
  import { cancelFetchAndSaveSearchResponse, fetchAndSaveSearchResponse } from './actions/fetch-and-save-search-response.action.js';
8
9
  import { fetchSearchResponse } from './actions/fetch-search-response.action.js';
@@ -25,7 +26,8 @@ const searchXStoreModule = {
25
26
  selectedFilters: {},
26
27
  params: {},
27
28
  config: {
28
- pageSize: 24
29
+ pageSize: 24,
30
+ pageMode: 'infinite_scroll'
29
31
  },
30
32
  status: 'initial',
31
33
  isNoResults: false,
@@ -112,6 +114,9 @@ const searchXStoreModule = {
112
114
  if (stateResult) {
113
115
  Object.assign(stateResult, result);
114
116
  }
117
+ },
118
+ setStats(state, stats) {
119
+ state.stats = stats;
115
120
  }
116
121
  },
117
122
  actions: {
@@ -156,7 +161,8 @@ function resettableState() {
156
161
  displayTagging: {
157
162
  url: '',
158
163
  params: {}
159
- }
164
+ },
165
+ stats: {}
160
166
  };
161
167
  }
162
168
 
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sources":["../../../../../src/x-modules/search/store/module.ts"],"sourcesContent":["import { isFacetFilter } from '@empathyco/x-types';\nimport { setQuery } from '../../../store/utils/query.utils';\nimport { setStatus } from '../../../store';\nimport { groupItemsBy } from '../../../utils/array';\nimport { mergeConfig, setConfig } from '../../../store/utils/config-store.utils';\nimport { UNKNOWN_FACET_KEY } from '../../facets/store/constants';\nimport {\n cancelFetchAndSaveSearchResponse,\n fetchAndSaveSearchResponse,\n fetchSearchResponse,\n increasePageAppendingResults,\n resetRequestOnRefinement,\n saveSearchResponse\n} from './actions';\nimport { saveOrigin } from './actions/save-origin.action';\nimport { setUrlParams } from './actions/set-url-params.action';\nimport { query } from './getters/query.getter';\nimport { request } from './getters/request.getter';\nimport { SearchXStoreModule } from './types';\n\n/**\n * {@link XStoreModule} For the search module.\n *\n * @internal\n */\nexport const searchXStoreModule: SearchXStoreModule = {\n state: () => ({\n ...resettableState(),\n selectedFilters: {},\n params: {},\n config: {\n pageSize: 24\n },\n status: 'initial',\n isNoResults: false,\n fromNoResultsWithFilters: false\n }),\n getters: {\n request,\n query\n },\n mutations: {\n appendResults(state, results) {\n state.results = [...state.results, ...results];\n },\n resetState(state) {\n Object.assign(state, resettableState());\n },\n resetStateForReload(state) {\n const { query, facets, sort, page, ...resettable } = resettableState();\n Object.assign(state, resettable);\n },\n setQuery,\n setResults(state, results) {\n state.results = results;\n },\n setPartialResults(state, partialResults) {\n state.partialResults = partialResults;\n },\n setFacets(state, facets) {\n state.facets = facets;\n },\n setRelatedTags(state, relatedTags) {\n state.relatedTags = relatedTags;\n },\n setSelectedFilters(state, selectedFilters) {\n state.selectedFilters = groupItemsBy(selectedFilters, filter =>\n isFacetFilter(filter) ? filter.facetId : UNKNOWN_FACET_KEY\n );\n },\n setBanners(state, banners) {\n state.banners = banners;\n },\n setPromoteds(state, promoteds) {\n state.promoteds = promoteds;\n },\n setSpellcheck(state, spellcheckedQuery) {\n state.spellcheckedQuery = spellcheckedQuery;\n },\n setTotalResults(state, totalResults) {\n state.totalResults = totalResults;\n },\n setSort(state, sort) {\n state.sort = sort;\n },\n setPage(state, page) {\n state.page = page;\n },\n setConfig,\n mergeConfig,\n setIsAppendResults(state, isAppendResults) {\n state.isAppendResults = isAppendResults;\n },\n setIsNoResults(state, isNoResults) {\n state.isNoResults = isNoResults;\n },\n setFromNoResultsWithFilters(state, fromNoResultsWithFilters) {\n state.fromNoResultsWithFilters = fromNoResultsWithFilters;\n },\n setStatus,\n setParams(state, params) {\n state.params = params;\n },\n setOrigin(state, origin = null) {\n state.origin = origin;\n },\n setRedirections(state, redirections) {\n state.redirections = redirections;\n },\n setQueryTagging(state, queryTagging) {\n state.queryTagging = queryTagging;\n },\n setDisplayTagging(state, displayTagging) {\n state.displayTagging = displayTagging;\n },\n updateResult(state, result) {\n const stateResult = state.results.find(stateResult => result.id === stateResult.id);\n if (stateResult) {\n Object.assign(stateResult, result);\n }\n }\n },\n actions: {\n cancelFetchAndSaveSearchResponse,\n fetchSearchResponse,\n fetchAndSaveSearchResponse,\n increasePageAppendingResults,\n resetRequestOnRefinement,\n saveSearchResponse,\n setUrlParams,\n saveOrigin\n }\n};\n\n/**\n * Function to return the \"resettable\" part of the state. This will be used in the `resetState`\n * mutation to reset to the initial state.\n *\n * @returns The \"resettable\" part of the {@link SearchState}.\n *\n * @internal\n */\nexport function resettableState() {\n return {\n query: '',\n results: [],\n partialResults: [],\n facets: [],\n relatedTags: [],\n banners: [],\n promoteds: [],\n totalResults: 0,\n spellcheckedQuery: '',\n sort: '',\n page: 1,\n origin: null,\n isAppendResults: false,\n redirections: [],\n queryTagging: {\n url: '',\n params: {}\n },\n displayTagging: {\n url: '',\n params: {}\n }\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAoBA;;;;AAIG;AACU,MAAA,kBAAkB,GAAuB;AACpD,IAAA,KAAK,EAAE,OAAO;AACZ,QAAA,GAAG,eAAe,EAAE;AACpB,QAAA,eAAe,EAAE,EAAE;AACnB,QAAA,MAAM,EAAE,EAAE;AACV,QAAA,M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AAA;AACD,QAAA,cAAc,EAAE;AACd,YAAA,GAAG,EAAE,EAAE;AACP,YAAA,MAAM,EAAE,EAAE;AACX,SAAA;KACF,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"module.js","sources":["../../../../../src/x-modules/search/store/module.ts"],"sourcesContent":["import { isFacetFilter, Stats } from '@empathyco/x-types';\nimport { setQuery } from '../../../store/utils/query.utils';\nimport { setStatus } from '../../../store';\nimport { groupItemsBy } from '../../../utils/array';\nimport { mergeConfig, setConfig } from '../../../store/utils/config-store.utils';\nimport { UNKNOWN_FACET_KEY } from '../../facets/store/constants';\nimport {\n cancelFetchAndSaveSearchResponse,\n fetchAndSaveSearchResponse,\n fetchSearchResponse,\n increasePageAppendingResults,\n resetRequestOnRefinement,\n saveSearchResponse\n} from './actions';\nimport { saveOrigin } from './actions/save-origin.action';\nimport { setUrlParams } from './actions/set-url-params.action';\nimport { query } from './getters/query.getter';\nimport { request } from './getters/request.getter';\nimport { SearchXStoreModule } from './types';\n\n/**\n * {@link XStoreModule} For the search module.\n *\n * @internal\n */\nexport const searchXStoreModule: SearchXStoreModule = {\n state: () => ({\n ...resettableState(),\n selectedFilters: {},\n params: {},\n config: {\n pageSize: 24,\n pageMode: 'infinite_scroll'\n },\n status: 'initial',\n isNoResults: false,\n fromNoResultsWithFilters: false\n }),\n getters: {\n request,\n query\n },\n mutations: {\n appendResults(state, results) {\n state.results = [...state.results, ...results];\n },\n resetState(state) {\n Object.assign(state, resettableState());\n },\n resetStateForReload(state) {\n const { query, facets, sort, page, ...resettable } = resettableState();\n Object.assign(state, resettable);\n },\n setQuery,\n setResults(state, results) {\n state.results = results;\n },\n setPartialResults(state, partialResults) {\n state.partialResults = partialResults;\n },\n setFacets(state, facets) {\n state.facets = facets;\n },\n setRelatedTags(state, relatedTags) {\n state.relatedTags = relatedTags;\n },\n setSelectedFilters(state, selectedFilters) {\n state.selectedFilters = groupItemsBy(selectedFilters, filter =>\n isFacetFilter(filter) ? filter.facetId : UNKNOWN_FACET_KEY\n );\n },\n setBanners(state, banners) {\n state.banners = banners;\n },\n setPromoteds(state, promoteds) {\n state.promoteds = promoteds;\n },\n setSpellcheck(state, spellcheckedQuery) {\n state.spellcheckedQuery = spellcheckedQuery;\n },\n setTotalResults(state, totalResults) {\n state.totalResults = totalResults;\n },\n setSort(state, sort) {\n state.sort = sort;\n },\n setPage(state, page) {\n state.page = page;\n },\n setConfig,\n mergeConfig,\n setIsAppendResults(state, isAppendResults) {\n state.isAppendResults = isAppendResults;\n },\n setIsNoResults(state, isNoResults) {\n state.isNoResults = isNoResults;\n },\n setFromNoResultsWithFilters(state, fromNoResultsWithFilters) {\n state.fromNoResultsWithFilters = fromNoResultsWithFilters;\n },\n setStatus,\n setParams(state, params) {\n state.params = params;\n },\n setOrigin(state, origin = null) {\n state.origin = origin;\n },\n setRedirections(state, redirections) {\n state.redirections = redirections;\n },\n setQueryTagging(state, queryTagging) {\n state.queryTagging = queryTagging;\n },\n setDisplayTagging(state, displayTagging) {\n state.displayTagging = displayTagging;\n },\n updateResult(state, result) {\n const stateResult = state.results.find(stateResult => result.id === stateResult.id);\n if (stateResult) {\n Object.assign(stateResult, result);\n }\n },\n setStats(state, stats) {\n state.stats = stats;\n }\n },\n actions: {\n cancelFetchAndSaveSearchResponse,\n fetchSearchResponse,\n fetchAndSaveSearchResponse,\n increasePageAppendingResults,\n resetRequestOnRefinement,\n saveSearchResponse,\n setUrlParams,\n saveOrigin\n }\n};\n\n/**\n * Function to return the \"resettable\" part of the state. This will be used in the `resetState`\n * mutation to reset to the initial state.\n *\n * @returns The \"resettable\" part of the {@link SearchState}.\n *\n * @internal\n */\nexport function resettableState() {\n return {\n query: '',\n results: [],\n partialResults: [],\n facets: [],\n relatedTags: [],\n banners: [],\n promoteds: [],\n totalResults: 0,\n spellcheckedQuery: '',\n sort: '',\n page: 1,\n origin: null,\n isAppendResults: false,\n redirections: [],\n queryTagging: {\n url: '',\n params: {}\n },\n displayTagging: {\n url: '',\n params: {}\n },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AAE,EAAE;AACf,QAAA,OAAO,EAAE,EAAE;AACX,QAAA,SAAS,EAAE,EAAE;AACb,QAAA,YAAY,EAAE,CAAC;AACf,QAAA,iBAAiB,EAAE,EAAE;AACrB,QAAA,IAAI,EAAE,EAAE;AACR,QAAA,IAAI,EAAE,CAAC;AACP,QAAA,MAAM,EAAE,IAAI;AACZ,QAAA,eAAe,EAAE,KAAK;AACtB,QAAA,YAAY,EAAE,EAAE;AAChB,QAAA,YAAY,EAAE;AACZ,YAAA,GAAG,EAAE,EAAE;AACP,YAAA,MAAM,EAAE,EAAE;AACX,SAAA;AACD,QAAA,cAAc,EAAE;AACd,YAAA,GAAG,EAAE,EAAE;AACP,YAAA,MAAM,EAAE,EAAE;AACX,SAAA;AACD,QAAA,KAAK,EAAE,EAAW;KACnB,CAAC;AACJ;;;;"}
@@ -251,6 +251,10 @@ const searchWiring = createWiring({
251
251
  },
252
252
  UserSelectedAHistoryQuery: {
253
253
  setSearchSelectedFiltersFromHistoryQuery
254
+ },
255
+ UserSelectedAPage: {
256
+ setSearchPage,
257
+ resetAppending
254
258
  }
255
259
  });
256
260
 
@@ -1 +1 @@
1
- {"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/search/wiring.ts"],"sourcesContent":["import {\n createWiring,\n filterTruthyPayload,\n namespacedWireCommit,\n namespacedWireCommitWithoutPayload,\n namespacedWireDispatch,\n namespacedWireDispatchWithoutPayload,\n WirePayload\n} from '../../wiring';\nimport { createRawFilters } from '../../utils';\nimport { InternalSearchRequest } from './types';\n\n/**\n * `search` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'search';\n\n/**\n * WireCommit for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireCommit = namespacedWireCommit(moduleName);\n\n/**\n * WireCommit without Payload for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireCommitWithoutPayload = namespacedWireCommitWithoutPayload(moduleName);\n\n/**\n * WireDispatch for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireDispatch = namespacedWireDispatch(moduleName);\n\n/**\n * WireDispatchWithoutPayload for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName);\n\n/**\n * Cancels the {@link SearchActions.fetchAndSaveSearchResponse} request promise.\n *\n * @public\n */\nexport const cancelFetchAndSaveSearchResponseWire = wireDispatchWithoutPayload(\n 'cancelFetchAndSaveSearchResponse'\n);\n\n/**\n * Sets the search state `origin`.\n *\n * @public\n */\nexport const saveOriginWire = wireDispatch('saveOrigin', ({ metadata }) => metadata);\n\n/**\n * Requests and stores the search response.\n *\n * @public\n */\nexport const fetchAndSaveSearchResponseWire = wireDispatch('fetchAndSaveSearchResponse');\n\n/**\n * Resets the search state `spellcheckedQuery` to its initial value, an empty string.\n *\n * @public\n */\nexport const resetSpellcheckQuery = wireCommit('setSpellcheck', '');\n\n/**\n * Sets the search state `relatedTags`.\n *\n * @public\n */\nexport const setRelatedTags = wireCommit('setRelatedTags');\n\n/**\n * Sets the search state `query`.\n *\n * @public\n */\nexport const setSearchQuery = wireCommit('setQuery');\n\n/**\n * Clears the search state `query`.\n *\n * @public\n */\nexport const clearSearchQuery = wireCommit('setQuery', '');\n\n/**\n * Sets the search state `selectedFilters`.\n *\n * @public\n */\nexport const setSelectedFilters = wireCommit('setSelectedFilters');\n\n/**\n * Sets the search state `sort`.\n *\n * @public\n */\nexport const setSort = wireCommit('setSort');\n\n/**\n * Sets the search state `query`.\n *\n * @public\n */\nexport const setUrlParams = wireDispatch('setUrlParams');\n\n/**\n * Sets the search state `page`.\n *\n * @public\n */\nexport const setSearchPage = wireCommit('setPage');\n\n/**\n * Sets the search state `params`.\n *\n * @public\n */\nexport const setSearchExtraParams = wireCommit('setParams');\n\n/**\n * Resets the search state to reload the current search.\n *\n * @public\n */\nexport const resetStateForReloadWire = wireCommitWithoutPayload('resetStateForReload');\n\n/**\n * Resets the search state `isNoResults`.\n *\n * @public\n */\nexport const resetIsNoResults = wireCommit('setIsNoResults', false);\n\n/**\n * Resets the search state `fromNoResultsWithFilters`.\n *\n * @public\n */\nexport const resetFromNoResultsWithFilters = wireCommit('setFromNoResultsWithFilters', false);\n\n/**\n * Increases the current search state `page` by one.\n *\n * @public\n */\nexport const increasePageAppendingResultsWire = wireDispatchWithoutPayload(\n 'increasePageAppendingResults'\n);\n\n/**\n * Resets the search state `isAppendingResults`.\n *\n * @public\n */\nexport const resetAppending = wireCommit('setIsAppendResults', false);\n\n/**\n * Resets the {@link SearchGetters.request} parameters when refining request and before the actual\n * request is launched.\n *\n * @public\n */\nexport const resetRequestOnRefinementWire = wireDispatch(\n 'resetRequestOnRefinement',\n ({ eventPayload: newRequest, metadata: { oldValue } }: WirePayload<InternalSearchRequest>) => ({\n newRequest,\n oldRequest: oldValue as InternalSearchRequest\n })\n);\n\n/**\n * Resets the search state when the request is changed to null. See the\n * {@link searchXStoreModule} for details.\n *\n * @public\n */\nexport const resetStateIfNoRequestWire = filterTruthyPayload<InternalSearchRequest | null>(\n wireCommitWithoutPayload('resetState')\n);\n\n/**\n * Sets the search state `query` with the selectedQueryPreview's query.\n *\n * @public\n */\nexport const setSearchQueryFromPreview = wireCommit(\n 'setQuery',\n ({ eventPayload: { query } }) => query\n);\n\n/**\n * Sets the search state `params` with the selectedQueryPreview's extraParams.\n *\n * @public\n */\nexport const setSearchExtraParamsFromPreview = wireCommit(\n 'setParams',\n ({ eventPayload: { extraParams } }) => extraParams\n);\n\n/**\n * Sets the search state `selectedFilters` with the selectedQueryPreview's filters.\n *\n * @public\n */\nexport const setSearchSelectedFiltersFromPreview = wireCommit(\n 'setSelectedFilters',\n ({ eventPayload: { filters } }) => (filters ? createRawFilters(filters) : [])\n);\n\n/**\n * Sets the search state `selectedFilters` with a selectedHistoryQuery's filters.\n *\n * @public\n */\nexport const setSearchSelectedFiltersFromHistoryQuery = wireCommit(\n 'setSelectedFilters',\n ({ eventPayload: { selectedFilters } }) => selectedFilters ?? []\n);\n\n/**\n * Search wiring.\n *\n * @internal\n */\nexport const searchWiring = createWiring({\n ParamsLoadedFromUrl: {\n setUrlParams,\n saveOriginWire\n },\n UserAcceptedAQuery: {\n setSearchQuery,\n saveOriginWire\n },\n UserAcceptedSpellcheckQuery: {\n resetSpellcheckQuery\n },\n UserClearedQuery: {\n setSearchQuery,\n cancelFetchAndSaveSearchResponseWire,\n resetFromNoResultsWithFilters,\n resetIsNoResults\n },\n UserClickedASort: {\n setSort\n },\n UserPickedARelatedTag: {\n saveOriginWire\n },\n UserReachedResultsListEnd: {\n increasePageAppendingResultsWire\n },\n SearchRequestUpdated: {\n resetStateIfNoRequestWire,\n fetchAndSaveSearchResponseWire\n },\n SearchRequestChanged: {\n resetRequestOnRefinementWire\n },\n SelectedRelatedTagsChanged: {\n setRelatedTags\n },\n SelectedFiltersForRequestChanged: {\n setSelectedFilters\n },\n ResultsChanged: {\n resetAppending\n },\n ReloadSearchRequested: {\n resetStateForReloadWire\n },\n SelectedSortProvided: {\n setSort\n },\n ExtraParamsChanged: {\n setSearchExtraParams\n },\n UserClickedCloseX: {\n clearSearchQuery\n },\n UserClickedOutOfMainModal: {\n clearSearchQuery\n },\n UserAcceptedAQueryPreview: {\n setSearchQueryFromPreview,\n setSearchExtraParamsFromPreview,\n setSearchSelectedFiltersFromPreview,\n saveOriginWire\n },\n QueryPreviewUnselected: {\n setSearchExtraParams\n },\n UserSelectedAHistoryQuery: {\n setSearchSelectedFiltersFromHistoryQuery\n }\n});\n"],"names":[],"mappings":";;;;;;AAYA;;;;AAIG;AACH,MAAM,UAAU,GAAG,QAAQ,CAAC;AAE5B;;;;AAIG;AACH,MAAM,UAAU,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAEpD;;;;AAIG;AACH,MAAM,wBAAwB,GAAG,kCAAkC,CAAC,UAAU,CAAC,CAAC;AAEhF;;;;AAIG;AACH,MAAM,YAAY,GAAG,sBAAsB,CAAC,UAAU,CAAC,CAAC;AAExD;;;;AAIG;AACH,MAAM,0BAA0B,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,qBAAqB,EAAE;QACrB,cAAc;AACf,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,gCAAgC;AACjC,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,yBAAyB;QACzB,8BAA8B;AAC/B,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,4BAA4B;AAC7B,KAAA;AACD,IAAA,0BAA0B,EAAE;QAC1B,cAAc;AACf,KAAA;AACD,IAAA,gCAAgC,EAAE;QAChC,kBAAkB;AACnB,KAAA;AACD,IAAA,cAAc,EAAE;QACd,cAAc;AACf,KAAA;AACD,IAAA,qBAAqB,EAAE;QACrB,uBAAuB;AACxB,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,OAAO;AACR,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,oBAAoB;AACrB,KAAA;AACD,IAAA,iBAAiB,EAAE;QACjB,gBAAgB;AACjB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,gBAAgB;AACjB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,yBAAyB;QACzB,+BAA+B;QAC/B,mCAAmC;QACnC,cAAc;AACf,KAAA;AACD,IAAA,sBAAsB,EAAE;QACtB,oBAAoB;AACrB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,wCAAwC;AACzC,KAAA;AACF,CAAA;;;;"}
1
+ {"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/search/wiring.ts"],"sourcesContent":["import {\n createWiring,\n filterTruthyPayload,\n namespacedWireCommit,\n namespacedWireCommitWithoutPayload,\n namespacedWireDispatch,\n namespacedWireDispatchWithoutPayload,\n WirePayload\n} from '../../wiring';\nimport { createRawFilters } from '../../utils';\nimport { InternalSearchRequest } from './types';\n\n/**\n * `search` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'search';\n\n/**\n * WireCommit for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireCommit = namespacedWireCommit(moduleName);\n\n/**\n * WireCommit without Payload for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireCommitWithoutPayload = namespacedWireCommitWithoutPayload(moduleName);\n\n/**\n * WireDispatch for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireDispatch = namespacedWireDispatch(moduleName);\n\n/**\n * WireDispatchWithoutPayload for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName);\n\n/**\n * Cancels the {@link SearchActions.fetchAndSaveSearchResponse} request promise.\n *\n * @public\n */\nexport const cancelFetchAndSaveSearchResponseWire = wireDispatchWithoutPayload(\n 'cancelFetchAndSaveSearchResponse'\n);\n\n/**\n * Sets the search state `origin`.\n *\n * @public\n */\nexport const saveOriginWire = wireDispatch('saveOrigin', ({ metadata }) => metadata);\n\n/**\n * Requests and stores the search response.\n *\n * @public\n */\nexport const fetchAndSaveSearchResponseWire = wireDispatch('fetchAndSaveSearchResponse');\n\n/**\n * Resets the search state `spellcheckedQuery` to its initial value, an empty string.\n *\n * @public\n */\nexport const resetSpellcheckQuery = wireCommit('setSpellcheck', '');\n\n/**\n * Sets the search state `relatedTags`.\n *\n * @public\n */\nexport const setRelatedTags = wireCommit('setRelatedTags');\n\n/**\n * Sets the search state `query`.\n *\n * @public\n */\nexport const setSearchQuery = wireCommit('setQuery');\n\n/**\n * Clears the search state `query`.\n *\n * @public\n */\nexport const clearSearchQuery = wireCommit('setQuery', '');\n\n/**\n * Sets the search state `selectedFilters`.\n *\n * @public\n */\nexport const setSelectedFilters = wireCommit('setSelectedFilters');\n\n/**\n * Sets the search state `sort`.\n *\n * @public\n */\nexport const setSort = wireCommit('setSort');\n\n/**\n * Sets the search state `query`.\n *\n * @public\n */\nexport const setUrlParams = wireDispatch('setUrlParams');\n\n/**\n * Sets the search state `page`.\n *\n * @public\n */\nexport const setSearchPage = wireCommit('setPage');\n\n/**\n * Sets the search state `params`.\n *\n * @public\n */\nexport const setSearchExtraParams = wireCommit('setParams');\n\n/**\n * Resets the search state to reload the current search.\n *\n * @public\n */\nexport const resetStateForReloadWire = wireCommitWithoutPayload('resetStateForReload');\n\n/**\n * Resets the search state `isNoResults`.\n *\n * @public\n */\nexport const resetIsNoResults = wireCommit('setIsNoResults', false);\n\n/**\n * Resets the search state `fromNoResultsWithFilters`.\n *\n * @public\n */\nexport const resetFromNoResultsWithFilters = wireCommit('setFromNoResultsWithFilters', false);\n\n/**\n * Increases the current search state `page` by one.\n *\n * @public\n */\nexport const increasePageAppendingResultsWire = wireDispatchWithoutPayload(\n 'increasePageAppendingResults'\n);\n\n/**\n * Resets the search state `isAppendingResults`.\n *\n * @public\n */\nexport const resetAppending = wireCommit('setIsAppendResults', false);\n\n/**\n * Resets the {@link SearchGetters.request} parameters when refining request and before the actual\n * request is launched.\n *\n * @public\n */\nexport const resetRequestOnRefinementWire = wireDispatch(\n 'resetRequestOnRefinement',\n ({ eventPayload: newRequest, metadata: { oldValue } }: WirePayload<InternalSearchRequest>) => ({\n newRequest,\n oldRequest: oldValue as InternalSearchRequest\n })\n);\n\n/**\n * Resets the search state when the request is changed to null. See the\n * {@link searchXStoreModule} for details.\n *\n * @public\n */\nexport const resetStateIfNoRequestWire = filterTruthyPayload<InternalSearchRequest | null>(\n wireCommitWithoutPayload('resetState')\n);\n\n/**\n * Sets the search state `query` with the selectedQueryPreview's query.\n *\n * @public\n */\nexport const setSearchQueryFromPreview = wireCommit(\n 'setQuery',\n ({ eventPayload: { query } }) => query\n);\n\n/**\n * Sets the search state `params` with the selectedQueryPreview's extraParams.\n *\n * @public\n */\nexport const setSearchExtraParamsFromPreview = wireCommit(\n 'setParams',\n ({ eventPayload: { extraParams } }) => extraParams\n);\n\n/**\n * Sets the search state `selectedFilters` with the selectedQueryPreview's filters.\n *\n * @public\n */\nexport const setSearchSelectedFiltersFromPreview = wireCommit(\n 'setSelectedFilters',\n ({ eventPayload: { filters } }) => (filters ? createRawFilters(filters) : [])\n);\n\n/**\n * Sets the search state `selectedFilters` with a selectedHistoryQuery's filters.\n *\n * @public\n */\nexport const setSearchSelectedFiltersFromHistoryQuery = wireCommit(\n 'setSelectedFilters',\n ({ eventPayload: { selectedFilters } }) => selectedFilters ?? []\n);\n\n/**\n * Search wiring.\n *\n * @internal\n */\nexport const searchWiring = createWiring({\n ParamsLoadedFromUrl: {\n setUrlParams,\n saveOriginWire\n },\n UserAcceptedAQuery: {\n setSearchQuery,\n saveOriginWire\n },\n UserAcceptedSpellcheckQuery: {\n resetSpellcheckQuery\n },\n UserClearedQuery: {\n setSearchQuery,\n cancelFetchAndSaveSearchResponseWire,\n resetFromNoResultsWithFilters,\n resetIsNoResults\n },\n UserClickedASort: {\n setSort\n },\n UserPickedARelatedTag: {\n saveOriginWire\n },\n UserReachedResultsListEnd: {\n increasePageAppendingResultsWire\n },\n SearchRequestUpdated: {\n resetStateIfNoRequestWire,\n fetchAndSaveSearchResponseWire\n },\n SearchRequestChanged: {\n resetRequestOnRefinementWire\n },\n SelectedRelatedTagsChanged: {\n setRelatedTags\n },\n SelectedFiltersForRequestChanged: {\n setSelectedFilters\n },\n ResultsChanged: {\n resetAppending\n },\n ReloadSearchRequested: {\n resetStateForReloadWire\n },\n SelectedSortProvided: {\n setSort\n },\n ExtraParamsChanged: {\n setSearchExtraParams\n },\n UserClickedCloseX: {\n clearSearchQuery\n },\n UserClickedOutOfMainModal: {\n clearSearchQuery\n },\n UserAcceptedAQueryPreview: {\n setSearchQueryFromPreview,\n setSearchExtraParamsFromPreview,\n setSearchSelectedFiltersFromPreview,\n saveOriginWire\n },\n QueryPreviewUnselected: {\n setSearchExtraParams\n },\n UserSelectedAHistoryQuery: {\n setSearchSelectedFiltersFromHistoryQuery\n },\n UserSelectedAPage: {\n setSearchPage,\n resetAppending\n }\n});\n"],"names":[],"mappings":";;;;;;AAYA;;;;AAIG;AACH,MAAM,UAAU,GAAG,QAAQ,CAAC;AAE5B;;;;AAIG;AACH,MAAM,UAAU,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAEpD;;;;AAIG;AACH,MAAM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AAA;AACD,IAAA,gBAAgB,EAAE;QAChB,cAAc;QACd,oCAAoC;QACpC,6BAA6B;QAC7B,gBAAgB;AACjB,KAAA;AACD,IAAA,gBAAgB,EAAE;QAChB,OAAO;AACR,KAAA;AACD,IAAA,qBAAqB,EAAE;QACrB,cAAc;AACf,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,gCAAgC;AACjC,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,yBAAyB;QACzB,8BAA8B;AAC/B,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,4BAA4B;AAC7B,KAAA;AACD,IAAA,0BAA0B,EAAE;QAC1B,cAAc;AACf,KAAA;AACD,IAAA,gCAAgC,EAAE;QAChC,kBAAkB;AACnB,KAAA;AACD,IAAA,cAAc,EAAE;QACd,cAAc;AACf,KAAA;AACD,IAAA,qBAAqB,EAAE;QACrB,uBAAuB;AACxB,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,OAAO;AACR,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,oBAAoB;AACrB,KAAA;AACD,IAAA,iBAAiB,EAAE;QACjB,gBAAgB;AACjB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,gBAAgB;AACjB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,yBAAyB;QACzB,+BAA+B;QAC/B,mCAAmC;QACnC,cAAc;AACf,KAAA;AACD,IAAA,sBAAsB,EAAE;QACtB,oBAAoB;AACrB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,wCAAwC;AACzC,KAAA;AACD,IAAA,iBAAiB,EAAE;QACjB,aAAa;QACb,cAAc;AACf,KAAA;AACF,CAAA;;;;"}
@@ -1,5 +1,5 @@
1
1
  import _sfc_main from './clear-search-input.vue2.js';
2
- import { resolveComponent, openBlock, createBlock, normalizeClass, withCtx, createCommentVNode, renderSlot, createTextVNode } from 'vue';
2
+ import { resolveComponent, openBlock, createBlock, normalizeClass, withCtx, renderSlot, createTextVNode } from 'vue';
3
3
  import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.js';
4
4
 
5
5
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
@@ -10,7 +10,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
10
10
  "data-test": "clear-search-input"
11
11
  }, {
12
12
  default: withCtx(() => [
13
- createCommentVNode(" @slot _Required_. Button content (text, icon, or both) "),
14
13
  renderSlot(_ctx.$slots, "default", {}, () => [
15
14
  createTextVNode("\u2715")
16
15
  ])
@@ -1 +1 @@
1
- {"version":3,"file":"clear-search-input.vue.js","sources":["../../../../../src/x-modules/search-box/components/clear-search-input.vue"],"sourcesContent":["<template>\n <BaseEventButton\n class=\"x-clear-search-input x-button\"\n :class=\"dynamicClasses\"\n :events=\"clearSearchInputEvents\"\n data-test=\"clear-search-input\"\n >\n <!-- @slot _Required_. Button content (text, icon, or both) -->\n <slot>✕</slot>\n </BaseEventButton>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent, computed, ref } from 'vue';\n import BaseEventButton from '../../../components/base-event-button.vue';\n import { VueCSSClasses } from '../../../utils/types';\n import { useState } from '../../../composables/use-state';\n import { searchBoxXModule } from '../x-module';\n\n /**\n * This component renders a button to delete the current query.\n *\n * @remarks\n * A button that when pressed emits the {@link SearchBoxXEvents.UserPressedClearSearchBoxButton}\n * and {@link SearchBoxXEvents.UserClearedQuery} events, expressing the user intention to clear\n * the current query.\n * It also adds `x-clear-search-input--has-empty-query` as class when there is no query.\n *\n * @public\n */\n export default defineComponent({\n name: 'ClearSearchInput',\n components: { BaseEventButton },\n xModule: searchBoxXModule.name,\n setup: function () {\n const { query } = useState('searchBox', ['query']);\n\n /**\n * The events dictionary that are going to be emitted when the button is pressed.\n *\n * @internal\n */\n const clearSearchInputEvents = ref({\n UserPressedClearSearchBoxButton: undefined\n });\n\n const isQueryEmpty = computed(() => query.value.length === 0);\n\n const dynamicClasses = computed<VueCSSClasses>(() => ({\n 'x-clear-search-input--has-empty-query': isQueryEmpty.value\n }));\n\n return {\n dynamicClasses,\n clearSearchInputEvents\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following events:\n\n- [`UserPressedClearSearchBoxButton`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n- [`UserClearedQuery`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n\n## See it in action\n\nHere a basic example of how the clear button is rendered.\n\n_Type any term in the input field and then click the Clear button to try it out!_\n\n```vue live\n<template>\n <div style=\"display: flex;\">\n <SearchInput />\n <ClearSearchInput />\n </div>\n</template>\n\n<script>\n import { ClearSearchInput, SearchInput } from '@empathyco/x-components/search-box';\n\n export default {\n name: 'ClearSearchInputDemo',\n components: {\n ClearSearchInput,\n SearchInput\n }\n };\n</script>\n```\n\n### Play with default slot\n\nIn this example, a custom text is passed in the default slot instead of the default text to\ncustomize the button content.\n\n_Click the icon button to try it out!_\n\n```vue live\n<template>\n <ClearSearchInput>Clear</ClearSearchInput>\n</template>\n\n<script>\n import { ClearSearchInput } from '@empathyco/x-components/search-box';\n\n export default {\n name: 'ClearSearchInputDemo',\n components: {\n ClearSearchInput\n }\n };\n</script>\n```\n\n### Play with events\n\nIn this example, the `UserPressedClearSearchBoxButton` event is implemented, triggering the message\n“clear” when the clear search input button is clicked.\n\n_Click the Clear button to try it out!_\n\n```vue live\n<template>\n <div>\n <ClearSearchInput @UserPressedClearSearchBoxButton=\"message = 'clear'\">Clear</ClearSearchInput>\n {{ message }}\n </div>\n</template>\n\n<script>\n import { ClearSearchInput } from '@empathyco/x-components/search-box';\n\n export default {\n name: 'ClearSearchInputDemo',\n components: {\n ClearSearchInput\n },\n data() {\n return {\n message: ''\n };\n }\n };\n</script>\n```\n\n## Extending the component\n\nComponents can be combined and communicate with each other. Commonly, the `ClearSearchInput`\ncomponent communicates with the [`SearchInput`](./search-input.md), deleting the search term\nentered.\n\n_Type any term in the input field and then click the icon button to try it out!_\n\n```vue live\n<template>\n <div style=\"display: flex;\">\n <SearchInput />\n <ClearSearchInput />\n </div>\n</template>\n\n<script>\n import { SearchInput, ClearSearchInput } from '@empathyco/x-components/search-box';\n\n export default {\n name: 'ClearSearchInputDemo',\n components: {\n SearchInput,\n ClearSearchInput\n }\n };\n</script>\n```\n</docs>\n"],"names":["_resolveComponent","_openBlock","_createBlock","_withCtx","_createCommentVNode","_renderSlot"],"mappings":";;;;;AASoB,EAAA,MAAA,0BAAA,GAAAA,gBAAA,CAAA,iBAAA,CAAA,CAAA;AALT,EAAA,OAAAC,SAAA,EAAwB,EAAAC,WAAA,CAAA,0BAAA,EAAA;AAAA,IAC/B,sBAAU,CAAoB,+BAAA,EAAA,IAAA,CAAA,cAAA,CAAA,CAAA;AAAA,IAAA,MAAA,EAAA,IAAA,CAAA,sBAAA;AALlC,IAAA,WAAA,EAAA,oBAAA;AAAA,GAAA,EAAA;aAQIC,OAAc,CAAA,MAAA;AAAA,MAAAC,kBAAA,CAAR,0DAAC,CAAA;AAAA,MAAAC,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,EAAA,EAAA,EAAA,MAAA;;AARX,OAAA,CAAA;AAAA,KAAA,CAAA;;;;;;;;;"}
1
+ {"version":3,"file":"clear-search-input.vue.js","sources":["../../../../../src/x-modules/search-box/components/clear-search-input.vue"],"sourcesContent":["<template>\n <BaseEventButton\n class=\"x-clear-search-input x-button\"\n :class=\"dynamicClasses\"\n :events=\"clearSearchInputEvents\"\n data-test=\"clear-search-input\"\n >\n <!-- @slot _Required_. Button content (text, icon, or both) -->\n <slot>✕</slot>\n </BaseEventButton>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent, computed, ref } from 'vue';\n import BaseEventButton from '../../../components/base-event-button.vue';\n import { VueCSSClasses } from '../../../utils/types';\n import { useState } from '../../../composables/use-state';\n import { searchBoxXModule } from '../x-module';\n\n /**\n * This component renders a button to delete the current query.\n *\n * @remarks\n * A button that when pressed emits the {@link SearchBoxXEvents.UserPressedClearSearchBoxButton}\n * and {@link SearchBoxXEvents.UserClearedQuery} events, expressing the user intention to clear\n * the current query.\n * It also adds `x-clear-search-input--has-empty-query` as class when there is no query.\n *\n * @public\n */\n export default defineComponent({\n name: 'ClearSearchInput',\n components: { BaseEventButton },\n xModule: searchBoxXModule.name,\n setup: function () {\n const { query } = useState('searchBox', ['query']);\n\n /**\n * The events dictionary that are going to be emitted when the button is pressed.\n *\n * @internal\n */\n const clearSearchInputEvents = ref({\n UserPressedClearSearchBoxButton: undefined\n });\n\n const isQueryEmpty = computed(() => query.value.length === 0);\n\n const dynamicClasses = computed<VueCSSClasses>(() => ({\n 'x-clear-search-input--has-empty-query': isQueryEmpty.value\n }));\n\n return {\n dynamicClasses,\n clearSearchInputEvents\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following events:\n\n- [`UserPressedClearSearchBoxButton`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n- [`UserClearedQuery`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n\n## See it in action\n\nHere a basic example of how the clear button is rendered.\n\n_Type any term in the input field and then click the Clear button to try it out!_\n\n```vue live\n<template>\n <div style=\"display: flex;\">\n <SearchInput />\n <ClearSearchInput />\n </div>\n</template>\n\n<script>\n import { ClearSearchInput, SearchInput } from '@empathyco/x-components/search-box';\n\n export default {\n name: 'ClearSearchInputDemo',\n components: {\n ClearSearchInput,\n SearchInput\n }\n };\n</script>\n```\n\n### Play with default slot\n\nIn this example, a custom text is passed in the default slot instead of the default text to\ncustomize the button content.\n\n_Click the icon button to try it out!_\n\n```vue live\n<template>\n <ClearSearchInput>Clear</ClearSearchInput>\n</template>\n\n<script>\n import { ClearSearchInput } from '@empathyco/x-components/search-box';\n\n export default {\n name: 'ClearSearchInputDemo',\n components: {\n ClearSearchInput\n }\n };\n</script>\n```\n\n### Play with events\n\nIn this example, the `UserPressedClearSearchBoxButton` event is implemented, triggering the message\n“clear” when the clear search input button is clicked.\n\n_Click the Clear button to try it out!_\n\n```vue live\n<template>\n <div>\n <ClearSearchInput @UserPressedClearSearchBoxButton=\"message = 'clear'\">Clear</ClearSearchInput>\n {{ message }}\n </div>\n</template>\n\n<script>\n import { ClearSearchInput } from '@empathyco/x-components/search-box';\n\n export default {\n name: 'ClearSearchInputDemo',\n components: {\n ClearSearchInput\n },\n data() {\n return {\n message: ''\n };\n }\n };\n</script>\n```\n\n## Extending the component\n\nComponents can be combined and communicate with each other. Commonly, the `ClearSearchInput`\ncomponent communicates with the [`SearchInput`](./search-input.md), deleting the search term\nentered.\n\n_Type any term in the input field and then click the icon button to try it out!_\n\n```vue live\n<template>\n <div style=\"display: flex;\">\n <SearchInput />\n <ClearSearchInput />\n </div>\n</template>\n\n<script>\n import { SearchInput, ClearSearchInput } from '@empathyco/x-components/search-box';\n\n export default {\n name: 'ClearSearchInputDemo',\n components: {\n SearchInput,\n ClearSearchInput\n }\n };\n</script>\n```\n</docs>\n"],"names":["_resolveComponent","_openBlock","_createBlock","_withCtx","_renderSlot"],"mappings":";;;;;AASoB,EAAA,MAAA,0BAAA,GAAAA,gBAAA,CAAA,iBAAA,CAAA,CAAA;AALT,EAAA,OAAAC,SAAA,EAAwB,EAAAC,WAAA,CAAA,0BAAA,EAAA;AAAA,IAC/B,sBAAU,CAAoB,+BAAA,EAAA,IAAA,CAAA,cAAA,CAAA,CAAA;AAAA,IAAA,MAAA,EAAA,IAAA,CAAA,sBAAA;AALlC,IAAA,WAAA,EAAA,oBAAA;AAAA,GAAA,EAAA;aAAAC,OAQW,CAAA,MAAA;AAAA,MAAAC,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,EAAA,EAAA,EAAA,MAAA;;AARX,OAAA,CAAA;AAAA,KAAA,CAAA;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import _sfc_main from './search-button.vue2.js';
2
- import { openBlock, createElementBlock, normalizeClass, createCommentVNode, renderSlot, createElementVNode } from 'vue';
2
+ import { openBlock, createElementBlock, normalizeClass, renderSlot, createElementVNode } from 'vue';
3
3
  import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.js';
4
4
 
5
5
  const _hoisted_1 = /* @__PURE__ */ createElementVNode(
@@ -19,7 +19,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
19
19
  "data-test": "search-button"
20
20
  },
21
21
  [
22
- createCommentVNode(" @slot _Required_. Button content (text, icon, or both) "),
23
22
  renderSlot(_ctx.$slots, "default", {}, () => [
24
23
  _hoisted_1
25
24
  ])
@@ -1 +1 @@
1
- {"version":3,"file":"search-button.vue.js","sources":["../../../../../src/x-modules/search-box/components/search-button.vue"],"sourcesContent":["<template>\n <button\n ref=\"buttonRef\"\n @click=\"emitEvents\"\n class=\"x-search-button x-button\"\n :class=\"dynamicClasses\"\n data-test=\"search-button\"\n >\n <!-- @slot _Required_. Button content (text, icon, or both) -->\n <slot><span class=\"x-icon\">⌕</span></slot>\n </button>\n</template>\n\n<script lang=\"ts\">\n import { computed, ComputedRef, defineComponent, ref } from 'vue';\n import { VueCSSClasses } from '../../../utils/types';\n import { WireMetadata } from '../../../wiring/wiring.types';\n import { use$x } from '../../../composables/use-$x';\n import { useState } from '../../../composables/use-state';\n import { searchBoxXModule } from '../x-module';\n\n /**\n * This component renders a button to submit the query.\n *\n * @remarks\n * If query is not empty, it emits {@link XEventsTypes.UserAcceptedAQuery} and\n * {@link SearchBoxXEvents.UserPressedSearchButton} events with the query as payload.\n * It also adds `x-search-button--has-empty-query` as class when there is no query.\n *\n * @public\n */\n export default defineComponent({\n name: 'SearchButton',\n xModule: searchBoxXModule.name,\n setup: function () {\n const $x = use$x();\n\n const buttonRef = ref<HTMLElement | null>(null);\n\n const query: ComputedRef<string> = useState('searchBox', ['query']).query;\n\n const isQueryEmpty = computed(() => query.value.length === 0);\n\n const dynamicClasses = computed<VueCSSClasses>(() => ({\n 'x-search-button--has-empty-query': isQueryEmpty.value\n }));\n\n /**\n * Generates the {@link WireMetadata} object omitting the moduleName.\n *\n * @returns The {@link WireMetadata} object omitting the moduleName.\n * @internal\n */\n function createEventMetadata(): Omit<WireMetadata, 'moduleName'> {\n return {\n target: buttonRef.value,\n feature: 'search_box'\n };\n }\n\n /**\n * Emits events when the button is clicked.\n *\n * @public\n */\n function emitEvents() {\n if (!isQueryEmpty.value) {\n $x.emit('UserAcceptedAQuery', query.value, createEventMetadata());\n $x.emit('UserPressedSearchButton', query.value, createEventMetadata());\n }\n }\n\n return {\n dynamicClasses,\n buttonRef,\n emitEvents\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following events:\n\n- [`UserAcceptedAQuery`]https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n- [`UserPressedSearchButton`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n\n<!-- prettier-ignore-start -->\n:::warning\nNote that no events are emitted if the query is empty.\n:::\n<!-- prettier-ignore-end -->\n\n## Dynamic classes\n\n`SearchButton` uses the `x-search-button--has-empty-query` dynamic CSS class to modify the HTML\nbutton style when the query is empty.\n\n## See it in action\n\nIn this example, a clickable button is rendered.\n\n_Click the Search button to try it out!_\n\n```vue live\n<template>\n <SearchButton />\n</template>\n\n<script>\n import { SearchButton } from '@empathyco/x-components/search-box';\n\n export default {\n name: 'SearchButtonDemo',\n components: {\n SearchButton\n }\n };\n</script>\n```\n\n### Play with default slot\n\nHere text is passed in the default slot instead of an icon to customize the button content.\n\n_Click the icon button to try it out!_\n\n```vue live\n<template>\n <SearchButton>Search</SearchButton>\n</template>\n\n<script>\n import { SearchButton } from '@empathyco/x-components/search-box';\n\n export default {\n name: 'SearchButtonDemo',\n components: {\n SearchButton\n }\n };\n</script>\n```\n\n### Play with events\n\nIn this example, the `UserPressedSearchButton` event has been implemented so that when you enter a\nsearch term and click the Search button, the search term is displayed as a message.\n\n_Type any term in the input field and then click the Search button to try it out!_\n\n```vue live\n<template>\n <div>\n <div style=\"display: flex;\">\n <SearchInput />\n <SearchButton\n @UserPressedSearchButton=\"\n query => {\n message = query;\n }\n \"\n />\n </div>\n {{ message }}\n </div>\n</template>\n\n<script>\n import { SearchInput, SearchButton } from '@empathyco/x-components/search-box';\n\n export default {\n name: 'SearchButtonDemo',\n components: {\n SearchInput,\n SearchButton\n },\n data() {\n return {\n message: ''\n };\n }\n };\n</script>\n```\n\n## Extending the component\n\nComponents can be combined and communicate with each other. Commonly, the `SearchButton` component\ncommunicates with the [`SearchInput`](./search-input.md) to submit the query. In this example, when\nyou enter a search term and click the Search button, the “Looking for results” message is displayed.\n\n_Type any term in the input field and then click the Search button to try it out!_\n\n```vue live\n<template>\n <div>\n <div style=\"display: flex;\">\n <SearchInput />\n <SearchButton @UserAcceptedAQuery=\"message = 'looking for results'\">Search</SearchButton>\n </div>\n {{ message }}\n </div>\n</template>\n\n<script>\n import { SearchButton, SearchInput } from '@empathyco/x-components/search-box';\n\n export default {\n name: 'SearchButtonDemo',\n components: {\n SearchButton,\n SearchInput\n },\n data() {\n return {\n message: ''\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createElementBlock","_normalizeClass","_createCommentVNode","_renderSlot"],"mappings":";;;;;;;;;;;SAEQ,WAAW,CAAA,IAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,KAAA,EAAA,QAAA,EAAA;SACdA,SAAK,EAAA,EAAAC,kBAAA;AAAA,IAAA,QAAA;AAAA,IAAE;AAAA,MACR,GAAK,EAAA,WAAA;AAAA,MAEL,gBAAU,CAAe,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,GAAA,IAAA,KAAA,IAAA,CAAA,UAAA,IAAA,IAAA,CAAA,UAAA,CAAA,GAAA,IAAA,CAAA,CAAA;AAAA,MAAA,KAAA,EAAAC,cAAA,CAAA,CAAA,0BAAA,EAAA,IAAA,CAAA,cAAA,CAAA,CAAA;AAEzB,MAAA,WAAA,EAAA,eAAA;AAAA,KAAA;AACA,IAAA;AAAA,MAAmCC,kBAAA,CAAA,0DAAA,CAAA;AAAA,MAAAC,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,EAAA,EAAA,EAAA,MAAA;;;;;;;;;;;;"}
1
+ {"version":3,"file":"search-button.vue.js","sources":["../../../../../src/x-modules/search-box/components/search-button.vue"],"sourcesContent":["<template>\n <button\n ref=\"buttonRef\"\n @click=\"emitEvents\"\n class=\"x-search-button x-button\"\n :class=\"dynamicClasses\"\n data-test=\"search-button\"\n >\n <!-- @slot _Required_. Button content (text, icon, or both) -->\n <slot><span class=\"x-icon\">⌕</span></slot>\n </button>\n</template>\n\n<script lang=\"ts\">\n import { computed, ComputedRef, defineComponent, ref } from 'vue';\n import { VueCSSClasses } from '../../../utils/types';\n import { WireMetadata } from '../../../wiring/wiring.types';\n import { use$x } from '../../../composables/use-$x';\n import { useState } from '../../../composables/use-state';\n import { searchBoxXModule } from '../x-module';\n\n /**\n * This component renders a button to submit the query.\n *\n * @remarks\n * If query is not empty, it emits {@link XEventsTypes.UserAcceptedAQuery} and\n * {@link SearchBoxXEvents.UserPressedSearchButton} events with the query as payload.\n * It also adds `x-search-button--has-empty-query` as class when there is no query.\n *\n * @public\n */\n export default defineComponent({\n name: 'SearchButton',\n xModule: searchBoxXModule.name,\n setup: function () {\n const $x = use$x();\n\n const buttonRef = ref<HTMLElement | null>(null);\n\n const query: ComputedRef<string> = useState('searchBox', ['query']).query;\n\n const isQueryEmpty = computed(() => query.value.length === 0);\n\n const dynamicClasses = computed<VueCSSClasses>(() => ({\n 'x-search-button--has-empty-query': isQueryEmpty.value\n }));\n\n /**\n * Generates the {@link WireMetadata} object omitting the moduleName.\n *\n * @returns The {@link WireMetadata} object omitting the moduleName.\n * @internal\n */\n function createEventMetadata(): Omit<WireMetadata, 'moduleName'> {\n return {\n target: buttonRef.value,\n feature: 'search_box'\n };\n }\n\n /**\n * Emits events when the button is clicked.\n *\n * @public\n */\n function emitEvents() {\n if (!isQueryEmpty.value) {\n $x.emit('UserAcceptedAQuery', query.value, createEventMetadata());\n $x.emit('UserPressedSearchButton', query.value, createEventMetadata());\n }\n }\n\n return {\n dynamicClasses,\n buttonRef,\n emitEvents\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following events:\n\n- [`UserAcceptedAQuery`]https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n- [`UserPressedSearchButton`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n\n<!-- prettier-ignore-start -->\n:::warning\nNote that no events are emitted if the query is empty.\n:::\n<!-- prettier-ignore-end -->\n\n## Dynamic classes\n\n`SearchButton` uses the `x-search-button--has-empty-query` dynamic CSS class to modify the HTML\nbutton style when the query is empty.\n\n## See it in action\n\nIn this example, a clickable button is rendered.\n\n_Click the Search button to try it out!_\n\n```vue live\n<template>\n <SearchButton />\n</template>\n\n<script>\n import { SearchButton } from '@empathyco/x-components/search-box';\n\n export default {\n name: 'SearchButtonDemo',\n components: {\n SearchButton\n }\n };\n</script>\n```\n\n### Play with default slot\n\nHere text is passed in the default slot instead of an icon to customize the button content.\n\n_Click the icon button to try it out!_\n\n```vue live\n<template>\n <SearchButton>Search</SearchButton>\n</template>\n\n<script>\n import { SearchButton } from '@empathyco/x-components/search-box';\n\n export default {\n name: 'SearchButtonDemo',\n components: {\n SearchButton\n }\n };\n</script>\n```\n\n### Play with events\n\nIn this example, the `UserPressedSearchButton` event has been implemented so that when you enter a\nsearch term and click the Search button, the search term is displayed as a message.\n\n_Type any term in the input field and then click the Search button to try it out!_\n\n```vue live\n<template>\n <div>\n <div style=\"display: flex;\">\n <SearchInput />\n <SearchButton\n @UserPressedSearchButton=\"\n query => {\n message = query;\n }\n \"\n />\n </div>\n {{ message }}\n </div>\n</template>\n\n<script>\n import { SearchInput, SearchButton } from '@empathyco/x-components/search-box';\n\n export default {\n name: 'SearchButtonDemo',\n components: {\n SearchInput,\n SearchButton\n },\n data() {\n return {\n message: ''\n };\n }\n };\n</script>\n```\n\n## Extending the component\n\nComponents can be combined and communicate with each other. Commonly, the `SearchButton` component\ncommunicates with the [`SearchInput`](./search-input.md) to submit the query. In this example, when\nyou enter a search term and click the Search button, the “Looking for results” message is displayed.\n\n_Type any term in the input field and then click the Search button to try it out!_\n\n```vue live\n<template>\n <div>\n <div style=\"display: flex;\">\n <SearchInput />\n <SearchButton @UserAcceptedAQuery=\"message = 'looking for results'\">Search</SearchButton>\n </div>\n {{ message }}\n </div>\n</template>\n\n<script>\n import { SearchButton, SearchInput } from '@empathyco/x-components/search-box';\n\n export default {\n name: 'SearchButtonDemo',\n components: {\n SearchButton,\n SearchInput\n },\n data() {\n return {\n message: ''\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":["_openBlock","_createElementBlock","_normalizeClass"],"mappings":";;;;;;;;;;;SAEQ,WAAW,CAAA,IAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,KAAA,EAAA,QAAA,EAAA;SACdA,SAAK,EAAA,EAAAC,kBAAA;AAAA,IAAA,QAAA;AAAA,IAAE;AAAA,MACR,GAAK,EAAA,WAAA;AAAA,MAEL,gBAAU,CAAe,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,GAAA,IAAA,KAAA,IAAA,CAAA,UAAA,IAAA,IAAA,CAAA,UAAA,CAAA,GAAA,IAAA,CAAA,CAAA;AAAA,MAAA,KAAA,EAAAC,cAAA,CAAA,CAAA,0BAAA,EAAA,IAAA,CAAA,cAAA,CAAA,CAAA;MAGzB,WAA0C,EAAA,eAAA;AAAA,KAAA;;;;;;;;;;;;;;"}
@@ -1,3 +1,4 @@
1
+ import '@empathyco/x-utils';
1
2
  import { createStoreEmitters } from '../../../store/utils/store-emitters.utils.js';
2
3
  import { isStringEmpty } from '../../../utils/string.js';
3
4
  import { searchBoxXStoreModule } from './module.js';
@@ -1 +1 @@
1
- {"version":3,"file":"emitters.js","sources":["../../../../../src/x-modules/search-box/store/emitters.ts"],"sourcesContent":["import { createStoreEmitters } from '../../../store';\nimport { isStringEmpty } from '../../../utils/string';\nimport { searchBoxXStoreModule } from './module';\n\n/**\n * {@link StoreEmitters} For the search-box module.\n *\n * @internal\n */\nexport const searchBoxEmitters = createStoreEmitters(searchBoxXStoreModule, {\n SearchBoxQueryChanged: (_, getters) => getters.trimmedQuery,\n UserClearedQuery: { selector: state => state.query, filter: isStringEmpty }\n});\n"],"names":[],"mappings":";;;;AAIA;;;;AAIG;AACU,MAAA,iBAAiB,GAAG,mBAAmB,CAAC,qBAAqB,EAAE;IAC1E,qBAAqB,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,YAAY;AAC3D,IAAA,gBAAgB,EAAE,EAAE,QAAQ,EAAE,KAAK,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE;AAC5E,CAAA;;;;"}
1
+ {"version":3,"file":"emitters.js","sources":["../../../../../src/x-modules/search-box/store/emitters.ts"],"sourcesContent":["import { createStoreEmitters } from '../../../store';\nimport { isStringEmpty } from '../../../utils/string';\nimport { searchBoxXStoreModule } from './module';\n\n/**\n * {@link StoreEmitters} For the search-box module.\n *\n * @internal\n */\nexport const searchBoxEmitters = createStoreEmitters(searchBoxXStoreModule, {\n SearchBoxQueryChanged: (_, getters) => getters.trimmedQuery,\n UserClearedQuery: { selector: state => state.query, filter: isStringEmpty }\n});\n"],"names":[],"mappings":";;;;;AAIA;;;;AAIG;AACU,MAAA,iBAAiB,GAAG,mBAAmB,CAAC,qBAAqB,EAAE;IAC1E,qBAAqB,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,YAAY;AAC3D,IAAA,gBAAgB,EAAE,EAAE,QAAQ,EAAE,KAAK,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE;AAC5E,CAAA;;;;"}
@@ -1,5 +1,5 @@
1
1
  import _sfc_main from './semantic-queries.vue2.js';
2
- import { resolveComponent, openBlock, createBlock, withCtx, createCommentVNode, renderSlot, normalizeProps, guardReactiveProps, createVNode } from 'vue';
2
+ import { resolveComponent, openBlock, createBlock, withCtx, renderSlot, normalizeProps, guardReactiveProps, createVNode, createCommentVNode } from 'vue';
3
3
  import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.js';
4
4
 
5
5
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
@@ -11,13 +11,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
11
11
  suggestions: _ctx.suggestions
12
12
  }, {
13
13
  default: withCtx((baseSuggestionsScope) => [
14
- createCommentVNode("\n @slot Semantic Query content\n @binding {{suggestion: object - Suggestion data, index: number - Suggestion index}} v-bind\n BaseSuggestion bindings\n "),
15
14
  renderSlot(_ctx.$slots, "suggestion", normalizeProps(guardReactiveProps(baseSuggestionsScope)), () => [
16
15
  createVNode(_component_SemanticQuery, {
17
16
  suggestion: baseSuggestionsScope.suggestion
18
17
  }, {
19
18
  default: withCtx((baseSuggestionScope) => [
20
- createCommentVNode("\n @slot Semantic Query content\n @binding {{suggestion: object - Suggestion data, query: string - The query that the\n suggestion belongs to}} v-bind SemanticQuery bindings\n "),
21
19
  renderSlot(_ctx.$slots, "suggestion-content", normalizeProps(guardReactiveProps(baseSuggestionScope)))
22
20
  ]),
23
21
  _: 2
@@ -1 +1 @@
1
- {"version":3,"file":"semantic-queries.vue.js","sources":["../../../../../src/x-modules/semantic-queries/components/semantic-queries.vue"],"sourcesContent":["<template>\n <BaseSuggestions\n v-if=\"suggestions.length\"\n class=\"x-semantic-queries\"\n :suggestions=\"suggestions\"\n #default=\"baseSuggestionsScope\"\n >\n <!--\n @slot Semantic Query content\n @binding {{suggestion: object - Suggestion data, index: number - Suggestion index}} v-bind\n BaseSuggestion bindings\n -->\n <slot name=\"suggestion\" v-bind=\"baseSuggestionsScope\">\n <SemanticQuery :suggestion=\"baseSuggestionsScope.suggestion\" #default=\"baseSuggestionScope\">\n <!--\n @slot Semantic Query content\n @binding {{suggestion: object - Suggestion data, query: string - The query that the\n suggestion belongs to}} v-bind SemanticQuery bindings\n -->\n <slot name=\"suggestion-content\" v-bind=\"baseSuggestionScope\" />\n </SemanticQuery>\n </slot>\n </BaseSuggestions>\n</template>\n\n<script lang=\"ts\">\n import { computed, ComputedRef, defineComponent } from 'vue';\n import { Suggestion } from '@empathyco/x-types';\n import { semanticQueriesXModule } from '../x-module';\n import BaseSuggestions from '../../../components/suggestions/base-suggestions.vue';\n import { useState } from '../../../composables';\n import SemanticQuery from './semantic-query.vue';\n\n /**\n * Retrieves a list of semantic queries from the state and exposes them in the slots.\n *\n * @public\n */\n export default defineComponent({\n name: 'SemanticQueries',\n xModule: semanticQueriesXModule.name,\n components: { BaseSuggestions, SemanticQuery },\n setup(_, { slots }) {\n /** The semantic queries from the state. */\n const suggestions: ComputedRef<Suggestion[]> = useState('semanticQueries', [\n 'semanticQueries'\n ]).semanticQueries;\n\n /**\n * Maps the list of semantic queries to a list of queries, to make it compatible with\n * other components.\n */\n const queries = computed(() => suggestions.value.map(suggestion => suggestion.query));\n\n /**\n * Finds a {@link @empathyco/x-types#Suggestion} given a query.\n *\n * @param query - The query to search.\n * @returns The {@link @empathyco/x-types#Suggestion} or undefined if not found.\n */\n function findSemanticQuery(query: string) {\n return suggestions.value.find(suggestion => suggestion.query === query);\n }\n\n /**\n * Render function to execute the `default` slot, binding `slotsProps` and getting only the\n * first `vNode` to avoid Fragments and Text root nodes.\n * If there are no suggestions, nothing is rendered.\n *\n * @remarks `slotProps` must be values without Vue reactivity and located inside the\n * render-function to update the binding data properly.\n *\n * @returns The root `vNode` of the `default` slot or empty string if there are\n * no suggestions.\n */\n function renderDefaultSlot() {\n const slotProps = {\n suggestions: suggestions.value,\n queries: queries.value,\n findSemanticQuery\n };\n return suggestions.value.length ? slots.default?.(slotProps)[0] : '';\n }\n\n /* Hack to render through a render-function, the `default` slot or, in its absence,\n the component itself. It is the alternative for the NoElement antipattern. */\n const componentProps = { suggestions };\n return (slots.default ? renderDefaultSlot : componentProps) as typeof componentProps;\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component doesn't emit events.\n\n## See it in action\n\nBy default, the `SemanticQueries` component will render a list of semantic queries.\n\n```vue\n<template>\n <SemanticQueries />\n</template>\n\n<script>\n import { SemanticQueries } from '@empathyco/x-components/semantic-queries';\n\n export default {\n name: 'SemanticQueriesDemo',\n components: {\n SemanticQueries\n }\n };\n</script>\n```\n\n### Play with props\n\nThe component has the following props:\n\n- maxItemsToRender to limit the number of semantic queries to render.\n- animation to specify the animation to be used to animate the semantic queries.\n\n```vue live\n<template>\n <SemanticQueries :animation=\"animation\" :maxItemsToRender=\"3\" />\n</template>\n\n<script>\n import { FadeAndSlide } from '@empathyco/x-components';\n\n export default {\n name: 'SemanticQueriesPropsDemo',\n data() {\n return {\n animation: FadeAndSlide\n };\n }\n };\n</script>\n```\n\n### Play with the default slot\n\nThe default slot is used to overwrite the whole content of the component.\n\n```vue live\n<template>\n <SemanticQueries #default=\"{ suggestions }\">\n <section>\n <SlidingPanel>\n <div v-for=\"suggestion in suggestions\">\n {{ suggestion.query }}\n {{ suggestion.distance }}\n </div>\n </SlidingPanel>\n </section>\n </SemanticQueries>\n</template>\n\n<script>\n import { SemanticQueries } from '@empathyco/x-components/semantic-queries';\n import { SlidingPanel } from '@empathyco/x-components';\n\n export default {\n name: 'SemanticQueriesDefaultSlotDemo',\n components: {\n SemanticQueries,\n SlidingPanel\n }\n };\n</script>\n```\n\nThe default slot also exposes an array of semantic queries mapped to strings, and a method to find a\nsemantic query given a string query.\n\nThis is useful if you need an array of string queries, but also need to retrieve the original\nsemantic query to use it in another element.\n\n```vue live\n<template>\n <SemanticQueries #default=\"{ queries, findSemanticQuery }\">\n <section>\n <QueryPreviewList :queries=\"queries\" #slot=\"{ query, results }\">\n <div>\n <SemanticQuery :semanticQuery=\"findSemanticQuery(query)\" #default=\"{ query }\">\n {{ query.query }} ({{ query.distance }})\n </SemanticQuery>\n <ul>\n <li v-for=\"result in results\" :key=\"result.id\">\n {{ result.name }}\n </li>\n </ul>\n </div>\n </QueryPreviewList>\n </section>\n </SemanticQueries>\n</template>\n\n<script>\n import { SemanticQueries, SemanticQuery } from '@empathyco/x-components/semantic-queries';\n import { QueryPreviewList } from '@empathyco/x-components/queries-preview';\n\n export default {\n name: 'SemanticQueriesDefaultSlotDemo2',\n components: {\n SemanticQueries,\n SemanticQuery,\n QueryPreviewList\n }\n };\n</script>\n```\n\n### Play with the suggestion slot\n\nThe suggestion slot can be used to override each semantic query item.\n\nIn this example, the query will be rendered along with the distance.\n\n```vue live\n<template>\n <SemanticQueries #suggestion=\"{ suggestion: { query, distance } }\">\n <span>\n ({{ distance }})\n {{ query }}\n </span>\n </SemanticQueries>\n</template>\n\n<script>\n import { SemanticQueries } from '@empathyco/x-components/semantic-queries';\n export default {\n name: 'SemanticQueriesItemSlotDemo',\n components: {\n SemanticQueries\n }\n };\n</script>\n```\n\n### Play with the suggestion content slot\n\nThe suggsetion content slot can be used to override only the content, but keep using the\nSemanticQuery component internally.\n\n```vue live\n<template>\n <SemanticQueries #suggestion-content=\"{ suggestion: { query, distance } }\">\n <span>\n ({{ distance }})\n {{ query }}\n </span>\n </SemanticQueries>\n</template>\n\n<script>\n import { SemanticQueries } from '@empathyco/x-components/semantic-queries';\n export default {\n name: 'SemanticQueriesItemSlotDemo',\n components: {\n SemanticQueries\n }\n };\n</script>\n```\n</docs>\n"],"names":["_resolveComponent","_openBlock","_createBlock","_withCtx","_createCommentVNode","_renderSlot","_normalizeProps","_guardReactiveProps","_createVNode"],"mappings":";;;;;;AAE4B,EAAA,MAAA,0BAAA,GAAAA,gBAAA,CAAA,iBAAA,CAAA,CAAA;AAF5B,EAAA,OAAA,IAAA,CAAA,WAAA,CAAA,MAAA,IAAAC,SAAA,EAG8B,EAAAC,WAAA,CAAA,0BAAA,EAAA;AAAA,IACzB,GAAA,EAAA,CAAA;AAAA,IAAA,KAAA,EAAA,oBAAA;AACA,IAAA,WAAA,EAAO,IAER,CAAA,WAAA;AAAA,GAAA,EAAA;AAKA,IAAA,OAAA,EAAAC,OAAA,CASO,CArBX,oBAAA,KAAA;AAAA,MAoBsBC,kBAAA,CAAA,+KAAA,CAAA;AAAA,MAPAC,UAAA,CAAA,IAAA,CAAY,sBAAqBC,cAAU,CAAAC,kBAAA,CAAA,oBAAA,CAAA,CAAA,EAAA,MAAA;AAAA,QAAAC,WAAA,CAAA,wBAAA,EAAA;AAAG,UAAA,UAAA,EAAO,oBAAE,CAAA,UAAA;AAAA,SAAA,EAAA;mBAMrEL,OAA+D,CAAA,CAAA,mBAAA,KAAA;AAAA,YAAAC,kBAAA,CAAA,sNAAA,CAAA;AAnBvE,YAAAC,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,oBAAA,EAAAC,cAAA,CAAAC,kBAAA,CAAA,mBAAA,CAAA,CAAA,CAAA;AAAA,WAAA,CAAA;;;;AAAA,OAAA,CAAA;AAAA,KAAA,CAAA;AAAA,IAAA,CAAA,EAAA,CAAA;AAAA;AAAA,GAAA,EAAA,CAAA,EAAA,CAAA,aAAA,CAAA,CAAA,IAAAH,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA,CAAA;;;;;;"}
1
+ {"version":3,"file":"semantic-queries.vue.js","sources":["../../../../../src/x-modules/semantic-queries/components/semantic-queries.vue"],"sourcesContent":["<template>\n <BaseSuggestions\n v-if=\"suggestions.length\"\n class=\"x-semantic-queries\"\n :suggestions=\"suggestions\"\n #default=\"baseSuggestionsScope\"\n >\n <!--\n @slot Semantic Query content\n @binding {{suggestion: object - Suggestion data, index: number - Suggestion index}} v-bind\n BaseSuggestion bindings\n -->\n <slot name=\"suggestion\" v-bind=\"baseSuggestionsScope\">\n <SemanticQuery :suggestion=\"baseSuggestionsScope.suggestion\" #default=\"baseSuggestionScope\">\n <!--\n @slot Semantic Query content\n @binding {{suggestion: object - Suggestion data, query: string - The query that the\n suggestion belongs to}} v-bind SemanticQuery bindings\n -->\n <slot name=\"suggestion-content\" v-bind=\"baseSuggestionScope\" />\n </SemanticQuery>\n </slot>\n </BaseSuggestions>\n</template>\n\n<script lang=\"ts\">\n import { computed, ComputedRef, defineComponent } from 'vue';\n import { Suggestion } from '@empathyco/x-types';\n import { semanticQueriesXModule } from '../x-module';\n import BaseSuggestions from '../../../components/suggestions/base-suggestions.vue';\n import { useState } from '../../../composables';\n import SemanticQuery from './semantic-query.vue';\n\n /**\n * Retrieves a list of semantic queries from the state and exposes them in the slots.\n *\n * @public\n */\n export default defineComponent({\n name: 'SemanticQueries',\n xModule: semanticQueriesXModule.name,\n components: { BaseSuggestions, SemanticQuery },\n setup(_, { slots }) {\n /** The semantic queries from the state. */\n const suggestions: ComputedRef<Suggestion[]> = useState('semanticQueries', [\n 'semanticQueries'\n ]).semanticQueries;\n\n /**\n * Maps the list of semantic queries to a list of queries, to make it compatible with\n * other components.\n */\n const queries = computed(() => suggestions.value.map(suggestion => suggestion.query));\n\n /**\n * Finds a {@link @empathyco/x-types#Suggestion} given a query.\n *\n * @param query - The query to search.\n * @returns The {@link @empathyco/x-types#Suggestion} or undefined if not found.\n */\n function findSemanticQuery(query: string) {\n return suggestions.value.find(suggestion => suggestion.query === query);\n }\n\n /**\n * Render function to execute the `default` slot, binding `slotsProps` and getting only the\n * first `vNode` to avoid Fragments and Text root nodes.\n * If there are no suggestions, nothing is rendered.\n *\n * @remarks `slotProps` must be values without Vue reactivity and located inside the\n * render-function to update the binding data properly.\n *\n * @returns The root `vNode` of the `default` slot or empty string if there are\n * no suggestions.\n */\n function renderDefaultSlot() {\n const slotProps = {\n suggestions: suggestions.value,\n queries: queries.value,\n findSemanticQuery\n };\n return suggestions.value.length ? slots.default?.(slotProps)[0] : '';\n }\n\n /* Hack to render through a render-function, the `default` slot or, in its absence,\n the component itself. It is the alternative for the NoElement antipattern. */\n const componentProps = { suggestions };\n return (slots.default ? renderDefaultSlot : componentProps) as typeof componentProps;\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component doesn't emit events.\n\n## See it in action\n\nBy default, the `SemanticQueries` component will render a list of semantic queries.\n\n```vue\n<template>\n <SemanticQueries />\n</template>\n\n<script>\n import { SemanticQueries } from '@empathyco/x-components/semantic-queries';\n\n export default {\n name: 'SemanticQueriesDemo',\n components: {\n SemanticQueries\n }\n };\n</script>\n```\n\n### Play with props\n\nThe component has the following props:\n\n- maxItemsToRender to limit the number of semantic queries to render.\n- animation to specify the animation to be used to animate the semantic queries.\n\n```vue live\n<template>\n <SemanticQueries :animation=\"animation\" :maxItemsToRender=\"3\" />\n</template>\n\n<script>\n import { FadeAndSlide } from '@empathyco/x-components';\n\n export default {\n name: 'SemanticQueriesPropsDemo',\n data() {\n return {\n animation: FadeAndSlide\n };\n }\n };\n</script>\n```\n\n### Play with the default slot\n\nThe default slot is used to overwrite the whole content of the component.\n\n```vue live\n<template>\n <SemanticQueries #default=\"{ suggestions }\">\n <section>\n <SlidingPanel>\n <div v-for=\"suggestion in suggestions\">\n {{ suggestion.query }}\n {{ suggestion.distance }}\n </div>\n </SlidingPanel>\n </section>\n </SemanticQueries>\n</template>\n\n<script>\n import { SemanticQueries } from '@empathyco/x-components/semantic-queries';\n import { SlidingPanel } from '@empathyco/x-components';\n\n export default {\n name: 'SemanticQueriesDefaultSlotDemo',\n components: {\n SemanticQueries,\n SlidingPanel\n }\n };\n</script>\n```\n\nThe default slot also exposes an array of semantic queries mapped to strings, and a method to find a\nsemantic query given a string query.\n\nThis is useful if you need an array of string queries, but also need to retrieve the original\nsemantic query to use it in another element.\n\n```vue live\n<template>\n <SemanticQueries #default=\"{ queries, findSemanticQuery }\">\n <section>\n <QueryPreviewList :queries=\"queries\" #slot=\"{ query, results }\">\n <div>\n <SemanticQuery :semanticQuery=\"findSemanticQuery(query)\" #default=\"{ query }\">\n {{ query.query }} ({{ query.distance }})\n </SemanticQuery>\n <ul>\n <li v-for=\"result in results\" :key=\"result.id\">\n {{ result.name }}\n </li>\n </ul>\n </div>\n </QueryPreviewList>\n </section>\n </SemanticQueries>\n</template>\n\n<script>\n import { SemanticQueries, SemanticQuery } from '@empathyco/x-components/semantic-queries';\n import { QueryPreviewList } from '@empathyco/x-components/queries-preview';\n\n export default {\n name: 'SemanticQueriesDefaultSlotDemo2',\n components: {\n SemanticQueries,\n SemanticQuery,\n QueryPreviewList\n }\n };\n</script>\n```\n\n### Play with the suggestion slot\n\nThe suggestion slot can be used to override each semantic query item.\n\nIn this example, the query will be rendered along with the distance.\n\n```vue live\n<template>\n <SemanticQueries #suggestion=\"{ suggestion: { query, distance } }\">\n <span>\n ({{ distance }})\n {{ query }}\n </span>\n </SemanticQueries>\n</template>\n\n<script>\n import { SemanticQueries } from '@empathyco/x-components/semantic-queries';\n export default {\n name: 'SemanticQueriesItemSlotDemo',\n components: {\n SemanticQueries\n }\n };\n</script>\n```\n\n### Play with the suggestion content slot\n\nThe suggsetion content slot can be used to override only the content, but keep using the\nSemanticQuery component internally.\n\n```vue live\n<template>\n <SemanticQueries #suggestion-content=\"{ suggestion: { query, distance } }\">\n <span>\n ({{ distance }})\n {{ query }}\n </span>\n </SemanticQueries>\n</template>\n\n<script>\n import { SemanticQueries } from '@empathyco/x-components/semantic-queries';\n export default {\n name: 'SemanticQueriesItemSlotDemo',\n components: {\n SemanticQueries\n }\n };\n</script>\n```\n</docs>\n"],"names":["_resolveComponent","_openBlock","_createBlock","_withCtx","_renderSlot","_normalizeProps","_guardReactiveProps","_createVNode","_createCommentVNode"],"mappings":";;;;;;AAE4B,EAAA,MAAA,0BAAA,GAAAA,gBAAA,CAAA,iBAAA,CAAA,CAAA;AAF5B,EAAA,OAAA,IAAA,CAAA,WAAA,CAAA,MAAA,IAAAC,SAAA,EAG8B,EAAAC,WAAA,CAAA,0BAAA,EAAA;AAAA,IACzB,GAAA,EAAA,CAAA;AAAA,IAAA,KAAA,EAAA,oBAAA;AACA,IAAA,WAAA,EAAO,IAOR,CAAA,WAAA;AAAA,GAAA,EAAA;aACEC,OAOgB,CAAA,CAAA,oBAAA,KAAA;AAAA,MAPAC,UAAA,CAAA,IAAA,CAAY,sBAAqBC,cAAU,CAAAC,kBAAA,CAAA,oBAAA,CAAA,CAAA,EAAA,MAAA;AAAA,QAAAC,WAAA,CAAA,wBAAA,EAAA;AAAG,UAAA,UAAA,EAAO,oBAAE,CAAA,UAAA;AAAA,SAAA,EAAA;;AAb7E,YAAAH,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,oBAAA,EAAAC,cAAA,CAAAC,kBAAA,CAAA,mBAAA,CAAA,CAAA,CAAA;AAAA,WAAA,CAAA;;;;AAAA,OAAA,CAAA;AAAA,KAAA,CAAA;AAAA,IAAA,CAAA,EAAA,CAAA;AAAA;AAAA,GAAA,EAAA,CAAA,EAAA,CAAA,aAAA,CAAA,CAAA,IAAAE,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA,CAAA;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import _sfc_main from './semantic-query.vue2.js';
2
- import { resolveComponent, openBlock, createBlock, withCtx, createCommentVNode, renderSlot, normalizeProps, guardReactiveProps } from 'vue';
2
+ import { resolveComponent, openBlock, createBlock, withCtx, renderSlot, normalizeProps, guardReactiveProps } from 'vue';
3
3
  import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.js';
4
4
 
5
5
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
@@ -12,9 +12,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
12
12
  "data-test": "semantic-query"
13
13
  }, {
14
14
  default: withCtx((baseScope) => [
15
- createCommentVNode(" eslint-disable max-len "),
16
- createCommentVNode("\n @slot Semantic Query content\n @binding {{suggestion: object - Suggestion data, query: string - The query that the suggestion belongs to}} v-bind BaseSuggestion bindings\n "),
17
- createCommentVNode(" eslint-enable max-len "),
18
15
  renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({ ...baseScope })))
19
16
  ]),
20
17
  _: 3
@@ -1 +1 @@
1
- {"version":3,"file":"semantic-query.vue.js","sources":["../../../../../src/x-modules/semantic-queries/components/semantic-query.vue"],"sourcesContent":["<template>\n <BaseSuggestion\n :query=\"query\"\n :suggestion=\"suggestion\"\n :suggestionSelectedEvents=\"suggestionSelectedEvents\"\n feature=\"semantics\"\n data-test=\"semantic-query\"\n #default=\"baseScope\"\n >\n <!-- eslint-disable max-len -->\n <!--\n @slot Semantic Query content\n @binding {{suggestion: object - Suggestion data, query: string - The query that the suggestion belongs to}} v-bind BaseSuggestion bindings\n -->\n <!-- eslint-enable max-len -->\n <slot v-bind=\"{ ...baseScope }\" />\n </BaseSuggestion>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import { SemanticQuery } from '@empathyco/x-types';\n import { semanticQueriesXModule } from '../x-module';\n import BaseSuggestion from '../../../components/suggestions/base-suggestion.vue';\n import { useGetter } from '../../../composables/use-getter';\n\n /**\n * This component renders a semantic query. A semantic query is a recommended query\n * that is similar in its meaning to another one.\n * It contains the query and the distance, which indicates how similar the query is\n * compared to the searched query.\n *\n * @public\n */\n export default defineComponent({\n name: 'SemanticQuery',\n xModule: semanticQueriesXModule.name,\n components: { BaseSuggestion },\n props: {\n /** The {@link @empathyco/x-types#SemanticQuery} to render. */\n suggestion: {\n type: Object as PropType<SemanticQuery>,\n required: true\n }\n },\n setup(props) {\n /** The normalized query of the semantic queries module. */\n const query = useGetter('semanticQueries', ['normalizedQuery']).normalizedQuery;\n\n /** The list of events that are going to be emitted when the button is pressed. */\n const suggestionSelectedEvents = {\n UserSelectedASemanticQuery: props.suggestion\n };\n\n return {\n query,\n suggestionSelectedEvents\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserSelectedASemanticQuery`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the semantic query button. The event payload is the\n semantic query data.\n\n## See it in action\n\nHere you can see that the semantic query query is rendered.\n\n```vue live\n<template>\n <SemanticQuery :suggestion=\"semanticQuery\" />\n</template>\n\n<script>\n import { SemanticQuery } from '@empathyco/x-components/semantic-queries';\n\n export default {\n name: 'SemanticQueryDemo',\n components: {\n SemanticQuery\n },\n data() {\n return {\n semanticQuery: {\n modelName: 'SemanticQuery',\n query: 'jacket',\n distance: 2\n }\n };\n }\n };\n</script>\n```\n\n### Play with the default slot\n\nIn this example, we add the distance of the semantic query next to the query.\n\n```vue live\n<template>\n <SemanticQuery :suggestion=\"semanticQuery\" #default=\"{ suggestion, query }\">\n <div>Original query: {{ query }}</div>\n <div>Suggested semantic query: {{ suggestion.query }} - {{ suggestion.distance }}</div>\n </SemanticQuery>\n</template>\n\n<script>\n import { SemanticQuery } from '@empathyco/x-components/semantic-queries';\n\n export default {\n name: 'SemanticQueryDemoDefaultSlot',\n components: {\n SemanticQuery\n },\n data() {\n return {\n semanticQuery: {\n modelName: 'SemanticQuery',\n query: 'jacket',\n distance: 2\n }\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":["_resolveComponent","_openBlock","_createBlock","_withCtx","_createCommentVNode","_renderSlot","_normalizeProps","_guardReactiveProps"],"mappings":";;;;;oCACEA,gBAeiB,CAAA,gBAAA,CAAA,CAAA;AAbd,EAAA,OAAAC,SAAA,EAAsB,EAAAC,WAAA,CAAA,yBAAA,EAAA;AAAA,IACtB,KAAA,EAAA,IAAA,CAAA,KAAA;AAAA,IACD,UAAQ,EAAA,IAAA,CAAA,UAAA;AAAA,IACR,0BAAU,IAAgB,CAAA,wBAAA;AAAA,IAAA,OAAA,EAAA,WAAA;IACzB,WAAO,EAAA,gBAAA;AAAA,GAAA,EAAA;AAGR,IAAA,OAAA,EAAAC,OAAA,CAAA,CAAA,SAAA,KAAA;AAAA,MAIAC,kBAA8B,CAAA,0BAAA,CAAA;AAAA,MAC9BA,mBAAkC,kMAAN,CAAA;AAAA,MAAAA,kBAAA,CAAA,yBAAA,CAAA;AAfhC,MAAAC,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,EAAAC,cAAA,CAAAC,kBAAA,CAAA,EAAA,GAAA,SAAA,EAAA,CAAA,CAAA,CAAA;AAAA,KAAA,CAAA;;;;;;;;;"}
1
+ {"version":3,"file":"semantic-query.vue.js","sources":["../../../../../src/x-modules/semantic-queries/components/semantic-query.vue"],"sourcesContent":["<template>\n <BaseSuggestion\n :query=\"query\"\n :suggestion=\"suggestion\"\n :suggestionSelectedEvents=\"suggestionSelectedEvents\"\n feature=\"semantics\"\n data-test=\"semantic-query\"\n #default=\"baseScope\"\n >\n <!-- eslint-disable max-len -->\n <!--\n @slot Semantic Query content\n @binding {{suggestion: object - Suggestion data, query: string - The query that the suggestion belongs to}} v-bind BaseSuggestion bindings\n -->\n <!-- eslint-enable max-len -->\n <slot v-bind=\"{ ...baseScope }\" />\n </BaseSuggestion>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import { SemanticQuery } from '@empathyco/x-types';\n import { semanticQueriesXModule } from '../x-module';\n import BaseSuggestion from '../../../components/suggestions/base-suggestion.vue';\n import { useGetter } from '../../../composables/use-getter';\n\n /**\n * This component renders a semantic query. A semantic query is a recommended query\n * that is similar in its meaning to another one.\n * It contains the query and the distance, which indicates how similar the query is\n * compared to the searched query.\n *\n * @public\n */\n export default defineComponent({\n name: 'SemanticQuery',\n xModule: semanticQueriesXModule.name,\n components: { BaseSuggestion },\n props: {\n /** The {@link @empathyco/x-types#SemanticQuery} to render. */\n suggestion: {\n type: Object as PropType<SemanticQuery>,\n required: true\n }\n },\n setup(props) {\n /** The normalized query of the semantic queries module. */\n const query = useGetter('semanticQueries', ['normalizedQuery']).normalizedQuery;\n\n /** The list of events that are going to be emitted when the button is pressed. */\n const suggestionSelectedEvents = {\n UserSelectedASemanticQuery: props.suggestion\n };\n\n return {\n query,\n suggestionSelectedEvents\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserSelectedASemanticQuery`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the semantic query button. The event payload is the\n semantic query data.\n\n## See it in action\n\nHere you can see that the semantic query query is rendered.\n\n```vue live\n<template>\n <SemanticQuery :suggestion=\"semanticQuery\" />\n</template>\n\n<script>\n import { SemanticQuery } from '@empathyco/x-components/semantic-queries';\n\n export default {\n name: 'SemanticQueryDemo',\n components: {\n SemanticQuery\n },\n data() {\n return {\n semanticQuery: {\n modelName: 'SemanticQuery',\n query: 'jacket',\n distance: 2\n }\n };\n }\n };\n</script>\n```\n\n### Play with the default slot\n\nIn this example, we add the distance of the semantic query next to the query.\n\n```vue live\n<template>\n <SemanticQuery :suggestion=\"semanticQuery\" #default=\"{ suggestion, query }\">\n <div>Original query: {{ query }}</div>\n <div>Suggested semantic query: {{ suggestion.query }} - {{ suggestion.distance }}</div>\n </SemanticQuery>\n</template>\n\n<script>\n import { SemanticQuery } from '@empathyco/x-components/semantic-queries';\n\n export default {\n name: 'SemanticQueryDemoDefaultSlot',\n components: {\n SemanticQuery\n },\n data() {\n return {\n semanticQuery: {\n modelName: 'SemanticQuery',\n query: 'jacket',\n distance: 2\n }\n };\n }\n };\n</script>\n```\n</docs>\n"],"names":["_resolveComponent","_openBlock","_createBlock","_renderSlot","_normalizeProps","_guardReactiveProps"],"mappings":";;;;;oCACEA,gBAeiB,CAAA,gBAAA,CAAA,CAAA;AAbd,EAAA,OAAAC,SAAA,EAAsB,EAAAC,WAAA,CAAA,yBAAA,EAAA;AAAA,IACtB,KAAA,EAAA,IAAA,CAAA,KAAA;AAAA,IACD,UAAQ,EAAA,IAAA,CAAA,UAAA;AAAA,IACR,0BAAU,IAAgB,CAAA,wBAAA;AAAA,IAAA,OAAA,EAAA,WAAA;IACzB,WAAO,EAAA,gBAAA;AAAA,GAAA,EAAA;;AAPZ,MAAAC,UAAA,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,EAAAC,cAAA,CAAAC,kBAAA,CAAA,EAAA,GAAA,SAAA,EAAA,CAAA,CAAA,CAAA;AAAA,KAAA,CAAA;;;;;;;;;"}
@@ -14,17 +14,18 @@ var _sfc_main = defineComponent({
14
14
  xModule: taggingXModule.name,
15
15
  props: {
16
16
  /**
17
- * The TTL in milliseconds for storing the clicked result info.
17
+ * The TTL in milliseconds for storing the result info.
18
18
  */
19
- clickedResultStorageTTLMs: {
19
+ storageTTLMs: {
20
20
  type: Number,
21
21
  default: 30000
22
22
  },
23
23
  /**
24
- * The Object key of the {@link @empathyco/x-types#Result} clicked by the user
25
- * that will be used as id for the storage. By default, the Result url will be used.
24
+ * The Object key of the {@link @empathyco/x-types#Result} clicked or added to the cart by the user
25
+ * that will be used as id for the storage.
26
+ * By default, the Result url will be used.
26
27
  */
27
- clickedResultStorageKey: {
28
+ storageKey: {
28
29
  type: String,
29
30
  default: 'url'
30
31
  },
@@ -70,8 +71,8 @@ var _sfc_main = defineComponent({
70
71
  return {
71
72
  queryTaggingDebounceMs: props.queryTaggingDebounceMs,
72
73
  sessionTTLMs: props.sessionTTLMs,
73
- clickedResultStorageTTLMs: props.clickedResultStorageTTLMs,
74
- clickedResultStorageKey: props.clickedResultStorageKey
74
+ storageTTLMs: props.storageTTLMs,
75
+ storageKey: props.storageKey
75
76
  };
76
77
  });
77
78
  /**