@empathyco/x-components 6.0.0-alpha.6 → 6.0.0-alpha.61

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 (833) hide show
  1. package/CHANGELOG.md +531 -0
  2. package/core/index.js +9 -1
  3. package/core/index.js.map +1 -1
  4. package/design-system/deprecated-full-theme.css +2371 -2371
  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 +1 -1
  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.baseswitch.md +1 -1
  47. package/docs/API-reference/api/x-components.basetabspanel.md +8 -8
  48. package/docs/API-reference/api/x-components.baseteleport.md +21 -0
  49. package/docs/API-reference/api/x-components.basetogglepanel.md +3 -3
  50. package/docs/API-reference/api/x-components.basevariablecolumngrid.md +3 -3
  51. package/docs/API-reference/api/x-components.cancelfetchandsaverelatedprompts.md +13 -0
  52. package/docs/API-reference/api/x-components.configmutations.config.md +11 -0
  53. package/docs/API-reference/api/x-components.configmutations.md +29 -0
  54. package/docs/API-reference/api/x-components.configmutations.mergeconfig.md +24 -0
  55. package/docs/API-reference/api/x-components.configmutations.setconfig.md +24 -0
  56. package/docs/API-reference/api/x-components.createrelatedtagsquerygetter.md +26 -0
  57. package/docs/API-reference/api/x-components.createrelatedtagsquerygetteroptions.getrelatedtags.md +13 -0
  58. package/docs/API-reference/api/x-components.createrelatedtagsquerygetteroptions.md +20 -0
  59. package/docs/API-reference/api/x-components.createtrackrelatedprompttoolingdisplayclickwire.md +19 -0
  60. package/docs/API-reference/api/x-components.createtracktoolingadd2cartwire.md +19 -0
  61. package/docs/API-reference/api/x-components.createtracktoolingdisplaywire.md +19 -0
  62. package/docs/API-reference/api/{x-components.defaultpdpaddtocartservice._constructor_.md → x-components.defaultexternaltaggingservice._constructor_.md} +3 -3
  63. package/docs/API-reference/api/x-components.defaultexternaltaggingservice.add_to_cart_id_key.md +13 -0
  64. package/docs/API-reference/api/x-components.defaultexternaltaggingservice.instance.md +13 -0
  65. package/docs/API-reference/api/x-components.defaultexternaltaggingservice.localstorageservice.md +11 -0
  66. package/docs/API-reference/api/x-components.defaultexternaltaggingservice.md +43 -0
  67. package/docs/API-reference/api/{x-components.defaultpdpaddtocartservice.movetosessionstorage.md → x-components.defaultexternaltaggingservice.movetosessionstorage.md} +2 -2
  68. package/docs/API-reference/api/x-components.defaultexternaltaggingservice.result_clicked_id_key.md +13 -0
  69. package/docs/API-reference/api/x-components.defaultexternaltaggingservice.sessionstorageservice.md +11 -0
  70. package/docs/API-reference/api/x-components.defaultexternaltaggingservice.storagekey.md +11 -0
  71. package/docs/API-reference/api/x-components.defaultexternaltaggingservice.storagettlms.md +11 -0
  72. package/docs/API-reference/api/{x-components.defaultpdpaddtocartservice.store.md → x-components.defaultexternaltaggingservice.store.md} +2 -2
  73. package/docs/API-reference/api/x-components.defaultexternaltaggingservice.storeaddtocart.md +24 -0
  74. package/docs/API-reference/api/{x-components.defaultpdpaddtocartservice.storeresultclicked.md → x-components.defaultexternaltaggingservice.storeresultclicked.md} +3 -3
  75. package/docs/API-reference/api/{x-components.defaultpdpaddtocartservice.trackaddtocart.md → x-components.defaultexternaltaggingservice.trackaddtocart.md} +3 -3
  76. package/docs/API-reference/api/x-components.displayclickprovider.md +66 -0
  77. package/docs/API-reference/api/x-components.empathize.md +6 -6
  78. package/docs/API-reference/api/x-components.empathizemutations.md +1 -1
  79. package/docs/API-reference/api/x-components.externaltaggingservice.md +23 -0
  80. package/docs/API-reference/api/{x-components.pdpaddtocartservice.movetosessionstorage.md → x-components.externaltaggingservice.movetosessionstorage.md} +2 -2
  81. package/docs/API-reference/api/x-components.externaltaggingservice.storeaddtocart.md +24 -0
  82. package/docs/API-reference/api/{x-components.pdpaddtocartservice.storeresultclicked.md → x-components.externaltaggingservice.storeresultclicked.md} +3 -3
  83. package/docs/API-reference/api/{x-components.pdpaddtocartservice.trackaddtocart.md → x-components.externaltaggingservice.trackaddtocart.md} +3 -3
  84. package/docs/API-reference/api/x-components.facets.md +3 -3
  85. package/docs/API-reference/api/x-components.facetsmutations.md +1 -1
  86. package/docs/API-reference/api/x-components.featurelocation.md +1 -1
  87. package/docs/API-reference/api/x-components.fetchandsaverelatedprompts.md +13 -0
  88. package/docs/API-reference/api/x-components.fetchrelatedprompts.md +13 -0
  89. package/docs/API-reference/api/x-components.filterslist.md +3 -3
  90. package/docs/API-reference/api/x-components.globalxbus.md +14 -0
  91. package/docs/API-reference/api/x-components.hierarchicalfilter.md +9 -2
  92. package/docs/API-reference/api/x-components.historyqueriesmutations.md +1 -1
  93. package/docs/API-reference/api/x-components.historyqueriesstate.md +1 -1
  94. package/docs/API-reference/api/x-components.identifierresults.md +3 -3
  95. package/docs/API-reference/api/x-components.identifierresultsmutations.md +1 -1
  96. package/docs/API-reference/api/x-components.identifierresultsstate.md +1 -1
  97. package/docs/API-reference/api/x-components.installxoptions.domelement.md +1 -1
  98. package/docs/API-reference/api/x-components.installxoptions.installextraplugins.md +2 -2
  99. package/docs/API-reference/api/x-components.installxoptions.md +1 -1
  100. package/docs/API-reference/api/x-components.itemslist.md +3 -3
  101. package/docs/API-reference/api/x-components.mainmodal.md +2 -2
  102. package/docs/API-reference/api/x-components.md +39 -3
  103. package/docs/API-reference/api/x-components.mergeconfig.md +27 -0
  104. package/docs/API-reference/api/x-components.multicolumnmaxwidthlayout.md +5 -5
  105. package/docs/API-reference/api/x-components.myhistory.md +3 -3
  106. package/docs/API-reference/api/x-components.nextqueriesgroup.md +22 -0
  107. package/docs/API-reference/api/x-components.nextqueriesgroup.modelname.md +11 -0
  108. package/docs/API-reference/api/x-components.nextqueriesgroup.nextqueries.md +11 -0
  109. package/docs/API-reference/api/x-components.nextquerieslist.md +3 -3
  110. package/docs/API-reference/api/x-components.nextqueriesmutations.md +1 -1
  111. package/docs/API-reference/api/x-components.nextqueriesstate.md +1 -1
  112. package/docs/API-reference/api/x-components.pageselector.md +80 -0
  113. package/docs/API-reference/api/x-components.partialresultslist.md +3 -3
  114. package/docs/API-reference/api/x-components.popularsearchesmutations.md +1 -1
  115. package/docs/API-reference/api/x-components.promotedslist.md +3 -3
  116. package/docs/API-reference/api/x-components.queriespreviewmutations.md +1 -1
  117. package/docs/API-reference/api/x-components.queryfeature.md +1 -1
  118. package/docs/API-reference/api/x-components.querymutations.md +20 -0
  119. package/docs/API-reference/api/x-components.querymutations.setquery.md +24 -0
  120. package/docs/API-reference/api/x-components.querypreviewlist.md +3 -3
  121. package/docs/API-reference/api/x-components.querystate.md +20 -0
  122. package/docs/API-reference/api/x-components.querystate.query.md +13 -0
  123. package/docs/API-reference/api/x-components.querysuggestionsmutations.md +1 -1
  124. package/docs/API-reference/api/x-components.querysuggestionsstate.md +1 -1
  125. package/docs/API-reference/api/x-components.recommendations.md +3 -3
  126. package/docs/API-reference/api/x-components.recommendationsmutations.md +1 -1
  127. package/docs/API-reference/api/x-components.relatedprompt.md +33 -0
  128. package/docs/API-reference/api/x-components.relatedpromptsactioncontext.md +15 -0
  129. package/docs/API-reference/api/x-components.relatedpromptsactions.cancelfetchandsaverelatedprompts.md +17 -0
  130. package/docs/API-reference/api/x-components.relatedpromptsactions.fetchandsaverelatedprompts.md +24 -0
  131. package/docs/API-reference/api/x-components.relatedpromptsactions.fetchrelatedprompts.md +24 -0
  132. package/docs/API-reference/api/x-components.relatedpromptsactions.md +23 -0
  133. package/docs/API-reference/api/x-components.relatedpromptsactions.seturlparams.md +24 -0
  134. package/docs/API-reference/api/x-components.relatedpromptsgetters.md +21 -0
  135. package/docs/API-reference/api/x-components.relatedpromptsgetters.query.md +13 -0
  136. package/docs/API-reference/api/x-components.relatedpromptsgetters.request.md +13 -0
  137. package/docs/API-reference/api/x-components.relatedpromptslist.md +72 -0
  138. package/docs/API-reference/api/x-components.relatedpromptsmutations.md +27 -0
  139. package/docs/API-reference/api/x-components.relatedpromptsmutations.resetrelatedpromptsstate.md +17 -0
  140. package/docs/API-reference/api/x-components.relatedpromptsmutations.resetselectedprompt.md +17 -0
  141. package/docs/API-reference/api/x-components.relatedpromptsmutations.setparams.md +24 -0
  142. package/docs/API-reference/api/x-components.relatedpromptsmutations.setrelatedpromptsproducts.md +24 -0
  143. package/docs/API-reference/api/x-components.relatedpromptsmutations.setrelatedpromptsrelatedtags.md +24 -0
  144. package/docs/API-reference/api/x-components.relatedpromptsmutations.setselectedprompt.md +24 -0
  145. package/docs/API-reference/api/x-components.relatedpromptsmutations.setselectedquery.md +24 -0
  146. package/docs/API-reference/api/x-components.relatedpromptsstate.md +25 -0
  147. package/docs/API-reference/api/x-components.relatedpromptsstate.params.md +13 -0
  148. package/docs/API-reference/api/x-components.relatedpromptsstate.relatedprompts.md +13 -0
  149. package/docs/API-reference/api/x-components.relatedpromptsstate.relatedtags.md +13 -0
  150. package/docs/API-reference/api/x-components.relatedpromptsstate.selectedprompt.md +13 -0
  151. package/docs/API-reference/api/x-components.relatedpromptsstate.selectedquery.md +13 -0
  152. package/docs/API-reference/api/x-components.relatedpromptstaglist.md +72 -0
  153. package/docs/API-reference/api/x-components.relatedpromptsxevents.md +25 -0
  154. package/docs/API-reference/api/x-components.relatedpromptsxevents.relatedpromptsrequestupdated.md +13 -0
  155. package/docs/API-reference/api/x-components.relatedpromptsxevents.selectedrelatedpromptchanged.md +13 -0
  156. package/docs/API-reference/api/x-components.relatedpromptsxevents.userclickedarelatedpromptadd2cart.md +13 -0
  157. package/docs/API-reference/api/x-components.relatedpromptsxevents.userclickedarelatedpromptresult.md +13 -0
  158. package/docs/API-reference/api/x-components.relatedpromptsxevents.userselectedarelatedprompt.md +13 -0
  159. package/docs/API-reference/api/x-components.relatedpromptsxevents.userselectedarelatedpromptquery.md +13 -0
  160. package/docs/API-reference/api/x-components.relatedpromptsxmodule.md +13 -0
  161. package/docs/API-reference/api/x-components.relatedpromptsxstoremodule.md +15 -0
  162. package/docs/API-reference/api/x-components.relatedtags.md +3 -3
  163. package/docs/API-reference/api/x-components.relatedtagsmutations.md +1 -1
  164. package/docs/API-reference/api/x-components.relatedtagsstate.md +1 -1
  165. package/docs/API-reference/api/x-components.resultfeature.md +1 -1
  166. package/docs/API-reference/api/x-components.resultslist.md +3 -3
  167. package/docs/API-reference/api/x-components.scrolltotop.md +5 -5
  168. package/docs/API-reference/api/x-components.searchboxmutations.md +1 -1
  169. package/docs/API-reference/api/x-components.searchboxstate.md +1 -1
  170. package/docs/API-reference/api/x-components.searchconfig.md +1 -0
  171. package/docs/API-reference/api/x-components.searchconfig.pagemode.md +11 -0
  172. package/docs/API-reference/api/x-components.searchinputplaceholder.md +3 -3
  173. package/docs/API-reference/api/x-components.searchmutations.md +2 -1
  174. package/docs/API-reference/api/x-components.searchmutations.setstats.md +24 -0
  175. package/docs/API-reference/api/x-components.searchstate.md +2 -1
  176. package/docs/API-reference/api/x-components.searchstate.stats.md +13 -0
  177. package/docs/API-reference/api/x-components.searchxevents.md +1 -0
  178. package/docs/API-reference/api/x-components.searchxevents.userselectedapage.md +13 -0
  179. package/docs/API-reference/api/x-components.selectedfilterslist.md +3 -3
  180. package/docs/API-reference/api/x-components.semanticqueriesgetters.md +1 -0
  181. package/docs/API-reference/api/x-components.semanticqueriesgetters.query.md +13 -0
  182. package/docs/API-reference/api/x-components.semanticqueriesmutations.md +2 -1
  183. package/docs/API-reference/api/x-components.semanticqueriesmutations.setsemanticqueriesrelatedtags.md +24 -0
  184. package/docs/API-reference/api/x-components.semanticqueriesstate.md +2 -1
  185. package/docs/API-reference/api/x-components.semanticqueriesstate.relatedtags.md +13 -0
  186. package/docs/API-reference/api/x-components.setconfig.md +27 -0
  187. package/docs/API-reference/api/x-components.setquery.md +25 -0
  188. package/docs/API-reference/api/x-components.seturlprompt.md +13 -0
  189. package/docs/API-reference/api/x-components.simplefilter.md +7 -0
  190. package/docs/API-reference/api/x-components.singlecolumnlayout.md +3 -3
  191. package/docs/API-reference/api/x-components.slidingpanel.md +13 -5
  192. package/docs/API-reference/api/x-components.snippetcallbacks.md +7 -0
  193. package/docs/API-reference/api/x-components.sortdropdown.md +1 -1
  194. package/docs/API-reference/api/x-components.tagging.md +6 -6
  195. package/docs/API-reference/api/x-components.taggingconfig.md +2 -2
  196. package/docs/API-reference/api/{x-components.taggingconfig.clickedresultstoragekey.md → x-components.taggingconfig.storagekey.md} +3 -3
  197. package/docs/API-reference/api/x-components.taggingconfig.storagettlms.md +13 -0
  198. package/docs/API-reference/api/x-components.taggingmutations.md +1 -1
  199. package/docs/API-reference/api/x-components.taggingxevents.md +1 -1
  200. package/docs/API-reference/api/x-components.taggingxevents.resulturltrackingenabled.md +1 -1
  201. package/docs/API-reference/api/x-components.trackrelatedprompttoolingdisplayclickwire.md +13 -0
  202. package/docs/API-reference/api/x-components.tracktoolingadd2cartwire.md +13 -0
  203. package/docs/API-reference/api/x-components.tracktoolingdisplayclickedwire.md +13 -0
  204. package/docs/API-reference/api/x-components.typing.md +13 -0
  205. package/docs/API-reference/api/x-components.typingoptions.md +22 -0
  206. package/docs/API-reference/api/x-components.typingoptions.speed.md +13 -0
  207. package/docs/API-reference/api/x-components.typingoptions.targetattr.md +18 -0
  208. package/docs/API-reference/api/x-components.typingoptions.text.md +13 -0
  209. package/docs/API-reference/api/x-components.urlmutations.md +2 -1
  210. package/docs/API-reference/api/x-components.urlmutations.setprompt.md +24 -0
  211. package/docs/API-reference/api/x-components.urlparams.md +1 -0
  212. package/docs/API-reference/api/x-components.urlparams.prompt.md +11 -0
  213. package/docs/API-reference/api/x-components.urlstate.md +1 -1
  214. package/docs/API-reference/api/x-components.usealiasapi.md +1 -0
  215. package/docs/API-reference/api/x-components.usealiasapi.pricestats.md +16 -0
  216. package/docs/API-reference/api/x-components.xeventstypes.md +3 -3
  217. package/docs/API-reference/api/x-components.xmodulestree.md +1 -0
  218. package/docs/API-reference/api/x-components.xmodulestree.relatedprompts.md +11 -0
  219. package/docs/API-reference/api/x-types.md +2 -0
  220. package/docs/API-reference/api/x-types.relatedprompt.md +4 -1
  221. package/docs/API-reference/api/x-types.relatedprompt.nextqueries.md +1 -1
  222. package/docs/API-reference/api/x-types.relatedprompt.relatedpromptnextqueries.md +13 -0
  223. package/docs/API-reference/api/x-types.relatedprompt.tagging.md +17 -0
  224. package/docs/API-reference/api/x-types.relatedprompt.toolingdisplaytagging.md +13 -0
  225. package/docs/API-reference/api/x-types.relatedpromptnextquery.md +23 -0
  226. package/docs/API-reference/api/x-types.relatedpromptnextquery.query.md +13 -0
  227. package/docs/API-reference/api/x-types.relatedpromptnextquery.toolingdisplayadd2carttagging.md +13 -0
  228. package/docs/API-reference/api/x-types.relatedpromptnextquery.toolingdisplayclicktagging.md +13 -0
  229. package/docs/API-reference/api/x-types.relatedpromptnextquery.toolingdisplaytagging.md +13 -0
  230. package/docs/API-reference/api/x-types.searchresponse.md +1 -0
  231. package/docs/API-reference/api/x-types.searchresponse.stats.md +11 -0
  232. package/docs/API-reference/api/x-types.stats.md +22 -0
  233. package/docs/API-reference/api/x-types.stats.price.md +14 -0
  234. package/docs/API-reference/components/common/result/x-components.base-result-image.md +2 -2
  235. package/docs/API-reference/components/common/x-components.base-slider.md +189 -0
  236. package/docs/API-reference/components/common/x-components.base-teleport.md +19 -0
  237. package/docs/API-reference/components/common/x-components.display-click-provider.md +17 -0
  238. package/docs/API-reference/components/common/x-components.items-list.md +1 -1
  239. package/docs/API-reference/components/common/x-components.page-selector.md +136 -0
  240. package/docs/API-reference/components/common/x-components.sliding-panel.md +7 -7
  241. package/docs/API-reference/components/facets/x-components.facets/facets.md +1 -1
  242. package/docs/API-reference/components/facets/x-components.lists/selected-filters-list.md +1 -1
  243. package/docs/API-reference/components/related-prompts/x-components.related-prompt.md +22 -0
  244. package/docs/API-reference/components/related-prompts/x-components.related-prompts-list.md +196 -0
  245. package/docs/API-reference/components/related-prompts/x-components.related-prompts-tag-list.md +32 -0
  246. package/docs/API-reference/components/search/x-components.results-list.md +1 -1
  247. package/docs/API-reference/components/tagging/x-components.tagging.md +15 -16
  248. package/js/components/animations/fade-and-slide.vue.js +1 -2
  249. package/js/components/animations/fade-and-slide.vue.js.map +1 -1
  250. package/js/components/base-dropdown.vue.js +1 -3
  251. package/js/components/base-dropdown.vue.js.map +1 -1
  252. package/js/components/base-dropdown.vue2.js +1 -7
  253. package/js/components/base-dropdown.vue2.js.map +1 -1
  254. package/js/components/base-event-button.vue.js +1 -2
  255. package/js/components/base-event-button.vue.js.map +1 -1
  256. package/js/components/base-grid.vue.js +11 -18
  257. package/js/components/base-grid.vue.js.map +1 -1
  258. package/js/components/base-grid.vue2.js.map +1 -1
  259. package/js/components/base-grid.vue3.js +1 -1
  260. package/js/components/base-keyboard-navigation.vue.js +1 -2
  261. package/js/components/base-keyboard-navigation.vue.js.map +1 -1
  262. package/js/components/base-rating.vue.js +1 -3
  263. package/js/components/base-rating.vue.js.map +1 -1
  264. package/js/components/base-slider.vue.js +65 -0
  265. package/js/components/base-slider.vue.js.map +1 -0
  266. package/js/components/base-slider.vue2.js +109 -0
  267. package/js/components/base-slider.vue2.js.map +1 -0
  268. package/js/components/base-slider.vue3.js +7 -0
  269. package/js/components/base-slider.vue3.js.map +1 -0
  270. package/js/components/base-switch.vue.js.map +1 -1
  271. package/js/components/base-switch.vue2.js +3 -7
  272. package/js/components/base-switch.vue2.js.map +1 -1
  273. package/js/components/base-teleport.vue.js +17 -0
  274. package/js/components/base-teleport.vue.js.map +1 -0
  275. package/js/components/base-teleport.vue2.js +14 -0
  276. package/js/components/base-teleport.vue2.js.map +1 -0
  277. package/js/components/base-teleport.vue3.js +7 -0
  278. package/js/components/base-teleport.vue3.js.map +1 -0
  279. package/js/components/base-variable-column-grid.vue.js +1 -2
  280. package/js/components/base-variable-column-grid.vue.js.map +1 -1
  281. package/js/components/column-picker/base-column-picker-dropdown.vue.js +1 -3
  282. package/js/components/column-picker/base-column-picker-dropdown.vue.js.map +1 -1
  283. package/js/components/column-picker/base-column-picker-list.vue.js +1 -3
  284. package/js/components/column-picker/base-column-picker-list.vue.js.map +1 -1
  285. package/js/components/display-click-provider.vue.js +74 -0
  286. package/js/components/display-click-provider.vue.js.map +1 -0
  287. package/js/components/display-click-provider.vue2.js +6 -0
  288. package/js/components/display-click-provider.vue2.js.map +1 -0
  289. package/js/components/filters/labels/base-rating-filter-label.vue.js +1 -3
  290. package/js/components/filters/labels/base-rating-filter-label.vue.js.map +1 -1
  291. package/js/components/icons/cross-tiny.vue.js +2 -2
  292. package/js/components/icons/plus.vue.js +2 -2
  293. package/js/components/items-list.vue.js +1 -2
  294. package/js/components/items-list.vue.js.map +1 -1
  295. package/js/components/items-list.vue2.js +2 -2
  296. package/js/components/items-list.vue2.js.map +1 -1
  297. package/js/components/layouts/fixed-header-and-asides-layout.vue.js +1 -7
  298. package/js/components/layouts/fixed-header-and-asides-layout.vue.js.map +1 -1
  299. package/js/components/layouts/multi-column-max-width-layout.vue.js +1 -9
  300. package/js/components/layouts/multi-column-max-width-layout.vue.js.map +1 -1
  301. package/js/components/layouts/single-column-layout.vue.js +1 -9
  302. package/js/components/layouts/single-column-layout.vue.js.map +1 -1
  303. package/js/components/modals/base-events-modal-close.vue.js +1 -2
  304. package/js/components/modals/base-events-modal-close.vue.js.map +1 -1
  305. package/js/components/modals/base-events-modal-open.vue.js +1 -2
  306. package/js/components/modals/base-events-modal-open.vue.js.map +1 -1
  307. package/js/components/modals/base-id-modal-close.vue.js +1 -2
  308. package/js/components/modals/base-id-modal-close.vue.js.map +1 -1
  309. package/js/components/modals/base-id-modal-open.vue.js +1 -2
  310. package/js/components/modals/base-id-modal-open.vue.js.map +1 -1
  311. package/js/components/modals/base-modal.vue.js +1 -2
  312. package/js/components/modals/base-modal.vue.js.map +1 -1
  313. package/js/components/modals/base-modal.vue2.js +13 -6
  314. package/js/components/modals/base-modal.vue2.js.map +1 -1
  315. package/js/components/page-loader-button.vue.js +8 -10
  316. package/js/components/page-loader-button.vue.js.map +1 -1
  317. package/js/components/page-loader-button.vue2.js.map +1 -1
  318. package/js/components/page-loader-button.vue3.js +7 -0
  319. package/js/components/page-loader-button.vue3.js.map +1 -0
  320. package/js/components/page-selector.vue.js +78 -0
  321. package/js/components/page-selector.vue.js.map +1 -0
  322. package/js/components/page-selector.vue2.js +128 -0
  323. package/js/components/page-selector.vue2.js.map +1 -0
  324. package/js/components/page-selector.vue3.js +7 -0
  325. package/js/components/page-selector.vue3.js.map +1 -0
  326. package/js/components/panels/base-header-toggle-panel.vue.js +1 -5
  327. package/js/components/panels/base-header-toggle-panel.vue.js.map +1 -1
  328. package/js/components/panels/base-id-toggle-panel-button.vue.js +1 -2
  329. package/js/components/panels/base-id-toggle-panel-button.vue.js.map +1 -1
  330. package/js/components/panels/base-id-toggle-panel.vue.js +1 -2
  331. package/js/components/panels/base-id-toggle-panel.vue.js.map +1 -1
  332. package/js/components/panels/base-tabs-panel.vue.js +1 -4
  333. package/js/components/panels/base-tabs-panel.vue.js.map +1 -1
  334. package/js/components/panels/base-toggle-panel.vue.js +1 -2
  335. package/js/components/panels/base-toggle-panel.vue.js.map +1 -1
  336. package/js/components/result/base-result-add-to-cart.vue.js +3 -3
  337. package/js/components/result/base-result-add-to-cart.vue.js.map +1 -1
  338. package/js/components/result/base-result-add-to-cart.vue2.js +19 -5
  339. package/js/components/result/base-result-add-to-cart.vue2.js.map +1 -1
  340. package/js/components/result/base-result-current-price.vue.js +1 -2
  341. package/js/components/result/base-result-current-price.vue.js.map +1 -1
  342. package/js/components/result/base-result-image.vue.js +39 -59
  343. package/js/components/result/base-result-image.vue.js.map +1 -1
  344. package/js/components/result/base-result-image.vue2.js +5 -5
  345. package/js/components/result/base-result-image.vue2.js.map +1 -1
  346. package/js/components/result/base-result-link.vue.js +1 -2
  347. package/js/components/result/base-result-link.vue.js.map +1 -1
  348. package/js/components/result/base-result-previous-price.vue.js +1 -2
  349. package/js/components/result/base-result-previous-price.vue.js.map +1 -1
  350. package/js/components/result/base-result-rating.vue.js +1 -4
  351. package/js/components/result/base-result-rating.vue.js.map +1 -1
  352. package/js/components/result/result-variant-selector.vue.js +1 -3
  353. package/js/components/result/result-variant-selector.vue.js.map +1 -1
  354. package/js/components/sliding-panel.vue.js +3 -6
  355. package/js/components/sliding-panel.vue.js.map +1 -1
  356. package/js/components/sliding-panel.vue2.js +2 -2
  357. package/js/components/sliding-panel.vue2.js.map +1 -1
  358. package/js/components/suggestions/base-suggestion.vue.js +1 -2
  359. package/js/components/suggestions/base-suggestion.vue.js.map +1 -1
  360. package/js/components/suggestions/base-suggestions.vue.js +1 -2
  361. package/js/components/suggestions/base-suggestions.vue.js.map +1 -1
  362. package/js/composables/use-alias-api.js +4 -1
  363. package/js/composables/use-alias-api.js.map +1 -1
  364. package/js/composables/use-getter.js +1 -1
  365. package/js/composables/use-state.js +1 -1
  366. package/js/directives/typing.js +58 -0
  367. package/js/directives/typing.js.map +1 -0
  368. package/js/index.js +21 -4
  369. package/js/index.js.map +1 -1
  370. package/js/types/animation-prop.js +5 -0
  371. package/js/types/animation-prop.js.map +1 -1
  372. package/js/x-installer/x-installer/x-installer.js +3 -3
  373. package/js/x-installer/x-installer/x-installer.js.map +1 -1
  374. package/js/x-modules/device/store/emitters.js +1 -0
  375. package/js/x-modules/device/store/emitters.js.map +1 -1
  376. package/js/x-modules/empathize/components/empathize.vue.js +1 -2
  377. package/js/x-modules/empathize/components/empathize.vue.js.map +1 -1
  378. package/js/x-modules/empathize/components/empathize.vue2.js +10 -3
  379. package/js/x-modules/empathize/components/empathize.vue2.js.map +1 -1
  380. package/js/x-modules/empathize/store/emitters.js +1 -0
  381. package/js/x-modules/empathize/store/emitters.js.map +1 -1
  382. package/js/x-modules/experience-controls/store/emitters.js +1 -0
  383. package/js/x-modules/experience-controls/store/emitters.js.map +1 -1
  384. package/js/x-modules/extra-params/components/extra-params.vue.js +1 -1
  385. package/js/x-modules/extra-params/components/extra-params.vue.js.map +1 -1
  386. package/js/x-modules/extra-params/store/emitters.js +1 -0
  387. package/js/x-modules/extra-params/store/emitters.js.map +1 -1
  388. package/js/x-modules/facets/components/facets/facets.vue.js +20 -33
  389. package/js/x-modules/facets/components/facets/facets.vue.js.map +1 -1
  390. package/js/x-modules/facets/components/facets/facets.vue2.js +2 -2
  391. package/js/x-modules/facets/components/facets/facets.vue2.js.map +1 -1
  392. package/js/x-modules/facets/components/filters/all-filter.vue.js +1 -2
  393. package/js/x-modules/facets/components/filters/all-filter.vue.js.map +1 -1
  394. package/js/x-modules/facets/components/filters/editable-number-range-filter.vue.js +1 -6
  395. package/js/x-modules/facets/components/filters/editable-number-range-filter.vue.js.map +1 -1
  396. package/js/x-modules/facets/components/filters/hierarchical-filter.vue.js +1 -3
  397. package/js/x-modules/facets/components/filters/hierarchical-filter.vue.js.map +1 -1
  398. package/js/x-modules/facets/components/filters/number-range-filter.vue.js +1 -3
  399. package/js/x-modules/facets/components/filters/number-range-filter.vue.js.map +1 -1
  400. package/js/x-modules/facets/components/filters/simple-filter.vue.js +1 -3
  401. package/js/x-modules/facets/components/filters/simple-filter.vue.js.map +1 -1
  402. package/js/x-modules/facets/components/lists/filters-list.vue.js +1 -2
  403. package/js/x-modules/facets/components/lists/filters-list.vue.js.map +1 -1
  404. package/js/x-modules/facets/components/lists/filters-search.vue.js +1 -3
  405. package/js/x-modules/facets/components/lists/filters-search.vue.js.map +1 -1
  406. package/js/x-modules/facets/components/lists/selected-filters-list.vue.js +11 -18
  407. package/js/x-modules/facets/components/lists/selected-filters-list.vue.js.map +1 -1
  408. package/js/x-modules/facets/components/lists/selected-filters-list.vue2.js +2 -2
  409. package/js/x-modules/facets/components/lists/selected-filters-list.vue2.js.map +1 -1
  410. package/js/x-modules/facets/components/lists/sliced-filters.vue.js +1 -4
  411. package/js/x-modules/facets/components/lists/sliced-filters.vue.js.map +1 -1
  412. package/js/x-modules/history-queries/components/clear-history-queries.vue.js +1 -2
  413. package/js/x-modules/history-queries/components/clear-history-queries.vue.js.map +1 -1
  414. package/js/x-modules/history-queries/components/history-queries.vue.js +1 -10
  415. package/js/x-modules/history-queries/components/history-queries.vue.js.map +1 -1
  416. package/js/x-modules/history-queries/components/history-query.vue.js +1 -6
  417. package/js/x-modules/history-queries/components/history-query.vue.js.map +1 -1
  418. package/js/x-modules/history-queries/components/my-history.vue.js +1 -4
  419. package/js/x-modules/history-queries/components/my-history.vue.js.map +1 -1
  420. package/js/x-modules/history-queries/components/remove-history-query.vue.js +1 -2
  421. package/js/x-modules/history-queries/components/remove-history-query.vue.js.map +1 -1
  422. package/js/x-modules/history-queries/store/emitters.js +1 -0
  423. package/js/x-modules/history-queries/store/emitters.js.map +1 -1
  424. package/js/x-modules/identifier-results/components/identifier-results.vue.js +1 -2
  425. package/js/x-modules/identifier-results/components/identifier-results.vue.js.map +1 -1
  426. package/js/x-modules/identifier-results/store/emitters.js +1 -0
  427. package/js/x-modules/identifier-results/store/emitters.js.map +1 -1
  428. package/js/x-modules/next-queries/components/next-queries.vue.js +1 -7
  429. package/js/x-modules/next-queries/components/next-queries.vue.js.map +1 -1
  430. package/js/x-modules/next-queries/components/next-query-preview.vue.js +1 -3
  431. package/js/x-modules/next-queries/components/next-query-preview.vue.js.map +1 -1
  432. package/js/x-modules/next-queries/components/next-query.vue.js +1 -4
  433. package/js/x-modules/next-queries/components/next-query.vue.js.map +1 -1
  434. package/js/x-modules/next-queries/store/emitters.js +1 -0
  435. package/js/x-modules/next-queries/store/emitters.js.map +1 -1
  436. package/js/x-modules/popular-searches/components/popular-search.vue.js +1 -4
  437. package/js/x-modules/popular-searches/components/popular-search.vue.js.map +1 -1
  438. package/js/x-modules/popular-searches/components/popular-searches.vue.js +1 -7
  439. package/js/x-modules/popular-searches/components/popular-searches.vue.js.map +1 -1
  440. package/js/x-modules/queries-preview/components/query-preview-button.vue.js +1 -2
  441. package/js/x-modules/queries-preview/components/query-preview-button.vue.js.map +1 -1
  442. package/js/x-modules/queries-preview/components/query-preview-button.vue2.js +8 -0
  443. package/js/x-modules/queries-preview/components/query-preview-button.vue2.js.map +1 -1
  444. package/js/x-modules/queries-preview/components/query-preview-list.vue.js.map +1 -1
  445. package/js/x-modules/queries-preview/components/query-preview-list.vue2.js +15 -2
  446. package/js/x-modules/queries-preview/components/query-preview-list.vue2.js.map +1 -1
  447. package/js/x-modules/queries-preview/components/query-preview.vue.js +1 -2
  448. package/js/x-modules/queries-preview/components/query-preview.vue.js.map +1 -1
  449. package/js/x-modules/queries-preview/components/query-preview.vue2.js +9 -1
  450. package/js/x-modules/queries-preview/components/query-preview.vue2.js.map +1 -1
  451. package/js/x-modules/queries-preview/store/actions/fetch-and-save-query-preview.action.js +2 -1
  452. package/js/x-modules/queries-preview/store/actions/fetch-and-save-query-preview.action.js.map +1 -1
  453. package/js/x-modules/queries-preview/store/emitters.js +1 -0
  454. package/js/x-modules/queries-preview/store/emitters.js.map +1 -1
  455. package/js/x-modules/queries-preview/store/module.js +1 -1
  456. package/js/x-modules/queries-preview/store/module.js.map +1 -1
  457. package/js/x-modules/queries-preview/utils/get-hash-from-query-preview.js +6 -4
  458. package/js/x-modules/queries-preview/utils/get-hash-from-query-preview.js.map +1 -1
  459. package/js/x-modules/query-suggestions/components/query-suggestion.vue.js +1 -4
  460. package/js/x-modules/query-suggestions/components/query-suggestion.vue.js.map +1 -1
  461. package/js/x-modules/query-suggestions/components/query-suggestions.vue.js +1 -7
  462. package/js/x-modules/query-suggestions/components/query-suggestions.vue.js.map +1 -1
  463. package/js/x-modules/query-suggestions/store/emitters.js +1 -0
  464. package/js/x-modules/query-suggestions/store/emitters.js.map +1 -1
  465. package/js/x-modules/recommendations/components/recommendations.vue.js +1 -2
  466. package/js/x-modules/recommendations/components/recommendations.vue.js.map +1 -1
  467. package/js/x-modules/recommendations/store/emitters.js +1 -0
  468. package/js/x-modules/recommendations/store/emitters.js.map +1 -1
  469. package/js/x-modules/related-prompts/components/related-prompt.vue.js +27 -0
  470. package/js/x-modules/related-prompts/components/related-prompt.vue.js.map +1 -0
  471. package/js/x-modules/related-prompts/components/related-prompt.vue2.js +31 -0
  472. package/js/x-modules/related-prompts/components/related-prompt.vue2.js.map +1 -0
  473. package/js/x-modules/related-prompts/components/related-prompt.vue3.js +7 -0
  474. package/js/x-modules/related-prompts/components/related-prompt.vue3.js.map +1 -0
  475. package/js/x-modules/related-prompts/components/related-prompts-list.vue.js +154 -0
  476. package/js/x-modules/related-prompts/components/related-prompts-list.vue.js.map +1 -0
  477. package/js/x-modules/related-prompts/components/related-prompts-list.vue2.js +6 -0
  478. package/js/x-modules/related-prompts/components/related-prompts-list.vue2.js.map +1 -0
  479. package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue.js +101 -0
  480. package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue.js.map +1 -0
  481. package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue2.js +221 -0
  482. package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue2.js.map +1 -0
  483. package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue3.js +7 -0
  484. package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue3.js.map +1 -0
  485. package/js/x-modules/related-prompts/store/actions/fetch-and-save-related-prompts.action.js +29 -0
  486. package/js/x-modules/related-prompts/store/actions/fetch-and-save-related-prompts.action.js.map +1 -0
  487. package/js/x-modules/related-prompts/store/actions/fetch-related-prompts.action.js +20 -0
  488. package/js/x-modules/related-prompts/store/actions/fetch-related-prompts.action.js.map +1 -0
  489. package/js/x-modules/related-prompts/store/actions/set-url-params.action.js +15 -0
  490. package/js/x-modules/related-prompts/store/actions/set-url-params.action.js.map +1 -0
  491. package/js/x-modules/related-prompts/store/emitters.js +16 -0
  492. package/js/x-modules/related-prompts/store/emitters.js.map +1 -0
  493. package/js/x-modules/related-prompts/store/getters/related-prompts-query.getter.js +18 -0
  494. package/js/x-modules/related-prompts/store/getters/related-prompts-query.getter.js.map +1 -0
  495. package/js/x-modules/related-prompts/store/getters/request.getter.js +17 -0
  496. package/js/x-modules/related-prompts/store/getters/request.getter.js.map +1 -0
  497. package/js/x-modules/related-prompts/store/module.js +64 -0
  498. package/js/x-modules/related-prompts/store/module.js.map +1 -0
  499. package/js/x-modules/related-prompts/wiring.js +82 -0
  500. package/js/x-modules/related-prompts/wiring.js.map +1 -0
  501. package/js/x-modules/related-prompts/x-module.js +21 -0
  502. package/js/x-modules/related-prompts/x-module.js.map +1 -0
  503. package/js/x-modules/related-tags/components/related-tag.vue.js +1 -2
  504. package/js/x-modules/related-tags/components/related-tag.vue.js.map +1 -1
  505. package/js/x-modules/related-tags/components/related-tags.vue.js +1 -4
  506. package/js/x-modules/related-tags/components/related-tags.vue.js.map +1 -1
  507. package/js/x-modules/related-tags/store/emitters.js +1 -0
  508. package/js/x-modules/related-tags/store/emitters.js.map +1 -1
  509. package/js/x-modules/scroll/components/scroll-to-top.vue.js +1 -2
  510. package/js/x-modules/scroll/components/scroll-to-top.vue.js.map +1 -1
  511. package/js/x-modules/scroll/components/scroll-to-top.vue2.js +8 -0
  512. package/js/x-modules/scroll/components/scroll-to-top.vue2.js.map +1 -1
  513. package/js/x-modules/scroll/store/emitters.js +1 -0
  514. package/js/x-modules/scroll/store/emitters.js.map +1 -1
  515. package/js/x-modules/search/components/partial-results-list.vue.js +1 -2
  516. package/js/x-modules/search/components/partial-results-list.vue.js.map +1 -1
  517. package/js/x-modules/search/components/results-list.vue.js +2 -2
  518. package/js/x-modules/search/components/results-list.vue.js.map +1 -1
  519. package/js/x-modules/search/components/sort-dropdown.vue.js +1 -3
  520. package/js/x-modules/search/components/sort-dropdown.vue.js.map +1 -1
  521. package/js/x-modules/search/store/actions/fetch-and-save-search-response.action.js +10 -3
  522. package/js/x-modules/search/store/actions/fetch-and-save-search-response.action.js.map +1 -1
  523. package/js/x-modules/search/store/actions/save-search-response.action.js +3 -1
  524. package/js/x-modules/search/store/actions/save-search-response.action.js.map +1 -1
  525. package/js/x-modules/search/store/emitters.js +1 -0
  526. package/js/x-modules/search/store/emitters.js.map +1 -1
  527. package/js/x-modules/search/store/module.js +9 -3
  528. package/js/x-modules/search/store/module.js.map +1 -1
  529. package/js/x-modules/search/wiring.js +4 -0
  530. package/js/x-modules/search/wiring.js.map +1 -1
  531. package/js/x-modules/search-box/components/clear-search-input.vue.js +1 -2
  532. package/js/x-modules/search-box/components/clear-search-input.vue.js.map +1 -1
  533. package/js/x-modules/search-box/components/search-button.vue.js +1 -2
  534. package/js/x-modules/search-box/components/search-button.vue.js.map +1 -1
  535. package/js/x-modules/search-box/store/emitters.js +1 -0
  536. package/js/x-modules/search-box/store/emitters.js.map +1 -1
  537. package/js/x-modules/semantic-queries/components/semantic-queries.vue.js +1 -3
  538. package/js/x-modules/semantic-queries/components/semantic-queries.vue.js.map +1 -1
  539. package/js/x-modules/semantic-queries/components/semantic-query.vue.js +1 -4
  540. package/js/x-modules/semantic-queries/components/semantic-query.vue.js.map +1 -1
  541. package/js/x-modules/semantic-queries/store/getters/normalized-query.getter.js +1 -1
  542. package/js/x-modules/semantic-queries/store/getters/normalized-query.getter.js.map +1 -1
  543. package/js/x-modules/semantic-queries/store/getters/request.getter.js +5 -4
  544. package/js/x-modules/semantic-queries/store/getters/request.getter.js.map +1 -1
  545. package/js/x-modules/semantic-queries/store/getters/semanti-queries-query.getter.js +18 -0
  546. package/js/x-modules/semantic-queries/store/getters/semanti-queries-query.getter.js.map +1 -0
  547. package/js/x-modules/semantic-queries/store/module.js +8 -2
  548. package/js/x-modules/semantic-queries/store/module.js.map +1 -1
  549. package/js/x-modules/semantic-queries/wiring.js +5 -0
  550. package/js/x-modules/semantic-queries/wiring.js.map +1 -1
  551. package/js/x-modules/tagging/components/tagging.vue.js +8 -7
  552. package/js/x-modules/tagging/components/tagging.vue.js.map +1 -1
  553. package/js/x-modules/tagging/service/{pdp-add-to-cart.service.js → external-tagging.service.js} +56 -25
  554. package/js/x-modules/tagging/service/external-tagging.service.js.map +1 -0
  555. package/js/x-modules/tagging/store/emitters.js +1 -1
  556. package/js/x-modules/tagging/store/emitters.js.map +1 -1
  557. package/js/x-modules/tagging/store/module.js +7 -3
  558. package/js/x-modules/tagging/store/module.js.map +1 -1
  559. package/js/x-modules/tagging/wiring.js +110 -9
  560. package/js/x-modules/tagging/wiring.js.map +1 -1
  561. package/js/x-modules/url/components/url-handler.vue.js.map +1 -1
  562. package/js/x-modules/url/components/url-handler.vue2.js +4 -5
  563. package/js/x-modules/url/components/url-handler.vue2.js.map +1 -1
  564. package/js/x-modules/url/store/emitters.js +1 -0
  565. package/js/x-modules/url/store/emitters.js.map +1 -1
  566. package/js/x-modules/url/store/getters/url-params.getter.js +2 -3
  567. package/js/x-modules/url/store/getters/url-params.getter.js.map +1 -1
  568. package/js/x-modules/url/store/initial-state.js +2 -1
  569. package/js/x-modules/url/store/initial-state.js.map +1 -1
  570. package/js/x-modules/url/store/module.js +3 -0
  571. package/js/x-modules/url/store/module.js.map +1 -1
  572. package/js/x-modules/url/wiring.js +10 -1
  573. package/js/x-modules/url/wiring.js.map +1 -1
  574. package/package.json +50 -49
  575. package/related-prompts/index.d.ts +1 -0
  576. package/related-prompts/index.js +9 -0
  577. package/report/x-adapter-platform.api.json +895 -67
  578. package/report/x-components.api.json +16491 -17162
  579. package/report/x-components.api.md +847 -215
  580. package/report/x-types.api.json +320 -4
  581. package/tagging/index.js +2 -2
  582. package/types/adapter/mocked-responses.d.ts +3 -0
  583. package/types/adapter/mocked-responses.d.ts.map +1 -1
  584. package/types/components/base-dropdown.vue.d.ts +5 -5
  585. package/types/components/base-dropdown.vue.d.ts.map +1 -1
  586. package/types/components/base-grid.vue.d.ts +3 -3
  587. package/types/components/base-slider.vue.d.ts +74 -0
  588. package/types/components/base-slider.vue.d.ts.map +1 -0
  589. package/types/components/base-switch.vue.d.ts +2 -1
  590. package/types/components/base-switch.vue.d.ts.map +1 -1
  591. package/types/components/base-teleport.vue.d.ts +13 -0
  592. package/types/components/base-teleport.vue.d.ts.map +1 -0
  593. package/types/components/base-variable-column-grid.vue.d.ts +3 -3
  594. package/types/components/display-click-provider.vue.d.ts +61 -0
  595. package/types/components/display-click-provider.vue.d.ts.map +1 -0
  596. package/types/components/global-x-bus.vue.d.ts +14 -0
  597. package/types/components/global-x-bus.vue.d.ts.map +1 -1
  598. package/types/components/index.d.ts +4 -0
  599. package/types/components/index.d.ts.map +1 -1
  600. package/types/components/items-list.vue.d.ts +3 -3
  601. package/types/components/layouts/multi-column-max-width-layout.vue.d.ts +5 -5
  602. package/types/components/layouts/single-column-layout.vue.d.ts +3 -3
  603. package/types/components/modals/base-events-modal.vue.d.ts +2 -2
  604. package/types/components/modals/base-id-modal.vue.d.ts +2 -2
  605. package/types/components/modals/base-modal.vue.d.ts +10 -10
  606. package/types/components/modals/base-modal.vue.d.ts.map +1 -1
  607. package/types/components/modals/main-modal.vue.d.ts +2 -2
  608. package/types/components/page-selector.vue.d.ts +125 -0
  609. package/types/components/page-selector.vue.d.ts.map +1 -0
  610. package/types/components/panels/base-header-toggle-panel.vue.d.ts +5 -5
  611. package/types/components/panels/base-id-toggle-panel.vue.d.ts +5 -5
  612. package/types/components/panels/base-tabs-panel.vue.d.ts +8 -8
  613. package/types/components/panels/base-toggle-panel.vue.d.ts +3 -3
  614. package/types/components/result/base-result-add-to-cart.vue.d.ts +2 -0
  615. package/types/components/result/base-result-add-to-cart.vue.d.ts.map +1 -1
  616. package/types/components/result/base-result-image.vue.d.ts +10 -10
  617. package/types/components/result/base-result-image.vue.d.ts.map +1 -1
  618. package/types/components/sliding-panel.vue.d.ts +15 -5
  619. package/types/components/sliding-panel.vue.d.ts.map +1 -1
  620. package/types/components/snippet-callbacks.vue.d.ts +7 -0
  621. package/types/components/snippet-callbacks.vue.d.ts.map +1 -1
  622. package/types/components/suggestions/base-suggestions.vue.d.ts +3 -3
  623. package/types/composables/use-alias-api.d.ts +5 -0
  624. package/types/composables/use-alias-api.d.ts.map +1 -1
  625. package/types/composables/use-store.d.ts +2 -2
  626. package/types/composables/use-store.d.ts.map +1 -1
  627. package/types/directives/index.d.ts +1 -0
  628. package/types/directives/index.d.ts.map +1 -1
  629. package/types/directives/typing.d.ts +35 -0
  630. package/types/directives/typing.d.ts.map +1 -0
  631. package/types/index.d.ts +1 -0
  632. package/types/index.d.ts.map +1 -1
  633. package/types/store/index.d.ts +4 -1
  634. package/types/store/index.d.ts.map +1 -1
  635. package/types/tailwind/plugin-options.d.ts +1 -2
  636. package/types/tailwind/plugin-options.d.ts.map +1 -1
  637. package/types/types/animation-prop.d.ts +6 -2
  638. package/types/types/animation-prop.d.ts.map +1 -1
  639. package/types/types/origin.d.ts +3 -3
  640. package/types/types/origin.d.ts.map +1 -1
  641. package/types/types/page-mode.d.ts +2 -0
  642. package/types/types/page-mode.d.ts.map +1 -0
  643. package/types/types/url-params.d.ts +1 -0
  644. package/types/types/url-params.d.ts.map +1 -1
  645. package/types/views/home/types.d.ts +3 -0
  646. package/types/views/home/types.d.ts.map +1 -1
  647. package/types/wiring/events.types.d.ts +3 -1
  648. package/types/wiring/events.types.d.ts.map +1 -1
  649. package/types/x-installer/x-installer/types.d.ts +2 -2
  650. package/types/x-installer/x-installer/types.d.ts.map +1 -1
  651. package/types/x-installer/x-installer/x-installer.d.ts +4 -4
  652. package/types/x-installer/x-installer/x-installer.d.ts.map +1 -1
  653. package/types/x-modules/empathize/components/empathize.vue.d.ts +6 -6
  654. package/types/x-modules/empathize/components/empathize.vue.d.ts.map +1 -1
  655. package/types/x-modules/facets/components/facets/facets.vue.d.ts +3 -3
  656. package/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts +9 -2
  657. package/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts.map +1 -1
  658. package/types/x-modules/facets/components/filters/simple-filter.vue.d.ts +7 -0
  659. package/types/x-modules/facets/components/filters/simple-filter.vue.d.ts.map +1 -1
  660. package/types/x-modules/facets/components/lists/filters-list.vue.d.ts +3 -3
  661. package/types/x-modules/facets/components/lists/selected-filters-list.vue.d.ts +3 -3
  662. package/types/x-modules/history-queries/components/my-history.vue.d.ts +3 -3
  663. package/types/x-modules/identifier-results/components/identifier-results.vue.d.ts +3 -3
  664. package/types/x-modules/next-queries/components/next-queries-list.vue.d.ts +3 -3
  665. package/types/x-modules/next-queries/index.d.ts +1 -0
  666. package/types/x-modules/next-queries/index.d.ts.map +1 -1
  667. package/types/x-modules/queries-preview/components/query-preview-list.vue.d.ts +3 -3
  668. package/types/x-modules/queries-preview/components/query-preview-list.vue.d.ts.map +1 -1
  669. package/types/x-modules/queries-preview/components/query-preview.vue.d.ts.map +1 -1
  670. package/types/x-modules/queries-preview/store/actions/fetch-and-save-query-preview.action.d.ts.map +1 -1
  671. package/types/x-modules/queries-preview/store/module.d.ts.map +1 -1
  672. package/types/x-modules/queries-preview/utils/get-hash-from-query-preview.d.ts +4 -2
  673. package/types/x-modules/queries-preview/utils/get-hash-from-query-preview.d.ts.map +1 -1
  674. package/types/x-modules/recommendations/components/recommendations.vue.d.ts +3 -3
  675. package/types/x-modules/related-prompts/components/index.d.ts +4 -0
  676. package/types/x-modules/related-prompts/components/index.d.ts.map +1 -0
  677. package/types/x-modules/related-prompts/components/related-prompt.vue.d.ts +28 -0
  678. package/types/x-modules/related-prompts/components/related-prompt.vue.d.ts.map +1 -0
  679. package/types/x-modules/related-prompts/components/related-prompts-list.vue.d.ts +106 -0
  680. package/types/x-modules/related-prompts/components/related-prompts-list.vue.d.ts.map +1 -0
  681. package/types/x-modules/related-prompts/components/related-prompts-tag-list.vue.d.ts +131 -0
  682. package/types/x-modules/related-prompts/components/related-prompts-tag-list.vue.d.ts.map +1 -0
  683. package/types/x-modules/related-prompts/events.types.d.ts +41 -0
  684. package/types/x-modules/related-prompts/events.types.d.ts.map +1 -0
  685. package/types/x-modules/related-prompts/index.d.ts +6 -0
  686. package/types/x-modules/related-prompts/index.d.ts.map +1 -0
  687. package/types/x-modules/related-prompts/store/actions/fetch-and-save-related-prompts.action.d.ts +17 -0
  688. package/types/x-modules/related-prompts/store/actions/fetch-and-save-related-prompts.action.d.ts.map +1 -0
  689. package/types/x-modules/related-prompts/store/actions/fetch-related-prompts.action.d.ts +13 -0
  690. package/types/x-modules/related-prompts/store/actions/fetch-related-prompts.action.d.ts.map +1 -0
  691. package/types/x-modules/related-prompts/store/actions/set-url-params.action.d.ts +11 -0
  692. package/types/x-modules/related-prompts/store/actions/set-url-params.action.d.ts.map +1 -0
  693. package/types/x-modules/related-prompts/store/emitters.d.ts +10 -0
  694. package/types/x-modules/related-prompts/store/emitters.d.ts.map +1 -0
  695. package/types/x-modules/related-prompts/store/getters/index.d.ts +3 -0
  696. package/types/x-modules/related-prompts/store/getters/index.d.ts.map +1 -0
  697. package/types/x-modules/related-prompts/store/getters/related-prompts-query.getter.d.ts +13 -0
  698. package/types/x-modules/related-prompts/store/getters/related-prompts-query.getter.d.ts.map +1 -0
  699. package/types/x-modules/related-prompts/store/getters/request.getter.d.ts +14 -0
  700. package/types/x-modules/related-prompts/store/getters/request.getter.d.ts.map +1 -0
  701. package/types/x-modules/related-prompts/store/index.d.ts +6 -0
  702. package/types/x-modules/related-prompts/store/index.d.ts.map +1 -0
  703. package/types/x-modules/related-prompts/store/module.d.ts +8 -0
  704. package/types/x-modules/related-prompts/store/module.d.ts.map +1 -0
  705. package/types/x-modules/related-prompts/store/types.d.ts +125 -0
  706. package/types/x-modules/related-prompts/store/types.d.ts.map +1 -0
  707. package/types/x-modules/related-prompts/types.d.ts +10 -0
  708. package/types/x-modules/related-prompts/types.d.ts.map +1 -0
  709. package/types/x-modules/related-prompts/wiring.d.ts +42 -0
  710. package/types/x-modules/related-prompts/wiring.d.ts.map +1 -0
  711. package/types/x-modules/related-prompts/x-module.d.ts +16 -0
  712. package/types/x-modules/related-prompts/x-module.d.ts.map +1 -0
  713. package/types/x-modules/related-tags/components/related-tags.vue.d.ts +3 -3
  714. package/types/x-modules/scroll/components/scroll-to-top.vue.d.ts +5 -5
  715. package/types/x-modules/search/components/banners-list.vue.d.ts +3 -3
  716. package/types/x-modules/search/components/partial-results-list.vue.d.ts +3 -3
  717. package/types/x-modules/search/components/promoteds-list.vue.d.ts +3 -3
  718. package/types/x-modules/search/components/results-list.vue.d.ts +3 -3
  719. package/types/x-modules/search/components/sort-dropdown.vue.d.ts +1 -1
  720. package/types/x-modules/search/config.types.d.ts +2 -0
  721. package/types/x-modules/search/config.types.d.ts.map +1 -1
  722. package/types/x-modules/search/events.types.d.ts +4 -0
  723. package/types/x-modules/search/events.types.d.ts.map +1 -1
  724. package/types/x-modules/search/store/actions/fetch-and-save-search-response.action.d.ts.map +1 -1
  725. package/types/x-modules/search/store/actions/save-search-response.action.d.ts.map +1 -1
  726. package/types/x-modules/search/store/module.d.ts +2 -0
  727. package/types/x-modules/search/store/module.d.ts.map +1 -1
  728. package/types/x-modules/search/store/types.d.ts +9 -1
  729. package/types/x-modules/search/store/types.d.ts.map +1 -1
  730. package/types/x-modules/search/wiring.d.ts +4 -0
  731. package/types/x-modules/search/wiring.d.ts.map +1 -1
  732. package/types/x-modules/search-box/components/search-input-placeholder.vue.d.ts +3 -3
  733. package/types/x-modules/semantic-queries/store/getters/index.d.ts +1 -0
  734. package/types/x-modules/semantic-queries/store/getters/index.d.ts.map +1 -1
  735. package/types/x-modules/semantic-queries/store/getters/normalized-query.getter.d.ts +1 -1
  736. package/types/x-modules/semantic-queries/store/getters/request.getter.d.ts +2 -1
  737. package/types/x-modules/semantic-queries/store/getters/request.getter.d.ts.map +1 -1
  738. package/types/x-modules/semantic-queries/store/getters/semanti-queries-query.getter.d.ts +13 -0
  739. package/types/x-modules/semantic-queries/store/getters/semanti-queries-query.getter.d.ts.map +1 -0
  740. package/types/x-modules/semantic-queries/store/module.d.ts.map +1 -1
  741. package/types/x-modules/semantic-queries/store/types.d.ts +13 -1
  742. package/types/x-modules/semantic-queries/store/types.d.ts.map +1 -1
  743. package/types/x-modules/semantic-queries/wiring.d.ts +3 -0
  744. package/types/x-modules/semantic-queries/wiring.d.ts.map +1 -1
  745. package/types/x-modules/tagging/components/tagging.vue.d.ts +14 -12
  746. package/types/x-modules/tagging/components/tagging.vue.d.ts.map +1 -1
  747. package/types/x-modules/tagging/config.types.d.ts +3 -3
  748. package/types/x-modules/tagging/config.types.d.ts.map +1 -1
  749. package/types/x-modules/tagging/events.types.d.ts +2 -2
  750. package/types/x-modules/tagging/service/{pdp-add-to-cart.service.d.ts → external-tagging.service.d.ts} +31 -13
  751. package/types/x-modules/tagging/service/external-tagging.service.d.ts.map +1 -0
  752. package/types/x-modules/tagging/service/index.d.ts +1 -1
  753. package/types/x-modules/tagging/service/index.d.ts.map +1 -1
  754. package/types/x-modules/tagging/service/types.d.ts +13 -4
  755. package/types/x-modules/tagging/service/types.d.ts.map +1 -1
  756. package/types/x-modules/tagging/store/module.d.ts.map +1 -1
  757. package/types/x-modules/tagging/wiring.d.ts +54 -2
  758. package/types/x-modules/tagging/wiring.d.ts.map +1 -1
  759. package/types/x-modules/url/components/url-handler.vue.d.ts.map +1 -1
  760. package/types/x-modules/url/store/getters/url-params.getter.d.ts +2 -3
  761. package/types/x-modules/url/store/getters/url-params.getter.d.ts.map +1 -1
  762. package/types/x-modules/url/store/initial-state.d.ts.map +1 -1
  763. package/types/x-modules/url/store/module.d.ts.map +1 -1
  764. package/types/x-modules/url/store/types.d.ts +6 -0
  765. package/types/x-modules/url/store/types.d.ts.map +1 -1
  766. package/types/x-modules/url/wiring.d.ts +9 -0
  767. package/types/x-modules/url/wiring.d.ts.map +1 -1
  768. package/types/x-modules/x-modules.types.d.ts +2 -0
  769. package/types/x-modules/x-modules.types.d.ts.map +1 -1
  770. package/url/index.js +1 -1
  771. package/docs/API-reference/api/x-components.defaultpdpaddtocartservice.clickedresultstoragekey.md +0 -11
  772. package/docs/API-reference/api/x-components.defaultpdpaddtocartservice.clickedresultstoragettlms.md +0 -11
  773. package/docs/API-reference/api/x-components.defaultpdpaddtocartservice.instance.md +0 -13
  774. package/docs/API-reference/api/x-components.defaultpdpaddtocartservice.localstorageservice.md +0 -11
  775. package/docs/API-reference/api/x-components.defaultpdpaddtocartservice.md +0 -41
  776. package/docs/API-reference/api/x-components.defaultpdpaddtocartservice.result_clicked_id_key.md +0 -13
  777. package/docs/API-reference/api/x-components.defaultpdpaddtocartservice.sessionstorageservice.md +0 -11
  778. package/docs/API-reference/api/x-components.pdpaddtocartservice.md +0 -22
  779. package/docs/API-reference/api/x-components.taggingconfig.clickedresultstoragettlms.md +0 -13
  780. package/docs/API-reference/api/x-components.usestore.md +0 -19
  781. package/docs/assets/features/overview-my-history.svg +0 -279
  782. package/docs/assets/features/overview-product-results-card.svg +0 -128
  783. package/docs/assets/interface/build-search-ui.svg +0 -167
  784. package/docs/assets/interface/experience-search-intro.svg +0 -1
  785. package/docs/assets/interface/integration-guide.svg +0 -1
  786. package/docs/assets/interface/integration-video.png +0 -0
  787. package/docs/assets/interface/x-architecture.svg +0 -1
  788. package/docs/assets/interface/x-empathize.gif +0 -0
  789. package/docs/assets/interface/x-facets.gif +0 -0
  790. package/docs/assets/interface/x-facets.svg +0 -189
  791. package/docs/assets/interface/x-history-queries.gif +0 -0
  792. package/docs/assets/interface/x-id-results.gif +0 -0
  793. package/docs/assets/interface/x-next-queries.gif +0 -0
  794. package/docs/assets/interface/x-popular-searches.gif +0 -0
  795. package/docs/assets/interface/x-query-suggestions.gif +0 -0
  796. package/docs/assets/interface/x-recommendations.gif +0 -0
  797. package/docs/assets/interface/x-recommendations.svg +0 -472
  798. package/docs/assets/interface/x-related-tags.gif +0 -0
  799. package/docs/assets/interface/x-results-layout.svg +0 -259
  800. package/docs/assets/interface/x-search-box-elements.svg +0 -1
  801. package/docs/assets/interface/x-search-box.svg +0 -60
  802. package/docs/build-search-ui/README.md +0 -127
  803. package/docs/build-search-ui/sidebar.js +0 -7
  804. package/docs/build-search-ui/web-archetype-development-guide.md +0 -186
  805. package/docs/build-search-ui/web-archetype-integration-guide.md +0 -458
  806. package/docs/build-search-ui/web-how-to-use-x-components-guide.md +0 -200
  807. package/docs/build-search-ui/web-x-architecture.md +0 -83
  808. package/docs/build-search-ui/web-x-components-development-guide.md +0 -157
  809. package/docs/experience-search-and-discovery/README.md +0 -132
  810. package/docs/experience-search-and-discovery/empathize.md +0 -119
  811. package/docs/experience-search-and-discovery/facets-and-filters.md +0 -154
  812. package/docs/experience-search-and-discovery/history-queries.md +0 -70
  813. package/docs/experience-search-and-discovery/id-results.md +0 -49
  814. package/docs/experience-search-and-discovery/my-history.md +0 -60
  815. package/docs/experience-search-and-discovery/next-queries.md +0 -72
  816. package/docs/experience-search-and-discovery/popular-searches.md +0 -50
  817. package/docs/experience-search-and-discovery/product-results-ui.md +0 -82
  818. package/docs/experience-search-and-discovery/query-suggestions.md +0 -48
  819. package/docs/experience-search-and-discovery/recommendations.md +0 -134
  820. package/docs/experience-search-and-discovery/related-tags.md +0 -66
  821. package/docs/experience-search-and-discovery/search-box.md +0 -99
  822. package/docs/experience-search-and-discovery/serp-ui.md +0 -125
  823. package/docs/experience-search-and-discovery/sidebar.js +0 -17
  824. package/docs/experience-search-and-discovery/web-local-storage.md +0 -30
  825. package/docs/input-status-machine-state.png +0 -0
  826. package/js/composables/use-store.js +0 -15
  827. package/js/composables/use-store.js.map +0 -1
  828. package/js/utils/options-api.js +0 -4
  829. package/js/utils/options-api.js.map +0 -1
  830. package/js/x-modules/tagging/service/pdp-add-to-cart.service.js.map +0 -1
  831. package/types/utils/options-api.d.ts +0 -3
  832. package/types/utils/options-api.d.ts.map +0 -1
  833. package/types/x-modules/tagging/service/pdp-add-to-cart.service.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"url-handler.vue.js","sources":["../../../../../src/x-modules/url/components/url-handler.vue"],"sourcesContent":["<template>\n <GlobalEvents @pageshow=\"onPageShow\" @popstate=\"emitEvents\" target=\"window\" />\n</template>\n\n<script lang=\"ts\">\n import { Dictionary, objectFilter } from '@empathyco/x-utils';\n import { computed, defineComponent, inject, onMounted, ref } from 'vue';\n import { GlobalEvents } from 'vue-global-events';\n import { FeatureLocation } from '../../../types/origin';\n import { UrlParams } from '../../../types/url-params';\n import { isArrayEmpty } from '../../../utils/array';\n import { WireMetadata } from '../../../wiring/wiring.types';\n import { SnippetConfig } from '../../../x-installer/api/api.types';\n import { initialUrlState } from '../store/initial-state';\n import { UrlParamValue } from '../store/types';\n import { urlXModule } from '../x-module';\n import { use$x } from '../../../composables/use-$x';\n import { useState } from '../../../composables/use-state';\n\n interface ParsedUrlParams {\n all: UrlParams;\n extra: Dictionary<unknown>;\n }\n\n /**\n * This component manages the browser URL parameters to preserve them through reloads and browser\n * history navigation. It allow to configure the default url parameter names using its attributes.\n * This component doesn't render elements to the DOM.\n *\n * @public\n */\n export default defineComponent({\n name: 'UrlHandler',\n components: {\n GlobalEvents\n },\n xModule: urlXModule.name,\n setup: function (props, { attrs }) {\n const $x = use$x();\n\n const initialExtraParams = useState('url', ['initialExtraParams']).initialExtraParams;\n\n /**\n * The {@link SnippetConfig} provided by an ancestor.\n *\n * @internal\n */\n const snippetConfig = inject<SnippetConfig | undefined>('snippetConfig');\n\n /**\n * Flag to know if the params were already loaded from the URL.\n *\n * @internal\n */\n const urlLoaded = ref(false);\n\n /**\n * The page URL. It is used to compare against the current URL to check navigation state.\n *\n * @internal\n */\n const url = ref<URL | undefined>(undefined);\n\n /**\n * Flag to know if the page has been persisted by the browser's back-forward cache.\n *\n * @internal\n */\n const isPagePersisted = ref(false);\n\n /**\n * Computed to know which params we must get from URL. It gets the params names from the initial\n * state, to get all default params names, and also from the `$attrs` to get the extra params\n * names to take into account.\n *\n * @returns An array with the name of the params.\n *\n * @internal\n */\n const managedParamsNames = computed(() => {\n return Object.keys({ ...initialUrlState, ...attrs });\n });\n\n /**\n * Returns the mapping of the param keys used in the URL is configured through $attrs. This way\n * we can support any param and extra param, no matters its name.\n *\n * @param paramName - The param name to get the Url key.\n * @returns The key used in the URL for the `paramName` passed.\n *\n * @internal\n */\n const getUrlKey = (paramName: string): string => {\n const paramValue = attrs[paramName];\n return typeof paramValue === 'string' ? paramValue : paramName;\n };\n\n /**\n * Deletes all the parameters in the passed URL.\n *\n * @param url - The URL to remove parameters from.\n * @internal\n */\n const deleteUrlParameters = (url: URL): void => {\n managedParamsNames.value.forEach(paramName =>\n url.searchParams.delete(getUrlKey(paramName))\n );\n };\n\n /**\n * Sorts the params in a tuple array [key,value] to generate always the same URL with the params\n * in the same order.\n *\n * @param urlParams - The {@link UrlParams} to sort.\n * @returns An array of tuples with the key-value of each paramter, sorted by key.\n * @internal\n */\n const sortParams = (urlParams: UrlParams): Array<[string, unknown]> => {\n return Object.entries(urlParams).sort(([param1], [param2]) => {\n return param1 < param2 ? -1 : 1;\n });\n };\n\n /**\n * Set all the provided parameters to the url with the mapped key.\n *\n * @param url - The current URL.\n * @param urlParams - The list of parameters to add.\n * @remarks The params are filtered because there maybe received extra params which will not be\n * managed by URL. This is defined by the `managedParamsNames` computed. Also, the parameters\n * are sorted Alphabetically to produce always the same URL with the same parameters.This is\n * important for SEO purposes.\n *\n * @internal\n */\n const setUrlParameters = (url: URL, urlParams: UrlParams): void => {\n // Only when there is a query the rest of the parameters are valid.\n if (!urlParams.query) {\n return;\n }\n const filteredParams = objectFilter(urlParams, paramName =>\n managedParamsNames.value.includes(paramName as string)\n );\n const sortedParameters = sortParams(filteredParams);\n sortedParameters.forEach(([paramName, paramValue]) => {\n const urlParamKey = getUrlKey(paramName);\n if (Array.isArray(paramValue)) {\n paramValue.forEach(value => {\n url.searchParams.append(urlParamKey, String(value));\n });\n } else {\n url.searchParams.set(urlParamKey, String(paramValue));\n }\n });\n };\n\n /**\n * Updates the browser URL with the passed `newUrlParams` and using the browser history method\n * passed as `historyMethod`. It only updates the browser history if the new URL is different\n * from the current.\n *\n * @param newUrlParams - The new params to add to the browser URL.\n * @param historyMethod - The browser history method used to add the new URL.\n *\n * @internal\n */\n const updateUrl = (\n newUrlParams: UrlParams,\n historyMethod: History['pushState'] | History['replaceState']\n ): void => {\n if (urlLoaded.value) {\n const newUrl = new URL(window.location.href);\n deleteUrlParameters(newUrl);\n setUrlParameters(newUrl, newUrlParams);\n\n newUrl.href = newUrl.href.replace(/\\+/g, '%20');\n\n if (newUrl.href !== window.location.href) {\n historyMethod({ ...window.history.state }, document.title, newUrl.href);\n }\n url.value = newUrl;\n }\n };\n\n /**\n * Updates the browser URL with the new {@link UrlParams} using the history `pushState` method.\n *\n * @param newUrlParams - The new params to update browser URL.\n */\n $x.on('PushableUrlStateUpdated', false).subscribe((newUrlParams: UrlParams) => {\n updateUrl(newUrlParams, window.history.pushState.bind(window.history));\n });\n\n /**\n * Updates the browser URL with the new {@link UrlParams} using the history `replaceState`\n * method.\n *\n * @param newUrlParams - The new params to update browser URL.\n */\n $x.on('ReplaceableUrlStateUpdated', false).subscribe((newUrlParams: UrlParams) => {\n updateUrl(newUrlParams, window.history.replaceState.bind(window.history));\n });\n\n /**\n * Handler of the\n * [pageshow](https://developer.mozilla.org/en-US/docs/Web/API/Window/pageshow_event)\n * event.\n *\n * @remarks The pageshow event is listened to check if the browser has performed a navigation\n * using the back-forward cache. This information is available in the\n * PageTransitionEvent.persisted property.\n *\n * @param event - The page transition event.\n * @internal\n */\n const onPageShow = (event: PageTransitionEvent) => {\n isPagePersisted.value = event.persisted;\n if (event.persisted) {\n // The internal url is reset due to the back-forward cache storing the previous value which\n // is no longer valid.\n url.value = undefined;\n }\n };\n\n /**\n * Returns the URL param value parsed depending on its type in the initial store state. As we\n * can not know what type can have an extra param, all extra params are parsed as strings. We\n * know if it is an extra param because it is not in the initial state.\n *\n * @param name - The name of the param in {@link UrlParams}.\n * @param value - The `URLSearchParams` value as an arry of strings.\n * @returns The parsed value.\n *\n * @internal\n */\n const parseUrlParam = (name: string, value: string[]): UrlParamValue => {\n switch (typeof initialUrlState[name]) {\n case 'number':\n return Number(value[0]);\n case 'boolean':\n return value[0].toLowerCase() === 'true';\n case 'string':\n return value[0];\n default:\n // array\n return value;\n }\n };\n\n /**\n * Gets the {@link UrlParams} from the URL, including only the params defined by `paramsNames`.\n *\n * @returns ParsedUrlParams obtained from URL.\n * @internal\n */\n const parseUrlParams = (): ParsedUrlParams => {\n const urlSearchParams = new URL(window.location.href).searchParams;\n return managedParamsNames.value.reduce<ParsedUrlParams>(\n (params, name) => {\n const urlKey = getUrlKey(name);\n if (urlSearchParams.has(urlKey)) {\n if (name in initialUrlState) {\n const urlValue = urlSearchParams.getAll(urlKey);\n params.all[name] = parseUrlParam(name, urlValue);\n } else {\n params.all[name] = params.extra[name] = urlSearchParams.get(urlKey);\n }\n }\n return params;\n },\n { all: { ...initialUrlState }, extra: { ...initialExtraParams.value } }\n );\n };\n\n /**\n * Check if the navigation is from a product page.\n *\n * @remarks Due to Safari 14 not supporting the new and standard PerformanceNavigationTiming\n * API, we are falling back to the deprecated one, PerformanceNavigation. We also fallback to\n * this API whenever we get a navigationType equal to reload, because Safari has a bug that the\n * navigationType is permanently set to reload after you have reload the page and it never\n * resets. As some browsers have a back-forward cache implemented, we also take into account if\n * the page is persisted.\n *\n * @returns True if the navigation is from a product page, false otherwise.\n * @internal\n */\n const isNavigatingFromPdp = (): boolean => {\n const isPagePersistedValue = isPagePersisted.value;\n const navigationEntries = window.performance.getEntriesByType('navigation');\n const navigationType = (navigationEntries[0] as PerformanceNavigationTiming)?.type;\n const useFallbackStrategy =\n !navigationEntries.length &&\n (isArrayEmpty(navigationEntries) || navigationType === 'reload');\n\n // Reset internal isPagePersisted property value\n isPagePersisted.value = false;\n\n if (useFallbackStrategy) {\n const isNavigatingInSpa = !!snippetConfig?.isSpa && navigationType === 'navigate';\n return navigationType === 'back_forward' || isNavigatingInSpa || isPagePersistedValue;\n } else {\n const isNavigatingInSpa = !!snippetConfig?.isSpa && navigationType === 'navigate';\n return navigationType === 'back_forward' || isNavigatingInSpa || isPagePersistedValue;\n }\n };\n\n /**\n * Detects the {@link FeatureLocation} used to build the\n * {@link QueryOriginInit} data.\n *\n * @returns The {@link FeatureLocation}.\n * @internal\n */\n const detectLocation = (): FeatureLocation => {\n const currentUrl = new URL(window.location.href);\n const previousUrl = url.value;\n url.value = currentUrl;\n\n const isInternalNavigation =\n previousUrl?.search !== currentUrl.search &&\n previousUrl?.pathname === currentUrl.pathname;\n if (isInternalNavigation) {\n return 'url_history';\n }\n\n if (isNavigatingFromPdp()) {\n return 'url_history_pdp';\n }\n\n return 'external';\n };\n\n /**\n * Creates the wire metadata to include in every emitted {@link XEvent}.\n *\n * @returns The {@link WireMetadata}.\n * @internal\n */\n const createWireMetadata = (): Pick<WireMetadata, 'feature' | 'location'> => {\n return {\n feature: 'url',\n location: detectLocation()\n };\n };\n\n /**\n * Emits the {@link UrlXEvents.ParamsLoadedFromUrl} XEvent,\n * the {@link UrlXEvents.ExtraParamsLoadedFromUrl} XEvent and, if there is query, also emits\n * the {@link XEventsTypes.UserOpenXProgrammatically}.\n *\n * @internal\n */\n const emitEvents = () => {\n const { all, extra } = parseUrlParams();\n const metadata = createWireMetadata();\n $x.emit('ParamsLoadedFromUrl', all, metadata);\n $x.emit('ExtraParamsLoadedFromUrl', extra, metadata);\n if (all.query) {\n $x.emit('UserOpenXProgrammatically', undefined, metadata);\n }\n urlLoaded.value = true;\n };\n\n /**\n * To emit the Url events just when the URL is load, and before the components mounted events\n * and state changes, we do it in the created of this component.\n */\n onMounted(() => {\n emitEvents();\n });\n\n return {\n onPageShow,\n emitEvents\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following events:\n\n- [`ParamsLoadedFromUrl`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n- [`ExtraParamsLoadedFromUrl`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n- [`UserOpenXProgrammatically`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n\n## See it in action\n\nThis component manages the browser URL parameters to preserve them through reloads and browser\nhistory navigation. It allow to configure the default url parameter names using its attributes. This\ncomponent doesn't render elements to the DOM.\n\n_Try to make some requests and take a look to the url!_\n\n```vue\n<template>\n <UrlHandler />\n</template>\n\n<script>\n import { UrlHandler } from '@empathyco/x-components/url-handler';\n\n export default {\n name: 'UrlHandlerDemo',\n components: {\n UrlHandler\n }\n };\n</script>\n```\n\n### Play with props\n\nIn this example, the `UrlHandler` component changes the following query parameter names:\n\n- `query` to be `q`.\n- `page` to be `p`.\n- `filter` to be `f`\n- `sort` to be `s`\n\n_Try to make some requests and take a look to the url!_\n\n```vue\n<template>\n <UrlHandler query=\"q\" page=\"p\" filter=\"f\" sort=\"s\" />\n</template>\n\n<script>\n import { UrlHandler } from '@empathyco/x-components/url-handler';\n\n export default {\n name: 'UrlHandlerDemo',\n components: {\n UrlHandler\n }\n };\n</script>\n```\n\n### Play with events\n\nThe `UrlHandler` will emit the `ParamsLoadedFromUrl` when the page is loaded.\n\nThe `UrlHandler` will emit the `ExtraParamsLoadedFromUrl` when the page is loaded with an extra\nparam configured and with a value in URL.\n\nThe `UrlHandler` will emit the `UserOpenXProgrammatically` when the page is loaded with a query in\nthe URL.\n</docs>\n"],"names":["_resolveComponent","_openBlock","_createBlock"],"mappings":";;;;;kCACEA,gBAA8E,CAAA,cAAA,CAAA,CAAA;AAAxC,EAAA,OAAAC,SAAA,EAAoB,EAAAC,WAAA,CAAA,uBAAA,EAAA;AAAA,IAAE,YAAO,IAAQ,CAAA,UAAA;AAAA,IAAA,UAAA,EAAA,IAAA,CAAA,UAAA;;;;;;;;"}
1
+ {"version":3,"file":"url-handler.vue.js","sources":["../../../../../src/x-modules/url/components/url-handler.vue"],"sourcesContent":["<template>\n <GlobalEvents @pageshow=\"onPageShow\" @popstate=\"emitEvents\" target=\"window\" />\n</template>\n\n<script lang=\"ts\">\n import { Dictionary, objectFilter } from '@empathyco/x-utils';\n import { computed, defineComponent, inject, onMounted, ref } from 'vue';\n import { GlobalEvents } from 'vue-global-events';\n import { FeatureLocation } from '../../../types/origin';\n import { UrlParams } from '../../../types/url-params';\n import { isArrayEmpty } from '../../../utils/array';\n import { WireMetadata } from '../../../wiring/wiring.types';\n import { SnippetConfig } from '../../../x-installer/api/api.types';\n import { initialUrlState } from '../store/initial-state';\n import { UrlParamValue } from '../store/types';\n import { urlXModule } from '../x-module';\n import { use$x } from '../../../composables/use-$x';\n import { useState } from '../../../composables/use-state';\n\n interface ParsedUrlParams {\n all: UrlParams;\n extra: Dictionary<unknown>;\n }\n\n /**\n * This component manages the browser URL parameters to preserve them through reloads and browser\n * history navigation. It allow to configure the default url parameter names using its attributes.\n * This component doesn't render elements to the DOM.\n *\n * @public\n */\n export default defineComponent({\n name: 'UrlHandler',\n components: {\n GlobalEvents\n },\n xModule: urlXModule.name,\n setup: function (_, { attrs }) {\n const $x = use$x();\n\n const initialExtraParams = useState('url', ['initialExtraParams']).initialExtraParams;\n\n /**\n * The {@link SnippetConfig} provided by an ancestor.\n *\n * @internal\n */\n const snippetConfig = inject<SnippetConfig | undefined>('snippetConfig');\n\n /**\n * Flag to know if the params were already loaded from the URL.\n *\n * @internal\n */\n const urlLoaded = ref(false);\n\n /**\n * The page URL. It is used to compare against the current URL to check navigation state.\n *\n * @internal\n */\n const url = ref<URL | undefined>(undefined);\n\n /**\n * Flag to know if the page has been persisted by the browser's back-forward cache.\n *\n * @internal\n */\n const isPagePersisted = ref(false);\n\n /**\n * Computed to know which params we must get from URL. It gets the params names from the initial\n * state, to get all default params names, and also from the `$attrs` to get the extra params\n * names to take into account.\n *\n * @returns An array with the name of the params.\n *\n * @internal\n */\n const managedParamsNames = computed(() => Object.keys({ ...initialUrlState, ...attrs }));\n\n /**\n * Returns the mapping of the param keys used in the URL is configured through $attrs. This way\n * we can support any param and extra param, no matters its name.\n *\n * @param paramName - The param name to get the Url key.\n * @returns The key used in the URL for the `paramName` passed.\n *\n * @internal\n */\n const getUrlKey = (paramName: string) => {\n const paramValue = attrs[paramName];\n return typeof paramValue === 'string' ? paramValue : paramName;\n };\n\n /**\n * Deletes all the parameters in the passed URL.\n *\n * @param url - The URL to remove parameters from.\n * @internal\n */\n const deleteUrlParameters = (url: URL) => {\n managedParamsNames.value.forEach(paramName =>\n url.searchParams.delete(getUrlKey(paramName))\n );\n };\n\n /**\n * Sorts the params in a tuple array [key,value] to generate always the same URL with the params\n * in the same order.\n *\n * @param urlParams - The {@link UrlParams} to sort.\n * @returns An array of tuples with the key-value of each paramter, sorted by key.\n * @internal\n */\n const sortParams = (urlParams: UrlParams): Array<[string, unknown]> => {\n return Object.entries(urlParams).sort(([param1], [param2]) => {\n return param1 < param2 ? -1 : 1;\n });\n };\n\n /**\n * Set all the provided parameters to the url with the mapped key.\n *\n * @param url - The current URL.\n * @param urlParams - The list of parameters to add.\n * @remarks The params are filtered because there maybe received extra params which will not be\n * managed by URL. This is defined by the `managedParamsNames` computed. Also, the parameters\n * are sorted Alphabetically to produce always the same URL with the same parameters.This is\n * important for SEO purposes.\n *\n * @internal\n */\n const setUrlParameters = (url: URL, urlParams: UrlParams): void => {\n // Only when there is a query the rest of the parameters are valid.\n if (!urlParams.query) {\n return;\n }\n const filteredParams = objectFilter(urlParams, paramName =>\n managedParamsNames.value.includes(paramName as string)\n );\n const sortedParameters = sortParams(filteredParams);\n sortedParameters.forEach(([paramName, paramValue]) => {\n const urlParamKey = getUrlKey(paramName);\n if (Array.isArray(paramValue)) {\n paramValue.forEach(value => {\n url.searchParams.append(urlParamKey, String(value));\n });\n } else {\n url.searchParams.set(urlParamKey, String(paramValue));\n }\n });\n };\n\n /**\n * Updates the browser URL with the passed `newUrlParams` and using the browser history method\n * passed as `historyMethod`. It only updates the browser history if the new URL is different\n * from the current.\n *\n * @param newUrlParams - The new params to add to the browser URL.\n * @param historyMethod - The browser history method used to add the new URL.\n *\n * @internal\n */\n const updateUrl = (\n newUrlParams: UrlParams,\n historyMethod: History['pushState'] | History['replaceState']\n ): void => {\n if (urlLoaded.value) {\n const newUrl = new URL(window.location.href);\n deleteUrlParameters(newUrl);\n setUrlParameters(newUrl, newUrlParams);\n\n // Normalize '+' characters into '%20' for spaces in url params.\n newUrl.search = newUrl.search.replace(/\\+/g, '%20');\n\n if (newUrl.href !== window.location.href) {\n historyMethod({ ...window.history.state }, document.title, newUrl.href);\n }\n url.value = newUrl;\n }\n };\n\n /**\n * Updates the browser URL with the new {@link UrlParams} using the history `pushState` method.\n *\n * @param newUrlParams - The new params to update browser URL.\n */\n $x.on('PushableUrlStateUpdated', false).subscribe((newUrlParams: UrlParams) => {\n updateUrl(newUrlParams, window.history.pushState.bind(window.history));\n });\n\n /**\n * Updates the browser URL with the new {@link UrlParams} using the history `replaceState`\n * method.\n *\n * @param newUrlParams - The new params to update browser URL.\n */\n $x.on('ReplaceableUrlStateUpdated', false).subscribe((newUrlParams: UrlParams) => {\n updateUrl(newUrlParams, window.history.replaceState.bind(window.history));\n });\n\n /**\n * Handler of the\n * [pageshow](https://developer.mozilla.org/en-US/docs/Web/API/Window/pageshow_event)\n * event.\n *\n * @remarks The pageshow event is listened to check if the browser has performed a navigation\n * using the back-forward cache. This information is available in the\n * PageTransitionEvent.persisted property.\n *\n * @param event - The page transition event.\n * @internal\n */\n const onPageShow = (event: PageTransitionEvent) => {\n isPagePersisted.value = event.persisted;\n if (event.persisted) {\n // The internal url is reset due to the back-forward cache storing the previous value which\n // is no longer valid.\n url.value = undefined;\n }\n };\n\n /**\n * Returns the URL param value parsed depending on its type in the initial store state. As we\n * can not know what type can have an extra param, all extra params are parsed as strings. We\n * know if it is an extra param because it is not in the initial state.\n *\n * @param name - The name of the param in {@link UrlParams}.\n * @param value - The `URLSearchParams` value as an arry of strings.\n * @returns The parsed value.\n *\n * @internal\n */\n const parseUrlParam = (name: string, value: string[]): UrlParamValue => {\n switch (typeof initialUrlState[name]) {\n case 'number':\n return Number(value[0]);\n case 'boolean':\n return value[0].toLowerCase() === 'true';\n case 'string':\n return value[0];\n default:\n // array\n return value;\n }\n };\n\n /**\n * Gets the {@link UrlParams} from the URL, including only the params defined by `paramsNames`.\n *\n * @returns ParsedUrlParams obtained from URL.\n * @internal\n */\n const parseUrlParams = (): ParsedUrlParams => {\n const urlSearchParams = new URL(window.location.href).searchParams;\n return managedParamsNames.value.reduce<ParsedUrlParams>(\n (params, name) => {\n const urlKey = getUrlKey(name);\n if (urlSearchParams.has(urlKey)) {\n if (name in initialUrlState) {\n const urlValue = urlSearchParams.getAll(urlKey);\n params.all[name] = parseUrlParam(name, urlValue);\n } else {\n params.all[name] = params.extra[name] = urlSearchParams.get(urlKey);\n }\n }\n return params;\n },\n { all: { ...initialUrlState }, extra: { ...initialExtraParams.value } }\n );\n };\n\n /**\n * Check if the navigation is from a product page.\n *\n * @remarks Due to Safari 14 not supporting the new and standard PerformanceNavigationTiming\n * API, we are falling back to the deprecated one, PerformanceNavigation. We also fallback to\n * this API whenever we get a navigationType equal to reload, because Safari has a bug that the\n * navigationType is permanently set to reload after you have reload the page and it never\n * resets. As some browsers have a back-forward cache implemented, we also take into account if\n * the page is persisted.\n *\n * @returns True if the navigation is from a product page, false otherwise.\n * @internal\n */\n const isNavigatingFromPdp = (): boolean => {\n const isPagePersistedValue = isPagePersisted.value;\n const navigationEntries = window.performance.getEntriesByType('navigation');\n const navigationType = (navigationEntries[0] as PerformanceNavigationTiming)?.type;\n const useFallbackStrategy =\n !navigationEntries.length &&\n (isArrayEmpty(navigationEntries) || navigationType === 'reload');\n\n // Reset internal isPagePersisted property value\n isPagePersisted.value = false;\n\n if (useFallbackStrategy) {\n const isNavigatingInSpa = !!snippetConfig?.isSpa && navigationType === 'navigate';\n return navigationType === 'back_forward' || isNavigatingInSpa || isPagePersistedValue;\n } else {\n const isNavigatingInSpa = !!snippetConfig?.isSpa && navigationType === 'navigate';\n return navigationType === 'back_forward' || isNavigatingInSpa || isPagePersistedValue;\n }\n };\n\n /**\n * Detects the {@link FeatureLocation} used to build the\n * {@link QueryOriginInit} data.\n *\n * @returns The {@link FeatureLocation}.\n * @internal\n */\n const detectLocation = (): FeatureLocation => {\n const currentUrl = new URL(window.location.href);\n const previousUrl = url.value;\n url.value = currentUrl;\n\n const isInternalNavigation =\n previousUrl?.search !== currentUrl.search &&\n previousUrl?.pathname === currentUrl.pathname;\n if (isInternalNavigation) {\n return 'url_history';\n }\n\n if (isNavigatingFromPdp()) {\n return 'url_history_pdp';\n }\n\n return 'external';\n };\n\n /**\n * Creates the wire metadata to include in every emitted {@link XEvent}.\n *\n * @returns The {@link WireMetadata}.\n * @internal\n */\n const createWireMetadata = (): Pick<WireMetadata, 'feature' | 'location'> => {\n return {\n feature: 'url',\n location: detectLocation()\n };\n };\n\n /**\n * Emits the {@link UrlXEvents.ParamsLoadedFromUrl} XEvent,\n * the {@link UrlXEvents.ExtraParamsLoadedFromUrl} XEvent and, if there is query, also emits\n * the {@link XEventsTypes.UserOpenXProgrammatically}.\n *\n * @internal\n */\n const emitEvents = () => {\n const { all, extra } = parseUrlParams();\n const metadata = createWireMetadata();\n $x.emit('ParamsLoadedFromUrl', all, metadata);\n $x.emit('ExtraParamsLoadedFromUrl', extra, metadata);\n if (all.query) {\n $x.emit('UserOpenXProgrammatically', undefined, metadata);\n }\n urlLoaded.value = true;\n };\n\n /**\n * To emit the Url events just when the URL is load, and before the components mounted events\n * and state changes, we do it in the created of this component.\n */\n onMounted(() => {\n emitEvents();\n });\n\n return {\n onPageShow,\n emitEvents\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following events:\n\n- [`ParamsLoadedFromUrl`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n- [`ExtraParamsLoadedFromUrl`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n- [`UserOpenXProgrammatically`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n\n## See it in action\n\nThis component manages the browser URL parameters to preserve them through reloads and browser\nhistory navigation. It allow to configure the default url parameter names using its attributes. This\ncomponent doesn't render elements to the DOM.\n\n_Try to make some requests and take a look to the url!_\n\n```vue\n<template>\n <UrlHandler />\n</template>\n\n<script>\n import { UrlHandler } from '@empathyco/x-components/url-handler';\n\n export default {\n name: 'UrlHandlerDemo',\n components: {\n UrlHandler\n }\n };\n</script>\n```\n\n### Play with props\n\nIn this example, the `UrlHandler` component changes the following query parameter names:\n\n- `query` to be `q`.\n- `page` to be `p`.\n- `filter` to be `f`\n- `sort` to be `s`\n\n_Try to make some requests and take a look to the url!_\n\n```vue\n<template>\n <UrlHandler query=\"q\" page=\"p\" filter=\"f\" sort=\"s\" />\n</template>\n\n<script>\n import { UrlHandler } from '@empathyco/x-components/url-handler';\n\n export default {\n name: 'UrlHandlerDemo',\n components: {\n UrlHandler\n }\n };\n</script>\n```\n\n### Play with events\n\nThe `UrlHandler` will emit the `ParamsLoadedFromUrl` when the page is loaded.\n\nThe `UrlHandler` will emit the `ExtraParamsLoadedFromUrl` when the page is loaded with an extra\nparam configured and with a value in URL.\n\nThe `UrlHandler` will emit the `UserOpenXProgrammatically` when the page is loaded with a query in\nthe URL.\n</docs>\n"],"names":["_resolveComponent","_openBlock","_createBlock"],"mappings":";;;;;kCACEA,gBAA8E,CAAA,cAAA,CAAA,CAAA;AAAxC,EAAA,OAAAC,SAAA,EAAoB,EAAAC,WAAA,CAAA,uBAAA,EAAA;AAAA,IAAE,YAAO,IAAQ,CAAA,UAAA;AAAA,IAAA,UAAA,EAAA,IAAA,CAAA,UAAA;;;;;;;;"}
@@ -20,7 +20,7 @@ var _sfc_main = defineComponent({
20
20
  GlobalEvents
21
21
  },
22
22
  xModule: urlXModule.name,
23
- setup: function (props, { attrs }) {
23
+ setup: function (_, { attrs }) {
24
24
  const $x = use$x();
25
25
  const initialExtraParams = useState('url', ['initialExtraParams']).initialExtraParams;
26
26
  /**
@@ -56,9 +56,7 @@ var _sfc_main = defineComponent({
56
56
  *
57
57
  * @internal
58
58
  */
59
- const managedParamsNames = computed(() => {
60
- return Object.keys({ ...initialUrlState, ...attrs });
61
- });
59
+ const managedParamsNames = computed(() => Object.keys({ ...initialUrlState, ...attrs }));
62
60
  /**
63
61
  * Returns the mapping of the param keys used in the URL is configured through $attrs. This way
64
62
  * we can support any param and extra param, no matters its name.
@@ -140,7 +138,8 @@ var _sfc_main = defineComponent({
140
138
  const newUrl = new URL(window.location.href);
141
139
  deleteUrlParameters(newUrl);
142
140
  setUrlParameters(newUrl, newUrlParams);
143
- newUrl.href = newUrl.href.replace(/\+/g, '%20');
141
+ // Normalize '+' characters into '%20' for spaces in url params.
142
+ newUrl.search = newUrl.search.replace(/\+/g, '%20');
144
143
  if (newUrl.href !== window.location.href) {
145
144
  historyMethod({ ...window.history.state }, document.title, newUrl.href);
146
145
  }
@@ -1 +1 @@
1
- {"version":3,"file":"url-handler.vue2.js","sources":["../../../../../src/x-modules/url/components/url-handler.vue"],"sourcesContent":["<template>\n <GlobalEvents @pageshow=\"onPageShow\" @popstate=\"emitEvents\" target=\"window\" />\n</template>\n\n<script lang=\"ts\">\n import { Dictionary, objectFilter } from '@empathyco/x-utils';\n import { computed, defineComponent, inject, onMounted, ref } from 'vue';\n import { GlobalEvents } from 'vue-global-events';\n import { FeatureLocation } from '../../../types/origin';\n import { UrlParams } from '../../../types/url-params';\n import { isArrayEmpty } from '../../../utils/array';\n import { WireMetadata } from '../../../wiring/wiring.types';\n import { SnippetConfig } from '../../../x-installer/api/api.types';\n import { initialUrlState } from '../store/initial-state';\n import { UrlParamValue } from '../store/types';\n import { urlXModule } from '../x-module';\n import { use$x } from '../../../composables/use-$x';\n import { useState } from '../../../composables/use-state';\n\n interface ParsedUrlParams {\n all: UrlParams;\n extra: Dictionary<unknown>;\n }\n\n /**\n * This component manages the browser URL parameters to preserve them through reloads and browser\n * history navigation. It allow to configure the default url parameter names using its attributes.\n * This component doesn't render elements to the DOM.\n *\n * @public\n */\n export default defineComponent({\n name: 'UrlHandler',\n components: {\n GlobalEvents\n },\n xModule: urlXModule.name,\n setup: function (props, { attrs }) {\n const $x = use$x();\n\n const initialExtraParams = useState('url', ['initialExtraParams']).initialExtraParams;\n\n /**\n * The {@link SnippetConfig} provided by an ancestor.\n *\n * @internal\n */\n const snippetConfig = inject<SnippetConfig | undefined>('snippetConfig');\n\n /**\n * Flag to know if the params were already loaded from the URL.\n *\n * @internal\n */\n const urlLoaded = ref(false);\n\n /**\n * The page URL. It is used to compare against the current URL to check navigation state.\n *\n * @internal\n */\n const url = ref<URL | undefined>(undefined);\n\n /**\n * Flag to know if the page has been persisted by the browser's back-forward cache.\n *\n * @internal\n */\n const isPagePersisted = ref(false);\n\n /**\n * Computed to know which params we must get from URL. It gets the params names from the initial\n * state, to get all default params names, and also from the `$attrs` to get the extra params\n * names to take into account.\n *\n * @returns An array with the name of the params.\n *\n * @internal\n */\n const managedParamsNames = computed(() => {\n return Object.keys({ ...initialUrlState, ...attrs });\n });\n\n /**\n * Returns the mapping of the param keys used in the URL is configured through $attrs. This way\n * we can support any param and extra param, no matters its name.\n *\n * @param paramName - The param name to get the Url key.\n * @returns The key used in the URL for the `paramName` passed.\n *\n * @internal\n */\n const getUrlKey = (paramName: string): string => {\n const paramValue = attrs[paramName];\n return typeof paramValue === 'string' ? paramValue : paramName;\n };\n\n /**\n * Deletes all the parameters in the passed URL.\n *\n * @param url - The URL to remove parameters from.\n * @internal\n */\n const deleteUrlParameters = (url: URL): void => {\n managedParamsNames.value.forEach(paramName =>\n url.searchParams.delete(getUrlKey(paramName))\n );\n };\n\n /**\n * Sorts the params in a tuple array [key,value] to generate always the same URL with the params\n * in the same order.\n *\n * @param urlParams - The {@link UrlParams} to sort.\n * @returns An array of tuples with the key-value of each paramter, sorted by key.\n * @internal\n */\n const sortParams = (urlParams: UrlParams): Array<[string, unknown]> => {\n return Object.entries(urlParams).sort(([param1], [param2]) => {\n return param1 < param2 ? -1 : 1;\n });\n };\n\n /**\n * Set all the provided parameters to the url with the mapped key.\n *\n * @param url - The current URL.\n * @param urlParams - The list of parameters to add.\n * @remarks The params are filtered because there maybe received extra params which will not be\n * managed by URL. This is defined by the `managedParamsNames` computed. Also, the parameters\n * are sorted Alphabetically to produce always the same URL with the same parameters.This is\n * important for SEO purposes.\n *\n * @internal\n */\n const setUrlParameters = (url: URL, urlParams: UrlParams): void => {\n // Only when there is a query the rest of the parameters are valid.\n if (!urlParams.query) {\n return;\n }\n const filteredParams = objectFilter(urlParams, paramName =>\n managedParamsNames.value.includes(paramName as string)\n );\n const sortedParameters = sortParams(filteredParams);\n sortedParameters.forEach(([paramName, paramValue]) => {\n const urlParamKey = getUrlKey(paramName);\n if (Array.isArray(paramValue)) {\n paramValue.forEach(value => {\n url.searchParams.append(urlParamKey, String(value));\n });\n } else {\n url.searchParams.set(urlParamKey, String(paramValue));\n }\n });\n };\n\n /**\n * Updates the browser URL with the passed `newUrlParams` and using the browser history method\n * passed as `historyMethod`. It only updates the browser history if the new URL is different\n * from the current.\n *\n * @param newUrlParams - The new params to add to the browser URL.\n * @param historyMethod - The browser history method used to add the new URL.\n *\n * @internal\n */\n const updateUrl = (\n newUrlParams: UrlParams,\n historyMethod: History['pushState'] | History['replaceState']\n ): void => {\n if (urlLoaded.value) {\n const newUrl = new URL(window.location.href);\n deleteUrlParameters(newUrl);\n setUrlParameters(newUrl, newUrlParams);\n\n newUrl.href = newUrl.href.replace(/\\+/g, '%20');\n\n if (newUrl.href !== window.location.href) {\n historyMethod({ ...window.history.state }, document.title, newUrl.href);\n }\n url.value = newUrl;\n }\n };\n\n /**\n * Updates the browser URL with the new {@link UrlParams} using the history `pushState` method.\n *\n * @param newUrlParams - The new params to update browser URL.\n */\n $x.on('PushableUrlStateUpdated', false).subscribe((newUrlParams: UrlParams) => {\n updateUrl(newUrlParams, window.history.pushState.bind(window.history));\n });\n\n /**\n * Updates the browser URL with the new {@link UrlParams} using the history `replaceState`\n * method.\n *\n * @param newUrlParams - The new params to update browser URL.\n */\n $x.on('ReplaceableUrlStateUpdated', false).subscribe((newUrlParams: UrlParams) => {\n updateUrl(newUrlParams, window.history.replaceState.bind(window.history));\n });\n\n /**\n * Handler of the\n * [pageshow](https://developer.mozilla.org/en-US/docs/Web/API/Window/pageshow_event)\n * event.\n *\n * @remarks The pageshow event is listened to check if the browser has performed a navigation\n * using the back-forward cache. This information is available in the\n * PageTransitionEvent.persisted property.\n *\n * @param event - The page transition event.\n * @internal\n */\n const onPageShow = (event: PageTransitionEvent) => {\n isPagePersisted.value = event.persisted;\n if (event.persisted) {\n // The internal url is reset due to the back-forward cache storing the previous value which\n // is no longer valid.\n url.value = undefined;\n }\n };\n\n /**\n * Returns the URL param value parsed depending on its type in the initial store state. As we\n * can not know what type can have an extra param, all extra params are parsed as strings. We\n * know if it is an extra param because it is not in the initial state.\n *\n * @param name - The name of the param in {@link UrlParams}.\n * @param value - The `URLSearchParams` value as an arry of strings.\n * @returns The parsed value.\n *\n * @internal\n */\n const parseUrlParam = (name: string, value: string[]): UrlParamValue => {\n switch (typeof initialUrlState[name]) {\n case 'number':\n return Number(value[0]);\n case 'boolean':\n return value[0].toLowerCase() === 'true';\n case 'string':\n return value[0];\n default:\n // array\n return value;\n }\n };\n\n /**\n * Gets the {@link UrlParams} from the URL, including only the params defined by `paramsNames`.\n *\n * @returns ParsedUrlParams obtained from URL.\n * @internal\n */\n const parseUrlParams = (): ParsedUrlParams => {\n const urlSearchParams = new URL(window.location.href).searchParams;\n return managedParamsNames.value.reduce<ParsedUrlParams>(\n (params, name) => {\n const urlKey = getUrlKey(name);\n if (urlSearchParams.has(urlKey)) {\n if (name in initialUrlState) {\n const urlValue = urlSearchParams.getAll(urlKey);\n params.all[name] = parseUrlParam(name, urlValue);\n } else {\n params.all[name] = params.extra[name] = urlSearchParams.get(urlKey);\n }\n }\n return params;\n },\n { all: { ...initialUrlState }, extra: { ...initialExtraParams.value } }\n );\n };\n\n /**\n * Check if the navigation is from a product page.\n *\n * @remarks Due to Safari 14 not supporting the new and standard PerformanceNavigationTiming\n * API, we are falling back to the deprecated one, PerformanceNavigation. We also fallback to\n * this API whenever we get a navigationType equal to reload, because Safari has a bug that the\n * navigationType is permanently set to reload after you have reload the page and it never\n * resets. As some browsers have a back-forward cache implemented, we also take into account if\n * the page is persisted.\n *\n * @returns True if the navigation is from a product page, false otherwise.\n * @internal\n */\n const isNavigatingFromPdp = (): boolean => {\n const isPagePersistedValue = isPagePersisted.value;\n const navigationEntries = window.performance.getEntriesByType('navigation');\n const navigationType = (navigationEntries[0] as PerformanceNavigationTiming)?.type;\n const useFallbackStrategy =\n !navigationEntries.length &&\n (isArrayEmpty(navigationEntries) || navigationType === 'reload');\n\n // Reset internal isPagePersisted property value\n isPagePersisted.value = false;\n\n if (useFallbackStrategy) {\n const isNavigatingInSpa = !!snippetConfig?.isSpa && navigationType === 'navigate';\n return navigationType === 'back_forward' || isNavigatingInSpa || isPagePersistedValue;\n } else {\n const isNavigatingInSpa = !!snippetConfig?.isSpa && navigationType === 'navigate';\n return navigationType === 'back_forward' || isNavigatingInSpa || isPagePersistedValue;\n }\n };\n\n /**\n * Detects the {@link FeatureLocation} used to build the\n * {@link QueryOriginInit} data.\n *\n * @returns The {@link FeatureLocation}.\n * @internal\n */\n const detectLocation = (): FeatureLocation => {\n const currentUrl = new URL(window.location.href);\n const previousUrl = url.value;\n url.value = currentUrl;\n\n const isInternalNavigation =\n previousUrl?.search !== currentUrl.search &&\n previousUrl?.pathname === currentUrl.pathname;\n if (isInternalNavigation) {\n return 'url_history';\n }\n\n if (isNavigatingFromPdp()) {\n return 'url_history_pdp';\n }\n\n return 'external';\n };\n\n /**\n * Creates the wire metadata to include in every emitted {@link XEvent}.\n *\n * @returns The {@link WireMetadata}.\n * @internal\n */\n const createWireMetadata = (): Pick<WireMetadata, 'feature' | 'location'> => {\n return {\n feature: 'url',\n location: detectLocation()\n };\n };\n\n /**\n * Emits the {@link UrlXEvents.ParamsLoadedFromUrl} XEvent,\n * the {@link UrlXEvents.ExtraParamsLoadedFromUrl} XEvent and, if there is query, also emits\n * the {@link XEventsTypes.UserOpenXProgrammatically}.\n *\n * @internal\n */\n const emitEvents = () => {\n const { all, extra } = parseUrlParams();\n const metadata = createWireMetadata();\n $x.emit('ParamsLoadedFromUrl', all, metadata);\n $x.emit('ExtraParamsLoadedFromUrl', extra, metadata);\n if (all.query) {\n $x.emit('UserOpenXProgrammatically', undefined, metadata);\n }\n urlLoaded.value = true;\n };\n\n /**\n * To emit the Url events just when the URL is load, and before the components mounted events\n * and state changes, we do it in the created of this component.\n */\n onMounted(() => {\n emitEvents();\n });\n\n return {\n onPageShow,\n emitEvents\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following events:\n\n- [`ParamsLoadedFromUrl`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n- [`ExtraParamsLoadedFromUrl`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n- [`UserOpenXProgrammatically`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n\n## See it in action\n\nThis component manages the browser URL parameters to preserve them through reloads and browser\nhistory navigation. It allow to configure the default url parameter names using its attributes. This\ncomponent doesn't render elements to the DOM.\n\n_Try to make some requests and take a look to the url!_\n\n```vue\n<template>\n <UrlHandler />\n</template>\n\n<script>\n import { UrlHandler } from '@empathyco/x-components/url-handler';\n\n export default {\n name: 'UrlHandlerDemo',\n components: {\n UrlHandler\n }\n };\n</script>\n```\n\n### Play with props\n\nIn this example, the `UrlHandler` component changes the following query parameter names:\n\n- `query` to be `q`.\n- `page` to be `p`.\n- `filter` to be `f`\n- `sort` to be `s`\n\n_Try to make some requests and take a look to the url!_\n\n```vue\n<template>\n <UrlHandler query=\"q\" page=\"p\" filter=\"f\" sort=\"s\" />\n</template>\n\n<script>\n import { UrlHandler } from '@empathyco/x-components/url-handler';\n\n export default {\n name: 'UrlHandlerDemo',\n components: {\n UrlHandler\n }\n };\n</script>\n```\n\n### Play with events\n\nThe `UrlHandler` will emit the `ParamsLoadedFromUrl` when the page is loaded.\n\nThe `UrlHandler` will emit the `ExtraParamsLoadedFromUrl` when the page is loaded with an extra\nparam configured and with a value in URL.\n\nThe `UrlHandler` will emit the `UserOpenXProgrammatically` when the page is loaded with a query in\nthe URL.\n</docs>\n"],"names":[],"mappings":";;;;;;;;;AAwBE;;;;;;AAME;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,UAAU,EAAE;QACV,YAAW;AACZ,KAAA;IACD,OAAO,EAAE,UAAU,CAAC,IAAI;AACxB,IAAA,KAAK,EAAE,UAAU,KAAK,EAAE,EAAE,KAAM,EAAC,EAAA;AAC/B,QAAA,MAAM,EAAC,GAAI,KAAK,EAAE,CAAA;AAElB,QAAA,MAAM,kBAAmB,GAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC,kBAAkB,CAAA;AAErF;;;;AAIE;AACF,QAAA,MAAM,aAAY,GAAI,MAAM,CAA4B,eAAe,CAAC,CAAA;AAExE;;;;AAIE;AACF,QAAA,MAAM,SAAU,GAAE,GAAG,CAAC,KAAK,CAAC,CAAA;AAE5B;;;;AAIE;AACF,QAAA,MAAM,GAAI,GAAE,GAAG,CAAkB,SAAS,CAAC,CAAA;AAE3C;;;;AAIE;AACF,Q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ED;;;;;AAKE;QACF,MAAM,qBAAqB,MAAkD;YAC3E,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;gBACd,QAAQ,EAAE,cAAc,EAAC;aAC1B,CAAA;AACH,SAAC,CAAA;AAED;;;;;;AAME;QACF,MAAM,UAAS,GAAI,MAAM;YACvB,MAAM,EAAE,GAAG,EAAE,KAAM,EAAA,GAAI,cAAc,EAAE,CAAA;AACvC,YAAA,MAAM,QAAS,GAAE,kBAAkB,EAAE,CAAA;YACrC,EAAE,CAAC,IAAI,CAAC,qBAAqB,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAA;YAC7C,EAAE,CAAC,IAAI,CAAC,0BAA0B,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAA;YACpD,IAAI,GAAG,CAAC,KAAK,EAAE;gBACb,EAAE,CAAC,IAAI,CAAC,2BAA2B,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAA;AAC3D,aAAA;AACA,YAAA,SAAS,CAAC,KAAI,GAAI,IAAI,CAAA;AACxB,SAAC,CAAA;AAED;;;AAGE;QACF,SAAS,CAAC,MAAM;AACd,YAAA,UAAU,EAAE,CAAA;AACd,SAAC,CAAC,CAAA;QAEF,OAAO;YACL,UAAU;YACV,UAAS;SACV,CAAA;KACH;AACD,CAAA,CAAC;;;;"}
1
+ {"version":3,"file":"url-handler.vue2.js","sources":["../../../../../src/x-modules/url/components/url-handler.vue"],"sourcesContent":["<template>\n <GlobalEvents @pageshow=\"onPageShow\" @popstate=\"emitEvents\" target=\"window\" />\n</template>\n\n<script lang=\"ts\">\n import { Dictionary, objectFilter } from '@empathyco/x-utils';\n import { computed, defineComponent, inject, onMounted, ref } from 'vue';\n import { GlobalEvents } from 'vue-global-events';\n import { FeatureLocation } from '../../../types/origin';\n import { UrlParams } from '../../../types/url-params';\n import { isArrayEmpty } from '../../../utils/array';\n import { WireMetadata } from '../../../wiring/wiring.types';\n import { SnippetConfig } from '../../../x-installer/api/api.types';\n import { initialUrlState } from '../store/initial-state';\n import { UrlParamValue } from '../store/types';\n import { urlXModule } from '../x-module';\n import { use$x } from '../../../composables/use-$x';\n import { useState } from '../../../composables/use-state';\n\n interface ParsedUrlParams {\n all: UrlParams;\n extra: Dictionary<unknown>;\n }\n\n /**\n * This component manages the browser URL parameters to preserve them through reloads and browser\n * history navigation. It allow to configure the default url parameter names using its attributes.\n * This component doesn't render elements to the DOM.\n *\n * @public\n */\n export default defineComponent({\n name: 'UrlHandler',\n components: {\n GlobalEvents\n },\n xModule: urlXModule.name,\n setup: function (_, { attrs }) {\n const $x = use$x();\n\n const initialExtraParams = useState('url', ['initialExtraParams']).initialExtraParams;\n\n /**\n * The {@link SnippetConfig} provided by an ancestor.\n *\n * @internal\n */\n const snippetConfig = inject<SnippetConfig | undefined>('snippetConfig');\n\n /**\n * Flag to know if the params were already loaded from the URL.\n *\n * @internal\n */\n const urlLoaded = ref(false);\n\n /**\n * The page URL. It is used to compare against the current URL to check navigation state.\n *\n * @internal\n */\n const url = ref<URL | undefined>(undefined);\n\n /**\n * Flag to know if the page has been persisted by the browser's back-forward cache.\n *\n * @internal\n */\n const isPagePersisted = ref(false);\n\n /**\n * Computed to know which params we must get from URL. It gets the params names from the initial\n * state, to get all default params names, and also from the `$attrs` to get the extra params\n * names to take into account.\n *\n * @returns An array with the name of the params.\n *\n * @internal\n */\n const managedParamsNames = computed(() => Object.keys({ ...initialUrlState, ...attrs }));\n\n /**\n * Returns the mapping of the param keys used in the URL is configured through $attrs. This way\n * we can support any param and extra param, no matters its name.\n *\n * @param paramName - The param name to get the Url key.\n * @returns The key used in the URL for the `paramName` passed.\n *\n * @internal\n */\n const getUrlKey = (paramName: string) => {\n const paramValue = attrs[paramName];\n return typeof paramValue === 'string' ? paramValue : paramName;\n };\n\n /**\n * Deletes all the parameters in the passed URL.\n *\n * @param url - The URL to remove parameters from.\n * @internal\n */\n const deleteUrlParameters = (url: URL) => {\n managedParamsNames.value.forEach(paramName =>\n url.searchParams.delete(getUrlKey(paramName))\n );\n };\n\n /**\n * Sorts the params in a tuple array [key,value] to generate always the same URL with the params\n * in the same order.\n *\n * @param urlParams - The {@link UrlParams} to sort.\n * @returns An array of tuples with the key-value of each paramter, sorted by key.\n * @internal\n */\n const sortParams = (urlParams: UrlParams): Array<[string, unknown]> => {\n return Object.entries(urlParams).sort(([param1], [param2]) => {\n return param1 < param2 ? -1 : 1;\n });\n };\n\n /**\n * Set all the provided parameters to the url with the mapped key.\n *\n * @param url - The current URL.\n * @param urlParams - The list of parameters to add.\n * @remarks The params are filtered because there maybe received extra params which will not be\n * managed by URL. This is defined by the `managedParamsNames` computed. Also, the parameters\n * are sorted Alphabetically to produce always the same URL with the same parameters.This is\n * important for SEO purposes.\n *\n * @internal\n */\n const setUrlParameters = (url: URL, urlParams: UrlParams): void => {\n // Only when there is a query the rest of the parameters are valid.\n if (!urlParams.query) {\n return;\n }\n const filteredParams = objectFilter(urlParams, paramName =>\n managedParamsNames.value.includes(paramName as string)\n );\n const sortedParameters = sortParams(filteredParams);\n sortedParameters.forEach(([paramName, paramValue]) => {\n const urlParamKey = getUrlKey(paramName);\n if (Array.isArray(paramValue)) {\n paramValue.forEach(value => {\n url.searchParams.append(urlParamKey, String(value));\n });\n } else {\n url.searchParams.set(urlParamKey, String(paramValue));\n }\n });\n };\n\n /**\n * Updates the browser URL with the passed `newUrlParams` and using the browser history method\n * passed as `historyMethod`. It only updates the browser history if the new URL is different\n * from the current.\n *\n * @param newUrlParams - The new params to add to the browser URL.\n * @param historyMethod - The browser history method used to add the new URL.\n *\n * @internal\n */\n const updateUrl = (\n newUrlParams: UrlParams,\n historyMethod: History['pushState'] | History['replaceState']\n ): void => {\n if (urlLoaded.value) {\n const newUrl = new URL(window.location.href);\n deleteUrlParameters(newUrl);\n setUrlParameters(newUrl, newUrlParams);\n\n // Normalize '+' characters into '%20' for spaces in url params.\n newUrl.search = newUrl.search.replace(/\\+/g, '%20');\n\n if (newUrl.href !== window.location.href) {\n historyMethod({ ...window.history.state }, document.title, newUrl.href);\n }\n url.value = newUrl;\n }\n };\n\n /**\n * Updates the browser URL with the new {@link UrlParams} using the history `pushState` method.\n *\n * @param newUrlParams - The new params to update browser URL.\n */\n $x.on('PushableUrlStateUpdated', false).subscribe((newUrlParams: UrlParams) => {\n updateUrl(newUrlParams, window.history.pushState.bind(window.history));\n });\n\n /**\n * Updates the browser URL with the new {@link UrlParams} using the history `replaceState`\n * method.\n *\n * @param newUrlParams - The new params to update browser URL.\n */\n $x.on('ReplaceableUrlStateUpdated', false).subscribe((newUrlParams: UrlParams) => {\n updateUrl(newUrlParams, window.history.replaceState.bind(window.history));\n });\n\n /**\n * Handler of the\n * [pageshow](https://developer.mozilla.org/en-US/docs/Web/API/Window/pageshow_event)\n * event.\n *\n * @remarks The pageshow event is listened to check if the browser has performed a navigation\n * using the back-forward cache. This information is available in the\n * PageTransitionEvent.persisted property.\n *\n * @param event - The page transition event.\n * @internal\n */\n const onPageShow = (event: PageTransitionEvent) => {\n isPagePersisted.value = event.persisted;\n if (event.persisted) {\n // The internal url is reset due to the back-forward cache storing the previous value which\n // is no longer valid.\n url.value = undefined;\n }\n };\n\n /**\n * Returns the URL param value parsed depending on its type in the initial store state. As we\n * can not know what type can have an extra param, all extra params are parsed as strings. We\n * know if it is an extra param because it is not in the initial state.\n *\n * @param name - The name of the param in {@link UrlParams}.\n * @param value - The `URLSearchParams` value as an arry of strings.\n * @returns The parsed value.\n *\n * @internal\n */\n const parseUrlParam = (name: string, value: string[]): UrlParamValue => {\n switch (typeof initialUrlState[name]) {\n case 'number':\n return Number(value[0]);\n case 'boolean':\n return value[0].toLowerCase() === 'true';\n case 'string':\n return value[0];\n default:\n // array\n return value;\n }\n };\n\n /**\n * Gets the {@link UrlParams} from the URL, including only the params defined by `paramsNames`.\n *\n * @returns ParsedUrlParams obtained from URL.\n * @internal\n */\n const parseUrlParams = (): ParsedUrlParams => {\n const urlSearchParams = new URL(window.location.href).searchParams;\n return managedParamsNames.value.reduce<ParsedUrlParams>(\n (params, name) => {\n const urlKey = getUrlKey(name);\n if (urlSearchParams.has(urlKey)) {\n if (name in initialUrlState) {\n const urlValue = urlSearchParams.getAll(urlKey);\n params.all[name] = parseUrlParam(name, urlValue);\n } else {\n params.all[name] = params.extra[name] = urlSearchParams.get(urlKey);\n }\n }\n return params;\n },\n { all: { ...initialUrlState }, extra: { ...initialExtraParams.value } }\n );\n };\n\n /**\n * Check if the navigation is from a product page.\n *\n * @remarks Due to Safari 14 not supporting the new and standard PerformanceNavigationTiming\n * API, we are falling back to the deprecated one, PerformanceNavigation. We also fallback to\n * this API whenever we get a navigationType equal to reload, because Safari has a bug that the\n * navigationType is permanently set to reload after you have reload the page and it never\n * resets. As some browsers have a back-forward cache implemented, we also take into account if\n * the page is persisted.\n *\n * @returns True if the navigation is from a product page, false otherwise.\n * @internal\n */\n const isNavigatingFromPdp = (): boolean => {\n const isPagePersistedValue = isPagePersisted.value;\n const navigationEntries = window.performance.getEntriesByType('navigation');\n const navigationType = (navigationEntries[0] as PerformanceNavigationTiming)?.type;\n const useFallbackStrategy =\n !navigationEntries.length &&\n (isArrayEmpty(navigationEntries) || navigationType === 'reload');\n\n // Reset internal isPagePersisted property value\n isPagePersisted.value = false;\n\n if (useFallbackStrategy) {\n const isNavigatingInSpa = !!snippetConfig?.isSpa && navigationType === 'navigate';\n return navigationType === 'back_forward' || isNavigatingInSpa || isPagePersistedValue;\n } else {\n const isNavigatingInSpa = !!snippetConfig?.isSpa && navigationType === 'navigate';\n return navigationType === 'back_forward' || isNavigatingInSpa || isPagePersistedValue;\n }\n };\n\n /**\n * Detects the {@link FeatureLocation} used to build the\n * {@link QueryOriginInit} data.\n *\n * @returns The {@link FeatureLocation}.\n * @internal\n */\n const detectLocation = (): FeatureLocation => {\n const currentUrl = new URL(window.location.href);\n const previousUrl = url.value;\n url.value = currentUrl;\n\n const isInternalNavigation =\n previousUrl?.search !== currentUrl.search &&\n previousUrl?.pathname === currentUrl.pathname;\n if (isInternalNavigation) {\n return 'url_history';\n }\n\n if (isNavigatingFromPdp()) {\n return 'url_history_pdp';\n }\n\n return 'external';\n };\n\n /**\n * Creates the wire metadata to include in every emitted {@link XEvent}.\n *\n * @returns The {@link WireMetadata}.\n * @internal\n */\n const createWireMetadata = (): Pick<WireMetadata, 'feature' | 'location'> => {\n return {\n feature: 'url',\n location: detectLocation()\n };\n };\n\n /**\n * Emits the {@link UrlXEvents.ParamsLoadedFromUrl} XEvent,\n * the {@link UrlXEvents.ExtraParamsLoadedFromUrl} XEvent and, if there is query, also emits\n * the {@link XEventsTypes.UserOpenXProgrammatically}.\n *\n * @internal\n */\n const emitEvents = () => {\n const { all, extra } = parseUrlParams();\n const metadata = createWireMetadata();\n $x.emit('ParamsLoadedFromUrl', all, metadata);\n $x.emit('ExtraParamsLoadedFromUrl', extra, metadata);\n if (all.query) {\n $x.emit('UserOpenXProgrammatically', undefined, metadata);\n }\n urlLoaded.value = true;\n };\n\n /**\n * To emit the Url events just when the URL is load, and before the components mounted events\n * and state changes, we do it in the created of this component.\n */\n onMounted(() => {\n emitEvents();\n });\n\n return {\n onPageShow,\n emitEvents\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following events:\n\n- [`ParamsLoadedFromUrl`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n- [`ExtraParamsLoadedFromUrl`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n- [`UserOpenXProgrammatically`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n\n## See it in action\n\nThis component manages the browser URL parameters to preserve them through reloads and browser\nhistory navigation. It allow to configure the default url parameter names using its attributes. This\ncomponent doesn't render elements to the DOM.\n\n_Try to make some requests and take a look to the url!_\n\n```vue\n<template>\n <UrlHandler />\n</template>\n\n<script>\n import { UrlHandler } from '@empathyco/x-components/url-handler';\n\n export default {\n name: 'UrlHandlerDemo',\n components: {\n UrlHandler\n }\n };\n</script>\n```\n\n### Play with props\n\nIn this example, the `UrlHandler` component changes the following query parameter names:\n\n- `query` to be `q`.\n- `page` to be `p`.\n- `filter` to be `f`\n- `sort` to be `s`\n\n_Try to make some requests and take a look to the url!_\n\n```vue\n<template>\n <UrlHandler query=\"q\" page=\"p\" filter=\"f\" sort=\"s\" />\n</template>\n\n<script>\n import { UrlHandler } from '@empathyco/x-components/url-handler';\n\n export default {\n name: 'UrlHandlerDemo',\n components: {\n UrlHandler\n }\n };\n</script>\n```\n\n### Play with events\n\nThe `UrlHandler` will emit the `ParamsLoadedFromUrl` when the page is loaded.\n\nThe `UrlHandler` will emit the `ExtraParamsLoadedFromUrl` when the page is loaded with an extra\nparam configured and with a value in URL.\n\nThe `UrlHandler` will emit the `UserOpenXProgrammatically` when the page is loaded with a query in\nthe URL.\n</docs>\n"],"names":[],"mappings":";;;;;;;;;AAwBE;;;;;;AAME;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,UAAU,EAAE;QACV,YAAW;AACZ,KAAA;IACD,OAAO,EAAE,UAAU,CAAC,IAAI;AACxB,IAAA,KAAK,EAAE,UAAU,CAAC,EAAE,EAAE,KAAM,EAAC,EAAA;AAC3B,QAAA,MAAM,EAAC,GAAI,KAAK,EAAE,CAAA;AAElB,QAAA,MAAM,kBAAmB,GAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC,kBAAkB,CAAA;AAErF;;;;AAIE;AACF,QAAA,MAAM,aAAY,GAAI,MAAM,CAA4B,eAAe,CAAC,CAAA;AAExE;;;;AAIE;AACF,QAAA,MAAM,SAAU,GAAE,GAAG,CAAC,KAAK,CAAC,CAAA;AAE5B;;;;AAIE;AACF,QAAA,MAAM,GAAI,GAAE,GAAG,CAAkB,SAAS,CAAC,CAAA;AAE3C;;;;AAIE;AACF,QAAA,MAAM,eAAgB,GAAE,GAAG,CAAC,KAAK,CAAC,CAAA;AAElC;;;;;;;;AAQE;QACF,MAAM,k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AAA;AACH,SAAC,CAAA;AAED;;;;;;AAME;QACF,MAAM,UAAS,GAAI,MAAM;YACvB,MAAM,EAAE,GAAG,EAAE,KAAM,EAAA,GAAI,cAAc,EAAE,CAAA;AACvC,YAAA,MAAM,QAAS,GAAE,kBAAkB,EAAE,CAAA;YACrC,EAAE,CAAC,IAAI,CAAC,qBAAqB,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAA;YAC7C,EAAE,CAAC,IAAI,CAAC,0BAA0B,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAA;YACpD,IAAI,GAAG,CAAC,KAAK,EAAE;gBACb,EAAE,CAAC,IAAI,CAAC,2BAA2B,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAA;AAC3D,aAAA;AACA,YAAA,SAAS,CAAC,KAAI,GAAI,IAAI,CAAA;AACxB,SAAC,CAAA;AAED;;;AAGE;QACF,SAAS,CAAC,MAAM;AACd,YAAA,UAAU,EAAE,CAAA;AACd,SAAC,CAAC,CAAA;QAEF,OAAO;YACL,UAAU;YACV,UAAS;SACV,CAAA;KACH;AACD,CAAA,CAAC;;;;"}
@@ -1,3 +1,4 @@
1
+ import '@empathyco/x-utils';
1
2
  import { createStoreEmitters } from '../../../store/utils/store-emitters.utils.js';
2
3
  import { urlXStoreModule } from './module.js';
3
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"emitters.js","sources":["../../../../../src/x-modules/url/store/emitters.ts"],"sourcesContent":["import { createStoreEmitters } from '../../../store';\nimport { UrlParams } from '../../../types/url-params';\nimport { urlXStoreModule } from './module';\nimport { UrlParamKey } from './types';\n\n/**\n * The params from {@link UrlParams} that provokes a replace instead of a push in the browser URL\n * state.\n *\n * @internal\n */\nexport const replaceableParams: UrlParamKey[] = ['scroll', 'page'];\n\n/**\n * Compares new and old {@link UrlParams} to know if not replaceable params have changed.\n *\n * @param newParams - The new {@link UrlParams} to compare.\n * @param oldParams - The old {@link UrlParams} to compare.\n *\n * @returns True if is pushable change, false otherwise.\n */\nfunction shouldPushUrl(\n newParams: Partial<UrlParams> = {},\n oldParams: Partial<UrlParams> = {}\n): boolean {\n const keys = Object.keys({ ...oldParams, ...newParams });\n return keys.some(key => !replaceableParams.includes(key) && oldParams[key] !== newParams[key]);\n}\n\n/**\n * Compares new and old {@link UrlParams} to know if replaceable params have changed.\n *\n * @param newParams - The new {@link UrlParams} to compare.\n * @param oldParams - The old {@link UrlParams} to compare.\n *\n * @returns True if is pushable change, false otherwise.\n */\nfunction shouldReplaceUrl(\n newParams: Partial<UrlParams> = {},\n oldParams: Partial<UrlParams> = {}\n): boolean {\n const keys = Object.keys({ ...oldParams, ...newParams });\n return (\n keys.some(key => replaceableParams.includes(key) && oldParams[key] !== newParams[key]) &&\n !shouldPushUrl(newParams, oldParams)\n );\n}\n\n/**\n * {@link StoreEmitters} For the URL module.\n *\n * @internal\n */\nexport const urlEmitters = createStoreEmitters(urlXStoreModule, {\n PushableUrlStateUpdated: {\n selector: (_, getters) => getters.urlParams,\n filter: shouldPushUrl,\n metadata: { replaceable: false }\n },\n ReplaceableUrlStateUpdated: {\n selector: (_, getters) => getters.urlParams,\n filter: shouldReplaceUrl,\n metadata: { replaceable: false }\n }\n});\n"],"names":[],"mappings":";;;AAKA;;;;;AAKG;MACU,iBAAiB,GAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE;AAEnE;;;;;;;AAOG;AACH,SAAS,aAAa,CACpB,SAAA,GAAgC,EAAE,EAClC,YAAgC,EAAE,EAAA;AAElC,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,SAAS,EAAE,GAAG,SAAS,EAAE,CAAC,CAAC;IACzD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AACjG,CAAC;AAED;;;;;;;AAOG;AACH,SAAS,gBAAgB,CACvB,SAAA,GAAgC,EAAE,EAClC,YAAgC,EAAE,EAAA;AAElC,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,SAAS,EAAE,GAAG,SAAS,EAAE,CAAC,CAAC;IACzD,QACE,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,iBAAiB,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,GAAG,CAAC,CAAC;AACtF,QAAA,CAAC,aAAa,CAAC,SAAS,EAAE,SAAS,CAAC,EACpC;AACJ,CAAC;AAED;;;;AAIG;AACU,MAAA,WAAW,GAAG,mBAAmB,CAAC,eAAe,EAAE;AAC9D,IAAA,uBAAuB,EAAE;QACvB,QAAQ,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,SAAS;AAC3C,QAAA,MAAM,EAAE,aAAa;AACrB,QAAA,QAAQ,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE;AACjC,KAAA;AACD,IAAA,0BAA0B,EAAE;QAC1B,QAAQ,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,SAAS;AAC3C,QAAA,MAAM,EAAE,gBAAgB;AACxB,QAAA,QAAQ,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE;AACjC,KAAA;AACF,CAAA;;;;"}
1
+ {"version":3,"file":"emitters.js","sources":["../../../../../src/x-modules/url/store/emitters.ts"],"sourcesContent":["import { createStoreEmitters } from '../../../store';\nimport { UrlParams } from '../../../types/url-params';\nimport { urlXStoreModule } from './module';\nimport { UrlParamKey } from './types';\n\n/**\n * The params from {@link UrlParams} that provokes a replace instead of a push in the browser URL\n * state.\n *\n * @internal\n */\nexport const replaceableParams: UrlParamKey[] = ['scroll', 'page'];\n\n/**\n * Compares new and old {@link UrlParams} to know if not replaceable params have changed.\n *\n * @param newParams - The new {@link UrlParams} to compare.\n * @param oldParams - The old {@link UrlParams} to compare.\n *\n * @returns True if is pushable change, false otherwise.\n */\nfunction shouldPushUrl(\n newParams: Partial<UrlParams> = {},\n oldParams: Partial<UrlParams> = {}\n): boolean {\n const keys = Object.keys({ ...oldParams, ...newParams });\n return keys.some(key => !replaceableParams.includes(key) && oldParams[key] !== newParams[key]);\n}\n\n/**\n * Compares new and old {@link UrlParams} to know if replaceable params have changed.\n *\n * @param newParams - The new {@link UrlParams} to compare.\n * @param oldParams - The old {@link UrlParams} to compare.\n *\n * @returns True if is pushable change, false otherwise.\n */\nfunction shouldReplaceUrl(\n newParams: Partial<UrlParams> = {},\n oldParams: Partial<UrlParams> = {}\n): boolean {\n const keys = Object.keys({ ...oldParams, ...newParams });\n return (\n keys.some(key => replaceableParams.includes(key) && oldParams[key] !== newParams[key]) &&\n !shouldPushUrl(newParams, oldParams)\n );\n}\n\n/**\n * {@link StoreEmitters} For the URL module.\n *\n * @internal\n */\nexport const urlEmitters = createStoreEmitters(urlXStoreModule, {\n PushableUrlStateUpdated: {\n selector: (_, getters) => getters.urlParams,\n filter: shouldPushUrl,\n metadata: { replaceable: false }\n },\n ReplaceableUrlStateUpdated: {\n selector: (_, getters) => getters.urlParams,\n filter: shouldReplaceUrl,\n metadata: { replaceable: false }\n }\n});\n"],"names":[],"mappings":";;;;AAKA;;;;;AAKG;MACU,iBAAiB,GAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE;AAEnE;;;;;;;AAOG;AACH,SAAS,aAAa,CACpB,SAAA,GAAgC,EAAE,EAClC,YAAgC,EAAE,EAAA;AAElC,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,SAAS,EAAE,GAAG,SAAS,EAAE,CAAC,CAAC;IACzD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AACjG,CAAC;AAED;;;;;;;AAOG;AACH,SAAS,gBAAgB,CACvB,SAAA,GAAgC,EAAE,EAClC,YAAgC,EAAE,EAAA;AAElC,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,SAAS,EAAE,GAAG,SAAS,EAAE,CAAC,CAAC;IACzD,QACE,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,iBAAiB,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,GAAG,CAAC,CAAC;AACtF,QAAA,CAAC,aAAa,CAAC,SAAS,EAAE,SAAS,CAAC,EACpC;AACJ,CAAC;AAED;;;;AAIG;AACU,MAAA,WAAW,GAAG,mBAAmB,CAAC,eAAe,EAAE;AAC9D,IAAA,uBAAuB,EAAE;QACvB,QAAQ,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,SAAS;AAC3C,QAAA,MAAM,EAAE,aAAa;AACrB,QAAA,QAAQ,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE;AACjC,KAAA;AACD,IAAA,0BAA0B,EAAE;QAC1B,QAAQ,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,SAAS;AAC3C,QAAA,MAAM,EAAE,gBAAgB;AACxB,QAAA,QAAQ,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE;AACjC,KAAA;AACF,CAAA;;;;"}
@@ -2,12 +2,11 @@ import { objectFilter } from '@empathyco/x-utils';
2
2
  import { initialUrlState } from '../initial-state.js';
3
3
 
4
4
  /**
5
- * Default implementation for the {@link UrlGetters.urlParams} getter.
5
+ * Default implementation for the getter.
6
6
  *
7
- * @param state - Current {@link https://vuex.vuejs.org/guide/state.html | state} of the url module.
7
+ * @param state - Current state of the url module.
8
8
  *
9
9
  * @returns The url params.
10
- *
11
10
  * @public
12
11
  */
13
12
  const urlParams = ({ initialExtraParams, ...params }) => objectFilter(params, (paramKey, paramValue) => {
@@ -1 +1 @@
1
- {"version":3,"file":"url-params.getter.js","sources":["../../../../../../src/x-modules/url/store/getters/url-params.getter.ts"],"sourcesContent":["import { objectFilter } from '@empathyco/x-utils';\nimport { initialUrlState } from '../initial-state';\nimport { UrlParamValue, UrlXStoreModule } from '../types';\n\n/**\n * Default implementation for the {@link UrlGetters.urlParams} getter.\n *\n * @param state - Current {@link https://vuex.vuejs.org/guide/state.html | state} of the url module.\n *\n * @returns The url params.\n *\n * @public\n */\nexport const urlParams: UrlXStoreModule['getters']['urlParams'] = ({\n initialExtraParams,\n ...params\n}) =>\n objectFilter(params, (paramKey, paramValue) => {\n return paramKey in initialUrlState\n ? isNotDefaultValue(paramKey, paramValue, initialUrlState)\n : isNotEmptyParam(paramValue) && isNotDefaultValue(paramKey, paramValue, initialExtraParams);\n });\n\n/**\n * Checks if a parameter is not empty to avoid adding it to the URL.\n *\n * @param value - The value of the key parameter.\n *\n * @returns True if is not empty, False otherwise.\n */\nfunction isNotEmptyParam(value: UrlParamValue | unknown): boolean {\n return Array.isArray(value) ? value.length > 0 : value != null && value !== '';\n}\n\n/**\n * Checks if a parameter is not the default state value to avoid adding it to the URL.\n *\n * @param key - The key parameter.\n * @param value - The value of the key parameter.\n * @param defaultValues - The default values to compare.\n *\n * @returns True if is not the default state value, False otherwise.\n */\nfunction isNotDefaultValue<Key extends string | number, Value extends UrlParamValue | unknown>(\n key: Key,\n value: Value,\n defaultValues: Record<Key, Value>\n): boolean {\n return Array.isArray(value) ? value.length > 0 : defaultValues[key] !== value;\n}\n"],"names":[],"mappings":";;;AAIA;;;;;;;;AAQG;MACU,SAAS,GAA4C,CAAC,EACjE,kBAAkB,EAClB,GAAG,MAAM,EACV,KACC,YAAY,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,UAAU,KAAI;IAC5C,OAAO,QAAQ,IAAI,eAAe;UAC9B,iBAAiB,CAAC,QAAQ,EAAE,UAAU,EAAE,eAAe,CAAC;AAC1D,UAAE,eAAe,CAAC,UAAU,CAAC,IAAI,iBAAiB,CAAC,QAAQ,EAAE,UAAU,EAAE,kBAAkB,CAAC,CAAC;AACjG,CAAC,EAAE;AAEL;;;;;;AAMG;AACH,SAAS,eAAe,CAAC,KAA8B,EAAA;IACrD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,GAAG,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;AACjF,CAAC;AAED;;;;;;;;AAQG;AACH,SAAS,iBAAiB,CACxB,GAAQ,EACR,KAAY,EACZ,aAAiC,EAAA;IAEjC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC;AAChF;;;;"}
1
+ {"version":3,"file":"url-params.getter.js","sources":["../../../../../../src/x-modules/url/store/getters/url-params.getter.ts"],"sourcesContent":["import { objectFilter } from '@empathyco/x-utils';\nimport { initialUrlState } from '../initial-state';\nimport { UrlParamValue, UrlXStoreModule } from '../types';\n\n/**\n * Default implementation for the getter.\n *\n * @param state - Current state of the url module.\n *\n * @returns The url params.\n * @public\n */\nexport const urlParams: UrlXStoreModule['getters']['urlParams'] = ({\n initialExtraParams,\n ...params\n}) =>\n objectFilter(params, (paramKey, paramValue) => {\n return paramKey in initialUrlState\n ? isNotDefaultValue(paramKey, paramValue, initialUrlState)\n : isNotEmptyParam(paramValue) && isNotDefaultValue(paramKey, paramValue, initialExtraParams);\n });\n\n/**\n * Checks if a parameter is not empty to avoid adding it to the URL.\n *\n * @param value - The value of the key parameter.\n *\n * @returns True if is not empty, False otherwise.\n */\nfunction isNotEmptyParam(value: UrlParamValue | unknown): boolean {\n return Array.isArray(value) ? value.length > 0 : value != null && value !== '';\n}\n\n/**\n * Checks if a parameter is not the default state value to avoid adding it to the URL.\n *\n * @param key - The key parameter.\n * @param value - The value of the key parameter.\n * @param defaultValues - The default values to compare.\n *\n * @returns True if is not the default state value, False otherwise.\n */\nfunction isNotDefaultValue<Key extends string | number, Value extends UrlParamValue | unknown>(\n key: Key,\n value: Value,\n defaultValues: Record<Key, Value>\n): boolean {\n return Array.isArray(value) ? value.length > 0 : defaultValues[key] !== value;\n}\n"],"names":[],"mappings":";;;AAIA;;;;;;;AAOG;MACU,SAAS,GAA4C,CAAC,EACjE,kBAAkB,EAClB,GAAG,MAAM,EACV,KACC,YAAY,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,UAAU,KAAI;IAC5C,OAAO,QAAQ,IAAI,eAAe;UAC9B,iBAAiB,CAAC,QAAQ,EAAE,UAAU,EAAE,eAAe,CAAC;AAC1D,UAAE,eAAe,CAAC,UAAU,CAAC,IAAI,iBAAiB,CAAC,QAAQ,EAAE,UAAU,EAAE,kBAAkB,CAAC,CAAC;AACjG,CAAC,EAAE;AAEL;;;;;;AAMG;AACH,SAAS,eAAe,CAAC,KAA8B,EAAA;IACrD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,GAAG,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;AACjF,CAAC;AAED;;;;;;;;AAQG;AACH,SAAS,iBAAiB,CACxB,GAAQ,EACR,KAAY,EACZ,aAAiC,EAAA;IAEjC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC;AAChF;;;;"}
@@ -10,7 +10,8 @@ const initialUrlState = {
10
10
  filter: [],
11
11
  sort: '',
12
12
  scroll: '',
13
- tag: []
13
+ tag: [],
14
+ prompt: -1
14
15
  };
15
16
 
16
17
  export { initialUrlState };
@@ -1 +1 @@
1
- {"version":3,"file":"initial-state.js","sources":["../../../../../src/x-modules/url/store/initial-state.ts"],"sourcesContent":["import { UrlParams } from '../../../types/url-params';\n\n/**\n * The initial state of the Url store module. This is exported and used in other parts of the code\n * to use as default values for {@link UrlState}.\n *\n * @internal\n */\nexport const initialUrlState: Readonly<UrlParams> = {\n query: '',\n page: 1,\n filter: [],\n sort: '',\n scroll: '',\n tag: []\n};\n"],"names":[],"mappings":"AAEA;;;;;AAKG;AACU,MAAA,eAAe,GAAwB;AAClD,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,IAAI,EAAE,CAAC;AACP,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,IAAI,EAAE,EAAE;AACR,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,GAAG,EAAE,EAAE;;;;;"}
1
+ {"version":3,"file":"initial-state.js","sources":["../../../../../src/x-modules/url/store/initial-state.ts"],"sourcesContent":["import { UrlParams } from '../../../types/url-params';\n\n/**\n * The initial state of the Url store module. This is exported and used in other parts of the code\n * to use as default values for {@link UrlState}.\n *\n * @internal\n */\nexport const initialUrlState: Readonly<UrlParams> = {\n query: '',\n page: 1,\n filter: [],\n sort: '',\n scroll: '',\n tag: [],\n prompt: -1\n};\n"],"names":[],"mappings":"AAEA;;;;;AAKG;AACU,MAAA,eAAe,GAAwB;AAClD,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,IAAI,EAAE,CAAC;AACP,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,IAAI,EAAE,EAAE;AACR,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,GAAG,EAAE,EAAE;IACP,MAAM,EAAE,CAAC,CAAC;;;;;"}
@@ -22,6 +22,9 @@ const urlXStoreModule = {
22
22
  setRelatedTags(state, relatedTags) {
23
23
  state.tag = relatedTags.map(relatedTag => relatedTag.tag);
24
24
  },
25
+ setPrompt(state, prompt) {
26
+ state.prompt = prompt;
27
+ },
25
28
  setFilters(state, newFilters) {
26
29
  state.filter = newFilters.map(filter => filter.id);
27
30
  },
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sources":["../../../../../src/x-modules/url/store/module.ts"],"sourcesContent":["import { setQuery } from '../../../store/utils/query.utils';\nimport { urlParams } from './getters/url-params.getter';\nimport { initialUrlState } from './initial-state';\nimport { setParams } from './mutations/set-params.mutation';\nimport { UrlXStoreModule } from './types';\n\n/**\n * {@link XStoreModule} For the URL module.\n *\n * @internal\n */\nexport const urlXStoreModule: UrlXStoreModule = {\n state: () => ({\n ...initialUrlState,\n initialExtraParams: {}\n }),\n getters: {\n urlParams\n },\n mutations: {\n setParams,\n setQuery,\n setRelatedTags(state, relatedTags) {\n state.tag = relatedTags.map(relatedTag => relatedTag.tag);\n },\n setFilters(state, newFilters) {\n state.filter = newFilters.map(filter => filter.id as string);\n },\n setPage(state, page) {\n state.page = page;\n },\n setSort(state, sort) {\n state.sort = sort;\n },\n setInitialExtraParams(state, extraParams) {\n state.initialExtraParams = extraParams;\n },\n setScroll(state, scroll) {\n state.scroll = scroll;\n }\n },\n actions: {}\n};\n"],"names":[],"mappings":";;;;;AAMA;;;;AAIG;AACU,MAAA,eAAe,GAAoB;AAC9C,IAAA,KAAK,EAAE,OAAO;AACZ,QAAA,GAAG,eAAe;AAClB,QAAA,kBAAkB,EAAE,EAAE;KACvB,CAAC;AACF,IAAA,OAAO,EAAE;QACP,SAAS;AACV,KAAA;AACD,IAAA,SAAS,EAAE;QACT,SAAS;QACT,QAAQ;QACR,cAAc,CAAC,KAAK,EAAE,WAAW,EAAA;AAC/B,YAAA,KAAK,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC,UAAU,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;SAC3D;QACD,UAAU,CAAC,KAAK,EAAE,UAAU,EAAA;AAC1B,YAAA,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,MAAM,IAAI,MAAM,CAAC,EAAY,CAAC,CAAC;SAC9D;QACD,OAAO,CAAC,KAAK,EAAE,IAAI,EAAA;AACjB,YAAA,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;SACnB;QACD,OAAO,CAAC,KAAK,EAAE,IAAI,EAAA;AACjB,YAAA,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;SACnB;QACD,qBAAqB,CAAC,KAAK,EAAE,WAAW,EAAA;AACtC,YAAA,KAAK,CAAC,kBAAkB,GAAG,WAAW,CAAC;SACxC;QACD,SAAS,CAAC,KAAK,EAAE,MAAM,EAAA;AACrB,YAAA,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;SACvB;AACF,KAAA;AACD,IAAA,OAAO,EAAE,EAAE;;;;;"}
1
+ {"version":3,"file":"module.js","sources":["../../../../../src/x-modules/url/store/module.ts"],"sourcesContent":["import { setQuery } from '../../../store/utils/query.utils';\nimport { urlParams } from './getters/url-params.getter';\nimport { initialUrlState } from './initial-state';\nimport { setParams } from './mutations/set-params.mutation';\nimport { UrlXStoreModule } from './types';\n\n/**\n * {@link XStoreModule} For the URL module.\n *\n * @internal\n */\nexport const urlXStoreModule: UrlXStoreModule = {\n state: () => ({\n ...initialUrlState,\n initialExtraParams: {}\n }),\n getters: {\n urlParams\n },\n mutations: {\n setParams,\n setQuery,\n setRelatedTags(state, relatedTags) {\n state.tag = relatedTags.map(relatedTag => relatedTag.tag);\n },\n setPrompt(state, prompt) {\n state.prompt = prompt;\n },\n setFilters(state, newFilters) {\n state.filter = newFilters.map(filter => filter.id as string);\n },\n setPage(state, page) {\n state.page = page;\n },\n setSort(state, sort) {\n state.sort = sort;\n },\n setInitialExtraParams(state, extraParams) {\n state.initialExtraParams = extraParams;\n },\n setScroll(state, scroll) {\n state.scroll = scroll;\n }\n },\n actions: {}\n};\n"],"names":[],"mappings":";;;;;AAMA;;;;AAIG;AACU,MAAA,eAAe,GAAoB;AAC9C,IAAA,KAAK,EAAE,OAAO;AACZ,QAAA,GAAG,eAAe;AAClB,QAAA,kBAAkB,EAAE,EAAE;KACvB,CAAC;AACF,IAAA,OAAO,EAAE;QACP,SAAS;AACV,KAAA;AACD,IAAA,SAAS,EAAE;QACT,SAAS;QACT,QAAQ;QACR,cAAc,CAAC,KAAK,EAAE,WAAW,EAAA;AAC/B,YAAA,KAAK,CAAC,GAAG,GAAG,WAAW,CAAC,GAAG,CAAC,UAAU,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;SAC3D;QACD,SAAS,CAAC,KAAK,EAAE,MAAM,EAAA;AACrB,YAAA,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;SACvB;QACD,UAAU,CAAC,KAAK,EAAE,UAAU,EAAA;AAC1B,YAAA,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,MAAM,IAAI,MAAM,CAAC,EAAY,CAAC,CAAC;SAC9D;QACD,OAAO,CAAC,KAAK,EAAE,IAAI,EAAA;AACjB,YAAA,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;SACnB;QACD,OAAO,CAAC,KAAK,EAAE,IAAI,EAAA;AACjB,YAAA,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;SACnB;QACD,qBAAqB,CAAC,KAAK,EAAE,WAAW,EAAA;AACtC,YAAA,KAAK,CAAC,kBAAkB,GAAG,WAAW,CAAC;SACxC;QACD,SAAS,CAAC,KAAK,EAAE,MAAM,EAAA;AACrB,YAAA,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;SACvB;AACF,KAAA;AACD,IAAA,OAAO,EAAE,EAAE;;;;;"}
@@ -14,6 +14,12 @@ const wireCommit = namespacedWireCommit('url');
14
14
  * @public
15
15
  */
16
16
  const setUrlRelatedTags = wireCommit('setRelatedTags');
17
+ /**
18
+ * Sets the related prompt of the URL module.
19
+ *
20
+ * @public
21
+ */
22
+ const setUrlPrompt = wireCommit('setPrompt');
17
23
  /**
18
24
  * Sets the query of the url module.
19
25
  *
@@ -97,6 +103,9 @@ const urlWiring = createWiring({
97
103
  SelectedRelatedTagsChanged: {
98
104
  setUrlRelatedTags
99
105
  },
106
+ SelectedRelatedPromptChanged: {
107
+ setUrlPrompt
108
+ },
100
109
  SelectedFiltersForRequestChanged: {
101
110
  setUrlFilters
102
111
  },
@@ -117,5 +126,5 @@ const urlWiring = createWiring({
117
126
  }
118
127
  });
119
128
 
120
- export { setInitialExtraParams, setParams, setUrlFilters, setUrlPage, setUrlParamsFromPreview, setUrlQuery, setUrlQueryFromPreview, setUrlRelatedTags, setUrlScroll, setUrlSelectedFiltersFromPreview, setUrlSort, urlWiring };
129
+ export { setInitialExtraParams, setParams, setUrlFilters, setUrlPage, setUrlParamsFromPreview, setUrlPrompt, setUrlQuery, setUrlQueryFromPreview, setUrlRelatedTags, setUrlScroll, setUrlSelectedFiltersFromPreview, setUrlSort, urlWiring };
121
130
  //# sourceMappingURL=wiring.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/url/wiring.ts"],"sourcesContent":["import { namespacedWireCommit } from '../../wiring/namespaced-wires.factory';\nimport { createWiring } from '../../wiring/wiring.utils';\nimport { createRawFilters } from '../../utils/filters';\n\n/**\n * WireCommit for {@link UrlXModule}.\n *\n * @internal\n */\nconst wireCommit = namespacedWireCommit('url');\n\n/**\n * Sets the {@link RelatedTag | related tags }.\n *\n * @public\n */\nexport const setUrlRelatedTags = wireCommit('setRelatedTags');\n\n/**\n * Sets the query of the url module.\n *\n * @public\n */\nexport const setUrlQuery = wireCommit('setQuery');\n\n/**\n * Sets the url state `query` with a selectedQueryPreview's query.\n *\n * @public\n */\nexport const setUrlQueryFromPreview = wireCommit(\n 'setQuery',\n ({ eventPayload: { query } }) => query\n);\n\n/**\n * Sets the page of the url module.\n *\n * @public\n */\nexport const setUrlPage = wireCommit('setPage');\n\n/**\n * Sets the sort of the url module.\n *\n * @public\n */\nexport const setUrlSort = wireCommit('setSort');\n\n/**\n * Sets the extra params of the url module.\n *\n * @public\n */\nexport const setParams = wireCommit('setParams');\n\n/**\n * Sets the extra params of the url module from a selectedQueryPreview's extraParams.\n *\n * @public\n */\nexport const setUrlParamsFromPreview = wireCommit(\n 'setParams',\n ({ eventPayload: { extraParams } }) => extraParams\n);\n\n/**\n * Sets the filters of the url module from a selectedQueryPreview's filters.\n *\n * @public\n */\nexport const setUrlSelectedFiltersFromPreview = wireCommit(\n 'setFilters',\n ({ eventPayload: { filters } }) => (filters ? createRawFilters(filters) : [])\n);\n\n/**\n * Sets the scroll of the url module.\n *\n * @public\n */\nexport const setUrlScroll = wireCommit('setScroll');\n\n/**\n * Sets the initial provided extra params.\n *\n * @public\n */\nexport const setInitialExtraParams = wireCommit('setInitialExtraParams');\n\n/**\n * Sets the filters of the url module.\n *\n * @public\n */\nexport const setUrlFilters = wireCommit('setFilters');\n\n/**\n * Wiring configuration for the {@link UrlXModule | url module}.\n *\n * @internal\n */\nexport const urlWiring = createWiring({\n ParamsLoadedFromUrl: {\n setParams\n },\n UserAcceptedAQuery: {\n setUrlQuery\n },\n UserAcceptedAQueryPreview: {\n setUrlQueryFromPreview,\n setUrlParamsFromPreview,\n setUrlSelectedFiltersFromPreview\n },\n UserClearedQuery: {\n setUrlQuery\n },\n SelectedRelatedTagsChanged: {\n setUrlRelatedTags\n },\n SelectedFiltersForRequestChanged: {\n setUrlFilters\n },\n PageChanged: {\n setUrlPage\n },\n SortChanged: {\n setUrlSort\n },\n ExtraParamsChanged: {\n setParams\n },\n ExtraParamsInitialized: {\n setInitialExtraParams\n },\n UserScrolledToElement: {\n setUrlScroll\n }\n});\n"],"names":[],"mappings":";;;;AAIA;;;;AAIG;AACH,MAAM,UAAU,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;AAE/C;;;;AAIG;MACU,iBAAiB,GAAG,UAAU,CAAC,gBAAgB,EAAE;AAE9D;;;;AAIG;MACU,WAAW,GAAG,UAAU,CAAC,UAAU,EAAE;AAElD;;;;AAIG;MACU,sBAAsB,GAAG,UAAU,CAC9C,UAAU,EACV,CAAC,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,KAAK,EACtC;AAEF;;;;AAIG;MACU,UAAU,GAAG,UAAU,CAAC,SAAS,EAAE;AAEhD;;;;AAIG;MACU,UAAU,GAAG,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["../../../../src/x-modules/url/wiring.ts"],"sourcesContent":["import { namespacedWireCommit } from '../../wiring/namespaced-wires.factory';\nimport { createWiring } from '../../wiring/wiring.utils';\nimport { createRawFilters } from '../../utils/filters';\n\n/**\n * WireCommit for {@link UrlXModule}.\n *\n * @internal\n */\nconst wireCommit = namespacedWireCommit('url');\n\n/**\n * Sets the {@link RelatedTag | related tags }.\n *\n * @public\n */\nexport const setUrlRelatedTags = wireCommit('setRelatedTags');\n\n/**\n * Sets the related prompt of the URL module.\n *\n * @public\n */\nexport const setUrlPrompt = wireCommit('setPrompt');\n\n/**\n * Sets the query of the url module.\n *\n * @public\n */\nexport const setUrlQuery = wireCommit('setQuery');\n\n/**\n * Sets the url state `query` with a selectedQueryPreview's query.\n *\n * @public\n */\nexport const setUrlQueryFromPreview = wireCommit(\n 'setQuery',\n ({ eventPayload: { query } }) => query\n);\n\n/**\n * Sets the page of the url module.\n *\n * @public\n */\nexport const setUrlPage = wireCommit('setPage');\n\n/**\n * Sets the sort of the url module.\n *\n * @public\n */\nexport const setUrlSort = wireCommit('setSort');\n\n/**\n * Sets the extra params of the url module.\n *\n * @public\n */\nexport const setParams = wireCommit('setParams');\n\n/**\n * Sets the extra params of the url module from a selectedQueryPreview's extraParams.\n *\n * @public\n */\nexport const setUrlParamsFromPreview = wireCommit(\n 'setParams',\n ({ eventPayload: { extraParams } }) => extraParams\n);\n\n/**\n * Sets the filters of the url module from a selectedQueryPreview's filters.\n *\n * @public\n */\nexport const setUrlSelectedFiltersFromPreview = wireCommit(\n 'setFilters',\n ({ eventPayload: { filters } }) => (filters ? createRawFilters(filters) : [])\n);\n\n/**\n * Sets the scroll of the url module.\n *\n * @public\n */\nexport const setUrlScroll = wireCommit('setScroll');\n\n/**\n * Sets the initial provided extra params.\n *\n * @public\n */\nexport const setInitialExtraParams = wireCommit('setInitialExtraParams');\n\n/**\n * Sets the filters of the url module.\n *\n * @public\n */\nexport const setUrlFilters = wireCommit('setFilters');\n\n/**\n * Wiring configuration for the {@link UrlXModule | url module}.\n *\n * @internal\n */\nexport const urlWiring = createWiring({\n ParamsLoadedFromUrl: {\n setParams\n },\n UserAcceptedAQuery: {\n setUrlQuery\n },\n UserAcceptedAQueryPreview: {\n setUrlQueryFromPreview,\n setUrlParamsFromPreview,\n setUrlSelectedFiltersFromPreview\n },\n UserClearedQuery: {\n setUrlQuery\n },\n SelectedRelatedTagsChanged: {\n setUrlRelatedTags\n },\n SelectedRelatedPromptChanged: {\n setUrlPrompt\n },\n SelectedFiltersForRequestChanged: {\n setUrlFilters\n },\n PageChanged: {\n setUrlPage\n },\n SortChanged: {\n setUrlSort\n },\n ExtraParamsChanged: {\n setParams\n },\n ExtraParamsInitialized: {\n setInitialExtraParams\n },\n UserScrolledToElement: {\n setUrlScroll\n }\n});\n"],"names":[],"mappings":";;;;AAIA;;;;AAIG;AACH,MAAM,UAAU,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;AAE/C;;;;AAIG;MACU,iBAAiB,GAAG,UAAU,CAAC,gBAAgB,EAAE;AAE9D;;;;AAIG;MACU,YAAY,GAAG,UAAU,CAAC,WAAW,EAAE;AAEpD;;;;AAIG;MACU,WAAW,GAAG,UAAU,CAAC,UAAU,EAAE;AAElD;;;;AAIG;MACU,sBAAsB,GAAG,UAAU,CAC9C,UAAU,EACV,CAAC,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,KAAK,EACtC;AAEF;;;;AAIG;MACU,UAAU,GAAG,UAAU,CAAC,SAAS,EAAE;AAEhD;;;;AAIG;MACU,UAAU,GAAG,UAAU,CAAC,SAAS,EAAE;AAEhD;;;;AAIG;MACU,SAAS,GAAG,UAAU,CAAC,WAAW,EAAE;AAEjD;;;;AAIG;MACU,uBAAuB,GAAG,UAAU,CAC/C,WAAW,EACX,CAAC,EAAE,YAAY,EAAE,EAAE,WAAW,EAAE,EAAE,KAAK,WAAW,EAClD;AAEF;;;;AAIG;AACI,MAAM,gCAAgC,GAAG,UAAU,CACxD,YAAY,EACZ,CAAC,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,MAAM,OAAO,GAAG,gBAAgB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,EAC7E;AAEF;;;;AAIG;MACU,YAAY,GAAG,UAAU,CAAC,WAAW,EAAE;AAEpD;;;;AAIG;MACU,qBAAqB,GAAG,UAAU,CAAC,uBAAuB,EAAE;AAEzE;;;;AAIG;MACU,aAAa,GAAG,UAAU,CAAC,YAAY,EAAE;AAEtD;;;;AAIG;AACI,MAAM,SAAS,GAAG,YAAY,CAAC;AACpC,IAAA,mBAAmB,EAAE;QACnB,SAAS;AACV,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,WAAW;AACZ,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,sBAAsB;QACtB,uBAAuB;QACvB,gCAAgC;AACjC,KAAA;AACD,IAAA,gBAAgB,EAAE;QAChB,WAAW;AACZ,KAAA;AACD,IAAA,0BAA0B,EAAE;QAC1B,iBAAiB;AAClB,KAAA;AACD,IAAA,4BAA4B,EAAE;QAC5B,YAAY;AACb,KAAA;AACD,IAAA,gCAAgC,EAAE;QAChC,aAAa;AACd,KAAA;AACD,IAAA,WAAW,EAAE;QACX,UAAU;AACX,KAAA;AACD,IAAA,WAAW,EAAE;QACX,UAAU;AACX,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,SAAS;AACV,KAAA;AACD,IAAA,sBAAsB,EAAE;QACtB,qBAAqB;AACtB,KAAA;AACD,IAAA,qBAAqB,EAAE;QACrB,YAAY;AACb,KAAA;AACF,CAAA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empathyco/x-components",
3
- "version": "6.0.0-alpha.6",
3
+ "version": "6.0.0-alpha.61",
4
4
  "description": "Empathy X Components",
5
5
  "author": "Empathy Systems Corporation S.L.",
6
6
  "license": "Apache-2.0",
@@ -69,17 +69,18 @@
69
69
  "prepublishOnly": "pnpm run build"
70
70
  },
71
71
  "dependencies": {
72
- "@empathyco/x-adapter": "^8.1.0-alpha.0",
73
- "@empathyco/x-adapter-platform": "^1.1.0-alpha.4",
74
- "@empathyco/x-bus": "^1.0.3-alpha.1",
75
- "@empathyco/x-deep-merge": "^2.0.3-alpha.1",
72
+ "@empathyco/x-adapter": "^8.1.0-alpha.2",
73
+ "@empathyco/x-adapter-platform": "^1.1.0-alpha.14",
74
+ "@empathyco/x-bus": "^1.0.3-alpha.2",
75
+ "@empathyco/x-deep-merge": "^2.0.3-alpha.3",
76
76
  "@empathyco/x-logger": "^1.2.0-alpha.11",
77
- "@empathyco/x-storage-service": "^2.0.3-alpha.0",
78
- "@empathyco/x-types": "^10.1.0-alpha.4",
79
- "@empathyco/x-utils": "^1.0.3-alpha.1",
77
+ "@empathyco/x-storage-service": "^2.0.3-alpha.1",
78
+ "@empathyco/x-types": "^10.1.0-alpha.11",
79
+ "@empathyco/x-utils": "^1.0.3-alpha.2",
80
80
  "@vue/devtools-api": "~6.5.0",
81
81
  "@vueuse/core": "~10.7.1",
82
82
  "js-md5": "~0.8.3",
83
+ "nouislider": "~15.7.1",
83
84
  "rxjs": "~7.8.0",
84
85
  "tslib": "~2.6.0",
85
86
  "vue-global-events": "~3.0.1"
@@ -89,53 +90,53 @@
89
90
  "vuex": "4.0.2"
90
91
  },
91
92
  "devDependencies": {
92
- "@badeball/cypress-cucumber-preprocessor": "~20.0.0",
93
- "@bahmutov/cypress-esbuild-preprocessor": "~2.2.0",
94
- "@empathyco/x-tailwindcss": "^1.2.0-alpha.7",
95
- "@microsoft/api-documenter": "~7.23.0",
96
- "@microsoft/api-extractor": "~7.39.0",
97
- "@testing-library/jest-dom": "~5.17.0",
98
- "@types/autoprefixer": "~10.2.0",
99
- "@types/glob": "~8.0.1",
100
- "@types/jest": "~27.5.0",
101
- "@types/node": "~18.19.0",
102
- "@types/testing-library__jest-dom": "~5.14.5",
103
- "@vitejs/plugin-vue": "~5.1.2",
93
+ "@badeball/cypress-cucumber-preprocessor": "20.0.0",
94
+ "@bahmutov/cypress-esbuild-preprocessor": "2.2.0",
95
+ "@empathyco/x-tailwindcss": "2.0.0-alpha.4",
96
+ "@microsoft/api-documenter": "7.23.0",
97
+ "@microsoft/api-extractor": "7.39.0",
98
+ "@testing-library/jest-dom": "5.17.0",
99
+ "@types/autoprefixer": "10.2.0",
100
+ "@types/glob": "8.1.0",
101
+ "@types/jest": "27.5.0",
102
+ "@types/node": "18.19.0",
103
+ "@types/testing-library__jest-dom": "5.14.9",
104
+ "@vitejs/plugin-vue": "5.2.1",
104
105
  "@vue/test-utils": "~2.4.6",
105
- "@vue/vue3-jest": "~27.0.0",
106
- "autoprefixer": "~10.4.4",
107
- "convert-source-map": "~2.0.0",
108
- "cypress": "~13.6.0",
106
+ "@vue/vue3-jest": "27.0.0",
107
+ "autoprefixer": "10.4.4",
108
+ "convert-source-map": "2.0.0",
109
+ "cypress": "13.6.0",
109
110
  "esbuild": "0.20.0",
110
- "glob": "~10.3.0",
111
- "jest": "~27.5.0",
112
- "jest-scss-transform": "~1.0.1",
113
- "postcss": "~8.4.12",
114
- "postcss-dir-pseudo-class": "~7.0.0",
115
- "postcss-logical": "~4.0.2",
116
- "rimraf": "~3.0.2",
117
- "rollup": "~4.9.1",
118
- "rollup-plugin-copy": "~3.5.0",
119
- "rollup-plugin-delete": "~2.0.0",
120
- "rollup-plugin-styles": "~4.0.0",
121
- "rollup-plugin-typescript2": "~0.36.0",
122
- "rollup-plugin-vue": "~6.0.0",
123
- "sass": "~1.70.0",
124
- "start-server-and-test": "~2.0.0",
125
- "tailwindcss": "~3.4.0",
126
- "ts-jest": "~27.1.0",
127
- "ts-node": "~10.9.2",
128
- "typescript": "~4.9.4",
129
- "vite": "~4.5.0",
130
- "vite-plugin-vue-inspector": "~5.1.2",
131
- "vue": "~3.4.31",
132
- "vue-docgen-cli": "~4.79.0",
133
- "vue-router": "~4.4.0",
111
+ "glob": "10.3.0",
112
+ "jest": "27.5.0",
113
+ "jest-scss-transform": "1.0.1",
114
+ "postcss": "8.4.12",
115
+ "postcss-dir-pseudo-class": "7.0.0",
116
+ "postcss-logical": "4.0.2",
117
+ "rimraf": "3.0.2",
118
+ "rollup": "4.9.1",
119
+ "rollup-plugin-copy": "3.5.0",
120
+ "rollup-plugin-delete": "2.0.0",
121
+ "rollup-plugin-styles": "4.0.0",
122
+ "rollup-plugin-typescript2": "0.36.0",
123
+ "rollup-plugin-vue": "6.0.0",
124
+ "sass": "1.70.0",
125
+ "start-server-and-test": "2.0.0",
126
+ "tailwindcss": "3.4.0",
127
+ "ts-jest": "27.1.0",
128
+ "ts-node": "10.9.2",
129
+ "typescript": "4.9.4",
130
+ "vite": "4.5.0",
131
+ "vite-plugin-vue-inspector": "5.1.2",
132
+ "vue": "3.4.31",
133
+ "vue-docgen-cli": "4.79.0",
134
+ "vue-router": "4.4.0",
134
135
  "vuex": "4.0.2"
135
136
  },
136
137
  "publishConfig": {
137
138
  "access": "public",
138
139
  "directory": "dist"
139
140
  },
140
- "gitHead": "abc0d00d934bc6cd4052c2212d816321ab097742"
141
+ "gitHead": "3a4d749dd8a832e7c141455ff886c1890495a41a"
141
142
  }
@@ -0,0 +1 @@
1
+ export * from '../types/x-modules/related-prompts';
@@ -0,0 +1,9 @@
1
+ export { default as RelatedPrompt } from '../js/x-modules/related-prompts/components/related-prompt.vue.js';
2
+ export { default as RelatedPromptsList } from '../js/x-modules/related-prompts/components/related-prompts-list.vue.js';
3
+ export { default as RelatedPromptsTagList } from '../js/x-modules/related-prompts/components/related-prompts-tag-list.vue.js';
4
+ export { cancelFetchAndSaveRelatedPrompts, fetchAndSaveRelatedPrompts } from '../js/x-modules/related-prompts/store/actions/fetch-and-save-related-prompts.action.js';
5
+ export { fetchRelatedPrompts } from '../js/x-modules/related-prompts/store/actions/fetch-related-prompts.action.js';
6
+ export { relatedPromptsStoreEmitters } from '../js/x-modules/related-prompts/store/emitters.js';
7
+ export { relatedPromptsXStoreModule } from '../js/x-modules/related-prompts/store/module.js';
8
+ export { relatedPromptsWiring } from '../js/x-modules/related-prompts/wiring.js';
9
+ export { relatedPromptsXModule } from '../js/x-modules/related-prompts/x-module.js';