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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (335) hide show
  1. package/CHANGELOG.md +202 -1
  2. package/core/index.js +1 -0
  3. package/core/index.js.map +1 -1
  4. package/design-system/deprecated-full-theme.css +1555 -1555
  5. package/docs/API-reference/api/x-adapter-platform.md +9 -0
  6. package/docs/API-reference/api/x-adapter-platform.platformadapter.relatedprompts.md +11 -0
  7. package/docs/API-reference/api/x-adapter-platform.platformrelatedprompt.md +22 -0
  8. package/docs/API-reference/api/x-adapter-platform.platformrelatedprompt.nextqueries.md +11 -0
  9. package/docs/API-reference/api/x-adapter-platform.platformrelatedprompt.suggestiontext.md +11 -0
  10. package/docs/API-reference/api/x-adapter-platform.platformrelatedprompt.type.md +11 -0
  11. package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptsrequest.md +15 -0
  12. package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptsresponse.data.md +13 -0
  13. package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptsresponse.md +21 -0
  14. package/docs/API-reference/api/x-adapter-platform.platformrelatedpromptsresponse.status.md +11 -0
  15. package/docs/API-reference/api/x-adapter-platform.platformsearchresponse.catalog.md +6 -0
  16. package/docs/API-reference/api/x-adapter-platform.platformsearchresponse.md +1 -1
  17. package/docs/API-reference/api/x-adapter-platform.relatedpromptschema.md +13 -0
  18. package/docs/API-reference/api/x-adapter-platform.relatedpromptsendpointadapter.md +13 -0
  19. package/docs/API-reference/api/x-adapter-platform.relatedpromptsrequestmapper.md +13 -0
  20. package/docs/API-reference/api/x-adapter-platform.relatedpromptsrequestschema.md +13 -0
  21. package/docs/API-reference/api/x-adapter-platform.relatedpromptsresponsemapper.md +13 -0
  22. package/docs/API-reference/api/x-adapter-platform.relatedpromptsresponseschema.md +13 -0
  23. package/docs/API-reference/api/x-components.animationprop.md +6 -1
  24. package/docs/API-reference/api/x-components.bannerslist.md +3 -3
  25. package/docs/API-reference/api/x-components.basedropdown.md +5 -5
  26. package/docs/API-reference/api/x-components.baseeventsmodal.md +2 -2
  27. package/docs/API-reference/api/x-components.basegrid.md +3 -3
  28. package/docs/API-reference/api/x-components.baseheadertogglepanel.md +5 -5
  29. package/docs/API-reference/api/x-components.baseidmodal.md +2 -2
  30. package/docs/API-reference/api/x-components.baseidtogglepanel.md +5 -5
  31. package/docs/API-reference/api/x-components.basemodal.md +10 -10
  32. package/docs/API-reference/api/x-components.baseresultimage.md +9 -9
  33. package/docs/API-reference/api/x-components.baseslider.md +70 -0
  34. package/docs/API-reference/api/x-components.basesuggestions.md +3 -3
  35. package/docs/API-reference/api/x-components.basetabspanel.md +8 -8
  36. package/docs/API-reference/api/x-components.basetogglepanel.md +3 -3
  37. package/docs/API-reference/api/x-components.basevariablecolumngrid.md +3 -3
  38. package/docs/API-reference/api/x-components.cancelfetchandsaverelatedprompts.md +13 -0
  39. package/docs/API-reference/api/x-components.empathize.md +5 -5
  40. package/docs/API-reference/api/x-components.facets.md +3 -3
  41. package/docs/API-reference/api/x-components.fetchandsaverelatedprompts.md +13 -0
  42. package/docs/API-reference/api/x-components.fetchrelatedprompts.md +13 -0
  43. package/docs/API-reference/api/x-components.filterslist.md +3 -3
  44. package/docs/API-reference/api/x-components.globalxbus.md +6 -0
  45. package/docs/API-reference/api/x-components.hierarchicalfilter.md +5 -2
  46. package/docs/API-reference/api/x-components.identifierresults.md +3 -3
  47. package/docs/API-reference/api/x-components.itemslist.md +3 -3
  48. package/docs/API-reference/api/x-components.mainmodal.md +2 -2
  49. package/docs/API-reference/api/x-components.md +17 -0
  50. package/docs/API-reference/api/x-components.multicolumnmaxwidthlayout.md +5 -5
  51. package/docs/API-reference/api/x-components.myhistory.md +3 -3
  52. package/docs/API-reference/api/x-components.nextqueriesgroup.md +22 -0
  53. package/docs/API-reference/api/x-components.nextqueriesgroup.modelname.md +11 -0
  54. package/docs/API-reference/api/x-components.nextqueriesgroup.nextqueries.md +11 -0
  55. package/docs/API-reference/api/x-components.nextquerieslist.md +3 -3
  56. package/docs/API-reference/api/x-components.partialresultslist.md +3 -3
  57. package/docs/API-reference/api/x-components.promotedslist.md +3 -3
  58. package/docs/API-reference/api/x-components.querypreviewlist.md +3 -3
  59. package/docs/API-reference/api/x-components.recommendations.md +3 -3
  60. package/docs/API-reference/api/x-components.relatedprompt.md +38 -0
  61. package/docs/API-reference/api/x-components.relatedpromptrequest.md +13 -0
  62. package/docs/API-reference/api/x-components.relatedpromptsactioncontext.md +15 -0
  63. package/docs/API-reference/api/x-components.relatedpromptsactions.cancelfetchandsaverelatedprompts.md +17 -0
  64. package/docs/API-reference/api/x-components.relatedpromptsactions.fetchandsaverelatedprompts.md +24 -0
  65. package/docs/API-reference/api/x-components.relatedpromptsactions.fetchrelatedprompts.md +24 -0
  66. package/docs/API-reference/api/x-components.relatedpromptsactions.md +22 -0
  67. package/docs/API-reference/api/x-components.relatedpromptsgetters.md +20 -0
  68. package/docs/API-reference/api/x-components.relatedpromptsgetters.request.md +13 -0
  69. package/docs/API-reference/api/x-components.relatedpromptslist.md +72 -0
  70. package/docs/API-reference/api/x-components.relatedpromptsmutations.md +25 -0
  71. package/docs/API-reference/api/x-components.relatedpromptsmutations.resetrelatedpromptsstate.md +17 -0
  72. package/docs/API-reference/api/x-components.relatedpromptsmutations.setparams.md +24 -0
  73. package/docs/API-reference/api/x-components.relatedpromptsmutations.setrelatedpromptsproducts.md +24 -0
  74. package/docs/API-reference/api/x-components.relatedpromptsmutations.setselectedprompt.md +24 -0
  75. package/docs/API-reference/api/x-components.relatedpromptsmutations.setselectedquery.md +24 -0
  76. package/docs/API-reference/api/x-components.relatedpromptsstate.md +24 -0
  77. package/docs/API-reference/api/x-components.relatedpromptsstate.params.md +13 -0
  78. package/docs/API-reference/api/x-components.relatedpromptsstate.relatedprompts.md +13 -0
  79. package/docs/API-reference/api/x-components.relatedpromptsstate.selectedprompt.md +13 -0
  80. package/docs/API-reference/api/x-components.relatedpromptsstate.selectedquery.md +13 -0
  81. package/docs/API-reference/api/x-components.relatedpromptsxevents.md +22 -0
  82. package/docs/API-reference/api/x-components.relatedpromptsxevents.relatedpromptsrequestupdated.md +13 -0
  83. package/docs/API-reference/api/x-components.relatedpromptsxevents.userselectedarelatedprompt.md +13 -0
  84. package/docs/API-reference/api/x-components.relatedpromptsxevents.userselectedarelatedpromptquery.md +13 -0
  85. package/docs/API-reference/api/x-components.relatedpromptsxmodule.md +13 -0
  86. package/docs/API-reference/api/x-components.relatedpromptsxstoremodule.md +15 -0
  87. package/docs/API-reference/api/x-components.relatedtags.md +3 -3
  88. package/docs/API-reference/api/x-components.resultslist.md +3 -3
  89. package/docs/API-reference/api/x-components.scrolltotop.md +5 -5
  90. package/docs/API-reference/api/x-components.searchinputplaceholder.md +3 -3
  91. package/docs/API-reference/api/x-components.searchmutations.md +1 -0
  92. package/docs/API-reference/api/x-components.searchmutations.setstats.md +24 -0
  93. package/docs/API-reference/api/x-components.searchstate.md +1 -0
  94. package/docs/API-reference/api/x-components.searchstate.stats.md +13 -0
  95. package/docs/API-reference/api/x-components.selectedfilterslist.md +3 -3
  96. package/docs/API-reference/api/x-components.simplefilter.md +3 -0
  97. package/docs/API-reference/api/x-components.singlecolumnlayout.md +3 -3
  98. package/docs/API-reference/api/x-components.snippetcallbacks.md +3 -0
  99. package/docs/API-reference/api/x-components.snippetconfigextraparams.md +1 -1
  100. package/docs/API-reference/api/x-components.sortdropdown.md +1 -1
  101. package/docs/API-reference/api/x-components.tagging.md +17 -4
  102. package/docs/API-reference/api/x-components.usealiasapi.md +1 -0
  103. package/docs/API-reference/api/x-components.usealiasapi.pricestats.md +16 -0
  104. package/docs/API-reference/api/x-components.xeventstypes.md +3 -3
  105. package/docs/API-reference/api/x-components.xmodulestree.md +1 -0
  106. package/docs/API-reference/api/x-components.xmodulestree.relatedprompts.md +11 -0
  107. package/docs/API-reference/api/x-types.md +4 -0
  108. package/docs/API-reference/api/x-types.relatedprompt.md +23 -0
  109. package/docs/API-reference/api/x-types.relatedprompt.nextqueries.md +13 -0
  110. package/docs/API-reference/api/x-types.relatedprompt.suggestiontext.md +13 -0
  111. package/docs/API-reference/api/x-types.relatedprompt.type.md +13 -0
  112. package/docs/API-reference/api/x-types.relatedpromptsrequest.md +15 -0
  113. package/docs/API-reference/api/x-types.relatedpromptsresponse.md +20 -0
  114. package/docs/API-reference/api/x-types.relatedpromptsresponse.relatedprompts.md +11 -0
  115. package/docs/API-reference/api/x-types.searchresponse.md +1 -0
  116. package/docs/API-reference/api/x-types.searchresponse.stats.md +11 -0
  117. package/docs/API-reference/api/x-types.stats.md +22 -0
  118. package/docs/API-reference/api/x-types.stats.price.md +14 -0
  119. package/docs/API-reference/api/x-types.xcomponentsadapter.md +1 -0
  120. package/docs/API-reference/api/x-types.xcomponentsadapter.relatedprompts.md +11 -0
  121. package/docs/API-reference/components/common/result/x-components.base-result-image.md +2 -2
  122. package/docs/API-reference/components/common/x-components.base-slider.md +189 -0
  123. package/docs/API-reference/components/common/x-components.items-list.md +1 -1
  124. package/docs/API-reference/components/facets/x-components.facets/facets.md +1 -1
  125. package/docs/API-reference/components/facets/x-components.lists/selected-filters-list.md +1 -1
  126. package/docs/API-reference/components/related-prompts/x-components.related-prompt.md +29 -0
  127. package/docs/API-reference/components/related-prompts/x-components.related-prompts-list.md +196 -0
  128. package/docs/API-reference/components/search/x-components.results-list.md +1 -1
  129. package/docs/API-reference/components/tagging/x-components.tagging.md +2 -2
  130. package/js/components/base-grid.vue.js.map +1 -1
  131. package/js/components/base-grid.vue2.js.map +1 -1
  132. package/js/components/base-grid.vue3.js +1 -1
  133. package/js/components/base-slider.vue.js +66 -0
  134. package/js/components/base-slider.vue.js.map +1 -0
  135. package/js/components/base-slider.vue2.js +109 -0
  136. package/js/components/base-slider.vue2.js.map +1 -0
  137. package/js/components/base-slider.vue3.js +7 -0
  138. package/js/components/base-slider.vue3.js.map +1 -0
  139. package/js/components/icons/cross-tiny.vue.js +2 -2
  140. package/js/components/icons/plus.vue.js +2 -2
  141. package/js/components/items-list.vue.js.map +1 -1
  142. package/js/components/items-list.vue2.js +2 -2
  143. package/js/components/items-list.vue2.js.map +1 -1
  144. package/js/components/result/base-result-image.vue.js.map +1 -1
  145. package/js/components/result/base-result-image.vue2.js +3 -3
  146. package/js/components/result/base-result-image.vue2.js.map +1 -1
  147. package/js/components/scroll/use-scroll.js +1 -1
  148. package/js/components/scroll/use-scroll.js.map +1 -1
  149. package/js/components/sliding-panel.vue.js +2 -2
  150. package/js/composables/use-alias-api.js +3 -0
  151. package/js/composables/use-alias-api.js.map +1 -1
  152. package/js/index.js +10 -0
  153. package/js/index.js.map +1 -1
  154. package/js/types/animation-prop.js +5 -0
  155. package/js/types/animation-prop.js.map +1 -1
  156. package/js/x-modules/empathize/components/empathize.vue2.js +2 -0
  157. package/js/x-modules/empathize/components/empathize.vue2.js.map +1 -1
  158. package/js/x-modules/extra-params/components/snippet-config-extra-params.vue.js.map +1 -1
  159. package/js/x-modules/extra-params/components/snippet-config-extra-params.vue2.js +1 -1
  160. package/js/x-modules/extra-params/components/snippet-config-extra-params.vue2.js.map +1 -1
  161. package/js/x-modules/facets/components/facets/facets.vue.js.map +1 -1
  162. package/js/x-modules/facets/components/facets/facets.vue2.js +2 -2
  163. package/js/x-modules/facets/components/facets/facets.vue2.js.map +1 -1
  164. package/js/x-modules/facets/components/lists/selected-filters-list.vue.js.map +1 -1
  165. package/js/x-modules/facets/components/lists/selected-filters-list.vue2.js +2 -2
  166. package/js/x-modules/facets/components/lists/selected-filters-list.vue2.js.map +1 -1
  167. package/js/x-modules/queries-preview/components/query-preview-button.vue2.js +2 -0
  168. package/js/x-modules/queries-preview/components/query-preview-button.vue2.js.map +1 -1
  169. package/js/x-modules/queries-preview/components/query-preview-list.vue.js.map +1 -1
  170. package/js/x-modules/queries-preview/components/query-preview-list.vue2.js +15 -2
  171. package/js/x-modules/queries-preview/components/query-preview-list.vue2.js.map +1 -1
  172. package/js/x-modules/queries-preview/components/query-preview.vue.js.map +1 -1
  173. package/js/x-modules/queries-preview/components/query-preview.vue2.js +3 -1
  174. package/js/x-modules/queries-preview/components/query-preview.vue2.js.map +1 -1
  175. package/js/x-modules/queries-preview/store/actions/fetch-and-save-query-preview.action.js +2 -1
  176. package/js/x-modules/queries-preview/store/actions/fetch-and-save-query-preview.action.js.map +1 -1
  177. package/js/x-modules/queries-preview/store/module.js +1 -1
  178. package/js/x-modules/queries-preview/store/module.js.map +1 -1
  179. package/js/x-modules/queries-preview/utils/get-hash-from-query-preview.js +6 -4
  180. package/js/x-modules/queries-preview/utils/get-hash-from-query-preview.js.map +1 -1
  181. package/js/x-modules/related-prompts/components/related-prompt.vue.js +90 -0
  182. package/js/x-modules/related-prompts/components/related-prompt.vue.js.map +1 -0
  183. package/js/x-modules/related-prompts/components/related-prompt.vue2.js +54 -0
  184. package/js/x-modules/related-prompts/components/related-prompt.vue2.js.map +1 -0
  185. package/js/x-modules/related-prompts/components/related-prompt.vue3.js +7 -0
  186. package/js/x-modules/related-prompts/components/related-prompt.vue3.js.map +1 -0
  187. package/js/x-modules/related-prompts/components/related-prompts-list.vue.js +154 -0
  188. package/js/x-modules/related-prompts/components/related-prompts-list.vue.js.map +1 -0
  189. package/js/x-modules/related-prompts/components/related-prompts-list.vue2.js +6 -0
  190. package/js/x-modules/related-prompts/components/related-prompts-list.vue2.js.map +1 -0
  191. package/js/x-modules/related-prompts/store/actions/fetch-and-save-related-prompts.action.js +29 -0
  192. package/js/x-modules/related-prompts/store/actions/fetch-and-save-related-prompts.action.js.map +1 -0
  193. package/js/x-modules/related-prompts/store/actions/fetch-related-prompts.action.js +20 -0
  194. package/js/x-modules/related-prompts/store/actions/fetch-related-prompts.action.js.map +1 -0
  195. package/js/x-modules/related-prompts/store/emitters.js +14 -0
  196. package/js/x-modules/related-prompts/store/emitters.js.map +1 -0
  197. package/js/x-modules/related-prompts/store/getters/request.getter.js +16 -0
  198. package/js/x-modules/related-prompts/store/getters/request.getter.js.map +1 -0
  199. package/js/x-modules/related-prompts/store/module.js +53 -0
  200. package/js/x-modules/related-prompts/store/module.js.map +1 -0
  201. package/js/x-modules/related-prompts/wiring.js +88 -0
  202. package/js/x-modules/related-prompts/wiring.js.map +1 -0
  203. package/js/x-modules/related-prompts/x-module.js +21 -0
  204. package/js/x-modules/related-prompts/x-module.js.map +1 -0
  205. package/js/x-modules/scroll/components/scroll-to-top.vue2.js +2 -0
  206. package/js/x-modules/scroll/components/scroll-to-top.vue2.js.map +1 -1
  207. package/js/x-modules/search/components/results-list.vue.js +2 -2
  208. package/js/x-modules/search/components/results-list.vue.js.map +1 -1
  209. package/js/x-modules/search/store/actions/save-search-response.action.js +2 -1
  210. package/js/x-modules/search/store/actions/save-search-response.action.js.map +1 -1
  211. package/js/x-modules/search/store/module.js +5 -1
  212. package/js/x-modules/search/store/module.js.map +1 -1
  213. package/js/x-modules/tagging/components/tagging.vue.js +8 -2
  214. package/js/x-modules/tagging/components/tagging.vue.js.map +1 -1
  215. package/package.json +7 -6
  216. package/related-prompts/index.d.ts +1 -0
  217. package/related-prompts/index.js +9 -0
  218. package/report/x-adapter-platform.api.json +575 -1
  219. package/report/x-components.api.json +4236 -7917
  220. package/report/x-components.api.md +445 -155
  221. package/report/x-types.api.json +334 -0
  222. package/tools/inject-css.js +5 -3
  223. package/types/adapter/e2e-adapter.d.ts.map +1 -1
  224. package/types/adapter/mocked-responses.d.ts +3 -0
  225. package/types/adapter/mocked-responses.d.ts.map +1 -1
  226. package/types/components/base-dropdown.vue.d.ts +5 -5
  227. package/types/components/base-grid.vue.d.ts +3 -3
  228. package/types/components/base-slider.vue.d.ts +74 -0
  229. package/types/components/base-slider.vue.d.ts.map +1 -0
  230. package/types/components/base-variable-column-grid.vue.d.ts +3 -3
  231. package/types/components/global-x-bus.vue.d.ts +6 -0
  232. package/types/components/global-x-bus.vue.d.ts.map +1 -1
  233. package/types/components/index.d.ts +1 -0
  234. package/types/components/index.d.ts.map +1 -1
  235. package/types/components/items-list.vue.d.ts +3 -3
  236. package/types/components/layouts/multi-column-max-width-layout.vue.d.ts +5 -5
  237. package/types/components/layouts/single-column-layout.vue.d.ts +3 -3
  238. package/types/components/modals/base-events-modal.vue.d.ts +2 -2
  239. package/types/components/modals/base-id-modal.vue.d.ts +2 -2
  240. package/types/components/modals/base-modal.vue.d.ts +10 -10
  241. package/types/components/modals/main-modal.vue.d.ts +2 -2
  242. package/types/components/panels/base-header-toggle-panel.vue.d.ts +5 -5
  243. package/types/components/panels/base-id-toggle-panel.vue.d.ts +5 -5
  244. package/types/components/panels/base-tabs-panel.vue.d.ts +8 -8
  245. package/types/components/panels/base-toggle-panel.vue.d.ts +3 -3
  246. package/types/components/result/base-result-image.vue.d.ts +10 -10
  247. package/types/components/result/base-result-image.vue.d.ts.map +1 -1
  248. package/types/components/snippet-callbacks.vue.d.ts +3 -0
  249. package/types/components/snippet-callbacks.vue.d.ts.map +1 -1
  250. package/types/components/suggestions/base-suggestions.vue.d.ts +3 -3
  251. package/types/composables/use-alias-api.d.ts +5 -0
  252. package/types/composables/use-alias-api.d.ts.map +1 -1
  253. package/types/index.d.ts +1 -0
  254. package/types/index.d.ts.map +1 -1
  255. package/types/tailwind/plugin-options.d.ts +1 -2
  256. package/types/tailwind/plugin-options.d.ts.map +1 -1
  257. package/types/types/animation-prop.d.ts +6 -2
  258. package/types/types/animation-prop.d.ts.map +1 -1
  259. package/types/views/home/types.d.ts +3 -0
  260. package/types/views/home/types.d.ts.map +1 -1
  261. package/types/wiring/events.types.d.ts +3 -1
  262. package/types/wiring/events.types.d.ts.map +1 -1
  263. package/types/x-modules/empathize/components/empathize.vue.d.ts +5 -5
  264. package/types/x-modules/extra-params/components/snippet-config-extra-params.vue.d.ts +1 -1
  265. package/types/x-modules/facets/components/facets/facets.vue.d.ts +3 -3
  266. package/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts +5 -2
  267. package/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts.map +1 -1
  268. package/types/x-modules/facets/components/filters/simple-filter.vue.d.ts +3 -0
  269. package/types/x-modules/facets/components/filters/simple-filter.vue.d.ts.map +1 -1
  270. package/types/x-modules/facets/components/lists/filters-list.vue.d.ts +3 -3
  271. package/types/x-modules/facets/components/lists/selected-filters-list.vue.d.ts +3 -3
  272. package/types/x-modules/history-queries/components/my-history.vue.d.ts +3 -3
  273. package/types/x-modules/identifier-results/components/identifier-results.vue.d.ts +3 -3
  274. package/types/x-modules/next-queries/components/next-queries-list.vue.d.ts +3 -3
  275. package/types/x-modules/next-queries/index.d.ts +1 -0
  276. package/types/x-modules/next-queries/index.d.ts.map +1 -1
  277. package/types/x-modules/queries-preview/components/query-preview-list.vue.d.ts +3 -3
  278. package/types/x-modules/queries-preview/components/query-preview-list.vue.d.ts.map +1 -1
  279. package/types/x-modules/queries-preview/components/query-preview.vue.d.ts.map +1 -1
  280. package/types/x-modules/queries-preview/store/actions/fetch-and-save-query-preview.action.d.ts.map +1 -1
  281. package/types/x-modules/queries-preview/store/module.d.ts.map +1 -1
  282. package/types/x-modules/queries-preview/utils/get-hash-from-query-preview.d.ts +4 -2
  283. package/types/x-modules/queries-preview/utils/get-hash-from-query-preview.d.ts.map +1 -1
  284. package/types/x-modules/recommendations/components/recommendations.vue.d.ts +3 -3
  285. package/types/x-modules/related-prompts/components/index.d.ts +3 -0
  286. package/types/x-modules/related-prompts/components/index.d.ts.map +1 -0
  287. package/types/x-modules/related-prompts/components/related-prompt.vue.d.ts +37 -0
  288. package/types/x-modules/related-prompts/components/related-prompt.vue.d.ts.map +1 -0
  289. package/types/x-modules/related-prompts/components/related-prompts-list.vue.d.ts +106 -0
  290. package/types/x-modules/related-prompts/components/related-prompts-list.vue.d.ts.map +1 -0
  291. package/types/x-modules/related-prompts/events.types.d.ts +26 -0
  292. package/types/x-modules/related-prompts/events.types.d.ts.map +1 -0
  293. package/types/x-modules/related-prompts/index.d.ts +6 -0
  294. package/types/x-modules/related-prompts/index.d.ts.map +1 -0
  295. package/types/x-modules/related-prompts/store/actions/fetch-and-save-related-prompts.action.d.ts +17 -0
  296. package/types/x-modules/related-prompts/store/actions/fetch-and-save-related-prompts.action.d.ts.map +1 -0
  297. package/types/x-modules/related-prompts/store/actions/fetch-related-prompts.action.d.ts +13 -0
  298. package/types/x-modules/related-prompts/store/actions/fetch-related-prompts.action.d.ts.map +1 -0
  299. package/types/x-modules/related-prompts/store/emitters.d.ts +9 -0
  300. package/types/x-modules/related-prompts/store/emitters.d.ts.map +1 -0
  301. package/types/x-modules/related-prompts/store/getters/request.getter.d.ts +13 -0
  302. package/types/x-modules/related-prompts/store/getters/request.getter.d.ts.map +1 -0
  303. package/types/x-modules/related-prompts/store/index.d.ts +7 -0
  304. package/types/x-modules/related-prompts/store/index.d.ts.map +1 -0
  305. package/types/x-modules/related-prompts/store/module.d.ts +8 -0
  306. package/types/x-modules/related-prompts/store/module.d.ts.map +1 -0
  307. package/types/x-modules/related-prompts/store/types.d.ts +104 -0
  308. package/types/x-modules/related-prompts/store/types.d.ts.map +1 -0
  309. package/types/x-modules/related-prompts/types.d.ts +10 -0
  310. package/types/x-modules/related-prompts/types.d.ts.map +1 -0
  311. package/types/x-modules/related-prompts/wiring.d.ts +31 -0
  312. package/types/x-modules/related-prompts/wiring.d.ts.map +1 -0
  313. package/types/x-modules/related-prompts/x-module.d.ts +16 -0
  314. package/types/x-modules/related-prompts/x-module.d.ts.map +1 -0
  315. package/types/x-modules/related-tags/components/related-tags.vue.d.ts +3 -3
  316. package/types/x-modules/scroll/components/scroll-to-top.vue.d.ts +5 -5
  317. package/types/x-modules/search/components/banners-list.vue.d.ts +3 -3
  318. package/types/x-modules/search/components/partial-results-list.vue.d.ts +3 -3
  319. package/types/x-modules/search/components/promoteds-list.vue.d.ts +3 -3
  320. package/types/x-modules/search/components/results-list.vue.d.ts +3 -3
  321. package/types/x-modules/search/components/sort-dropdown.vue.d.ts +1 -1
  322. package/types/x-modules/search/store/actions/save-search-response.action.d.ts.map +1 -1
  323. package/types/x-modules/search/store/module.d.ts +2 -0
  324. package/types/x-modules/search/store/module.d.ts.map +1 -1
  325. package/types/x-modules/search/store/types.d.ts +9 -1
  326. package/types/x-modules/search/store/types.d.ts.map +1 -1
  327. package/types/x-modules/search-box/components/search-input-placeholder.vue.d.ts +3 -3
  328. package/types/x-modules/tagging/components/tagging.vue.d.ts +17 -4
  329. package/types/x-modules/tagging/components/tagging.vue.d.ts.map +1 -1
  330. package/types/x-modules/x-modules.types.d.ts +2 -0
  331. package/types/x-modules/x-modules.types.d.ts.map +1 -1
  332. package/js/utils/options-api.js +0 -4
  333. package/js/utils/options-api.js.map +0 -1
  334. package/types/utils/options-api.d.ts +0 -3
  335. package/types/utils/options-api.d.ts.map +0 -1
@@ -0,0 +1,29 @@
1
+ import { createFetchAndSaveActions } from '../../../../store/utils/fetch-and-save-action.utils.js';
2
+
3
+ const { fetchAndSave, cancelPrevious } = createFetchAndSaveActions({
4
+ fetch({ dispatch }, request) {
5
+ return dispatch('fetchRelatedPrompts', request);
6
+ },
7
+ onSuccess({ commit }, relatedPrompts) {
8
+ if (relatedPrompts) {
9
+ commit('setRelatedPromptsProducts', relatedPrompts);
10
+ }
11
+ }
12
+ });
13
+ /**
14
+ * Default implementation for
15
+ * {@link RelatedPromptsActions.fetchAndSaveRelatedPrompts} action.
16
+ *
17
+ * @public
18
+ */
19
+ const fetchAndSaveRelatedPrompts = fetchAndSave;
20
+ /**
21
+ * Default implementation for
22
+ * {@link RelatedPromptsActions.cancelFetchAndSaveRelatedPrompts} action.
23
+ *
24
+ * @public
25
+ */
26
+ const cancelFetchAndSaveRelatedPrompts = cancelPrevious;
27
+
28
+ export { cancelFetchAndSaveRelatedPrompts, fetchAndSaveRelatedPrompts };
29
+ //# sourceMappingURL=fetch-and-save-related-prompts.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch-and-save-related-prompts.action.js","sources":["../../../../../../src/x-modules/related-prompts/store/actions/fetch-and-save-related-prompts.action.ts"],"sourcesContent":["import { RelatedPrompt, RelatedPromptsRequest } from '@empathyco/x-types';\nimport { createFetchAndSaveActions } from '../../../../store/utils/fetch-and-save-action.utils';\nimport { RelatedPromptsActionContext } from '../types';\n\nconst { fetchAndSave, cancelPrevious } = createFetchAndSaveActions<\n RelatedPromptsActionContext,\n RelatedPromptsRequest | null,\n RelatedPrompt[] | null\n>({\n fetch({ dispatch }, request) {\n return dispatch('fetchRelatedPrompts', request);\n },\n onSuccess({ commit }, relatedPrompts) {\n if (relatedPrompts) {\n commit('setRelatedPromptsProducts', relatedPrompts);\n }\n }\n});\n\n/**\n * Default implementation for\n * {@link RelatedPromptsActions.fetchAndSaveRelatedPrompts} action.\n *\n * @public\n */\nexport const fetchAndSaveRelatedPrompts = fetchAndSave;\n\n/**\n * Default implementation for\n * {@link RelatedPromptsActions.cancelFetchAndSaveRelatedPrompts} action.\n *\n * @public\n */\nexport const cancelFetchAndSaveRelatedPrompts = cancelPrevious;\n"],"names":[],"mappings":";;AAIA,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,yBAAyB,CAIhE;AACA,IAAA,KAAK,CAAC,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAA;AACzB,QAAA,OAAO,QAAQ,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;KACjD;AACD,IAAA,SAAS,CAAC,EAAE,MAAM,EAAE,EAAE,cAAc,EAAA;AAClC,QAAA,IAAI,cAAc,EAAE;AAClB,YAAA,MAAM,CAAC,2BAA2B,EAAE,cAAc,CAAC,CAAC;AACrD,SAAA;KACF;AACF,CAAA,CAAC,CAAC;AAEH;;;;;AAKG;AACI,MAAM,0BAA0B,GAAG,aAAa;AAEvD;;;;;AAKG;AACI,MAAM,gCAAgC,GAAG;;;;"}
@@ -0,0 +1,20 @@
1
+ import { XPlugin } from '../../../../plugins/x-plugin.js';
2
+
3
+ /**
4
+ * Default implementation for the {@link RelatedPromptsActions.fetchRelatedPrompts}.
5
+ *
6
+ * @param _ - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,
7
+ * provided by Vuex.
8
+ * @param request - The related prompts request to make.
9
+ * @returns The related prompts response.
10
+ *
11
+ * @public
12
+ */
13
+ const fetchRelatedPrompts = (_, request) => {
14
+ return request
15
+ ? XPlugin.adapter.relatedPrompts(request).then(({ relatedPrompts }) => relatedPrompts)
16
+ : null;
17
+ };
18
+
19
+ export { fetchRelatedPrompts };
20
+ //# sourceMappingURL=fetch-related-prompts.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch-related-prompts.action.js","sources":["../../../../../../src/x-modules/related-prompts/store/actions/fetch-related-prompts.action.ts"],"sourcesContent":["import { XPlugin } from '../../../../plugins/x-plugin';\nimport { RelatedPromptsXStoreModule } from '../types';\n\n/**\n * Default implementation for the {@link RelatedPromptsActions.fetchRelatedPrompts}.\n *\n * @param _ - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,\n * provided by Vuex.\n * @param request - The related prompts request to make.\n * @returns The related prompts response.\n *\n * @public\n */\nexport const fetchRelatedPrompts: RelatedPromptsXStoreModule['actions']['fetchRelatedPrompts'] = (\n _,\n request\n) => {\n return request\n ? XPlugin.adapter.relatedPrompts(request).then(({ relatedPrompts }) => relatedPrompts)\n : null;\n};\n"],"names":[],"mappings":";;AAGA;;;;;;;;;AASG;MACU,mBAAmB,GAAiE,CAC/F,CAAC,EACD,OAAO,KACL;AACF,IAAA,OAAO,OAAO;UACV,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,cAAc,EAAE,KAAK,cAAc,CAAC;UACpF,IAAI,CAAC;AACX;;;;"}
@@ -0,0 +1,14 @@
1
+ import { createStoreEmitters } from '../../../store/utils/store-emitters.utils.js';
2
+ import { relatedPromptsXStoreModule } from './module.js';
3
+
4
+ /**
5
+ * {@link StoreEmitters} For the related-prompts module.
6
+ *
7
+ * @internal
8
+ */
9
+ const relatedPromptsStoreEmitters = createStoreEmitters(relatedPromptsXStoreModule, {
10
+ RelatedPromptsRequestUpdated: (_, getters) => getters.request
11
+ });
12
+
13
+ export { relatedPromptsStoreEmitters };
14
+ //# sourceMappingURL=emitters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emitters.js","sources":["../../../../../src/x-modules/related-prompts/store/emitters.ts"],"sourcesContent":["import { createStoreEmitters } from '../../../store';\nimport { relatedPromptsXStoreModule } from './module';\n\n/**\n * {@link StoreEmitters} For the related-prompts module.\n *\n * @internal\n */\nexport const relatedPromptsStoreEmitters = createStoreEmitters(relatedPromptsXStoreModule, {\n RelatedPromptsRequestUpdated: (_, getters) => getters.request\n});\n"],"names":[],"mappings":";;;AAGA;;;;AAIG;AACU,MAAA,2BAA2B,GAAG,mBAAmB,CAAC,0BAA0B,EAAE;IACzF,4BAA4B,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO;AAC9D,CAAA;;;;"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Default implementation for the {@link RelatedPromptsGetters.request} getter.
3
+ *
4
+ * @param state - Current {@link https://vuex.vuejs.org/guide/state.html | state} of the related
5
+ * prompts module.
6
+ *
7
+ * @returns The related prompts request to fetch data from the API.
8
+ *
9
+ * @public
10
+ */
11
+ const request = ({ params, query }) => {
12
+ return query ? { query, extraParams: params } : null;
13
+ };
14
+
15
+ export { request };
16
+ //# sourceMappingURL=request.getter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.getter.js","sources":["../../../../../../src/x-modules/related-prompts/store/getters/request.getter.ts"],"sourcesContent":["import { RelatedPromptsXStoreModule } from '../types';\n\n/**\n * Default implementation for the {@link RelatedPromptsGetters.request} getter.\n *\n * @param state - Current {@link https://vuex.vuejs.org/guide/state.html | state} of the related\n * prompts module.\n *\n * @returns The related prompts request to fetch data from the API.\n *\n * @public\n */\nexport const request: RelatedPromptsXStoreModule['getters']['request'] = ({ params, query }) => {\n return query ? { query, extraParams: params } : null;\n};\n"],"names":[],"mappings":"AAEA;;;;;;;;;AASG;AACU,MAAA,OAAO,GAAqD,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,KAAI;AAC7F,IAAA,OAAO,KAAK,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;AACvD;;;;"}
@@ -0,0 +1,53 @@
1
+ import { setStatus } from '../../../store/utils/status-store.utils.js';
2
+ import { setQuery } from '../../../store/utils/query.utils.js';
3
+ import { fetchAndSaveRelatedPrompts, cancelFetchAndSaveRelatedPrompts } from './actions/fetch-and-save-related-prompts.action.js';
4
+ import { fetchRelatedPrompts } from './actions/fetch-related-prompts.action.js';
5
+ import { request } from './getters/request.getter.js';
6
+
7
+ /**
8
+ * {@link XStoreModule} For the related prompt module.
9
+ *
10
+ * @internal
11
+ */
12
+ const relatedPromptsXStoreModule = {
13
+ state: () => ({
14
+ query: '',
15
+ relatedPrompts: [],
16
+ selectedPrompt: -1,
17
+ selectedQuery: -1,
18
+ status: 'initial',
19
+ params: {}
20
+ }),
21
+ getters: {
22
+ request
23
+ },
24
+ mutations: {
25
+ setStatus,
26
+ setQuery,
27
+ setParams(state, params) {
28
+ state.params = params;
29
+ },
30
+ setRelatedPromptsProducts(state, products) {
31
+ state.relatedPrompts = products;
32
+ },
33
+ setSelectedPrompt(state, selectedPrompt) {
34
+ state.selectedPrompt = selectedPrompt;
35
+ },
36
+ setSelectedQuery(state, selectedQuery) {
37
+ state.selectedQuery = selectedQuery;
38
+ },
39
+ resetRelatedPromptsState(state) {
40
+ state.selectedQuery = -1;
41
+ state.selectedPrompt = -1;
42
+ state.relatedPrompts = [];
43
+ }
44
+ },
45
+ actions: {
46
+ fetchRelatedPrompts,
47
+ fetchAndSaveRelatedPrompts,
48
+ cancelFetchAndSaveRelatedPrompts
49
+ }
50
+ };
51
+
52
+ export { relatedPromptsXStoreModule };
53
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.js","sources":["../../../../../src/x-modules/related-prompts/store/module.ts"],"sourcesContent":["import { setStatus } from '../../../store/utils/status-store.utils';\nimport { setQuery } from '../../../store/utils/query.utils';\nimport { RelatedPromptsXStoreModule } from './types';\nimport {\n cancelFetchAndSaveRelatedPrompts,\n fetchAndSaveRelatedPrompts\n} from './actions/fetch-and-save-related-prompts.action';\nimport { fetchRelatedPrompts } from './actions/fetch-related-prompts.action';\nimport { request } from './getters/request.getter';\n\n/**\n * {@link XStoreModule} For the related prompt module.\n *\n * @internal\n */\nexport const relatedPromptsXStoreModule: RelatedPromptsXStoreModule = {\n state: () => ({\n query: '',\n relatedPrompts: [],\n selectedPrompt: -1,\n selectedQuery: -1,\n status: 'initial',\n params: {}\n }),\n getters: {\n request\n },\n mutations: {\n setStatus,\n setQuery,\n setParams(state, params) {\n state.params = params;\n },\n setRelatedPromptsProducts(state, products) {\n state.relatedPrompts = products;\n },\n setSelectedPrompt(state, selectedPrompt) {\n state.selectedPrompt = selectedPrompt;\n },\n setSelectedQuery(state, selectedQuery) {\n state.selectedQuery = selectedQuery;\n },\n resetRelatedPromptsState(state) {\n state.selectedQuery = -1;\n state.selectedPrompt = -1;\n state.relatedPrompts = [];\n }\n },\n actions: {\n fetchRelatedPrompts,\n fetchAndSaveRelatedPrompts,\n cancelFetchAndSaveRelatedPrompts\n }\n};\n"],"names":[],"mappings":";;;;;;AAUA;;;;AAIG;AACU,MAAA,0BAA0B,GAA+B;AACpE,IAAA,KAAK,EAAE,OAAO;AACZ,QAAA,KAAK,EAAE,EAAE;AACT,QAAA,cAAc,EAAE,EAAE;QAClB,cAAc,EAAE,CAAC,CAAC;QAClB,aAAa,EAAE,CAAC,CAAC;AACjB,QAAA,MAAM,EAAE,SAAS;AACjB,QAAA,MAAM,EAAE,EAAE;KACX,CAAC;AACF,IAAA,OAAO,EAAE;QACP,OAAO;AACR,KAAA;AACD,IAAA,SAAS,EAAE;QACT,SAAS;QACT,QAAQ;QACR,SAAS,CAAC,KAAK,EAAE,MAAM,EAAA;AACrB,YAAA,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;SACvB;QACD,yBAAyB,CAAC,KAAK,EAAE,QAAQ,EAAA;AACvC,YAAA,KAAK,CAAC,cAAc,GAAG,QAAQ,CAAC;SACjC;QACD,iBAAiB,CAAC,KAAK,EAAE,cAAc,EAAA;AACrC,YAAA,KAAK,CAAC,cAAc,GAAG,cAAc,CAAC;SACvC;QACD,gBAAgB,CAAC,KAAK,EAAE,aAAa,EAAA;AACnC,YAAA,KAAK,CAAC,aAAa,GAAG,aAAa,CAAC;SACrC;AACD,QAAA,wBAAwB,CAAC,KAAK,EAAA;AAC5B,YAAA,KAAK,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;AACzB,YAAA,KAAK,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC;AAC1B,YAAA,KAAK,CAAC,cAAc,GAAG,EAAE,CAAC;SAC3B;AACF,KAAA;AACD,IAAA,OAAO,EAAE;QACP,mBAAmB;QACnB,0BAA0B;QAC1B,gCAAgC;AACjC,KAAA;;;;;"}
@@ -0,0 +1,88 @@
1
+ import { namespacedWireCommit, namespacedWireCommitWithoutPayload, namespacedWireDispatch, namespacedWireDispatchWithoutPayload } from '../../wiring/namespaced-wires.factory.js';
2
+ import { createWiring } from '../../wiring/wiring.utils.js';
3
+
4
+ /**
5
+ * `relatedPrompts` {@link XModuleName | XModule name}.
6
+ */
7
+ const moduleName = 'relatedPrompts';
8
+ /**
9
+ * WireCommit for {@link RelatedPromptsXModule}.
10
+ */
11
+ const wireCommit = namespacedWireCommit(moduleName);
12
+ /**
13
+ * WireCommitWithoutPayload for {@link RelatedPromptsXModule}.
14
+ */
15
+ const wireCommitWithoutPayload = namespacedWireCommitWithoutPayload(moduleName);
16
+ /**
17
+ * WireDispatch for {@link RelatedPromptsXModule}.
18
+ */
19
+ const wireDispatch = namespacedWireDispatch(moduleName);
20
+ /**
21
+ * WireDispatchWithoutPayload for {@link RelatedPromptsXModule}.
22
+ */
23
+ const wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName);
24
+ /**
25
+ * Sets the related prompts state `query`.
26
+ */
27
+ const setRelatedPromptsQuery = wireCommit('setQuery');
28
+ /**
29
+ * Sets the related prompts state `selectedPrompt`.
30
+ */
31
+ const setSelectedPromptWire = wireCommit('setSelectedPrompt');
32
+ /**
33
+ * Sets the related prompts state `selectedQuery`.
34
+ */
35
+ const setSelectedQueryWire = wireCommit('setSelectedQuery');
36
+ /**
37
+ * Sets the related prompts state `query` from url params.
38
+ */
39
+ const setRelatedPromptsQueryFromUrl = wireCommit('setQuery', ({ eventPayload: { query } }) => query);
40
+ /**
41
+ * Sets the related prompts state `params`.
42
+ */
43
+ const setRelatedPromptsExtraParams = wireCommit('setParams');
44
+ /**
45
+ * Resets the related prompts state.
46
+ */
47
+ const resetRelatedPromptsStateWire = wireCommitWithoutPayload('resetRelatedPromptsState');
48
+ /**
49
+ * Fetches and saves the related prompts response.
50
+ */
51
+ const fetchAndSaveRelatedPromptsResponseWire = wireDispatch('fetchAndSaveRelatedPrompts');
52
+ /**
53
+ * Cancels the fetch and save related prompts response.
54
+ */
55
+ const cancelFetchAndSaveSearchResponseWire = wireDispatchWithoutPayload('cancelFetchAndSaveRelatedPrompts');
56
+ /**
57
+ * Wiring configuration for the {@link RelatedPromptsXModule | related prompts module}.
58
+ *
59
+ * @internal
60
+ */
61
+ const relatedPromptsWiring = createWiring({
62
+ ParamsLoadedFromUrl: {
63
+ setRelatedPromptsQueryFromUrl
64
+ },
65
+ UserAcceptedAQuery: {
66
+ setRelatedPromptsQuery
67
+ },
68
+ UserClearedQuery: {
69
+ cancelFetchAndSaveSearchResponseWire,
70
+ resetRelatedPromptsStateWire,
71
+ setRelatedPromptsQuery
72
+ },
73
+ RelatedPromptsRequestUpdated: {
74
+ fetchAndSaveRelatedPromptsResponseWire
75
+ },
76
+ ExtraParamsChanged: {
77
+ setRelatedPromptsExtraParams
78
+ },
79
+ UserSelectedARelatedPrompt: {
80
+ setSelectedPromptWire
81
+ },
82
+ UserSelectedARelatedPromptQuery: {
83
+ setSelectedQueryWire
84
+ }
85
+ });
86
+
87
+ export { relatedPromptsWiring };
88
+ //# sourceMappingURL=wiring.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/related-prompts/wiring.ts"],"sourcesContent":["import {\n namespacedWireCommit,\n namespacedWireCommitWithoutPayload,\n namespacedWireDispatch,\n namespacedWireDispatchWithoutPayload\n} from '../../wiring/namespaced-wires.factory';\nimport {\n NamespacedWireCommit,\n NamespacedWireCommitWithoutPayload\n} from '../../wiring/namespaced-wiring.types';\nimport { createWiring } from '../../wiring/wiring.utils';\n\n/**\n * `relatedPrompts` {@link XModuleName | XModule name}.\n */\nconst moduleName = 'relatedPrompts';\n\n/**\n * WireCommit for {@link RelatedPromptsXModule}.\n */\nconst wireCommit: NamespacedWireCommit<typeof moduleName> = namespacedWireCommit(moduleName);\n\n/**\n * WireCommitWithoutPayload for {@link RelatedPromptsXModule}.\n */\nconst wireCommitWithoutPayload: NamespacedWireCommitWithoutPayload<typeof moduleName> =\n namespacedWireCommitWithoutPayload(moduleName);\n\n/**\n * WireDispatch for {@link RelatedPromptsXModule}.\n */\nconst wireDispatch = namespacedWireDispatch(moduleName);\n\n/**\n * WireDispatchWithoutPayload for {@link RelatedPromptsXModule}.\n */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName);\n\n/**\n * Sets the related prompts state `query`.\n */\nconst setRelatedPromptsQuery = wireCommit('setQuery');\n\n/**\n * Sets the related prompts state `selectedPrompt`.\n */\nconst setSelectedPromptWire = wireCommit('setSelectedPrompt');\n\n/**\n * Sets the related prompts state `selectedQuery`.\n */\nconst setSelectedQueryWire = wireCommit('setSelectedQuery');\n\n/**\n * Sets the related prompts state `query` from url params.\n */\nconst setRelatedPromptsQueryFromUrl = wireCommit(\n 'setQuery',\n ({ eventPayload: { query } }) => query\n);\n\n/**\n * Sets the related prompts state `params`.\n */\nconst setRelatedPromptsExtraParams = wireCommit('setParams');\n\n/**\n * Resets the related prompts state.\n */\nconst resetRelatedPromptsStateWire = wireCommitWithoutPayload('resetRelatedPromptsState');\n\n/**\n * Fetches and saves the related prompts response.\n */\nconst fetchAndSaveRelatedPromptsResponseWire = wireDispatch('fetchAndSaveRelatedPrompts');\n\n/**\n * Cancels the fetch and save related prompts response.\n */\nconst cancelFetchAndSaveSearchResponseWire = wireDispatchWithoutPayload(\n 'cancelFetchAndSaveRelatedPrompts'\n);\n\n/**\n * Wiring configuration for the {@link RelatedPromptsXModule | related prompts module}.\n *\n * @internal\n */\nexport const relatedPromptsWiring = createWiring({\n ParamsLoadedFromUrl: {\n setRelatedPromptsQueryFromUrl\n },\n UserAcceptedAQuery: {\n setRelatedPromptsQuery\n },\n UserClearedQuery: {\n cancelFetchAndSaveSearchResponseWire,\n resetRelatedPromptsStateWire,\n setRelatedPromptsQuery\n },\n RelatedPromptsRequestUpdated: {\n fetchAndSaveRelatedPromptsResponseWire\n },\n ExtraParamsChanged: {\n setRelatedPromptsExtraParams\n },\n UserSelectedARelatedPrompt: {\n setSelectedPromptWire\n },\n UserSelectedARelatedPromptQuery: {\n setSelectedQueryWire\n }\n});\n"],"names":[],"mappings":";;;AAYA;;AAEG;AACH,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAEpC;;AAEG;AACH,MAAM,UAAU,GAA4C,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAE7F;;AAEG;AACH,MAAM,wBAAwB,GAC5B,kCAAkC,CAAC,UAAU,CAAC,CAAC;AAEjD;;AAEG;AACH,MAAM,YAAY,GAAG,sBAAsB,CAAC,UAAU,CAAC,CAAC;AAExD;;AAEG;AACH,MAAM,0BAA0B,GAAG,oCAAoC,CAAC,UAAU,CAAC,CAAC;AAEpF;;AAEG;AACH,MAAM,sBAAsB,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;AAEtD;;AAEG;AACH,MAAM,qBAAqB,GAAG,UAAU,CAAC,mBAAmB,CAAC,CAAC;AAE9D;;AAEG;AACH,MAAM,oBAAoB,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAC;AAE5D;;AAEG;AACH,MAAM,6BAA6B,GAAG,UAAU,CAC9C,UAAU,EACV,CAAC,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,KAAK,CACvC,CAAC;AAEF;;AAEG;AACH,MAAM,4BAA4B,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;AAE7D;;AAEG;AACH,MAAM,4BAA4B,GAAG,wBAAwB,CAAC,0BAA0B,CAAC,CAAC;AAE1F;;AAEG;AACH,MAAM,sCAAsC,GAAG,YAAY,CAAC,4BAA4B,CAAC,CAAC;AAE1F;;AAEG;AACH,MAAM,oCAAoC,GAAG,0BAA0B,CACrE,kCAAkC,CACnC,CAAC;AAEF;;;;AAIG;AACI,MAAM,oBAAoB,GAAG,YAAY,CAAC;AAC/C,IAAA,mBAAmB,EAAE;QACnB,6BAA6B;AAC9B,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,sBAAsB;AACvB,KAAA;AACD,IAAA,gBAAgB,EAAE;QAChB,oCAAoC;QACpC,4BAA4B;QAC5B,sBAAsB;AACvB,KAAA;AACD,IAAA,4BAA4B,EAAE;QAC5B,sCAAsC;AACvC,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,4BAA4B;AAC7B,KAAA;AACD,IAAA,0BAA0B,EAAE;QAC1B,qBAAqB;AACtB,KAAA;AACD,IAAA,+BAA+B,EAAE;QAC/B,oBAAoB;AACrB,KAAA;AACF,CAAA;;;;"}
@@ -0,0 +1,21 @@
1
+ import { XPlugin } from '../../plugins/x-plugin.js';
2
+ import { relatedPromptsXStoreModule } from './store/module.js';
3
+ import { relatedPromptsStoreEmitters } from './store/emitters.js';
4
+ import { relatedPromptsWiring } from './wiring.js';
5
+
6
+ /**
7
+ * Related Prompts {@link XModule} implementation. This module is auto-registered as soon as you
8
+ * import any component from the `related-prompts` entry point.
9
+ *
10
+ * @public
11
+ */
12
+ const relatedPromptsXModule = {
13
+ name: 'relatedPrompts',
14
+ storeModule: relatedPromptsXStoreModule,
15
+ storeEmitters: relatedPromptsStoreEmitters,
16
+ wiring: relatedPromptsWiring
17
+ };
18
+ XPlugin.registerXModule(relatedPromptsXModule);
19
+
20
+ export { relatedPromptsXModule };
21
+ //# sourceMappingURL=x-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x-module.js","sources":["../../../../src/x-modules/related-prompts/x-module.ts"],"sourcesContent":["import { XPlugin } from '../../plugins/x-plugin';\nimport { XModule } from '../x-modules.types';\nimport { RelatedPromptsXStoreModule } from './store/types';\nimport { relatedPromptsXStoreModule } from './store/module';\nimport { relatedPromptsStoreEmitters } from './store/emitters';\nimport { relatedPromptsWiring } from './wiring';\n\n/**\n * RelatedPrompts {@link XModule} alias.\n *\n * @public\n */\nexport type RelatedPromptsXModule = XModule<RelatedPromptsXStoreModule>;\n\n/**\n * Related Prompts {@link XModule} implementation. This module is auto-registered as soon as you\n * import any component from the `related-prompts` entry point.\n *\n * @public\n */\nexport const relatedPromptsXModule: RelatedPromptsXModule = {\n name: 'relatedPrompts',\n storeModule: relatedPromptsXStoreModule,\n storeEmitters: relatedPromptsStoreEmitters,\n wiring: relatedPromptsWiring\n};\n\nXPlugin.registerXModule(relatedPromptsXModule);\n"],"names":[],"mappings":";;;;;AAcA;;;;;AAKG;AACU,MAAA,qBAAqB,GAA0B;AAC1D,IAAA,IAAI,EAAE,gBAAgB;AACtB,IAAA,WAAW,EAAE,0BAA0B;AACvC,IAAA,aAAa,EAAE,2BAA2B;AAC1C,IAAA,MAAM,EAAE,oBAAoB;EAC5B;AAEF,OAAO,CAAC,eAAe,CAAC,qBAAqB,CAAC;;;;"}
@@ -82,6 +82,8 @@ import '../../../components/base-grid.vue3.js';
82
82
  import '../../../components/base-keyboard-navigation.vue2.js';
83
83
  import '../../../components/base-rating.vue2.js';
84
84
  import '../../../components/base-rating.vue3.js';
85
+ import '../../../components/base-slider.vue2.js';
86
+ import '../../../components/base-slider.vue3.js';
85
87
  import '../../../components/base-switch.vue2.js';
86
88
  import '../../../components/base-switch.vue3.js';
87
89
  import '../../../components/base-variable-column-grid.vue2.js';
@@ -1 +1 @@
1
- {"version":3,"file":"scroll-to-top.vue2.js","sources":["../../../../../src/x-modules/scroll/components/scroll-to-top.vue"],"sourcesContent":["<template>\n <component :is=\"animation\">\n <BaseEventButton\n v-if=\"isVisible\"\n class=\"x-scroll-to-top x-button\"\n data-test=\"scroll-to-top\"\n aria-label=\"Scroll to top\"\n :events=\"events\"\n >\n <!-- @slot (Required) Button content with a text, an icon or both -->\n <slot />\n </BaseEventButton>\n </component>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent } from 'vue';\n import { NoAnimation, BaseEventButton } from '../../../components';\n import { XEventsTypes } from '../../../wiring';\n import { scrollXModule } from '../x-module';\n import { AnimationProp } from '../../../types';\n import { useState } from '../../../composables';\n import { MainScrollId } from './scroll.const';\n\n /**\n * The `ScrollToTop` component is a button that the user can click to make a container scroll\n * up to its initial position.\n *\n * @public\n */\n export default defineComponent({\n name: 'ScrollToTop',\n xModule: scrollXModule.name,\n components: { BaseEventButton },\n props: {\n /**\n * Animation to use for showing/hiding the button.\n *\n * @public\n */\n animation: {\n type: AnimationProp,\n default: () => NoAnimation\n },\n /**\n * Threshold in pixels from the top to show the button.\n *\n * @public\n */\n thresholdPx: Number,\n /**\n * Id of the target scroll component.\n *\n * @public\n */\n scrollId: {\n type: String,\n default: MainScrollId\n }\n },\n setup(props) {\n /**\n * State of all the scroll components in this module.\n *\n * @internal\n */\n // TODO: Directly retrieve the needed data in this computed property\n const { data } = useState('scroll', ['data']);\n\n /**\n * The scroll data retrieved for this component.\n *\n * @returns The scroll data for this component if a valid {@link ScrollToTop.scrollId} has been\n * passed. Otherwise it returns `null`.\n * @internal\n */\n const scrollData = computed(() => {\n return props.scrollId && data.value[props.scrollId]\n ? data.value[props.scrollId]\n : {\n position: 0,\n direction: 'UP',\n hasReachedStart: false,\n hasAlmostReachedEnd: false,\n hasReachedEnd: false\n };\n });\n\n /**\n * Event that will be emitted when the scroll to top is clicked.\n *\n * @returns The event to be emitted when the scroll to top is clicked. The id as a payload.\n * @internal\n */\n const events = computed(\n (): Partial<XEventsTypes> => ({ UserClickedScrollToTop: props.scrollId })\n );\n\n /**\n * Checks if the thresholdPx prop has been provided and if it is a number.\n *\n * @returns If the thresholdPx is a number or not.\n * @internal\n */\n const useThresholdStrategy = computed(() => typeof props.thresholdPx === 'number');\n\n /**\n * Checks if the threshold has been reached in case the threshold strategy is in use.\n *\n * @returns If the scrollTop is bigger than the thresholdPx.\n * @internal\n */\n const isThresholdReached = computed(\n () => useThresholdStrategy.value && scrollData.value.position > props.thresholdPx!\n );\n\n /**\n * Returns if the scroll has almost reached its end or not.\n *\n * @returns True if the scroll has almost reached the end and the user is still scrolling down.\n * @internal\n */\n const hasAlmostReachedScrollEnd = computed(\n () => scrollData.value.hasAlmostReachedEnd && scrollData.value.direction === 'DOWN'\n );\n\n /**\n * Whether if the button is visible or not depending on the strategy being used.\n *\n * @returns If the button should be visible or not.\n * @internal\n */\n const isVisible = computed(() =>\n useThresholdStrategy.value ? isThresholdReached.value : hasAlmostReachedScrollEnd.value\n );\n\n return {\n events,\n isVisible\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserClickedScrollToTop`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the button. The event payload is the id of the scroll\n that it going to be scrolled.\n\n## Examples\n\n### Basic example\n\nThe component renders whatever is passed to it in the default slot and scrolls to top the scroll\nwith an id `scrollId`.\n\nIt also receives an optional threshold in pixels. When the threshold is reached from the top, the\ncomponent will be shown once the user scrolls `UP`.\n\nIf this parameter is not provided the button will be visible when the user almost reaches the end of\nthe scroll.\n\n```vue\n<template>\n <div>\n <ScrollToTop scroll-id=\"scrollId\" :threshold-px=\"1000\">\n <span>Scroll to top</span>\n </ScrollToTop>\n </div>\n</template>\n\n<script>\n import { ScrollToTop } from '@empathyco/x-components/scroll';\n\n export default {\n name: 'ScrollToTopTest',\n components: {\n ScrollToTop\n }\n };\n</script>\n```\n</docs>\n"],"names":["NoAnimation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBE;;;;;AAKE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,aAAa,CAAC,IAAI;IAC3B,UAAU,EAAE,EAAE,eAAc,EAAG;AAC/B,IAAA,KAAK,EAAE;AACL;;;;AAIE;AACF,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,OAAO,EAAE,MAAMA,WAAU;AAC1B,SAAA;AACD;;;;AAIE;AACF,QAAA,WAAW,EAAE,MAAM;AACnB;;;;AAIE;AACF,QAAA,QAAQ,EAAE;AACR,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,OAAO,EAAE,YAAW;AACtB,SAAA;AACD,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT;;;;AAIE;;AAEF,QAAA,MAAM,EAAE,IAAK,EAAA,GAAI,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,CAAC,CAAA;AAE7C;;;;;;AAME;AACF,QAAA,MAAM,UAAW,GAAE,QAAQ,CAAC,MAAM;YAChC,OAAO,KAAK,CAAC,QAAO,IAAK,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAA;kBAC9C,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAA;AAC3B,kBAAE;AACE,oBAAA,QAAQ,EAAE,CAAC;AACX,oBAAA,SAAS,EAAE,IAAI;AACf,oBAAA,eAAe,EAAE,KAAK;AACtB,oBAAA,mBAAmB,EAAE,KAAK;AAC1B,oBAAA,aAAa,EAAE,KAAI;iBACpB,CAAA;AACP,SAAC,CAAC,CAAA;AAEF;;;;;AAKE;AACF,QAAA,MAAM,MAAO,GAAE,QAAQ,CACrB,OAA8B,EAAE,sBAAsB,EAAE,KAAK,CAAC,UAAU,CAAA,CACzE,CAAA;AAED;;;;;AAKE;AACF,QAAA,MAAM,uBAAuB,QAAQ,CAAC,MAAM,OAAO,KAAK,CAAC,WAAU,KAAM,QAAQ,CAAC,CAAA;AAElF;;;;;AAKE;QACF,MAAM,kBAAmB,GAAE,QAAQ,CACjC,MAAM,oBAAoB,CAAC,SAAS,UAAU,CAAC,KAAK,CAAC,QAAS,GAAE,KAAK,CAAC,WAAW,CAClF,CAAA;AAED;;;;;AAKE;QACF,MAAM,yBAA0B,GAAE,QAAQ,CACxC,MAAM,UAAU,CAAC,KAAK,CAAC,mBAAkB,IAAK,UAAU,CAAC,KAAK,CAAC,SAAU,KAAI,MAAK,CACnF,CAAA;AAED;;;;;AAKE;QACF,MAAM,YAAY,QAAQ,CAAC,MACzB,oBAAoB,CAAC,KAAM,GAAE,kBAAkB,CAAC,KAAI,GAAI,yBAAyB,CAAC,KAAI,CACvF,CAAA;QAED,OAAO;YACL,MAAM;YACN,SAAQ;SACT,CAAA;KACH;AACD,CAAA,CAAC;;;;"}
1
+ {"version":3,"file":"scroll-to-top.vue2.js","sources":["../../../../../src/x-modules/scroll/components/scroll-to-top.vue"],"sourcesContent":["<template>\n <component :is=\"animation\">\n <BaseEventButton\n v-if=\"isVisible\"\n class=\"x-scroll-to-top x-button\"\n data-test=\"scroll-to-top\"\n aria-label=\"Scroll to top\"\n :events=\"events\"\n >\n <!-- @slot (Required) Button content with a text, an icon or both -->\n <slot />\n </BaseEventButton>\n </component>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent } from 'vue';\n import { NoAnimation, BaseEventButton } from '../../../components';\n import { XEventsTypes } from '../../../wiring';\n import { scrollXModule } from '../x-module';\n import { AnimationProp } from '../../../types';\n import { useState } from '../../../composables';\n import { MainScrollId } from './scroll.const';\n\n /**\n * The `ScrollToTop` component is a button that the user can click to make a container scroll\n * up to its initial position.\n *\n * @public\n */\n export default defineComponent({\n name: 'ScrollToTop',\n xModule: scrollXModule.name,\n components: { BaseEventButton },\n props: {\n /**\n * Animation to use for showing/hiding the button.\n *\n * @public\n */\n animation: {\n type: AnimationProp,\n default: () => NoAnimation\n },\n /**\n * Threshold in pixels from the top to show the button.\n *\n * @public\n */\n thresholdPx: Number,\n /**\n * Id of the target scroll component.\n *\n * @public\n */\n scrollId: {\n type: String,\n default: MainScrollId\n }\n },\n setup(props) {\n /**\n * State of all the scroll components in this module.\n *\n * @internal\n */\n // TODO: Directly retrieve the needed data in this computed property\n const { data } = useState('scroll', ['data']);\n\n /**\n * The scroll data retrieved for this component.\n *\n * @returns The scroll data for this component if a valid {@link ScrollToTop.scrollId} has been\n * passed. Otherwise it returns `null`.\n * @internal\n */\n const scrollData = computed(() => {\n return props.scrollId && data.value[props.scrollId]\n ? data.value[props.scrollId]\n : {\n position: 0,\n direction: 'UP',\n hasReachedStart: false,\n hasAlmostReachedEnd: false,\n hasReachedEnd: false\n };\n });\n\n /**\n * Event that will be emitted when the scroll to top is clicked.\n *\n * @returns The event to be emitted when the scroll to top is clicked. The id as a payload.\n * @internal\n */\n const events = computed(\n (): Partial<XEventsTypes> => ({ UserClickedScrollToTop: props.scrollId })\n );\n\n /**\n * Checks if the thresholdPx prop has been provided and if it is a number.\n *\n * @returns If the thresholdPx is a number or not.\n * @internal\n */\n const useThresholdStrategy = computed(() => typeof props.thresholdPx === 'number');\n\n /**\n * Checks if the threshold has been reached in case the threshold strategy is in use.\n *\n * @returns If the scrollTop is bigger than the thresholdPx.\n * @internal\n */\n const isThresholdReached = computed(\n () => useThresholdStrategy.value && scrollData.value.position > props.thresholdPx!\n );\n\n /**\n * Returns if the scroll has almost reached its end or not.\n *\n * @returns True if the scroll has almost reached the end and the user is still scrolling down.\n * @internal\n */\n const hasAlmostReachedScrollEnd = computed(\n () => scrollData.value.hasAlmostReachedEnd && scrollData.value.direction === 'DOWN'\n );\n\n /**\n * Whether if the button is visible or not depending on the strategy being used.\n *\n * @returns If the button should be visible or not.\n * @internal\n */\n const isVisible = computed(() =>\n useThresholdStrategy.value ? isThresholdReached.value : hasAlmostReachedScrollEnd.value\n );\n\n return {\n events,\n isVisible\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nA list of events that the component will emit:\n\n- [`UserClickedScrollToTop`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):\n the event is emitted after the user clicks the button. The event payload is the id of the scroll\n that it going to be scrolled.\n\n## Examples\n\n### Basic example\n\nThe component renders whatever is passed to it in the default slot and scrolls to top the scroll\nwith an id `scrollId`.\n\nIt also receives an optional threshold in pixels. When the threshold is reached from the top, the\ncomponent will be shown once the user scrolls `UP`.\n\nIf this parameter is not provided the button will be visible when the user almost reaches the end of\nthe scroll.\n\n```vue\n<template>\n <div>\n <ScrollToTop scroll-id=\"scrollId\" :threshold-px=\"1000\">\n <span>Scroll to top</span>\n </ScrollToTop>\n </div>\n</template>\n\n<script>\n import { ScrollToTop } from '@empathyco/x-components/scroll';\n\n export default {\n name: 'ScrollToTopTest',\n components: {\n ScrollToTop\n }\n };\n</script>\n```\n</docs>\n"],"names":["NoAnimation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBE;;;;;AAKE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,aAAa,CAAC,IAAI;IAC3B,UAAU,EAAE,EAAE,eAAc,EAAG;AAC/B,IAAA,KAAK,EAAE;AACL;;;;AAIE;AACF,QAAA,SAAS,EAAE;AACT,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,CACxC,MAAM,UAAU,CAAC,KAAK,CAAC,mBAAkB,IAAK,UAAU,CAAC,KAAK,CAAC,SAAU,KAAI,MAAK,CACnF,CAAA;AAED;;;;;AAKE;QACF,MAAM,YAAY,QAAQ,CAAC,MACzB,oBAAoB,CAAC,KAAM,GAAE,kBAAkB,CAAC,KAAI,GAAI,yBAAyB,CAAC,KAAI,CACvF,CAAA;QAED,OAAO;YACL,MAAM;YACN,SAAQ;SACT,CAAA;KACH;AACD,CAAA,CAAC;;;;"}
@@ -1,9 +1,9 @@
1
1
  import { defineComponent, provide, ref, computed, watch, h } from 'vue';
2
2
  import { LIST_ITEMS_KEY, QUERY_KEY, HAS_MORE_ITEMS_KEY } from '../../../components/decorators/injection.consts.js';
3
3
  import ItemsList from '../../../components/items-list.vue.js';
4
- import { animationProp } from '../../../utils/options-api.js';
5
4
  import { useState } from '../../../composables/use-state.js';
6
5
  import { searchXModule } from '../x-module.js';
6
+ import { AnimationProp } from '../../../types/animation-prop.js';
7
7
 
8
8
  /**
9
9
  * It renders a {@link ItemsList} list with the results from {@link SearchState.results} by
@@ -22,7 +22,7 @@ var _sfc_main = defineComponent({
22
22
  props: {
23
23
  /** Animation component that will be used to animate the results. */
24
24
  animation: {
25
- type: animationProp,
25
+ type: AnimationProp,
26
26
  default: 'ul'
27
27
  }
28
28
  },
@@ -1 +1 @@
1
- {"version":3,"file":"results-list.vue.js","sources":["../../../../../src/x-modules/search/components/results-list.vue"],"sourcesContent":["<script lang=\"ts\">\n import { computed, ComputedRef, defineComponent, h, provide, Ref, ref, watch } from 'vue';\n import { Result } from '@empathyco/x-types';\n import {\n HAS_MORE_ITEMS_KEY,\n LIST_ITEMS_KEY,\n QUERY_KEY\n } from '../../../components/decorators/injection.consts';\n import ItemsList from '../../../components/items-list.vue';\n import { RequestStatus } from '../../../store/utils/status-store.utils';\n import { animationProp } from '../../../utils/options-api';\n import { useState } from '../../../composables/use-state';\n import { searchXModule } from '../x-module';\n\n /**\n * It renders a {@link ItemsList} list with the results from {@link SearchState.results} by\n * default.\n *\n * The component provides a default slot which wraps the whole component with the `results` bound.\n *\n * It also provides the slot result to customize the item, which is within the default slot, with\n * the result bound.\n *\n * @public\n */\n export default defineComponent({\n name: 'ResultsList',\n xModule: searchXModule.name,\n props: {\n /** Animation component that will be used to animate the results. */\n animation: {\n type: animationProp,\n default: 'ul'\n }\n },\n emits: ['UserReachedResultsListEnd'],\n setup(props, { slots }) {\n /**\n * The results to render from the state.\n *\n * @remarks The results list are provided with `items` key. It can be\n * concatenated with list items from components such as `BannersList`, `PromotedsList`,\n * `BaseGrid` or any component that injects the list.\n */\n const items: ComputedRef<Result[]> = useState('search', ['results']).results;\n provide<ComputedRef<Result[]>>(LIST_ITEMS_KEY as string, items);\n\n /** The total number of results, taken from the state. */\n const totalResults: ComputedRef<number> = useState('search', ['totalResults']).totalResults;\n\n /** This query is updated only when the search request has succeeded. */\n let providedQuery = ref('');\n provide<Ref<string>>(QUERY_KEY as string, providedQuery);\n\n /** Indicates if there are more available results that have not been injected. */\n const hasMoreItems = computed(() => items.value.length < totalResults.value);\n provide<ComputedRef<boolean>>(HAS_MORE_ITEMS_KEY as string, hasMoreItems);\n\n /** The status of the search request, taken from the state. */\n const searchStatus: ComputedRef<RequestStatus> = useState('search', ['status']).status;\n\n /** The query of the search request, taken from the state. */\n const searchQuery: ComputedRef<string> = useState('search', ['query']).query;\n\n /**\n * Updates the query to be provided to the child components\n * when the search request has succeeded.\n *\n * @param status - The status of the search request.\n */\n function updateQuery(status: RequestStatus) {\n if (status === 'success') {\n providedQuery.value = searchQuery.value;\n }\n }\n\n /**\n * Watches the searchStatus and triggers updateQuery as callback\n * when it changes.\n *\n * @param status - The status of the search request.\n */\n watch(searchStatus, () => updateQuery(searchStatus.value), { immediate: true });\n\n return () => {\n const innerProps = { items: items.value, animation: props.animation };\n // https://vue-land.github.io/faq/forwarding-slots#passing-all-slots\n return slots.default?.(innerProps)[0] ?? h(ItemsList, innerProps, slots);\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component doesn't emit events.\n\n## See it in action\n\n<!-- prettier-ignore-start -->\n:::warning Backend service required\nTo use this component, the Search service must be implemented.\n:::\n<!-- prettier-ignore-end -->\n\nHere you have a basic example of how the ResultsList is rendered.\n\n_Type any term in the input field to try it out!_\n\n```vue\n<template>\n <div>\n <SearchInput />\n <ResultsList />\n </div>\n</template>\n\n<script>\n import { ResultsList } from '@empathyco/x-components/search';\n import { SearchInput } from '@empathyco/x-components/search-box';\n\n export default {\n name: 'ResultsListDemo',\n components: {\n SearchInput,\n ResultsList\n }\n };\n</script>\n```\n\n### Play with the animation\n\n```vue\n<template>\n <div>\n <SearchInput />\n <ResultsList :animation=\"fadeAndSlide\" />\n </div>\n</template>\n\n<script>\n import { ResultsList } from '@empathyco/x-components/search';\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { FadeAndSlide } from '@empathyco/x-components/animations';\n\n export default {\n name: 'ResultsListDemo',\n components: {\n SearchInput,\n ResultsList\n },\n data() {\n return {\n fadeAndSlide: FadeAndSlide\n };\n }\n };\n</script>\n```\n\n### Overriding default content\n\n```vue\n<template>\n <div>\n <SearchInput />\n <ResultsList #default=\"{ items, animation }\">\n <BaseGrid :items=\"items\" :animation=\"animation\">\n <template #result=\"{ item }\">\n <span>Result: {{ item.name }}</span>\n </template>\n <template #default=\"{ item }\">\n <span>Default: {{ item }}</span>\n </template>\n </BaseGrid>\n </ResultsList>\n </div>\n</template>\n\n<script>\n import { ResultsList } from '@empathyco/x-components/search';\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { BaseGrid } from '@empathyco/x-components';\n\n export default {\n name: 'ResultsListDemo',\n components: {\n SearchInput,\n ResultsList,\n BaseGrid\n }\n };\n</script>\n```\n\n### Overriding result content\n\n```vue\n<template>\n <div>\n <SearchInput />\n <ResultsList #result=\"{ item }\">\n <span class=\"result\">\n {{ item.name }}\n </span>\n </ResultsList>\n </div>\n</template>\n\n<script>\n import { SearchInput, ResultsList } from '@empathyco/x-components/search';\n\n export default {\n name: 'ResultsListDemo',\n components: {\n SearchInput,\n ResultsList\n }\n };\n</script>\n```\n\n### Data injection\n\nStarting with the `ResultsList` component as root element, you can concat the list of list items\nusing `BannersList`, `PromotedsList`, `BaseGrid` or any component that injects the `listItems`\nvalue.\n\nThe order in which elements are placed in the template will define the concat strategy of the items,\nso it is important to define it properly; for example, Promoteds will be usually before Banners so\nfirst promoted items are inserted within the results and then banner items are placed on top of\nthat, occupying the rows.\n\n```vue\n<template>\n <div>\n <SearchInput />\n <ResultsList>\n <PromotedsList>\n <BannersList>\n <template #result=\"{ item }\">Result: {{ item.id }}</template>\n <template #banner=\"{ item }\">Banner: {{ item.id }}</template>\n <template #promoted=\"{ item }\">Promoted: {{ item.id }}</template>\n </BannersList>\n </PromotedsList>\n </ResultsList>\n </div>\n</template>\n\n<script>\n import { ResultsList, BannersList, PromotedsList } from '@empathyco/x-components/search';\n import { SearchInput } from '@empathyco/x-components/search-box';\n\n export default {\n name: 'ResultsListDemo',\n components: {\n SearchInput,\n ResultsList,\n BannersList,\n PromotedsList\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;;;;AAcE;;;;;;;;;;AAUE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,aAAa,CAAC,IAAI;AAC3B,IAAA,KAAK,EAAE;;AAEL,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,OAAO,EAAE,IAAG;AACd,SAAA;AACD,KAAA;IACD,KAAK,EAAE,CAAC,2BAA2B,CAAC;AACpC,IAAA,KAAK,CAAC,KAAK,EAAE,EAAE,KAAI,EAAG,EAAA;AACpB;;;;;;AAME;AACF,QAAA,MAAM,KAAK,GAA0B,QAAQ,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAA;AAC5E,QAAA,OAAO,CAAwB,cAAwB,EAAE,KA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C;;;;"}
1
+ {"version":3,"file":"results-list.vue.js","sources":["../../../../../src/x-modules/search/components/results-list.vue"],"sourcesContent":["<script lang=\"ts\">\n import { computed, ComputedRef, defineComponent, h, provide, Ref, ref, watch } from 'vue';\n import { Result } from '@empathyco/x-types';\n import {\n HAS_MORE_ITEMS_KEY,\n LIST_ITEMS_KEY,\n QUERY_KEY\n } from '../../../components/decorators/injection.consts';\n import ItemsList from '../../../components/items-list.vue';\n import { RequestStatus } from '../../../store/utils/status-store.utils';\n import { useState } from '../../../composables/use-state';\n import { searchXModule } from '../x-module';\n import { AnimationProp } from '../../../types';\n\n /**\n * It renders a {@link ItemsList} list with the results from {@link SearchState.results} by\n * default.\n *\n * The component provides a default slot which wraps the whole component with the `results` bound.\n *\n * It also provides the slot result to customize the item, which is within the default slot, with\n * the result bound.\n *\n * @public\n */\n export default defineComponent({\n name: 'ResultsList',\n xModule: searchXModule.name,\n props: {\n /** Animation component that will be used to animate the results. */\n animation: {\n type: AnimationProp,\n default: 'ul'\n }\n },\n emits: ['UserReachedResultsListEnd'],\n setup(props, { slots }) {\n /**\n * The results to render from the state.\n *\n * @remarks The results list are provided with `items` key. It can be\n * concatenated with list items from components such as `BannersList`, `PromotedsList`,\n * `BaseGrid` or any component that injects the list.\n */\n const items: ComputedRef<Result[]> = useState('search', ['results']).results;\n provide<ComputedRef<Result[]>>(LIST_ITEMS_KEY as string, items);\n\n /** The total number of results, taken from the state. */\n const totalResults: ComputedRef<number> = useState('search', ['totalResults']).totalResults;\n\n /** This query is updated only when the search request has succeeded. */\n let providedQuery = ref('');\n provide<Ref<string>>(QUERY_KEY as string, providedQuery);\n\n /** Indicates if there are more available results that have not been injected. */\n const hasMoreItems = computed(() => items.value.length < totalResults.value);\n provide<ComputedRef<boolean>>(HAS_MORE_ITEMS_KEY as string, hasMoreItems);\n\n /** The status of the search request, taken from the state. */\n const searchStatus: ComputedRef<RequestStatus> = useState('search', ['status']).status;\n\n /** The query of the search request, taken from the state. */\n const searchQuery: ComputedRef<string> = useState('search', ['query']).query;\n\n /**\n * Updates the query to be provided to the child components\n * when the search request has succeeded.\n *\n * @param status - The status of the search request.\n */\n function updateQuery(status: RequestStatus) {\n if (status === 'success') {\n providedQuery.value = searchQuery.value;\n }\n }\n\n /**\n * Watches the searchStatus and triggers updateQuery as callback\n * when it changes.\n *\n * @param status - The status of the search request.\n */\n watch(searchStatus, () => updateQuery(searchStatus.value), { immediate: true });\n\n return () => {\n const innerProps = { items: items.value, animation: props.animation };\n // https://vue-land.github.io/faq/forwarding-slots#passing-all-slots\n return slots.default?.(innerProps)[0] ?? h(ItemsList, innerProps, slots);\n };\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component doesn't emit events.\n\n## See it in action\n\n<!-- prettier-ignore-start -->\n:::warning Backend service required\nTo use this component, the Search service must be implemented.\n:::\n<!-- prettier-ignore-end -->\n\nHere you have a basic example of how the ResultsList is rendered.\n\n_Type any term in the input field to try it out!_\n\n```vue\n<template>\n <div>\n <SearchInput />\n <ResultsList />\n </div>\n</template>\n\n<script>\n import { ResultsList } from '@empathyco/x-components/search';\n import { SearchInput } from '@empathyco/x-components/search-box';\n\n export default {\n name: 'ResultsListDemo',\n components: {\n SearchInput,\n ResultsList\n }\n };\n</script>\n```\n\n### Play with the animation\n\n```vue\n<template>\n <div>\n <SearchInput />\n <ResultsList :animation=\"fadeAndSlide\" />\n </div>\n</template>\n\n<script>\n import { ResultsList } from '@empathyco/x-components/search';\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { FadeAndSlide } from '@empathyco/x-components/animations';\n\n export default {\n name: 'ResultsListDemo',\n components: {\n SearchInput,\n ResultsList\n },\n data() {\n return {\n fadeAndSlide: FadeAndSlide\n };\n }\n };\n</script>\n```\n\n### Overriding default content\n\n```vue\n<template>\n <div>\n <SearchInput />\n <ResultsList #default=\"{ items, animation }\">\n <BaseGrid :items=\"items\" :animation=\"animation\">\n <template #result=\"{ item }\">\n <span>Result: {{ item.name }}</span>\n </template>\n <template #default=\"{ item }\">\n <span>Default: {{ item }}</span>\n </template>\n </BaseGrid>\n </ResultsList>\n </div>\n</template>\n\n<script>\n import { ResultsList } from '@empathyco/x-components/search';\n import { SearchInput } from '@empathyco/x-components/search-box';\n import { BaseGrid } from '@empathyco/x-components';\n\n export default {\n name: 'ResultsListDemo',\n components: {\n SearchInput,\n ResultsList,\n BaseGrid\n }\n };\n</script>\n```\n\n### Overriding result content\n\n```vue\n<template>\n <div>\n <SearchInput />\n <ResultsList #result=\"{ item }\">\n <span class=\"result\">\n {{ item.name }}\n </span>\n </ResultsList>\n </div>\n</template>\n\n<script>\n import { SearchInput, ResultsList } from '@empathyco/x-components/search';\n\n export default {\n name: 'ResultsListDemo',\n components: {\n SearchInput,\n ResultsList\n }\n };\n</script>\n```\n\n### Data injection\n\nStarting with the `ResultsList` component as root element, you can concat the list of list items\nusing `BannersList`, `PromotedsList`, `BaseGrid` or any component that injects the `listItems`\nvalue.\n\nThe order in which elements are placed in the template will define the concat strategy of the items,\nso it is important to define it properly; for example, Promoteds will be usually before Banners so\nfirst promoted items are inserted within the results and then banner items are placed on top of\nthat, occupying the rows.\n\n```vue\n<template>\n <div>\n <SearchInput />\n <ResultsList>\n <PromotedsList>\n <BannersList>\n <template #result=\"{ item }\">Result: {{ item.id }}</template>\n <template #banner=\"{ item }\">Banner: {{ item.id }}</template>\n <template #promoted=\"{ item }\">Promoted: {{ item.id }}</template>\n </BannersList>\n </PromotedsList>\n </ResultsList>\n </div>\n</template>\n\n<script>\n import { ResultsList, BannersList, PromotedsList } from '@empathyco/x-components/search';\n import { SearchInput } from '@empathyco/x-components/search-box';\n\n export default {\n name: 'ResultsListDemo',\n components: {\n SearchInput,\n ResultsList,\n BannersList,\n PromotedsList\n }\n };\n</script>\n```\n</docs>\n"],"names":[],"mappings":";;;;;;;AAcE;;;;;;;;;;AAUE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,aAA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AAM,WAAW,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,EAAE,SAAS,EAAE,IAAG,EAAG,CAAC,CAAA;AAE/E,QAAA,OAAO,MAAM;AACX,YAAA,MAAM,UAAW,GAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,SAAQ,EAAG,CAAA;;AAErE,YAAA,OAAO,KAAK,CAAC,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,CAAE,IAAG,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,KAAK,CAAC,CAAA;AAC1E,SAAC,CAAA;KACH;AACD,CAAA,CAAC;;;;"}
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * @public
9
9
  */
10
- const saveSearchResponse = ({ commit, state, getters }, { results, partialResults, facets, banners, promoteds, totalResults, spellcheck, redirections, queryTagging, displayTagging }) => {
10
+ const saveSearchResponse = ({ commit, state, getters }, { results, partialResults, facets, banners, promoteds, totalResults, spellcheck, redirections, queryTagging, displayTagging, stats }) => {
11
11
  if (totalResults === 0) {
12
12
  commit('setIsNoResults', true);
13
13
  if (getters.request && Object.keys(getters.request.filters).length > 0) {
@@ -38,6 +38,7 @@ const saveSearchResponse = ({ commit, state, getters }, { results, partialResult
38
38
  }
39
39
  commit('setTotalResults', totalResults);
40
40
  commit('setSpellcheck', spellcheck ?? '');
41
+ commit('setStats', stats);
41
42
  };
42
43
 
43
44
  export { saveSearchResponse };
@@ -1 +1 @@
1
- {"version":3,"file":"save-search-response.action.js","sources":["../../../../../../src/x-modules/search/store/actions/save-search-response.action.ts"],"sourcesContent":["import { SearchXStoreModule } from '../types';\n\n/**\n * Default implementation for the {@link SearchActions.saveSearchResponse}.\n *\n * @param context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,\n * provided by Vuex.\n * @param response - The {@link @empathyco/x-types#SearchResponse} to save.\n *\n * @public\n */\nexport const saveSearchResponse: SearchXStoreModule['actions']['saveSearchResponse'] = (\n { commit, state, getters },\n {\n results,\n partialResults,\n facets,\n banners,\n promoteds,\n totalResults,\n spellcheck,\n redirections,\n queryTagging,\n displayTagging\n }\n) => {\n if (totalResults === 0) {\n commit('setIsNoResults', true);\n if (getters.request && Object.keys(getters.request.filters!).length > 0) {\n commit('setFromNoResultsWithFilters', true);\n }\n } else {\n commit('setIsNoResults', false);\n }\n\n if (state.isAppendResults) {\n commit('appendResults', results);\n } else {\n commit('setResults', results);\n commit('setBanners', banners ?? []);\n commit('setPromoteds', promoteds ?? []);\n commit('setRedirections', redirections ?? []);\n }\n\n commit('setPartialResults', partialResults ?? []);\n\n if (facets) {\n commit('setFacets', facets);\n }\n\n if (queryTagging) {\n commit('setQueryTagging', queryTagging);\n }\n\n if (displayTagging) {\n commit('setDisplayTagging', displayTagging);\n }\n\n commit('setTotalResults', totalResults);\n commit('setSpellcheck', spellcheck ?? '');\n};\n"],"names":[],"mappings":"AAEA;;;;;;;;AAQG;AACI,MAAM,kBAAkB,GAAwD,CACrF,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAC1B,EACE,OAAO,EACP,cAAc,EACd,MAAM,EACN,OAAO,EACP,SAAS,EACT,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,cAAc,EACf,KACC;IACF,IAAI,YAAY,KAAK,CAAC,EAAE;AACtB,QAAA,MAAM,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;AAC/B,QAAA,IAAI,OAAO,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAQ,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;AACvE,YAAA,MAAM,CAAC,6BAA6B,EAAE,IAAI,CAAC,CAAC;AAC7C,SAAA;AACF,KAAA;AAAM,SAAA;AACL,QAAA,MAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;AACjC,KAAA;IAED,IAAI,KAAK,CAAC,eAAe,EAAE;AACzB,QAAA,MAAM,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;AAClC,KAAA;AAAM,SAAA;AACL,QAAA,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AAC9B,QAAA,MAAM,CAAC,YAAY,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC;AACpC,QAAA,MAAM,CAAC,cAAc,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC;AACxC,QAAA,MAAM,CAAC,iBAAiB,EAAE,YAAY,IAAI,EAAE,CAAC,CAAC;AAC/C,KAAA;AAED,IAAA,MAAM,CAAC,mBAAmB,EAAE,cAAc,IAAI,EAAE,CAAC,CAAC;AAElD,IAAA,IAAI,MAAM,EAAE;AACV,QAAA,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;AAC7B,KAAA;AAED,IAAA,IAAI,YAAY,EAAE;AAChB,QAAA,MAAM,CAAC,iBAAiB,EAAE,YAAY,CAAC,CAAC;AACzC,KAAA;AAED,IAAA,IAAI,cAAc,EAAE;AAClB,QAAA,MAAM,CAAC,mBAAmB,EAAE,cAAc,CAAC,CAAC;AAC7C,KAAA;AAED,IAAA,MAAM,CAAC,iBAAiB,EAAE,YAAY,CAAC,CAAC;AACxC,IAAA,MAAM,CAAC,eAAe,EAAE,UAAU,IAAI,EAAE,CAAC,CAAC;AAC5C;;;;"}
1
+ {"version":3,"file":"save-search-response.action.js","sources":["../../../../../../src/x-modules/search/store/actions/save-search-response.action.ts"],"sourcesContent":["import { Stats } from '@empathyco/x-types';\nimport { SearchXStoreModule } from '../types';\n\n/**\n * Default implementation for the {@link SearchActions.saveSearchResponse}.\n *\n * @param context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,\n * provided by Vuex.\n * @param response - The {@link @empathyco/x-types#SearchResponse} to save.\n *\n * @public\n */\nexport const saveSearchResponse: SearchXStoreModule['actions']['saveSearchResponse'] = (\n { commit, state, getters },\n {\n results,\n partialResults,\n facets,\n banners,\n promoteds,\n totalResults,\n spellcheck,\n redirections,\n queryTagging,\n displayTagging,\n stats\n }\n) => {\n if (totalResults === 0) {\n commit('setIsNoResults', true);\n if (getters.request && Object.keys(getters.request.filters!).length > 0) {\n commit('setFromNoResultsWithFilters', true);\n }\n } else {\n commit('setIsNoResults', false);\n }\n\n if (state.isAppendResults) {\n commit('appendResults', results);\n } else {\n commit('setResults', results);\n commit('setBanners', banners ?? []);\n commit('setPromoteds', promoteds ?? []);\n commit('setRedirections', redirections ?? []);\n }\n\n commit('setPartialResults', partialResults ?? []);\n\n if (facets) {\n commit('setFacets', facets);\n }\n\n if (queryTagging) {\n commit('setQueryTagging', queryTagging);\n }\n\n if (displayTagging) {\n commit('setDisplayTagging', displayTagging);\n }\n\n commit('setTotalResults', totalResults);\n commit('setSpellcheck', spellcheck ?? '');\n commit('setStats', stats as Stats);\n};\n"],"names":[],"mappings":"AAGA;;;;;;;;AAQG;AACU,MAAA,kBAAkB,GAAwD,CACrF,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAC1B,EACE,OAAO,EACP,cAAc,EACd,MAAM,EACN,OAAO,EACP,SAAS,EACT,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,KAAK,EACN,KACC;IACF,IAAI,YAAY,KAAK,CAAC,EAAE;AACtB,QAAA,MAAM,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;AAC/B,QAAA,IAAI,OAAO,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAQ,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;AACvE,YAAA,MAAM,CAAC,6BAA6B,EAAE,IAAI,CAAC,CAAC;AAC7C,SAAA;AACF,KAAA;AAAM,SAAA;AACL,QAAA,MAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;AACjC,KAAA;IAED,IAAI,KAAK,CAAC,eAAe,EAAE;AACzB,QAAA,MAAM,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;AAClC,KAAA;AAAM,SAAA;AACL,QAAA,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AAC9B,QAAA,MAAM,CAAC,YAAY,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC;AACpC,QAAA,MAAM,CAAC,cAAc,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC;AACxC,QAAA,MAAM,CAAC,iBAAiB,EAAE,YAAY,IAAI,EAAE,CAAC,CAAC;AAC/C,KAAA;AAED,IAAA,MAAM,CAAC,mBAAmB,EAAE,cAAc,IAAI,EAAE,CAAC,CAAC;AAElD,IAAA,IAAI,MAAM,EAAE;AACV,QAAA,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;AAC7B,KAAA;AAED,IAAA,IAAI,YAAY,EAAE;AAChB,QAAA,MAAM,CAAC,iBAAiB,EAAE,YAAY,CAAC,CAAC;AACzC,KAAA;AAED,IAAA,IAAI,cAAc,EAAE;AAClB,QAAA,MAAM,CAAC,mBAAmB,EAAE,cAAc,CAAC,CAAC;AAC7C,KAAA;AAED,IAAA,MAAM,CAAC,iBAAiB,EAAE,YAAY,CAAC,CAAC;AACxC,IAAA,MAAM,CAAC,eAAe,EAAE,UAAU,IAAI,EAAE,CAAC,CAAC;AAC1C,IAAA,MAAM,CAAC,UAAU,EAAE,KAAc,CAAC,CAAC;AACrC;;;;"}
@@ -112,6 +112,9 @@ const searchXStoreModule = {
112
112
  if (stateResult) {
113
113
  Object.assign(stateResult, result);
114
114
  }
115
+ },
116
+ setStats(state, stats) {
117
+ state.stats = stats;
115
118
  }
116
119
  },
117
120
  actions: {
@@ -156,7 +159,8 @@ function resettableState() {
156
159
  displayTagging: {
157
160
  url: '',
158
161
  params: {}
159
- }
162
+ },
163
+ stats: {}
160
164
  };
161
165
  }
162
166
 
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sources":["../../../../../src/x-modules/search/store/module.ts"],"sourcesContent":["import { isFacetFilter } from '@empathyco/x-types';\nimport { setQuery } from '../../../store/utils/query.utils';\nimport { setStatus } from '../../../store';\nimport { groupItemsBy } from '../../../utils/array';\nimport { mergeConfig, setConfig } from '../../../store/utils/config-store.utils';\nimport { UNKNOWN_FACET_KEY } from '../../facets/store/constants';\nimport {\n cancelFetchAndSaveSearchResponse,\n fetchAndSaveSearchResponse,\n fetchSearchResponse,\n increasePageAppendingResults,\n resetRequestOnRefinement,\n saveSearchResponse\n} from './actions';\nimport { saveOrigin } from './actions/save-origin.action';\nimport { setUrlParams } from './actions/set-url-params.action';\nimport { query } from './getters/query.getter';\nimport { request } from './getters/request.getter';\nimport { SearchXStoreModule } from './types';\n\n/**\n * {@link XStoreModule} For the search module.\n *\n * @internal\n */\nexport const searchXStoreModule: SearchXStoreModule = {\n state: () => ({\n ...resettableState(),\n selectedFilters: {},\n params: {},\n config: {\n pageSize: 24\n },\n status: 'initial',\n isNoResults: false,\n fromNoResultsWithFilters: false\n }),\n getters: {\n request,\n query\n },\n mutations: {\n appendResults(state, results) {\n state.results = [...state.results, ...results];\n },\n resetState(state) {\n Object.assign(state, resettableState());\n },\n resetStateForReload(state) {\n const { query, facets, sort, page, ...resettable } = resettableState();\n Object.assign(state, resettable);\n },\n setQuery,\n setResults(state, results) {\n state.results = results;\n },\n setPartialResults(state, partialResults) {\n state.partialResults = partialResults;\n },\n setFacets(state, facets) {\n state.facets = facets;\n },\n setRelatedTags(state, relatedTags) {\n state.relatedTags = relatedTags;\n },\n setSelectedFilters(state, selectedFilters) {\n state.selectedFilters = groupItemsBy(selectedFilters, filter =>\n isFacetFilter(filter) ? filter.facetId : UNKNOWN_FACET_KEY\n );\n },\n setBanners(state, banners) {\n state.banners = banners;\n },\n setPromoteds(state, promoteds) {\n state.promoteds = promoteds;\n },\n setSpellcheck(state, spellcheckedQuery) {\n state.spellcheckedQuery = spellcheckedQuery;\n },\n setTotalResults(state, totalResults) {\n state.totalResults = totalResults;\n },\n setSort(state, sort) {\n state.sort = sort;\n },\n setPage(state, page) {\n state.page = page;\n },\n setConfig,\n mergeConfig,\n setIsAppendResults(state, isAppendResults) {\n state.isAppendResults = isAppendResults;\n },\n setIsNoResults(state, isNoResults) {\n state.isNoResults = isNoResults;\n },\n setFromNoResultsWithFilters(state, fromNoResultsWithFilters) {\n state.fromNoResultsWithFilters = fromNoResultsWithFilters;\n },\n setStatus,\n setParams(state, params) {\n state.params = params;\n },\n setOrigin(state, origin = null) {\n state.origin = origin;\n },\n setRedirections(state, redirections) {\n state.redirections = redirections;\n },\n setQueryTagging(state, queryTagging) {\n state.queryTagging = queryTagging;\n },\n setDisplayTagging(state, displayTagging) {\n state.displayTagging = displayTagging;\n },\n updateResult(state, result) {\n const stateResult = state.results.find(stateResult => result.id === stateResult.id);\n if (stateResult) {\n Object.assign(stateResult, result);\n }\n }\n },\n actions: {\n cancelFetchAndSaveSearchResponse,\n fetchSearchResponse,\n fetchAndSaveSearchResponse,\n increasePageAppendingResults,\n resetRequestOnRefinement,\n saveSearchResponse,\n setUrlParams,\n saveOrigin\n }\n};\n\n/**\n * Function to return the \"resettable\" part of the state. This will be used in the `resetState`\n * mutation to reset to the initial state.\n *\n * @returns The \"resettable\" part of the {@link SearchState}.\n *\n * @internal\n */\nexport function resettableState() {\n return {\n query: '',\n results: [],\n partialResults: [],\n facets: [],\n relatedTags: [],\n banners: [],\n promoteds: [],\n totalResults: 0,\n spellcheckedQuery: '',\n sort: '',\n page: 1,\n origin: null,\n isAppendResults: false,\n redirections: [],\n queryTagging: {\n url: '',\n params: {}\n },\n displayTagging: {\n url: '',\n params: {}\n }\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAoBA;;;;AAIG;AACU,MAAA,kBAAkB,GAAuB;AACpD,IAAA,KAAK,EAAE,OAAO;AACZ,QAAA,GAAG,eAAe,EAAE;AACpB,QAAA,eAAe,EAAE,EAAE;AACnB,QAAA,MAAM,EAAE,EAAE;AACV,QAAA,MAAM,EAAE;AACN,YAAA,QAAQ,EAAE,EAAE;AACb,SAAA;AACD,QAAA,MAAM,EAA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,EAAE,EAAE;AACX,SAAA;KACF,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"module.js","sources":["../../../../../src/x-modules/search/store/module.ts"],"sourcesContent":["import { isFacetFilter, Stats } from '@empathyco/x-types';\nimport { setQuery } from '../../../store/utils/query.utils';\nimport { setStatus } from '../../../store';\nimport { groupItemsBy } from '../../../utils/array';\nimport { mergeConfig, setConfig } from '../../../store/utils/config-store.utils';\nimport { UNKNOWN_FACET_KEY } from '../../facets/store/constants';\nimport {\n cancelFetchAndSaveSearchResponse,\n fetchAndSaveSearchResponse,\n fetchSearchResponse,\n increasePageAppendingResults,\n resetRequestOnRefinement,\n saveSearchResponse\n} from './actions';\nimport { saveOrigin } from './actions/save-origin.action';\nimport { setUrlParams } from './actions/set-url-params.action';\nimport { query } from './getters/query.getter';\nimport { request } from './getters/request.getter';\nimport { SearchXStoreModule } from './types';\n\n/**\n * {@link XStoreModule} For the search module.\n *\n * @internal\n */\nexport const searchXStoreModule: SearchXStoreModule = {\n state: () => ({\n ...resettableState(),\n selectedFilters: {},\n params: {},\n config: {\n pageSize: 24\n },\n status: 'initial',\n isNoResults: false,\n fromNoResultsWithFilters: false\n }),\n getters: {\n request,\n query\n },\n mutations: {\n appendResults(state, results) {\n state.results = [...state.results, ...results];\n },\n resetState(state) {\n Object.assign(state, resettableState());\n },\n resetStateForReload(state) {\n const { query, facets, sort, page, ...resettable } = resettableState();\n Object.assign(state, resettable);\n },\n setQuery,\n setResults(state, results) {\n state.results = results;\n },\n setPartialResults(state, partialResults) {\n state.partialResults = partialResults;\n },\n setFacets(state, facets) {\n state.facets = facets;\n },\n setRelatedTags(state, relatedTags) {\n state.relatedTags = relatedTags;\n },\n setSelectedFilters(state, selectedFilters) {\n state.selectedFilters = groupItemsBy(selectedFilters, filter =>\n isFacetFilter(filter) ? filter.facetId : UNKNOWN_FACET_KEY\n );\n },\n setBanners(state, banners) {\n state.banners = banners;\n },\n setPromoteds(state, promoteds) {\n state.promoteds = promoteds;\n },\n setSpellcheck(state, spellcheckedQuery) {\n state.spellcheckedQuery = spellcheckedQuery;\n },\n setTotalResults(state, totalResults) {\n state.totalResults = totalResults;\n },\n setSort(state, sort) {\n state.sort = sort;\n },\n setPage(state, page) {\n state.page = page;\n },\n setConfig,\n mergeConfig,\n setIsAppendResults(state, isAppendResults) {\n state.isAppendResults = isAppendResults;\n },\n setIsNoResults(state, isNoResults) {\n state.isNoResults = isNoResults;\n },\n setFromNoResultsWithFilters(state, fromNoResultsWithFilters) {\n state.fromNoResultsWithFilters = fromNoResultsWithFilters;\n },\n setStatus,\n setParams(state, params) {\n state.params = params;\n },\n setOrigin(state, origin = null) {\n state.origin = origin;\n },\n setRedirections(state, redirections) {\n state.redirections = redirections;\n },\n setQueryTagging(state, queryTagging) {\n state.queryTagging = queryTagging;\n },\n setDisplayTagging(state, displayTagging) {\n state.displayTagging = displayTagging;\n },\n updateResult(state, result) {\n const stateResult = state.results.find(stateResult => result.id === stateResult.id);\n if (stateResult) {\n Object.assign(stateResult, result);\n }\n },\n setStats(state, stats) {\n state.stats = stats;\n }\n },\n actions: {\n cancelFetchAndSaveSearchResponse,\n fetchSearchResponse,\n fetchAndSaveSearchResponse,\n increasePageAppendingResults,\n resetRequestOnRefinement,\n saveSearchResponse,\n setUrlParams,\n saveOrigin\n }\n};\n\n/**\n * Function to return the \"resettable\" part of the state. This will be used in the `resetState`\n * mutation to reset to the initial state.\n *\n * @returns The \"resettable\" part of the {@link SearchState}.\n *\n * @internal\n */\nexport function resettableState() {\n return {\n query: '',\n results: [],\n partialResults: [],\n facets: [],\n relatedTags: [],\n banners: [],\n promoteds: [],\n totalResults: 0,\n spellcheckedQuery: '',\n sort: '',\n page: 1,\n origin: null,\n isAppendResults: false,\n redirections: [],\n queryTagging: {\n url: '',\n params: {}\n },\n displayTagging: {\n url: '',\n params: {}\n },\n stats: {} as Stats\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAoBA;;;;AAIG;AACU,MAAA,kBAAkB,G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rB,QAAA,IAAI,EAAE,EAAE;AACR,QAAA,IAAI,EAAE,CAAC;AACP,QAAA,MAAM,EAAE,IAAI;AACZ,QAAA,eAAe,EAAE,KAAK;AACtB,QAAA,YAAY,EAAE,EAAE;AAChB,QAAA,YAAY,EAAE;AACZ,YAAA,GAAG,EAAE,EAAE;AACP,YAAA,MAAM,EAAE,EAAE;AACX,SAAA;AACD,QAAA,cAAc,EAAE;AACd,YAAA,GAAG,EAAE,EAAE;AACP,YAAA,MAAM,EAAE,EAAE;AACX,SAAA;AACD,QAAA,KAAK,EAAE,EAAW;KACnB,CAAC;AACJ;;;;"}
@@ -35,11 +35,17 @@ var _sfc_main = defineComponent({
35
35
  /**
36
36
  * The debounce time in milliseconds to track the query.
37
37
  */
38
- queryTaggingDebounceMs: Number,
38
+ queryTaggingDebounceMs: {
39
+ type: Number,
40
+ default: 2000
41
+ },
39
42
  /**
40
43
  * The consent to be emitted.
41
44
  */
42
- consent: Boolean
45
+ consent: {
46
+ type: Boolean,
47
+ default: null
48
+ }
43
49
  },
44
50
  setup(props) {
45
51
  const xBus = useXBus();
@@ -1 +1 @@
1
- {"version":3,"file":"tagging.vue.js","sources":["../../../../../src/x-modules/tagging/components/tagging.vue"],"sourcesContent":["<script lang=\"ts\">\n import { computed, defineComponent, inject, onMounted, watch } from 'vue';\n import { SnippetConfig } from '../../../x-installer/api/api.types';\n import { taggingXModule } from '../x-module';\n import { TaggingConfig } from '../config.types';\n import { useXBus } from '../../../composables/use-x-bus';\n /**\n * This component enables and manages the sending of information to the\n * [Empathy Tagging API](https://docs.empathy.co/develop-empathy-platform/api-reference/tagging-api.html).\n * It allows you to activate or deactivate the session id management through the `consent` prop.\n *\n * @public\n */\n export default defineComponent({\n name: 'Tagging',\n xModule: taggingXModule.name,\n props: {\n /**\n * The TTL in milliseconds for storing the clicked result info.\n */\n clickedResultStorageTTLMs: {\n type: Number,\n default: 30000\n },\n /**\n * The Object key of the {@link @empathyco/x-types#Result} clicked by the user\n * that will be used as id for the storage. By default, the Result url will be used.\n */\n clickedResultStorageKey: {\n type: String,\n default: 'url'\n },\n /**\n * The session TTL in milliseconds.\n */\n sessionTTLMs: Number,\n /**\n * The debounce time in milliseconds to track the query.\n */\n queryTaggingDebounceMs: Number,\n /**\n * The consent to be emitted.\n */\n consent: Boolean\n },\n setup(props) {\n const xBus = useXBus();\n\n /**\n * It injects {@link SnippetConfig} provided by an ancestor as snippetConfig.\n */\n const snippetConfig = inject<SnippetConfig | undefined>('snippetConfig');\n\n /**\n * The active consent, selected from the `consent` prop and the `snippetConfig.consent`\n * property. False by default.\n *\n * @remarks If the consent is undefined in the prop and in the snippetConfig, it will return\n * false.\n *\n * @returns A boolean that represents if the consent is accepted or not.\n */\n const activeConsent = computed(() => props.consent ?? snippetConfig?.consent ?? false);\n\n /**\n * The tagging config to be emitted.\n */\n const taggingConfig = computed<TaggingConfig>(() => {\n return {\n queryTaggingDebounceMs: props.queryTaggingDebounceMs as number,\n sessionTTLMs: props.sessionTTLMs as number,\n clickedResultStorageTTLMs: props.clickedResultStorageTTLMs,\n clickedResultStorageKey: props.clickedResultStorageKey\n };\n });\n\n /**\n * Emits the {@link TaggingXEvents.PDPIsLoaded} XEvent if the snippet config contains\n * a product id.\n */\n onMounted(() => {\n if (snippetConfig?.productId) {\n xBus.emit('PDPIsLoaded', snippetConfig.productId);\n }\n });\n\n /**\n * Emmits the consent when it changes.\n */\n watch(activeConsent, () => xBus.emit('ConsentProvided', activeConsent.value), {\n immediate: true\n });\n\n /**\n * Emmits the tagging config when it changes.\n */\n watch(taggingConfig, () => xBus.emit('TaggingConfigProvided', taggingConfig.value), {\n immediate: true\n });\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n return () => {};\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following events:\n\n- [`ConsentProvided`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n- [`TaggingConfigProvided`](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 tagging of the API to track the different features. This component\ndoesn't render elements to the DOM.\n\n```vue\n<template>\n <Tagging />\n</template>\n\n<script>\n import { Tagging } from '@empathyco/x-components/tagging';\n\n export default {\n name: 'TaggingDemo',\n components: {\n Tagging\n }\n };\n</script>\n```\n\n### Play with props\n\nIn this example, the `Tagging` component will emit `ConsentProvided` with payload false by default\nif the consent is not provided, the `TaggingConfigProvided` event will be emitted only if the props\n`queryTaggingDebounceMs`, `sessionDurationMs`, `clickedResultStorageTTLMs` or\n`clickedResultStorageKey`are defined.\n\nEvery time the user clicks a result the information for the clicked product will be stored on the\nbrowser during 30 seconds which is the default value for the prop `clickedResultStorageTTLMs`. To\ndistinguish the storage information for the different results the product url will be used since\n`clickedResultStorageKey` default value is 'url'.\n\n```vue\n<template>\n <Tagging :consent=\"true\" :queryTaggingDebounceMs=\"300\" :sessionDurationMs=\"30000\" />\n</template>\n\n<script>\n import { Tagging } from '@empathyco/x-components/tagging';\n\n export default {\n name: 'TaggingDemo',\n components: {\n Tagging\n }\n };\n</script>\n```\n\nIn this example, the clicked result information will be stored on the browser during 60 seconds and\nthe product id will be used as storage key.\n\n```vue\n<template>\n <Tagging :clickedResultStorageTTLMs=\"60000\" :clickedResultStorageKey=\"'id'\" />\n</template>\n\n<script>\n import { Tagging } from '@empathyco/x-components/tagging';\n\n export default {\n name: 'TaggingDemo',\n components: {\n Tagging\n }\n };\n</script>\n```\n\n### Play with events\n\nThe `Tagging` will emit the `ConsentProvided` when the component is loaded and the consent is set by\nthe prop or getting the value from the snippet config.\n\nThe `Tagging` will emit the `TaggingConfigProvided` when the component is loaded with the new\n[`TaggingConfig`](./../../api/x-components.taggingconfig.md) using the prop values.\n</docs>\n"],"names":[],"mappings":";;;;AAME;;;;;;AAME;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,cAAc,CAAC,IAAI;AAC5B,IAAA,KAAK,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AE;AAC5E,YAAA,SAAS,EAAE,IAAG;AACf,SAAA,CAAC,CAAA;AAEF;;AAEE;AACF,QAAA,KAAK,CAAC,aAAa,EAAE,MAAM,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE;AAClF,YAAA,SAAS,EAAE,IAAG;AACf,SAAA,CAAC,CAAA;;AAGF,QAAA,OAAO,MAAO,GAAC,CAAA;KACjB;AACD,CAAA,CAAC;;;;"}
1
+ {"version":3,"file":"tagging.vue.js","sources":["../../../../../src/x-modules/tagging/components/tagging.vue"],"sourcesContent":["<script lang=\"ts\">\n import { computed, defineComponent, inject, onMounted, watch } from 'vue';\n import { SnippetConfig } from '../../../x-installer/api/api.types';\n import { taggingXModule } from '../x-module';\n import { TaggingConfig } from '../config.types';\n import { useXBus } from '../../../composables/use-x-bus';\n /**\n * This component enables and manages the sending of information to the\n * [Empathy Tagging API](https://docs.empathy.co/develop-empathy-platform/api-reference/tagging-api.html).\n * It allows you to activate or deactivate the session id management through the `consent` prop.\n *\n * @public\n */\n export default defineComponent({\n name: 'Tagging',\n xModule: taggingXModule.name,\n props: {\n /**\n * The TTL in milliseconds for storing the clicked result info.\n */\n clickedResultStorageTTLMs: {\n type: Number,\n default: 30000\n },\n /**\n * The Object key of the {@link @empathyco/x-types#Result} clicked by the user\n * that will be used as id for the storage. By default, the Result url will be used.\n */\n clickedResultStorageKey: {\n type: String,\n default: 'url'\n },\n /**\n * The session TTL in milliseconds.\n */\n sessionTTLMs: Number,\n /**\n * The debounce time in milliseconds to track the query.\n */\n queryTaggingDebounceMs: {\n type: Number,\n default: 2000\n },\n /**\n * The consent to be emitted.\n */\n consent: {\n type: Boolean,\n default: null\n }\n },\n setup(props) {\n const xBus = useXBus();\n\n /**\n * It injects {@link SnippetConfig} provided by an ancestor as snippetConfig.\n */\n const snippetConfig = inject<SnippetConfig | undefined>('snippetConfig');\n\n /**\n * The active consent, selected from the `consent` prop and the `snippetConfig.consent`\n * property. False by default.\n *\n * @remarks If the consent is undefined in the prop and in the snippetConfig, it will return\n * false.\n *\n * @returns A boolean that represents if the consent is accepted or not.\n */\n const activeConsent = computed(() => props.consent ?? snippetConfig?.consent ?? false);\n\n /**\n * The tagging config to be emitted.\n */\n const taggingConfig = computed<TaggingConfig>(() => {\n return {\n queryTaggingDebounceMs: props.queryTaggingDebounceMs,\n sessionTTLMs: props.sessionTTLMs as number,\n clickedResultStorageTTLMs: props.clickedResultStorageTTLMs,\n clickedResultStorageKey: props.clickedResultStorageKey\n };\n });\n\n /**\n * Emits the {@link TaggingXEvents.PDPIsLoaded} XEvent if the snippet config contains\n * a product id.\n */\n onMounted(() => {\n if (snippetConfig?.productId) {\n xBus.emit('PDPIsLoaded', snippetConfig.productId);\n }\n });\n\n /**\n * Emmits the consent when it changes.\n */\n watch(activeConsent, () => xBus.emit('ConsentProvided', activeConsent.value), {\n immediate: true\n });\n\n /**\n * Emmits the tagging config when it changes.\n */\n watch(taggingConfig, () => xBus.emit('TaggingConfigProvided', taggingConfig.value), {\n immediate: true\n });\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n return () => {};\n }\n });\n</script>\n\n<docs lang=\"mdx\">\n## Events\n\nThis component emits the following events:\n\n- [`ConsentProvided`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts)\n- [`TaggingConfigProvided`](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 tagging of the API to track the different features. This component\ndoesn't render elements to the DOM.\n\n```vue\n<template>\n <Tagging />\n</template>\n\n<script>\n import { Tagging } from '@empathyco/x-components/tagging';\n\n export default {\n name: 'TaggingDemo',\n components: {\n Tagging\n }\n };\n</script>\n```\n\n### Play with props\n\nIn this example, the `Tagging` component will emit `ConsentProvided` with payload false by default\nif the consent is not provided, the `TaggingConfigProvided` event will be emitted only if the props\n`queryTaggingDebounceMs`, `sessionDurationMs`, `clickedResultStorageTTLMs` or\n`clickedResultStorageKey`are defined.\n\nEvery time the user clicks a result the information for the clicked product will be stored on the\nbrowser during 30 seconds which is the default value for the prop `clickedResultStorageTTLMs`. To\ndistinguish the storage information for the different results the product url will be used since\n`clickedResultStorageKey` default value is 'url'.\n\n```vue\n<template>\n <Tagging :consent=\"true\" :queryTaggingDebounceMs=\"300\" :sessionDurationMs=\"30000\" />\n</template>\n\n<script>\n import { Tagging } from '@empathyco/x-components/tagging';\n\n export default {\n name: 'TaggingDemo',\n components: {\n Tagging\n }\n };\n</script>\n```\n\nIn this example, the clicked result information will be stored on the browser during 60 seconds and\nthe product id will be used as storage key.\n\n```vue\n<template>\n <Tagging :clickedResultStorageTTLMs=\"60000\" :clickedResultStorageKey=\"'id'\" />\n</template>\n\n<script>\n import { Tagging } from '@empathyco/x-components/tagging';\n\n export default {\n name: 'TaggingDemo',\n components: {\n Tagging\n }\n };\n</script>\n```\n\n### Play with events\n\nThe `Tagging` will emit the `ConsentProvided` when the component is loaded and the consent is set by\nthe prop or getting the value from the snippet config.\n\nThe `Tagging` will emit the `TaggingConfigProvided` when the component is loaded with the new\n[`TaggingConfig`](./../../api/x-components.taggingconfig.md) using the prop values.\n</docs>\n"],"names":[],"mappings":";;;;AAME;;;;;;AAME;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,cAAc,CAAC,IAAI;AAC5B,IAAA,KAAK,EAAE;AACL;;AAEE;AACF,QAAA,yBAAyB,EAAE;AACzB,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,OAAO,EAAE,KAAI;AACd,SAAA;AACD;;;AAGE;AACF,QAAA,uBAAuB,EAAE;AACvB,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,OAAO,EAAE,KAAI;AACd,SAAA;AACD;;AAEE;AACF,QAAA,YAAY,EAAE,MAAM;AACpB;;AAEE;AACF,QAAA,sBAAsB,EAAE;AACtB,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,OAAO,EAAE,IAA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