@empathyco/x-components 8.3.0 → 8.5.0

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 (89) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/core/index.js.map +1 -1
  3. package/docs/API-reference/api/x-components.hierarchicalfilter.md +1 -0
  4. package/docs/API-reference/api/x-components.md +48 -0
  5. package/docs/API-reference/api/x-components.reseturlquery.md +13 -0
  6. package/docs/API-reference/api/x-components.setbanners.md +13 -0
  7. package/docs/API-reference/api/x-components.simplefilter.md +1 -0
  8. package/docs/API-reference/api/x-components.snippetcallbacks.md +1 -0
  9. package/docs/API-reference/api/x-components.vendorbanner.md +59 -0
  10. package/docs/API-reference/api/x-components.vendorbanner.position.md +11 -0
  11. package/docs/API-reference/api/x-components.vendorbannerslist.md +31 -0
  12. package/docs/API-reference/api/x-components.vendormutations.md +17 -0
  13. package/docs/API-reference/api/x-components.vendormutations.setbanners.md +11 -0
  14. package/docs/API-reference/api/x-components.vendorstate.banners.md +11 -0
  15. package/docs/API-reference/api/x-components.vendorstate.md +17 -0
  16. package/docs/API-reference/api/x-components.vendorxevents.md +19 -0
  17. package/docs/API-reference/api/x-components.vendorxevents.vendorbannerschanged.md +13 -0
  18. package/docs/API-reference/components/vendor/x-components.vendor-banners-list.md +21 -0
  19. package/js/components/base-grid.vue.js.map +1 -1
  20. package/js/components/base-grid.vue2.js +5 -1
  21. package/js/components/base-grid.vue2.js.map +1 -1
  22. package/js/components/base-grid.vue3.js +1 -1
  23. package/js/index.js +3 -2
  24. package/js/index.js.map +1 -1
  25. package/js/x-modules/ai/wiring.js +4 -0
  26. package/js/x-modules/ai/wiring.js.map +1 -1
  27. package/js/x-modules/facets/wiring.js +9 -0
  28. package/js/x-modules/facets/wiring.js.map +1 -1
  29. package/js/x-modules/next-queries/wiring.js +4 -0
  30. package/js/x-modules/next-queries/wiring.js.map +1 -1
  31. package/js/x-modules/query-suggestions/wiring.js +4 -0
  32. package/js/x-modules/query-suggestions/wiring.js.map +1 -1
  33. package/js/x-modules/related-prompts/wiring.js +7 -0
  34. package/js/x-modules/related-prompts/wiring.js.map +1 -1
  35. package/js/x-modules/related-tags/wiring.js +5 -0
  36. package/js/x-modules/related-tags/wiring.js.map +1 -1
  37. package/js/x-modules/search-box/wiring.js +3 -0
  38. package/js/x-modules/search-box/wiring.js.map +1 -1
  39. package/js/x-modules/url/wiring.js +8 -1
  40. package/js/x-modules/url/wiring.js.map +1 -1
  41. package/js/x-modules/vendor/components/vendor-banners-list.vue.js +83 -0
  42. package/js/x-modules/vendor/components/vendor-banners-list.vue.js.map +1 -0
  43. package/js/x-modules/vendor/components/vendor-banners-list.vue2.js +6 -0
  44. package/js/x-modules/vendor/components/vendor-banners-list.vue2.js.map +1 -0
  45. package/js/x-modules/vendor/store/module.js +4 -0
  46. package/js/x-modules/vendor/store/module.js.map +1 -1
  47. package/js/x-modules/vendor/wiring.js +20 -1
  48. package/js/x-modules/vendor/wiring.js.map +1 -1
  49. package/package.json +2 -2
  50. package/report/x-components.api.json +525 -5
  51. package/report/x-components.api.md +70 -0
  52. package/types/src/components/base-grid.vue.d.ts.map +1 -1
  53. package/types/src/components/snippet-callbacks.vue.d.ts +1 -0
  54. package/types/src/components/snippet-callbacks.vue.d.ts.map +1 -1
  55. package/types/src/x-modules/ai/wiring.d.ts +4 -0
  56. package/types/src/x-modules/ai/wiring.d.ts.map +1 -1
  57. package/types/src/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts +1 -0
  58. package/types/src/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts.map +1 -1
  59. package/types/src/x-modules/facets/components/filters/simple-filter.vue.d.ts +1 -0
  60. package/types/src/x-modules/facets/components/filters/simple-filter.vue.d.ts.map +1 -1
  61. package/types/src/x-modules/facets/wiring.d.ts +3 -0
  62. package/types/src/x-modules/facets/wiring.d.ts.map +1 -1
  63. package/types/src/x-modules/next-queries/wiring.d.ts +4 -0
  64. package/types/src/x-modules/next-queries/wiring.d.ts.map +1 -1
  65. package/types/src/x-modules/query-suggestions/wiring.d.ts +4 -0
  66. package/types/src/x-modules/query-suggestions/wiring.d.ts.map +1 -1
  67. package/types/src/x-modules/related-prompts/wiring.d.ts +5 -0
  68. package/types/src/x-modules/related-prompts/wiring.d.ts.map +1 -1
  69. package/types/src/x-modules/related-tags/wiring.d.ts +5 -0
  70. package/types/src/x-modules/related-tags/wiring.d.ts.map +1 -1
  71. package/types/src/x-modules/search-box/wiring.d.ts +3 -0
  72. package/types/src/x-modules/search-box/wiring.d.ts.map +1 -1
  73. package/types/src/x-modules/url/wiring.d.ts +7 -0
  74. package/types/src/x-modules/url/wiring.d.ts.map +1 -1
  75. package/types/src/x-modules/vendor/components/index.d.ts +1 -0
  76. package/types/src/x-modules/vendor/components/index.d.ts.map +1 -1
  77. package/types/src/x-modules/vendor/components/vendor-banners-list.vue.d.ts +30 -0
  78. package/types/src/x-modules/vendor/components/vendor-banners-list.vue.d.ts.map +1 -0
  79. package/types/src/x-modules/vendor/events.types.d.ts +7 -1
  80. package/types/src/x-modules/vendor/events.types.d.ts.map +1 -1
  81. package/types/src/x-modules/vendor/store/module.d.ts.map +1 -1
  82. package/types/src/x-modules/vendor/store/types.d.ts +3 -1
  83. package/types/src/x-modules/vendor/store/types.d.ts.map +1 -1
  84. package/types/src/x-modules/vendor/types.d.ts +10 -1
  85. package/types/src/x-modules/vendor/types.d.ts.map +1 -1
  86. package/types/src/x-modules/vendor/wiring.d.ts +10 -0
  87. package/types/src/x-modules/vendor/wiring.d.ts.map +1 -1
  88. package/url/index.js +1 -1
  89. package/vendor/index.js +2 -1
@@ -113,6 +113,12 @@ const selectPreselectedFilterWire = wireFacetsService('selectPreselectedFilters'
113
113
  * @public
114
114
  */
115
115
  const setQuery = wireFacetsService('setQuery');
116
+ /**
117
+ * Clear the facets state `query` .
118
+ *
119
+ * @public
120
+ */
121
+ const clearQuery = wireFacetsService('setQuery', '');
116
122
  /**
117
123
  * Removes all the sticky filters from the state.
118
124
  *
@@ -184,6 +190,9 @@ const facetsWiring = createWiring({
184
190
  clearAllFiltersButStickyWire,
185
191
  setQuery,
186
192
  },
193
+ UserBrowsedToCategory: {
194
+ clearQuery,
195
+ },
187
196
  UserClickedOpenX: {
188
197
  selectPreselectedFilterWire,
189
198
  },
@@ -1 +1 @@
1
- {"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/facets/wiring.ts"],"sourcesContent":["import type { Facet } from '@empathyco/x-types'\nimport type { UrlParams } from '../../types/url-params'\nimport type { XEventPayload } from '../../wiring/index'\nimport { createRawFilters } from '../../utils/filters'\nimport { namespacedWireCommit, namespacedWireCommitWithoutPayload } from '../../wiring/index'\nimport { wireService, wireServiceWithoutPayload } from '../../wiring/wires.factory'\nimport { filter, mapWire } from '../../wiring/wires.operators'\nimport { createWiring } from '../../wiring/wiring.utils'\nimport { DefaultFacetsService } from './service/facets.service'\n\n/**\n * `facets` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'facets'\n\n/**\n * WireCommit for {@link FacetsXModule}.\n *\n * @internal\n */\nconst wireCommit = namespacedWireCommit(moduleName)\n\n/**\n * WireCommitWithoutPayload for {@link FacetsXModule}.\n *\n * @internal\n */\nconst wireCommitWithoutPayload = namespacedWireCommitWithoutPayload(moduleName)\n\n/**\n * Wires factory for {@link DefaultFacetsService}.\n */\nconst wireFacetsService = wireService(DefaultFacetsService.instance)\n\n/**\n * Wires without payload factory for {@link DefaultFacetsService}.\n */\nconst wireFacetsServiceWithoutPayload = wireServiceWithoutPayload(DefaultFacetsService.instance)\n\n/**\n * Saves the facets contained in the `search` group, removing the previous ones, and keeping the\n * previous filters selected state.\n *\n * @public\n */\nconst updateFacetsGroupWithSearchFacetsWire = mapWire(\n wireFacetsService('updateFacets'),\n (facets: Facet[]) => ({\n facets,\n id: 'search',\n }),\n)\n\n/**\n * Saves the facets contained in the group, removing the previous ones, and keeping the new filters\n * selected state.\n *\n * @public\n */\nconst setFacetsGroupWire = wireFacetsService('setFacets')\n\n/**\n * Toggles the selected state of a filter.\n *\n * @public\n */\nconst toggleFilterWire = wireFacetsService('toggle')\n\n/**\n * Deselects all the filters. Optionally, it can accept a list of facets ids as payload, and it will\n * only deselect the filters from those facets.\n *\n * @public\n */\nconst clearFiltersWire = wireFacetsService('clearFilters')\n\n/**\n * Deselects all selected filters.\n *\n * @public\n */\nconst clearAllFiltersWire = wireFacetsServiceWithoutPayload('clearFilters')\n\n/**\n * Deselects all selected filters but keep the sticky ones.\n *\n * @internal\n */\nconst clearAllFiltersButStickyWire = wireFacetsService('clearFiltersWithMetadata', {\n metadata: {\n keepSticky: true,\n },\n})\n\n/**\n * Deselects all selected filters only when oldValue is not empty.\n *\n * @public\n */\nconst clearAllFiltersOnSecondQuery = filter(\n clearAllFiltersButStickyWire,\n ({ metadata }) => !!metadata.oldValue,\n)\n\n/**\n * Selects the filter passed by payload.\n *\n * @public\n */\nconst selectFilterWire = wireFacetsService('select')\n\n/**\n * Saves the params from the url.\n *\n * @public\n */\nconst setFiltersFromUrl = mapWire(wireFacetsService('select'), ({ filter }: UrlParams) =>\n createRawFilters(filter),\n)\n\n/**\n * Saves the preselected filters.\n *\n * @public\n */\nconst updatePreselectedFilters = wireFacetsService('updatePreselectedFilters')\n\n/**\n * Selects the preselected filters stored in the state.\n *\n * @public\n */\nconst selectPreselectedFilterWire = wireFacetsService('selectPreselectedFilters')\n\n/**\n * Sets the facets state `query`.\n *\n * @public\n */\nconst setQuery = wireFacetsService('setQuery')\n\n/**\n * Removes all the sticky filters from the state.\n *\n * @internal\n */\nconst clearStickyFilters = filter<XEventPayload<'SearchResponseChanged'>>(\n wireCommitWithoutPayload('clearStickyFilters'),\n ({ eventPayload }) => {\n return eventPayload.totalResults === 0\n },\n)\n\n/**\n * Sets the filters of the facets module from a queryPreview's filters.\n *\n * @public\n */\nexport const setSelectedFiltersFromPreview = wireCommit(\n 'setFilters',\n ({ eventPayload: { filters } }) => (filters ? createRawFilters(filters) : []),\n)\n\n/**\n * Sets the filters of the facets module from a selectedHistoryQuery's filters.\n *\n * @public\n */\nexport const setFiltersFromHistoryQueries = wireCommit(\n 'setFilters',\n ({ eventPayload: { selectedFilters } }) => selectedFilters ?? [],\n)\n\n/**\n * Sets the query of the facets module from a queryPreview.\n *\n * @public\n */\nexport const setQueryFromPreview = wireCommit('setQuery', ({ eventPayload: { query } }) => query)\n\n/**\n * Wiring configuration for the {@link FacetsXModule | facets module}.\n *\n * @internal\n */\nexport const facetsWiring = createWiring({\n ParamsLoadedFromUrl: {\n // TODO: move this logic to Facets Service\n clearAllFiltersWire,\n setFiltersFromUrl,\n },\n PreselectedFiltersProvided: {\n updatePreselectedFilters,\n },\n FacetsChanged: {\n updateFacetsGroupWithSearchFacetsWire,\n },\n FacetsGroupProvided: {\n setFacetsGroupWire,\n },\n UserAcceptedAQuery: {\n setQuery,\n },\n FacetsQueryChanged: {\n clearAllFiltersOnSecondQuery,\n },\n UserChangedExtraParams: {\n clearAllFiltersButStickyWire,\n },\n UserClickedAFilter: {\n toggleFilterWire,\n },\n UserClickedClearAllFilters: {\n clearFiltersWire,\n },\n UserModifiedEditableNumberRangeFilter: {\n selectFilterWire,\n },\n UserClickedAllFilter: {\n clearFiltersWire,\n },\n UserClearedQuery: {\n clearAllFiltersButStickyWire,\n setQuery,\n },\n UserClickedOpenX: {\n selectPreselectedFilterWire,\n },\n SearchResponseChanged: {\n clearStickyFilters,\n },\n UserAcceptedAQueryPreview: {\n setQueryFromPreview,\n setSelectedFiltersFromPreview,\n },\n UserSelectedAHistoryQuery: {\n setFiltersFromHistoryQueries,\n },\n})\n"],"names":[],"mappings":";;;;;;;AAUA;;;;AAIG;AACH,MAAM,UAAU,GAAG,QAAQ;AAE3B;;;;AAIG;AACH,MAAM,UAAU,GAAG,oBAAoB,CAAC,UAAU,CAAC;AAEnD;;;;AAIG;AACH,MAAM,wBAAwB,GAAG,kCAAkC,CAAC,UAAU,CAAC;AAE/E;;AAEG;AACH,MAAM,iBAAiB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QACrC,gBAAgB;AACjB,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,gBAAgB;AACjB,KAAA;AACD,IAAA,gBAAgB,EAAE;QAChB,4BAA4B;QAC5B,QAAQ;AACT,KAAA;AACD,IAAA,gBAAgB,EAAE;QAChB,2BAA2B;AAC5B,KAAA;AACD,IAAA,qBAAqB,EAAE;QACrB,kBAAkB;AACnB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,mBAAmB;QACnB,6BAA6B;AAC9B,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,4BAA4B;AAC7B,KAAA;AACF,CAAA;;;;"}
1
+ {"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/facets/wiring.ts"],"sourcesContent":["import type { Facet } from '@empathyco/x-types'\nimport type { UrlParams } from '../../types/url-params'\nimport type { XEventPayload } from '../../wiring/index'\nimport { createRawFilters } from '../../utils/filters'\nimport { namespacedWireCommit, namespacedWireCommitWithoutPayload } from '../../wiring/index'\nimport { wireService, wireServiceWithoutPayload } from '../../wiring/wires.factory'\nimport { filter, mapWire } from '../../wiring/wires.operators'\nimport { createWiring } from '../../wiring/wiring.utils'\nimport { DefaultFacetsService } from './service/facets.service'\n\n/**\n * `facets` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'facets'\n\n/**\n * WireCommit for {@link FacetsXModule}.\n *\n * @internal\n */\nconst wireCommit = namespacedWireCommit(moduleName)\n\n/**\n * WireCommitWithoutPayload for {@link FacetsXModule}.\n *\n * @internal\n */\nconst wireCommitWithoutPayload = namespacedWireCommitWithoutPayload(moduleName)\n\n/**\n * Wires factory for {@link DefaultFacetsService}.\n */\nconst wireFacetsService = wireService(DefaultFacetsService.instance)\n\n/**\n * Wires without payload factory for {@link DefaultFacetsService}.\n */\nconst wireFacetsServiceWithoutPayload = wireServiceWithoutPayload(DefaultFacetsService.instance)\n\n/**\n * Saves the facets contained in the `search` group, removing the previous ones, and keeping the\n * previous filters selected state.\n *\n * @public\n */\nconst updateFacetsGroupWithSearchFacetsWire = mapWire(\n wireFacetsService('updateFacets'),\n (facets: Facet[]) => ({\n facets,\n id: 'search',\n }),\n)\n\n/**\n * Saves the facets contained in the group, removing the previous ones, and keeping the new filters\n * selected state.\n *\n * @public\n */\nconst setFacetsGroupWire = wireFacetsService('setFacets')\n\n/**\n * Toggles the selected state of a filter.\n *\n * @public\n */\nconst toggleFilterWire = wireFacetsService('toggle')\n\n/**\n * Deselects all the filters. Optionally, it can accept a list of facets ids as payload, and it will\n * only deselect the filters from those facets.\n *\n * @public\n */\nconst clearFiltersWire = wireFacetsService('clearFilters')\n\n/**\n * Deselects all selected filters.\n *\n * @public\n */\nconst clearAllFiltersWire = wireFacetsServiceWithoutPayload('clearFilters')\n\n/**\n * Deselects all selected filters but keep the sticky ones.\n *\n * @internal\n */\nconst clearAllFiltersButStickyWire = wireFacetsService('clearFiltersWithMetadata', {\n metadata: {\n keepSticky: true,\n },\n})\n\n/**\n * Deselects all selected filters only when oldValue is not empty.\n *\n * @public\n */\nconst clearAllFiltersOnSecondQuery = filter(\n clearAllFiltersButStickyWire,\n ({ metadata }) => !!metadata.oldValue,\n)\n\n/**\n * Selects the filter passed by payload.\n *\n * @public\n */\nconst selectFilterWire = wireFacetsService('select')\n\n/**\n * Saves the params from the url.\n *\n * @public\n */\nconst setFiltersFromUrl = mapWire(wireFacetsService('select'), ({ filter }: UrlParams) =>\n createRawFilters(filter),\n)\n\n/**\n * Saves the preselected filters.\n *\n * @public\n */\nconst updatePreselectedFilters = wireFacetsService('updatePreselectedFilters')\n\n/**\n * Selects the preselected filters stored in the state.\n *\n * @public\n */\nconst selectPreselectedFilterWire = wireFacetsService('selectPreselectedFilters')\n\n/**\n * Sets the facets state `query`.\n *\n * @public\n */\nconst setQuery = wireFacetsService('setQuery')\n\n/**\n * Clear the facets state `query` .\n *\n * @public\n */\nconst clearQuery = wireFacetsService('setQuery', '')\n\n/**\n * Removes all the sticky filters from the state.\n *\n * @internal\n */\nconst clearStickyFilters = filter<XEventPayload<'SearchResponseChanged'>>(\n wireCommitWithoutPayload('clearStickyFilters'),\n ({ eventPayload }) => {\n return eventPayload.totalResults === 0\n },\n)\n\n/**\n * Sets the filters of the facets module from a queryPreview's filters.\n *\n * @public\n */\nexport const setSelectedFiltersFromPreview = wireCommit(\n 'setFilters',\n ({ eventPayload: { filters } }) => (filters ? createRawFilters(filters) : []),\n)\n\n/**\n * Sets the filters of the facets module from a selectedHistoryQuery's filters.\n *\n * @public\n */\nexport const setFiltersFromHistoryQueries = wireCommit(\n 'setFilters',\n ({ eventPayload: { selectedFilters } }) => selectedFilters ?? [],\n)\n\n/**\n * Sets the query of the facets module from a queryPreview.\n *\n * @public\n */\nexport const setQueryFromPreview = wireCommit('setQuery', ({ eventPayload: { query } }) => query)\n\n/**\n * Wiring configuration for the {@link FacetsXModule | facets module}.\n *\n * @internal\n */\nexport const facetsWiring = createWiring({\n ParamsLoadedFromUrl: {\n // TODO: move this logic to Facets Service\n clearAllFiltersWire,\n setFiltersFromUrl,\n },\n PreselectedFiltersProvided: {\n updatePreselectedFilters,\n },\n FacetsChanged: {\n updateFacetsGroupWithSearchFacetsWire,\n },\n FacetsGroupProvided: {\n setFacetsGroupWire,\n },\n UserAcceptedAQuery: {\n setQuery,\n },\n FacetsQueryChanged: {\n clearAllFiltersOnSecondQuery,\n },\n UserChangedExtraParams: {\n clearAllFiltersButStickyWire,\n },\n UserClickedAFilter: {\n toggleFilterWire,\n },\n UserClickedClearAllFilters: {\n clearFiltersWire,\n },\n UserModifiedEditableNumberRangeFilter: {\n selectFilterWire,\n },\n UserClickedAllFilter: {\n clearFiltersWire,\n },\n UserClearedQuery: {\n clearAllFiltersButStickyWire,\n setQuery,\n },\n UserBrowsedToCategory: {\n clearQuery,\n },\n UserClickedOpenX: {\n selectPreselectedFilterWire,\n },\n SearchResponseChanged: {\n clearStickyFilters,\n },\n UserAcceptedAQueryPreview: {\n setQueryFromPreview,\n setSelectedFiltersFromPreview,\n },\n UserSelect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qCAAqC;AACtC,KAAA;AACD,IAAA,mBAAmB,EAAE;QACnB,kBAAkB;AACnB,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,QAAQ;AACT,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,4BAA4B;AAC7B,KAAA;AACD,IAAA,sBAAsB,EAAE;QACtB,4BAA4B;AAC7B,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,gBAAgB;AACjB,KAAA;AACD,IAAA,0BAA0B,EAAE;QAC1B,gBAAgB;AACjB,KAAA;AACD,IAAA,qCAAqC,EAAE;QACrC,gBAAgB;AACjB,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,gBAAgB;AACjB,KAAA;AACD,IAAA,gBAAgB,EAAE;QAChB,4BAA4B;QAC5B,QAAQ;AACT,KAAA;AACD,IAAA,qBAAqB,EAAE;QACrB,UAAU;AACX,KAAA;AACD,IAAA,gBAAgB,EAAE;QAChB,2BAA2B;AAC5B,KAAA;AACD,IAAA,qBAAqB,EAAE;QACrB,kBAAkB;AACnB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,mBAAmB;QACnB,6BAA6B;AAC9B,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,4BAA4B;AAC7B,KAAA;AACF,CAAA;;;;"}
@@ -126,6 +126,10 @@ const nextQueriesWiring = createWiring({
126
126
  resetNextQueriesWire,
127
127
  resetNextQueriesQuery,
128
128
  },
129
+ UserBrowsedToCategory: {
130
+ resetNextQueriesWire,
131
+ resetNextQueriesQuery,
132
+ },
129
133
  SelectedRelatedTagsChanged: {
130
134
  setNextQueriesRelatedTags,
131
135
  },
@@ -1 +1 @@
1
- {"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/next-queries/wiring.ts"],"sourcesContent":["import type {\n NamespacedWireCommit,\n NamespacedWireCommitWithoutPayload,\n NamespacedWireDispatch,\n NamespacedWiringData,\n} from '../../wiring/namespaced-wiring.types'\nimport {\n namespacedWireCommit,\n namespacedWireCommitWithoutPayload,\n namespacedWireDispatch,\n} from '../../wiring/namespaced-wires.factory'\nimport { createWiring } from '../../wiring/wiring.utils'\n\n/**\n * `nextQueries` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'nextQueries'\n\n/**\n * WireCommit for {@link NextQueriesXModule}.\n *\n * @internal\n */\nconst wireCommit: NamespacedWireCommit<typeof moduleName> = namespacedWireCommit(moduleName)\n\n/**\n * WireCommitWithoutPayload for {@link NextQueriesXModule}.\n */\nconst wireCommitWithoutPayload: NamespacedWireCommitWithoutPayload<typeof moduleName> =\n namespacedWireCommitWithoutPayload(moduleName)\n\n/**\n * WireDispatch for {@link NextQueriesXModule}.\n *\n * @internal\n */\nconst wireDispatch: NamespacedWireDispatch<typeof moduleName> = namespacedWireDispatch(moduleName)\n\n/**\n * Sets the next queries state `query`.\n *\n * @public\n */\nexport const setNextQueriesQuery = wireCommit('setQuery')\n\n/**\n * Reset the next queries state `query`.\n *\n * @public\n */\nexport const resetNextQueriesQuery = wireCommit('setQuery', '')\n\n/**\n * Sets the next queries state `relatedTags`.\n *\n * @public\n */\nexport const setNextQueriesRelatedTags = wireCommit('setRelatedTags')\n\n/**\n * Sets the next queries state `query` with a selectedQueryPreview's query.\n *\n * @public\n */\nexport const setNextQueriesQueryFromPreview = wireCommit(\n 'setParams',\n ({ eventPayload: { query } }) => query,\n)\n\n/**\n * Sets the next queries state `query` from url.\n *\n * @public\n */\nconst setUrlParams = wireDispatch('setUrlParams')\n\n/**\n * Sets the next queries state `params`.\n *\n * @public\n */\nexport const setNextQueriesExtraParams = wireCommit('setParams')\n\n/**\n * Sets the next queries state `params` with a selectedQueryPreview's extraParams.\n *\n * @public\n */\nexport const setNextQueriesExtraParamsFromPreview = wireCommit(\n 'setParams',\n ({ eventPayload: { extraParams } }) => extraParams,\n)\n\n/**\n * Requests and stores the next queries.\n *\n * @public\n */\nexport const fetchAndSaveNextQueriesWire = wireDispatch('fetchAndSaveNextQueries')\n\n/**\n * Sets the next queries state `query` with the last query in history queries.\n *\n * @public\n */\nexport const setQueryFromLastHistoryQueryWire = wireDispatch('setQueryFromLastHistoryQuery')\n\n/**\n * Requests and store the next query preview results.\n *\n * @public\n */\nexport const fetchAndSaveNextQueryPreviewWire = wireDispatch(\n 'fetchAndSaveNextQueryPreview',\n ({ eventPayload: query, metadata: { location } }: NamespacedWiringData<'nextQueries'>) => {\n return {\n query,\n location,\n }\n },\n)\n/**\n * Resets the next query preview results.\n *\n * @public\n */\nexport const resetResultsPreviewWire = wireCommitWithoutPayload('resetResultsPreview')\n\n/**\n * Resets the next queries list to an empty array.\n *\n * @public\n */\nexport const resetNextQueriesWire = wireCommitWithoutPayload('resetNextQueries')\n\n/**\n * Sets the next queries state `searchedQueries` with the list of history queries.\n *\n * @public\n */\nexport const setSearchedQueries = wireCommit('setSearchedQueries')\n\n/**\n * Wiring configuration for the {@link NextQueriesXModule | next queries module}.\n *\n * @internal\n */\nexport const nextQueriesWiring = createWiring({\n ParamsLoadedFromUrl: {\n setUrlParams,\n },\n NextQueriesChanged: {\n resetResultsPreviewWire,\n },\n UserAcceptedAQuery: {\n resetNextQueriesWire,\n setNextQueriesQuery,\n },\n UserClearedQuery: {\n resetNextQueriesWire,\n resetNextQueriesQuery,\n },\n SelectedRelatedTagsChanged: {\n setNextQueriesRelatedTags,\n },\n SessionHistoryQueriesChanged: {\n setSearchedQueries,\n // TODO setQueryFromLastHistoryQuery it has to be called only one time\n setQueryFromLastHistoryQueryWire,\n },\n NextQueriesRequestUpdated: {\n fetchAndSaveNextQueriesWire,\n },\n ExtraParamsChanged: {\n setNextQueriesExtraParams,\n },\n NextQueryPreviewMountedHook: {\n fetchAndSaveNextQueryPreviewWire,\n },\n UserAcceptedAQueryPreview: {\n setNextQueriesQueryFromPreview,\n setNextQueriesExtraParamsFromPreview,\n },\n})\n"],"names":[],"mappings":";;;AAaA;;;;AAIG;AACH,MAAM,UAAU,GAAG,aAAa;AAEhC;;;;AAIG;AACH,MAAM,UAAU,GAA4C,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AC;AAC5C,IAAA,mBAAmB,EAAE;QACnB,YAAY;AACb,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,uBAAuB;AACxB,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,oBAAoB;QACpB,mBAAmB;AACpB,KAAA;AACD,IAAA,gBAAgB,EAAE;QAChB,oBAAoB;QACpB,qBAAqB;AACtB,KAAA;AACD,IAAA,0BAA0B,EAAE;QAC1B,yBAAyB;AAC1B,KAAA;AACD,IAAA,4BAA4B,EAAE;QAC5B,kBAAkB;;QAElB,gCAAgC;AACjC,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,2BAA2B;AAC5B,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,yBAAyB;AAC1B,KAAA;AACD,IAAA,2BAA2B,EAAE;QAC3B,gCAAgC;AACjC,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,8BAA8B;QAC9B,oCAAoC;AACrC,KAAA;AACF,CAAA;;;;"}
1
+ {"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/next-queries/wiring.ts"],"sourcesContent":["import type {\n NamespacedWireCommit,\n NamespacedWireCommitWithoutPayload,\n NamespacedWireDispatch,\n NamespacedWiringData,\n} from '../../wiring/namespaced-wiring.types'\nimport {\n namespacedWireCommit,\n namespacedWireCommitWithoutPayload,\n namespacedWireDispatch,\n} from '../../wiring/namespaced-wires.factory'\nimport { createWiring } from '../../wiring/wiring.utils'\n\n/**\n * `nextQueries` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'nextQueries'\n\n/**\n * WireCommit for {@link NextQueriesXModule}.\n *\n * @internal\n */\nconst wireCommit: NamespacedWireCommit<typeof moduleName> = namespacedWireCommit(moduleName)\n\n/**\n * WireCommitWithoutPayload for {@link NextQueriesXModule}.\n */\nconst wireCommitWithoutPayload: NamespacedWireCommitWithoutPayload<typeof moduleName> =\n namespacedWireCommitWithoutPayload(moduleName)\n\n/**\n * WireDispatch for {@link NextQueriesXModule}.\n *\n * @internal\n */\nconst wireDispatch: NamespacedWireDispatch<typeof moduleName> = namespacedWireDispatch(moduleName)\n\n/**\n * Sets the next queries state `query`.\n *\n * @public\n */\nexport const setNextQueriesQuery = wireCommit('setQuery')\n\n/**\n * Reset the next queries state `query`.\n *\n * @public\n */\nexport const resetNextQueriesQuery = wireCommit('setQuery', '')\n\n/**\n * Sets the next queries state `relatedTags`.\n *\n * @public\n */\nexport const setNextQueriesRelatedTags = wireCommit('setRelatedTags')\n\n/**\n * Sets the next queries state `query` with a selectedQueryPreview's query.\n *\n * @public\n */\nexport const setNextQueriesQueryFromPreview = wireCommit(\n 'setParams',\n ({ eventPayload: { query } }) => query,\n)\n\n/**\n * Sets the next queries state `query` from url.\n *\n * @public\n */\nconst setUrlParams = wireDispatch('setUrlParams')\n\n/**\n * Sets the next queries state `params`.\n *\n * @public\n */\nexport const setNextQueriesExtraParams = wireCommit('setParams')\n\n/**\n * Sets the next queries state `params` with a selectedQueryPreview's extraParams.\n *\n * @public\n */\nexport const setNextQueriesExtraParamsFromPreview = wireCommit(\n 'setParams',\n ({ eventPayload: { extraParams } }) => extraParams,\n)\n\n/**\n * Requests and stores the next queries.\n *\n * @public\n */\nexport const fetchAndSaveNextQueriesWire = wireDispatch('fetchAndSaveNextQueries')\n\n/**\n * Sets the next queries state `query` with the last query in history queries.\n *\n * @public\n */\nexport const setQueryFromLastHistoryQueryWire = wireDispatch('setQueryFromLastHistoryQuery')\n\n/**\n * Requests and store the next query preview results.\n *\n * @public\n */\nexport const fetchAndSaveNextQueryPreviewWire = wireDispatch(\n 'fetchAndSaveNextQueryPreview',\n ({ eventPayload: query, metadata: { location } }: NamespacedWiringData<'nextQueries'>) => {\n return {\n query,\n location,\n }\n },\n)\n/**\n * Resets the next query preview results.\n *\n * @public\n */\nexport const resetResultsPreviewWire = wireCommitWithoutPayload('resetResultsPreview')\n\n/**\n * Resets the next queries list to an empty array.\n *\n * @public\n */\nexport const resetNextQueriesWire = wireCommitWithoutPayload('resetNextQueries')\n\n/**\n * Sets the next queries state `searchedQueries` with the list of history queries.\n *\n * @public\n */\nexport const setSearchedQueries = wireCommit('setSearchedQueries')\n\n/**\n * Wiring configuration for the {@link NextQueriesXModule | next queries module}.\n *\n * @internal\n */\nexport const nextQueriesWiring = createWiring({\n ParamsLoadedFromUrl: {\n setUrlParams,\n },\n NextQueriesChanged: {\n resetResultsPreviewWire,\n },\n UserAcceptedAQuery: {\n resetNextQueriesWire,\n setNextQueriesQuery,\n },\n UserClearedQuery: {\n resetNextQueriesWire,\n resetNextQueriesQuery,\n },\n UserBrowsedToCategory: {\n resetNextQueriesWire,\n resetNextQueriesQuery,\n },\n SelectedRelatedTagsChanged: {\n setNextQueriesRelatedTags,\n },\n SessionHistoryQueriesChanged: {\n setSearchedQueries,\n // TODO setQueryFromLastHistoryQuery it has to be called only one time\n setQueryFromLastHistoryQueryWire,\n },\n NextQueriesRequestUpdated: {\n fetchAndSaveNextQueriesWire,\n },\n ExtraParamsChanged: {\n setNextQueriesExtraParams,\n },\n NextQueryPreviewMountedHook: {\n fetchAndSaveNextQueryPreviewWire,\n },\n UserAcceptedAQueryPreview: {\n setNextQueriesQueryFromPreview,\n setNextQueriesExtraParamsFromPreview,\n },\n})\n"],"names":[],"mappings":";;;AAaA;;;;AAIG;AACH,MAAM,UAAU,GAAG,aAAa;AAEhC;;;;AAIG;AACH,MAAM,UAAU,GAA4C,oBAAoB,CAAC,UAAU,CAAC;AAE5F;;AAEG;AACH,MAAM,wBAAwB,GAC5B,kCAAkC,CAAC,UAAU,CAAC;AAEhD;;;;AAIG;AACH,MAAM,YAAY,GAA8C,sBAAsB,CAAC,UAAU,CAAC;AAElG;;;;AAIG;MACU,mBAAmB,GAAG,UAAU,CAAC,UAAU;AAExD;;;;AAIG;AACI,MAAM,qBAAqB,GAAG,UAAU,CAAC,UAAU,EAAE,EAAE;AAE9D;;;;AAIG;MACU,yBAAyB,GAAG,UAAU,CAAC,gBAAgB;AAEpE;;;;AAIG;MACU,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IAAA,4BAA4B,EAAE;QAC5B,kBAAkB;;QAElB,gCAAgC;AACjC,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,2BAA2B;AAC5B,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,yBAAyB;AAC1B,KAAA;AACD,IAAA,2BAA2B,EAAE;QAC3B,gCAAgC;AACjC,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,8BAA8B;QAC9B,oCAAoC;AACrC,KAAA;AACF,CAAA;;;;"}
@@ -103,6 +103,10 @@ const querySuggestionsWiring = createWiring({
103
103
  clearQuerySuggestionsQuery,
104
104
  cancelFetchAndSaveSuggestionsWire,
105
105
  },
106
+ UserBrowsedToCategory: {
107
+ clearQuerySuggestionsQuery,
108
+ cancelFetchAndSaveSuggestionsWire,
109
+ },
106
110
  QuerySuggestionsRequestUpdated: {
107
111
  fetchAndSaveSuggestionsWire,
108
112
  },
@@ -1 +1 @@
1
- {"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/query-suggestions/wiring.ts"],"sourcesContent":["import type { NamespacedWireCommit } from '../../wiring/namespaced-wiring.types'\nimport {\n namespacedWireCommit,\n namespacedWireDispatch,\n namespacedWireDispatchWithoutPayload,\n} from '../../wiring/namespaced-wires.factory'\nimport { namespacedDebounce } from '../../wiring/namespaced-wires.operators'\nimport { createWiring } from '../../wiring/wiring.utils'\n\n/**\n * `querySuggestions` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'querySuggestions'\n\n/**\n * WireCommit for {@link QuerySuggestionsXModule}.\n *\n * @internal\n */\nconst wireCommit: NamespacedWireCommit<typeof moduleName> = namespacedWireCommit(moduleName)\n\n/**\n * WireDispatchWithoutPayload for {@link QuerySuggestionsXModule}.\n *\n * @internal\n */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName)\n\n/**\n * WireDispatch for {@link QuerySuggestionsXModule}.\n *\n * @internal\n */\nconst wireDispatch = namespacedWireDispatch(moduleName)\n\n/**\n * Sets the query-suggestions module query.\n *\n * @public\n */\nexport const setQuerySuggestionsQuery = wireCommit('setQuery')\n\n/**\n * Sets the query-suggestions module query from a selectedQueryPreview's query.\n *\n * @public\n */\nexport const setQuerySuggestionsQueryFromPreview = wireCommit(\n 'setQuery',\n ({ eventPayload: { query } }) => query,\n)\n\n/**\n * Sets the query-suggestions module params from a selectedQueryPreview's extraParams.\n *\n * @public\n */\nexport const setQuerySuggestionsExtraParamsFromPreview = wireCommit(\n 'setParams',\n ({ eventPayload: { extraParams } }) => extraParams,\n)\n\n/**\n * Sets the query suggestions state `params`.\n *\n * @public\n */\nexport const setQuerySuggestionsExtraParams = wireCommit('setParams')\n\n/**\n * Sets the query suggestions state `searchedQueries` with the list of history queries.\n *\n * @public\n */\nexport const setSearchedQueriesInSuggestions = wireCommit('setSearchedQueries')\n\n/**\n * Clears the query-suggestions module query.\n *\n * @public\n */\nexport const clearQuerySuggestionsQuery = wireCommit('setQuery', '')\n\n/**\n * Sets the query-suggestions state `query` from url.\n *\n * @public\n */\nconst setUrlParams = wireDispatch('setUrlParams')\n\n/**\n * Requests and stores a new set of query suggestions for the query.\n *\n * @public\n */\nexport const fetchAndSaveSuggestionsWire = wireDispatch('fetchAndSaveSuggestions')\n\n/**\n * Cancels the {@link QuerySuggestionsActions.fetchAndSaveSuggestions} request promise.\n *\n * @public\n */\nexport const cancelFetchAndSaveSuggestionsWire = wireDispatchWithoutPayload(\n 'cancelFetchAndSaveSuggestions',\n)\n\n/**\n * Debounce function for the module.\n */\nconst moduleDebounce = namespacedDebounce(moduleName)\n\n/**\n * QuerySuggestions wiring.\n *\n * @internal\n */\nexport const querySuggestionsWiring = createWiring({\n ParamsLoadedFromUrl: {\n setUrlParams,\n },\n UserIsTypingAQuery: {\n setQuerySuggestionsQueryDebounce: moduleDebounce(\n setQuerySuggestionsQuery,\n ({ state }) => state.config.debounceInMs,\n { cancelOn: 'UserAcceptedAQuery' },\n ),\n },\n UserAcceptedAQuery: {\n setQuerySuggestionsQuery,\n },\n UserClearedQuery: {\n clearQuerySuggestionsQuery,\n cancelFetchAndSaveSuggestionsWire,\n },\n QuerySuggestionsRequestUpdated: {\n fetchAndSaveSuggestionsWire,\n },\n ExtraParamsChanged: {\n setQuerySuggestionsExtraParams,\n },\n UserClickedCloseX: {\n clearQuerySuggestionsQuery,\n },\n UserClickedOutOfMainModal: {\n clearQuerySuggestionsQuery,\n },\n UserAcceptedAQueryPreview: {\n setQuerySuggestionsQueryFromPreview,\n setQuerySuggestionsExtraParamsFromPreview,\n },\n QueryPreviewUnselected: {\n setQuerySuggestionsExtraParams,\n },\n SessionHistoryQueriesChanged: {\n setSearchedQueriesInSuggestions,\n },\n})\n"],"names":[],"mappings":";;;;AASA;;;;AAIG;AACH,MAAM,UAAU,GAAG,kBAAkB;AAErC;;;;AAIG;AACH,MAAM,UAAU,GAA4C,oBAAoB,CAAC,UAAU,CAAC;AAE5F;;;;AAIG;AACH,MAAM,0BAA0B,GAAG,oCAAoC,CAAC,UAAU,CAAC;AAEnF;;;;AAIG;AACH,MAAM,YAAY,GAAG,sBAAsB,CAAC,UAAU,CAAC;AAEvD;;;;AAIG;MACU,wBAAwB,GAAG,UAAU,CAAC,UAAU;AAE7D;;;;AAIG;MACU,mCAAmC,GAAG,UAAU,CAC3D,UAAU,EACV,CAAC,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,KAAK;AAGxC;;;;AAIG;MACU,yCAAyC,GAAG,UAAU,CACjE,WAAW,EACX,CAAC,EAAE,YAAY,EAAE,EAAE,WAAW,EAAE,EAAE,KAAK,WAAW;AAGpD;;;;AAIG;MACU,8BAA8B,GAAG,UAAU,CAAC,WAAW;AAEpE;;;;AAIG;MACU,+BAA+B,GAAG,UAAU,CAAC,oBAAoB;AAE9E;;;;AAIG;AACI,MAAM,0BAA0B,GAAG,UAAU,CAAC,UAAU,EAAE,EAAE;AAEnE;;;;AAIG;AACH,MAAM,YAAY,GAAG,YAAY,CAAC,cAAc,CAAC;AAEjD;;;;AAIG;MACU,2BAA2B,GAAG,YAAY,CAAC,yBAAyB;AAEjF;;;;AAIG;MACU,iCAAiC,GAAG,0BAA0B,CACzE,+BAA+B;AAGjC;;AAEG;AACH,MAAM,cAAc,GAAG,kBAAkB,CAAC,UAAU,CAAC;AAErD;;;;AAIG;AACI,MAAM,sBAAsB,GAAG,YAAY,CAAC;AACjD,IAAA,mBAAmB,EAAE;QACnB,YAAY;AACb,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,gCAAgC,EAAE,cAAc,CAC9C,wBAAwB,EACxB,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,MAAM,CAAC,YAAY,EACxC,EAAE,QAAQ,EAAE,oBAAoB,EAAE,CACnC;AACF,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,wBAAwB;AACzB,KAAA;AACD,IAAA,gBAAgB,EAAE;QAChB,0BAA0B;QAC1B,iCAAiC;AAClC,KAAA;AACD,IAAA,8BAA8B,EAAE;QAC9B,2BAA2B;AAC5B,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,8BAA8B;AAC/B,KAAA;AACD,IAAA,iBAAiB,EAAE;QACjB,0BAA0B;AAC3B,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,0BAA0B;AAC3B,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,mCAAmC;QACnC,yCAAyC;AAC1C,KAAA;AACD,IAAA,sBAAsB,EAAE;QACtB,8BAA8B;AAC/B,KAAA;AACD,IAAA,4BAA4B,EAAE;QAC5B,+BAA+B;AAChC,KAAA;AACF,CAAA;;;;"}
1
+ {"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/query-suggestions/wiring.ts"],"sourcesContent":["import type { NamespacedWireCommit } from '../../wiring/namespaced-wiring.types'\nimport {\n namespacedWireCommit,\n namespacedWireDispatch,\n namespacedWireDispatchWithoutPayload,\n} from '../../wiring/namespaced-wires.factory'\nimport { namespacedDebounce } from '../../wiring/namespaced-wires.operators'\nimport { createWiring } from '../../wiring/wiring.utils'\n\n/**\n * `querySuggestions` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'querySuggestions'\n\n/**\n * WireCommit for {@link QuerySuggestionsXModule}.\n *\n * @internal\n */\nconst wireCommit: NamespacedWireCommit<typeof moduleName> = namespacedWireCommit(moduleName)\n\n/**\n * WireDispatchWithoutPayload for {@link QuerySuggestionsXModule}.\n *\n * @internal\n */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName)\n\n/**\n * WireDispatch for {@link QuerySuggestionsXModule}.\n *\n * @internal\n */\nconst wireDispatch = namespacedWireDispatch(moduleName)\n\n/**\n * Sets the query-suggestions module query.\n *\n * @public\n */\nexport const setQuerySuggestionsQuery = wireCommit('setQuery')\n\n/**\n * Sets the query-suggestions module query from a selectedQueryPreview's query.\n *\n * @public\n */\nexport const setQuerySuggestionsQueryFromPreview = wireCommit(\n 'setQuery',\n ({ eventPayload: { query } }) => query,\n)\n\n/**\n * Sets the query-suggestions module params from a selectedQueryPreview's extraParams.\n *\n * @public\n */\nexport const setQuerySuggestionsExtraParamsFromPreview = wireCommit(\n 'setParams',\n ({ eventPayload: { extraParams } }) => extraParams,\n)\n\n/**\n * Sets the query suggestions state `params`.\n *\n * @public\n */\nexport const setQuerySuggestionsExtraParams = wireCommit('setParams')\n\n/**\n * Sets the query suggestions state `searchedQueries` with the list of history queries.\n *\n * @public\n */\nexport const setSearchedQueriesInSuggestions = wireCommit('setSearchedQueries')\n\n/**\n * Clears the query-suggestions module query.\n *\n * @public\n */\nexport const clearQuerySuggestionsQuery = wireCommit('setQuery', '')\n\n/**\n * Sets the query-suggestions state `query` from url.\n *\n * @public\n */\nconst setUrlParams = wireDispatch('setUrlParams')\n\n/**\n * Requests and stores a new set of query suggestions for the query.\n *\n * @public\n */\nexport const fetchAndSaveSuggestionsWire = wireDispatch('fetchAndSaveSuggestions')\n\n/**\n * Cancels the {@link QuerySuggestionsActions.fetchAndSaveSuggestions} request promise.\n *\n * @public\n */\nexport const cancelFetchAndSaveSuggestionsWire = wireDispatchWithoutPayload(\n 'cancelFetchAndSaveSuggestions',\n)\n\n/**\n * Debounce function for the module.\n */\nconst moduleDebounce = namespacedDebounce(moduleName)\n\n/**\n * QuerySuggestions wiring.\n *\n * @internal\n */\nexport const querySuggestionsWiring = createWiring({\n ParamsLoadedFromUrl: {\n setUrlParams,\n },\n UserIsTypingAQuery: {\n setQuerySuggestionsQueryDebounce: moduleDebounce(\n setQuerySuggestionsQuery,\n ({ state }) => state.config.debounceInMs,\n { cancelOn: 'UserAcceptedAQuery' },\n ),\n },\n UserAcceptedAQuery: {\n setQuerySuggestionsQuery,\n },\n UserClearedQuery: {\n clearQuerySuggestionsQuery,\n cancelFetchAndSaveSuggestionsWire,\n },\n UserBrowsedToCategory: {\n clearQuerySuggestionsQuery,\n cancelFetchAndSaveSuggestionsWire,\n },\n QuerySuggestionsRequestUpdated: {\n fetchAndSaveSuggestionsWire,\n },\n ExtraParamsChanged: {\n setQuerySuggestionsExtraParams,\n },\n UserClickedCloseX: {\n clearQuerySuggestionsQuery,\n },\n UserClickedOutOfMainModal: {\n clearQuerySuggestionsQuery,\n },\n UserAcceptedAQueryPreview: {\n setQuerySuggestionsQueryFromPreview,\n setQuerySuggestionsExtraParamsFromPreview,\n },\n QueryPreviewUnselected: {\n setQuerySuggestionsExtraParams,\n },\n SessionHistoryQueriesChanged: {\n setSearchedQueriesInSuggestions,\n },\n})\n"],"names":[],"mappings":";;;;AASA;;;;AAIG;AACH,MAAM,UAAU,GAAG,kBAAkB;AAErC;;;;AAIG;AACH,MAAM,UAAU,GAA4C,oBAAoB,CAAC,UAAU,CAAC;AAE5F;;;;AAIG;AACH,MAAM,0BAA0B,GAAG,oCAAoC,CAAC,UAAU,CAAC;AAEnF;;;;AAIG;AACH,MAAM,YAAY,GAAG,sBAAsB,CAAC,UAAU,CAAC;AAEvD;;;;AAIG;MACU,wBAAwB,GAAG,UAAU,CAAC,U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B,8BAA8B;AAC/B,KAAA;AACD,IAAA,iBAAiB,EAAE;QACjB,0BAA0B;AAC3B,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,0BAA0B;AAC3B,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,mCAAmC;QACnC,yCAAyC;AAC1C,KAAA;AACD,IAAA,sBAAsB,EAAE;QACtB,8BAA8B;AAC/B,KAAA;AACD,IAAA,4BAA4B,EAAE;QAC5B,+BAA+B;AAChC,KAAA;AACF,CAAA;;;;"}
@@ -18,6 +18,8 @@ const setUrlParams = wireDispatch('setUrlParams');
18
18
  const setExtraParams = wireCommit('setParams');
19
19
  /** Sets the related prompts state `query`. */
20
20
  const setRelatedPromptsQuery = wireCommit('setQuery');
21
+ /** Sets the related prompts state `query` to a empty string. */
22
+ const resetRelatedPromptsQuery = wireCommit('setQuery', '');
21
23
  /** Sets the related prompts state `query` from the payload. */
22
24
  const setRelatedPromptsQueryFromPreview = wireCommit('setQuery', ({ eventPayload: { query } }) => query);
23
25
  /** Sets the related prompts state `selectedQuery`. */
@@ -61,6 +63,11 @@ const relatedPromptsWiring = createWiring({
61
63
  resetRelatedPromptsState,
62
64
  setRelatedPromptsQuery,
63
65
  },
66
+ UserBrowsedToCategory: {
67
+ cancelFetchAndSaveRelatedPrompts,
68
+ resetRelatedPromptsState,
69
+ resetRelatedPromptsQuery,
70
+ },
64
71
  RelatedPromptsRequestUpdated: {
65
72
  fetchAndSaveRelatedPrompts,
66
73
  },
@@ -1 +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 { filter } from '../../wiring/wires.operators'\nimport { createWiring } from '../../wiring/wiring.utils'\n\n/** `relatedPrompts` XModule name. */\nconst moduleName = 'relatedPrompts'\n/** WireCommit for RelatedPromptsXModule. */\nconst wireCommit = namespacedWireCommit(moduleName)\n/** WireCommitWithoutPayload for RelatedPromptsXModule. */\nconst wireCommitWithoutPayload = namespacedWireCommitWithoutPayload(moduleName)\n/** WireDispatch for RelatedPromptsXModule.*/\nconst wireDispatch = namespacedWireDispatch(moduleName)\n/** WireDispatchWithoutPayload for RelatedPromptsXModule. */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName)\n\n/** Sets the related prompts state from URL data. */\nconst setUrlParams = wireDispatch('setUrlParams')\n/** Sets the related prompts state `params`. */\nconst setExtraParams = wireCommit('setParams')\n\n/** Sets the related prompts state `query`. */\nconst setRelatedPromptsQuery = wireCommit('setQuery')\n/** Sets the related prompts state `query` from the payload. */\nconst setRelatedPromptsQueryFromPreview = wireCommit(\n 'setQuery',\n ({ eventPayload: { query } }) => query,\n)\n/** Sets the related prompts state `selectedQuery`. */\nconst setRelatedPromptQuery = wireCommit('setSelectedQuery')\n/** Sets the related prompts state `selectedPrompt`. */\nconst setRelatedPrompt = wireCommit('setSelectedPrompt')\n/** Sets the related prompts state `relatedTags`.*/\nconst setRelatedPromptsRelatedTags = wireCommit('setRelatedPromptsRelatedTags')\n/** Fetches and saves the related prompts response. */\nconst fetchAndSaveRelatedPrompts = wireDispatch('fetchAndSaveRelatedPrompts')\n/** Fetches the same request and saves the related prompts response. */\nconst reloadRelatedPromptsRequestWire = wireDispatch(\n 'fetchAndSaveRelatedPrompts',\n ({ getters }) => getters.request,\n)\n/** Cancels the fetch and save related prompts response. */\nconst cancelFetchAndSaveRelatedPrompts = wireDispatchWithoutPayload(\n 'cancelFetchAndSaveRelatedPrompts',\n)\n\n/** Resets the related prompts state. */\nconst resetRelatedPromptsState = wireCommitWithoutPayload('resetRelatedPromptsState')\n/** Resets the selected related prompt number. */\nconst resetRelatedPrompt = wireCommitWithoutPayload('resetSelectedPrompt')\n\n/**\n * Wiring configuration for the {@link RelatedPromptsXModule | related prompts module}.\n *\n * @internal\n */\nexport const relatedPromptsWiring = createWiring({\n ParamsLoadedFromUrl: {\n setUrlParams,\n },\n ExtraParamsChanged: {\n setExtraParams,\n },\n UserAcceptedAQuery: {\n setRelatedPromptsQuery,\n resetRelatedPrompt,\n },\n UserAcceptedAQueryPreview: {\n setRelatedPromptsQueryFromPreview,\n resetRelatedPrompt,\n },\n UserClearedQuery: {\n cancelFetchAndSaveRelatedPrompts,\n resetRelatedPromptsState,\n setRelatedPromptsQuery,\n },\n RelatedPromptsRequestUpdated: {\n fetchAndSaveRelatedPrompts,\n },\n UserSelectedARelatedPrompt: {\n setRelatedPrompt,\n },\n UserSelectedARelatedPromptQuery: {\n setRelatedPromptQuery,\n },\n SearchRequestChanged: {\n resetRelatedPrompt: filter(\n resetRelatedPrompt,\n // Avoid reset selected prompt just after restored from URL with ParamsLoadedFromUrl event\n ({ store }) => store.state.x.search.origin !== 'url:external',\n ),\n },\n SelectedRelatedTagsChanged: {\n setRelatedPromptsRelatedTags,\n },\n ReloadRelatedPromptsRequested: {\n resetRelatedPromptsState,\n reloadRelatedPromptsRequestWire,\n },\n})\n"],"names":[],"mappings":";;;;AASA;AACA,MAAM,UAAU,GAAG,gBAAgB;AACnC;AACA,MAAM,UAAU,GAAG,oBAAoB,CAAC,UAAU,CAAC;AACnD;AACA,MAAM,wBAAwB,GAAG,kCAAkC,CAAC,UAAU,CAAC;AAC/E;AACA,MAAM,YAAY,GAAG,sBAAsB,CAAC,UAAU,CAAC;AACvD;AACA,MAAM,0BAA0B,GAAG,oCAAoC,CAAC,UAAU,CAAC;AAEnF;AACA,MAAM,YAAY,GAAG,YAAY,CAAC,cAAc,CAAC;AACjD;AACA,MAAM,cAAc,GAAG,UAAU,CAAC,WAAW,CAAC;AAE9C;AACA,MAAM,sBAAsB,GAAG,UAAU,CAAC,UAAU,CAAC;AACrD;AACA,MAAM,iCAAiC,GAAG,UAAU,CAClD,UAAU,EACV,CAAC,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,KAAK,C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AC9D;AACF,KAAA;AACD,IAAA,0BAA0B,EAAE;QAC1B,4BAA4B;AAC7B,KAAA;AACD,IAAA,6BAA6B,EAAE;QAC7B,wBAAwB;QACxB,+BAA+B;AAChC,KAAA;AACF,CAAA;;;;"}
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 { filter } from '../../wiring/wires.operators'\nimport { createWiring } from '../../wiring/wiring.utils'\n\n/** `relatedPrompts` XModule name. */\nconst moduleName = 'relatedPrompts'\n/** WireCommit for RelatedPromptsXModule. */\nconst wireCommit = namespacedWireCommit(moduleName)\n/** WireCommitWithoutPayload for RelatedPromptsXModule. */\nconst wireCommitWithoutPayload = namespacedWireCommitWithoutPayload(moduleName)\n/** WireDispatch for RelatedPromptsXModule.*/\nconst wireDispatch = namespacedWireDispatch(moduleName)\n/** WireDispatchWithoutPayload for RelatedPromptsXModule. */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName)\n\n/** Sets the related prompts state from URL data. */\nconst setUrlParams = wireDispatch('setUrlParams')\n/** Sets the related prompts state `params`. */\nconst setExtraParams = wireCommit('setParams')\n\n/** Sets the related prompts state `query`. */\nconst setRelatedPromptsQuery = wireCommit('setQuery')\n/** Sets the related prompts state `query` to a empty string. */\nconst resetRelatedPromptsQuery = wireCommit('setQuery', '')\n/** Sets the related prompts state `query` from the payload. */\nconst setRelatedPromptsQueryFromPreview = wireCommit(\n 'setQuery',\n ({ eventPayload: { query } }) => query,\n)\n/** Sets the related prompts state `selectedQuery`. */\nconst setRelatedPromptQuery = wireCommit('setSelectedQuery')\n/** Sets the related prompts state `selectedPrompt`. */\nconst setRelatedPrompt = wireCommit('setSelectedPrompt')\n/** Sets the related prompts state `relatedTags`.*/\nconst setRelatedPromptsRelatedTags = wireCommit('setRelatedPromptsRelatedTags')\n/** Fetches and saves the related prompts response. */\nconst fetchAndSaveRelatedPrompts = wireDispatch('fetchAndSaveRelatedPrompts')\n/** Fetches the same request and saves the related prompts response. */\nconst reloadRelatedPromptsRequestWire = wireDispatch(\n 'fetchAndSaveRelatedPrompts',\n ({ getters }) => getters.request,\n)\n/** Cancels the fetch and save related prompts response. */\nconst cancelFetchAndSaveRelatedPrompts = wireDispatchWithoutPayload(\n 'cancelFetchAndSaveRelatedPrompts',\n)\n\n/** Resets the related prompts state. */\nconst resetRelatedPromptsState = wireCommitWithoutPayload('resetRelatedPromptsState')\n/** Resets the selected related prompt number. */\nconst resetRelatedPrompt = wireCommitWithoutPayload('resetSelectedPrompt')\n\n/**\n * Wiring configuration for the {@link RelatedPromptsXModule | related prompts module}.\n *\n * @internal\n */\nexport const relatedPromptsWiring = createWiring({\n ParamsLoadedFromUrl: {\n setUrlParams,\n },\n ExtraParamsChanged: {\n setExtraParams,\n },\n UserAcceptedAQuery: {\n setRelatedPromptsQuery,\n resetRelatedPrompt,\n },\n UserAcceptedAQueryPreview: {\n setRelatedPromptsQueryFromPreview,\n resetRelatedPrompt,\n },\n UserClearedQuery: {\n cancelFetchAndSaveRelatedPrompts,\n resetRelatedPromptsState,\n setRelatedPromptsQuery,\n },\n UserBrowsedToCategory: {\n cancelFetchAndSaveRelatedPrompts,\n resetRelatedPromptsState,\n resetRelatedPromptsQuery,\n },\n RelatedPromptsRequestUpdated: {\n fetchAndSaveRelatedPrompts,\n },\n UserSelectedARelatedPrompt: {\n setRelatedPrompt,\n },\n UserSelectedARelatedPromptQuery: {\n setRelatedPromptQuery,\n },\n SearchRequestChanged: {\n resetRelatedPrompt: filter(\n resetRelatedPrompt,\n // Avoid reset selected prompt just after restored from URL with ParamsLoadedFromUrl event\n ({ store }) => store.state.x.search.origin !== 'url:external',\n ),\n },\n SelectedRelatedTagsChanged: {\n setRelatedPromptsRelatedTags,\n },\n ReloadRelatedPromptsRequested: {\n resetR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BAAoB,GAAG,YAAY,CAAC;AAC/C,IAAA,mBAAmB,EAAE;QACnB,YAAY;AACb,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,cAAc;AACf,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,sBAAsB;QACtB,kBAAkB;AACnB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,iCAAiC;QACjC,kBAAkB;AACnB,KAAA;AACD,IAAA,gBAAgB,EAAE;QAChB,gCAAgC;QAChC,wBAAwB;QACxB,sBAAsB;AACvB,KAAA;AACD,IAAA,qBAAqB,EAAE;QACrB,gCAAgC;QAChC,wBAAwB;QACxB,wBAAwB;AACzB,KAAA;AACD,IAAA,4BAA4B,EAAE;QAC5B,0BAA0B;AAC3B,KAAA;AACD,IAAA,0BAA0B,EAAE;QAC1B,gBAAgB;AACjB,KAAA;AACD,IAAA,+BAA+B,EAAE;QAC/B,qBAAqB;AACtB,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,kBAAkB,EAAE,MAAM,CACxB,kBAAkB;;AAElB,QAAA,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,cAAc,CAC9D;AACF,KAAA;AACD,IAAA,0BAA0B,EAAE;QAC1B,4BAA4B;AAC7B,KAAA;AACD,IAAA,6BAA6B,EAAE;QAC7B,wBAAwB;QACxB,+BAA+B;AAChC,KAAA;AACF,CAAA;;;;"}
@@ -112,6 +112,11 @@ const relatedTagsWiring = createWiring({
112
112
  clearRelatedTagsQuery,
113
113
  clearSelectedRelatedTags,
114
114
  },
115
+ UserBrowsedToCategory: {
116
+ cancelFetchAndSaveRelatedTagsWire,
117
+ clearRelatedTagsQuery,
118
+ clearSelectedRelatedTags,
119
+ },
115
120
  ExtraParamsChanged: {
116
121
  setRelatedTagsExtraParams,
117
122
  },
@@ -1 +1 @@
1
- {"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/related-tags/wiring.ts"],"sourcesContent":["import type {\n NamespacedWireCommit,\n NamespacedWireDispatch,\n} from '../../wiring/namespaced-wiring.types'\nimport {\n namespacedWireCommit,\n namespacedWireDispatch,\n namespacedWireDispatchWithoutPayload,\n} from '../../wiring/namespaced-wires.factory'\nimport { createWiring } from '../../wiring/wiring.utils'\n\n/**\n * `relatedTags` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'relatedTags'\n/**\n * WireCommit for {@link RelatedTagsXModule}.\n *\n * @internal\n */\nconst wireCommit: NamespacedWireCommit<typeof moduleName> = namespacedWireCommit(moduleName)\n/**\n * WireDispatch for {@link RelatedTagsXModule}.\n *\n * @internal\n */\nconst wireDispatch: NamespacedWireDispatch<typeof moduleName> = namespacedWireDispatch(moduleName)\n/**\n * WireDispatchWithoutPayload for {@link RelatedTagsXModule}.\n *\n * @internal\n */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName)\n\n/**\n * Sets the related tags state `query`.\n *\n * @public\n */\nexport const setRelatedTagsQuery = wireCommit('setQuery')\n\n/**\n * Sets the related tags state `query` from a selectedQueryPreview's query.\n *\n * @public\n */\nexport const setRelatedTagsQueryFromPreview = wireCommit(\n 'setQuery',\n ({ eventPayload: { query } }) => query,\n)\n\n/**\n * Sets the related tags state `params` from a selectedQueryPreview's extraParams.\n *\n * @public\n */\nexport const setRelatedTagsExtraParamsFromPreview = wireCommit(\n 'setParams',\n ({ eventPayload: { extraParams } }) => extraParams,\n)\n\n/**\n * Sets the related tags state `params`.\n *\n * @public\n */\nexport const setRelatedTagsExtraParams = wireCommit('setParams')\n\n/**\n * Requests and stores the related tags.\n *\n * @public\n */\nexport const fetchAndSaveRelatedTagsWire = wireDispatch('fetchAndSaveRelatedTags')\n\n/**\n * Cancels the {@link RelatedTagsActions.fetchAndSaveRelatedTags} request promise.\n *\n * @public\n */\nexport const cancelFetchAndSaveRelatedTagsWire = wireDispatchWithoutPayload(\n 'cancelFetchAndSaveRelatedTags',\n)\n\n/**\n * Sets the selected related tags.\n *\n * @public\n */\nexport const toggleRelatedTagWire = wireDispatch('toggleRelatedTag')\n\n/**\n * Clear the selected related tags.\n *\n * @public\n */\nexport const clearSelectedRelatedTags = wireCommit('setSelectedRelatedTags', [])\n\n/**\n * Clear the related tags query.\n *\n * @public\n */\nexport const clearRelatedTagsQuery = wireCommit('setQuery', '')\n\n/**\n * Saves the params from the url.\n *\n * @public\n */\nexport const setUrlParamsWire = wireDispatch('setUrlParams')\n\n/**\n * Wiring configuration for the {@link RelatedTagsXModule | related tags module}.\n *\n * @internal\n */\nexport const relatedTagsWiring = createWiring({\n ParamsLoadedFromUrl: {\n setUrlParamsWire,\n },\n UserAcceptedAQuery: {\n setRelatedTagsQuery,\n clearSelectedRelatedTags,\n },\n UserPickedARelatedTag: {\n toggleRelatedTagWire,\n },\n UserChangedExtraParams: {\n clearSelectedRelatedTags,\n },\n RelatedTagsRequestUpdated: {\n fetchAndSaveRelatedTagsWire,\n },\n UserClearedQuery: {\n cancelFetchAndSaveRelatedTagsWire,\n clearRelatedTagsQuery,\n clearSelectedRelatedTags,\n },\n ExtraParamsChanged: {\n setRelatedTagsExtraParams,\n },\n UserClickedCloseX: {\n clearRelatedTagsQuery,\n },\n UserClickedOutOfMainModal: {\n clearRelatedTagsQuery,\n },\n UserAcceptedAQueryPreview: {\n setRelatedTagsQueryFromPreview,\n clearSelectedRelatedTags,\n setRelatedTagsExtraParamsFromPreview,\n },\n QueryPreviewUnselected: {\n setRelatedTagsExtraParams,\n },\n})\n"],"names":[],"mappings":";;;AAWA;;;;AAIG;AACH,MAAM,UAAU,GAAG,aAAa;AAChC;;;;AAIG;AACH,MAAM,UAAU,GAA4C,oBAAoB,CAAC,UAAU,CAAC;AAC5F;;;;AAIG;AACH,MAAM,YAAY,GAA8C,sBAAsB,CAAC,UAAU,CAAC;AAClG;;;;AAIG;AACH,MAAM,0BAA0B,GAAG,oCAAoC,CAAC,UAAU,CAAC;AAEnF;;;;AAIG;MACU,mBAA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E;QACzB,qBAAqB;AACtB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,8BAA8B;QAC9B,wBAAwB;QACxB,oCAAoC;AACrC,KAAA;AACD,IAAA,sBAAsB,EAAE;QACtB,yBAAyB;AAC1B,KAAA;AACF,CAAA;;;;"}
1
+ {"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/related-tags/wiring.ts"],"sourcesContent":["import type {\n NamespacedWireCommit,\n NamespacedWireDispatch,\n} from '../../wiring/namespaced-wiring.types'\nimport {\n namespacedWireCommit,\n namespacedWireDispatch,\n namespacedWireDispatchWithoutPayload,\n} from '../../wiring/namespaced-wires.factory'\nimport { createWiring } from '../../wiring/wiring.utils'\n\n/**\n * `relatedTags` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'relatedTags'\n/**\n * WireCommit for {@link RelatedTagsXModule}.\n *\n * @internal\n */\nconst wireCommit: NamespacedWireCommit<typeof moduleName> = namespacedWireCommit(moduleName)\n/**\n * WireDispatch for {@link RelatedTagsXModule}.\n *\n * @internal\n */\nconst wireDispatch: NamespacedWireDispatch<typeof moduleName> = namespacedWireDispatch(moduleName)\n/**\n * WireDispatchWithoutPayload for {@link RelatedTagsXModule}.\n *\n * @internal\n */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName)\n\n/**\n * Sets the related tags state `query`.\n *\n * @public\n */\nexport const setRelatedTagsQuery = wireCommit('setQuery')\n\n/**\n * Sets the related tags state `query` from a selectedQueryPreview's query.\n *\n * @public\n */\nexport const setRelatedTagsQueryFromPreview = wireCommit(\n 'setQuery',\n ({ eventPayload: { query } }) => query,\n)\n\n/**\n * Sets the related tags state `params` from a selectedQueryPreview's extraParams.\n *\n * @public\n */\nexport const setRelatedTagsExtraParamsFromPreview = wireCommit(\n 'setParams',\n ({ eventPayload: { extraParams } }) => extraParams,\n)\n\n/**\n * Sets the related tags state `params`.\n *\n * @public\n */\nexport const setRelatedTagsExtraParams = wireCommit('setParams')\n\n/**\n * Requests and stores the related tags.\n *\n * @public\n */\nexport const fetchAndSaveRelatedTagsWire = wireDispatch('fetchAndSaveRelatedTags')\n\n/**\n * Cancels the {@link RelatedTagsActions.fetchAndSaveRelatedTags} request promise.\n *\n * @public\n */\nexport const cancelFetchAndSaveRelatedTagsWire = wireDispatchWithoutPayload(\n 'cancelFetchAndSaveRelatedTags',\n)\n\n/**\n * Sets the selected related tags.\n *\n * @public\n */\nexport const toggleRelatedTagWire = wireDispatch('toggleRelatedTag')\n\n/**\n * Clear the selected related tags.\n *\n * @public\n */\nexport const clearSelectedRelatedTags = wireCommit('setSelectedRelatedTags', [])\n\n/**\n * Clear the related tags query.\n *\n * @public\n */\nexport const clearRelatedTagsQuery = wireCommit('setQuery', '')\n\n/**\n * Saves the params from the url.\n *\n * @public\n */\nexport const setUrlParamsWire = wireDispatch('setUrlParams')\n\n/**\n * Wiring configuration for the {@link RelatedTagsXModule | related tags module}.\n *\n * @internal\n */\nexport const relatedTagsWiring = createWiring({\n ParamsLoadedFromUrl: {\n setUrlParamsWire,\n },\n UserAcceptedAQuery: {\n setRelatedTagsQuery,\n clearSelectedRelatedTags,\n },\n UserPickedARelatedTag: {\n toggleRelatedTagWire,\n },\n UserChangedExtraParams: {\n clearSelectedRelatedTags,\n },\n RelatedTagsRequestUpdated: {\n fetchAndSaveRelatedTagsWire,\n },\n UserClearedQuery: {\n cancelFetchAndSaveRelatedTagsWire,\n clearRelatedTagsQuery,\n clearSelectedRelatedTags,\n },\n UserBrowsedToCategory: {\n cancelFetchAndSaveRelatedTagsWire,\n clearRelatedTagsQuery,\n clearSelectedRelatedTags,\n },\n ExtraParamsChanged: {\n setRelatedTagsExtraParams,\n },\n UserClickedCloseX: {\n clearRelatedTagsQuery,\n },\n UserClickedOutOfMainModal: {\n clearRelatedTagsQuery,\n },\n UserAcceptedAQueryPreview: {\n setRelatedTagsQueryFromPreview,\n clearSelectedRelatedTags,\n setRelatedTagsExtraParamsFromPreview,\n },\n QueryPreviewUn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ACrB,KAAA;AACD,IAAA,sBAAsB,EAAE;QACtB,wBAAwB;AACzB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,2BAA2B;AAC5B,KAAA;AACD,IAAA,gBAAgB,EAAE;QAChB,iCAAiC;QACjC,qBAAqB;QACrB,wBAAwB;AACzB,KAAA;AACD,IAAA,qBAAqB,EAAE;QACrB,iCAAiC;QACjC,qBAAqB;QACrB,wBAAwB;AACzB,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,yBAAyB;AAC1B,KAAA;AACD,IAAA,iBAAiB,EAAE;QACjB,qBAAqB;AACtB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,qBAAqB;AACtB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,8BAA8B;QAC9B,wBAAwB;QACxB,oCAAoC;AACrC,KAAA;AACD,IAAA,sBAAsB,EAAE;QACtB,yBAAyB;AAC1B,KAAA;AACF,CAAA;;;;"}
@@ -91,6 +91,9 @@ const searchBoxWiring = createWiring({
91
91
  UserClearedQuery: {
92
92
  transitionState: setInputStatus('UserClearedQuery'),
93
93
  },
94
+ UserBrowsedToCategory: {
95
+ transitionState: setInputStatus('UserClearedQuery'),
96
+ },
94
97
  UserFocusedSearchBox: {
95
98
  transitionState: setInputStatus('UserFocusedSearchBox'),
96
99
  },
@@ -1 +1 @@
1
- {"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/search-box/wiring.ts"],"sourcesContent":["import type { XEvent } from '../../wiring/events.types'\nimport type { NamespacedWireCommit } from '../../wiring/namespaced-wiring.types'\nimport type { AnyWire } from '../../wiring/wiring.types'\nimport { filter } from '../../wiring/index'\nimport { namespacedWireCommit, namespacedWireDispatch } from '../../wiring/namespaced-wires.factory'\nimport { createWiring } from '../../wiring/wiring.utils'\n\n/**\n * `searchBox` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'searchBox'\n\n/**\n * WireCommit for {@link SearchBoxXModule}.\n *\n * @internal\n */\nconst wireCommit: NamespacedWireCommit<typeof moduleName> = namespacedWireCommit(moduleName)\n\n/**\n * WireDispatch for {@link SearchBoxXModule}.\n *\n * @internal\n */\nconst wireDispatch = namespacedWireDispatch(moduleName)\n\n/**\n * Sets the query of the search-box module.\n *\n * @public\n */\nconst setSearchBoxQuery = wireCommit('setQuery')\n\n/**\n * Sets the search state `query` with the selectedQueryPreview's query.\n *\n * @public\n */\nconst setSearchBoxQueryFromPreview = wireCommit('setQuery', ({ eventPayload: { query } }) => query)\n\n/**\n * Clears the query of the search-box module.\n *\n * @public\n */\nconst clearSearchBoxQuery = wireCommit('setQuery', '')\n\n/**\n * Sets the search state `query`.\n *\n * @public\n */\nconst setUrlParams = wireDispatch('setUrlParams')\n\n/**\n * Sets the search state `status`.\n *\n * @param event - The {@link XEvent} used to transition the status.\n *\n * @returns A wire.\n *\n * @public\n */\nconst setInputStatus = (event: XEvent): AnyWire => wireDispatch('setInputStatus', event)\n\n/**\n * SearchBox wiring.\n *\n * @internal\n */\nexport const searchBoxWiring = createWiring({\n ParamsLoadedFromUrl: {\n setUrlParams,\n transitionState: filter(setInputStatus('UserAcceptedAQuery'), ({ eventPayload: urlParams }) => {\n // eslint-disable-next-line ts/no-unsafe-member-access\n return !!urlParams.query\n }),\n },\n UserIsTypingAQuery: {\n setSearchBoxQuery,\n transitionState: setInputStatus('UserIsTypingAQuery'),\n },\n UserAcceptedAQuery: {\n setSearchBoxQuery,\n transitionState: setInputStatus('UserAcceptedAQuery'),\n },\n UserAcceptedAQueryPreview: {\n setSearchBoxQueryFromPreview,\n transitionState: setInputStatus('UserAcceptedAQuery'),\n },\n UserPressedClearSearchBoxButton: {\n clearSearchBoxQuery,\n },\n UserClickedCloseX: {\n clearSearchBoxQuery,\n },\n UserClickedOutOfMainModal: {\n clearSearchBoxQuery,\n },\n UserClearedQuery: {\n transitionState: setInputStatus('UserClearedQuery'),\n },\n UserFocusedSearchBox: {\n transitionState: setInputStatus('UserFocusedSearchBox'),\n },\n UserBlurredSearchBox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e,EAAE,cAAc,CAAC,oBAAoB,CAAC;AACtD,KAAA;AACD,IAAA,+BAA+B,EAAE;QAC/B,mBAAmB;AACpB,KAAA;AACD,IAAA,iBAAiB,EAAE;QACjB,mBAAmB;AACpB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,mBAAmB;AACpB,KAAA;AACD,IAAA,gBAAgB,EAAE;AAChB,QAAA,eAAe,EAAE,cAAc,CAAC,kBAAkB,CAAC;AACpD,KAAA;AACD,IAAA,oBAAoB,EAAE;AACpB,QAAA,eAAe,EAAE,cAAc,CAAC,sBAAsB,CAAC;AACxD,KAAA;AACD,IAAA,oBAAoB,EAAE;AACpB,QAAA,eAAe,EAAE,cAAc,CAAC,sBAAsB,CAAC;AACxD,KAAA;AACF,CAAA;;;;"}
1
+ {"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/search-box/wiring.ts"],"sourcesContent":["import type { XEvent } from '../../wiring/events.types'\nimport type { NamespacedWireCommit } from '../../wiring/namespaced-wiring.types'\nimport type { AnyWire } from '../../wiring/wiring.types'\nimport { filter } from '../../wiring/index'\nimport { namespacedWireCommit, namespacedWireDispatch } from '../../wiring/namespaced-wires.factory'\nimport { createWiring } from '../../wiring/wiring.utils'\n\n/**\n * `searchBox` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'searchBox'\n\n/**\n * WireCommit for {@link SearchBoxXModule}.\n *\n * @internal\n */\nconst wireCommit: NamespacedWireCommit<typeof moduleName> = namespacedWireCommit(moduleName)\n\n/**\n * WireDispatch for {@link SearchBoxXModule}.\n *\n * @internal\n */\nconst wireDispatch = namespacedWireDispatch(moduleName)\n\n/**\n * Sets the query of the search-box module.\n *\n * @public\n */\nconst setSearchBoxQuery = wireCommit('setQuery')\n\n/**\n * Sets the search state `query` with the selectedQueryPreview's query.\n *\n * @public\n */\nconst setSearchBoxQueryFromPreview = wireCommit('setQuery', ({ eventPayload: { query } }) => query)\n\n/**\n * Clears the query of the search-box module.\n *\n * @public\n */\nconst clearSearchBoxQuery = wireCommit('setQuery', '')\n\n/**\n * Sets the search state `query`.\n *\n * @public\n */\nconst setUrlParams = wireDispatch('setUrlParams')\n\n/**\n * Sets the search state `status`.\n *\n * @param event - The {@link XEvent} used to transition the status.\n *\n * @returns A wire.\n *\n * @public\n */\nconst setInputStatus = (event: XEvent): AnyWire => wireDispatch('setInputStatus', event)\n\n/**\n * SearchBox wiring.\n *\n * @internal\n */\nexport const searchBoxWiring = createWiring({\n ParamsLoadedFromUrl: {\n setUrlParams,\n transitionState: filter(setInputStatus('UserAcceptedAQuery'), ({ eventPayload: urlParams }) => {\n // eslint-disable-next-line ts/no-unsafe-member-access\n return !!urlParams.query\n }),\n },\n UserIsTypingAQuery: {\n setSearchBoxQuery,\n transitionState: setInputStatus('UserIsTypingAQuery'),\n },\n UserAcceptedAQuery: {\n setSearchBoxQuery,\n transitionState: setInputStatus('UserAcceptedAQuery'),\n },\n UserAcceptedAQueryPreview: {\n setSearchBoxQueryFromPreview,\n transitionState: setInputStatus('UserAcceptedAQuery'),\n },\n UserPressedClearSearchBoxButton: {\n clearSearchBoxQuery,\n },\n UserClickedCloseX: {\n clearSearchBoxQuery,\n },\n UserClickedOutOfMainModal: {\n clearSearchBoxQuery,\n },\n UserClearedQuery: {\n transitionState: setInputStatus('UserClearedQuery'),\n },\n UserBrowsedToCategory: {\n transitionState: setInputStatus('UserClearedQuery'),\n },\n UserFocusedSearchBox: {\n transitionState: setInputStatus('UserFocusedSearchBox'),\n },\n UserBlurredSearchBox: {\n transitionState: setInputStatus('UserBlurredSearchBox'),\n },\n})\n"],"names":[],"mappings":";;;;AAOA;;;;AAIG;AACH,MAAM,UAAU,GAAG,WAAW;AAE9B;;;;AAIG;AACH,MAAM,UAAU,GAA4C,oBAAoB,CAAC,UAAU,CAAC;AAE5F;;;;AAIG;AACH,MAAM,YAAY,GAAG,sBAAsB,CAAC,UAAU,CAAC;AAEvD;;;;AAIG;AACH,MAAM,iBAAiB,GAAG,UAAU,CAA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D,IAAA,qBAAqB,EAAE;AACrB,QAAA,eAAe,EAAE,cAAc,CAAC,kBAAkB,CAAC;AACpD,KAAA;AACD,IAAA,oBAAoB,EAAE;AACpB,QAAA,eAAe,EAAE,cAAc,CAAC,sBAAsB,CAAC;AACxD,KAAA;AACD,IAAA,oBAAoB,EAAE;AACpB,QAAA,eAAe,EAAE,cAAc,CAAC,sBAAsB,CAAC;AACxD,KAAA;AACF,CAAA;;;;"}
@@ -26,6 +26,12 @@ const setUrlPrompt = wireCommit('setPrompt');
26
26
  * @public
27
27
  */
28
28
  const setUrlQuery = wireCommit('setQuery');
29
+ /**
30
+ * Sets to empathy string the query of the url module.
31
+ *
32
+ * @public
33
+ */
34
+ const resetUrlQuery = wireCommit('setQuery', '');
29
35
  /**
30
36
  * Sets the url state `query` with a selectedQueryPreview's query.
31
37
  *
@@ -142,6 +148,7 @@ const urlWiring = createWiring({
142
148
  },
143
149
  UserBrowsedToCategory: {
144
150
  setUrlBrowseCategory,
151
+ resetUrlQuery,
145
152
  },
146
153
  UserClickedCloseX: {
147
154
  resetUrlBrowseCategory,
@@ -160,5 +167,5 @@ const urlWiring = createWiring({
160
167
  },
161
168
  });
162
169
 
163
- export { resetUrlBrowseCategory, setInitialExtraParams, setParams, setUrlBrowseCategory, setUrlFilters, setUrlPage, setUrlParamsFromPreview, setUrlPrompt, setUrlQuery, setUrlQueryFromPreview, setUrlRelatedTags, setUrlScroll, setUrlSelectedFiltersFromPreview, setUrlSort, urlWiring };
170
+ export { resetUrlBrowseCategory, resetUrlQuery, setInitialExtraParams, setParams, setUrlBrowseCategory, setUrlFilters, setUrlPage, setUrlParamsFromPreview, setUrlPrompt, setUrlQuery, setUrlQueryFromPreview, setUrlRelatedTags, setUrlScroll, setUrlSelectedFiltersFromPreview, setUrlSort, urlWiring };
164
171
  //# sourceMappingURL=wiring.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/url/wiring.ts"],"sourcesContent":["import { createRawFilters } from '../../utils/filters'\nimport { namespacedWireCommit } from '../../wiring/namespaced-wires.factory'\nimport { createWiring } from '../../wiring/wiring.utils'\n\n/**\n * WireCommit for {@link UrlXModule}.\n *\n * @internal\n */\nconst wireCommit = namespacedWireCommit('url')\n\n/**\n * Sets the {@link RelatedTag | related tags }.\n *\n * @public\n */\nexport const setUrlRelatedTags = wireCommit('setRelatedTags')\n\n/**\n * Sets the related prompt of the URL module.\n *\n * @public\n */\nexport const setUrlPrompt = wireCommit('setPrompt')\n\n/**\n * Sets the query of the url module.\n *\n * @public\n */\nexport const setUrlQuery = wireCommit('setQuery')\n\n/**\n * Sets the url state `query` with a selectedQueryPreview's query.\n *\n * @public\n */\nexport const setUrlQueryFromPreview = wireCommit('setQuery', ({ eventPayload: { query } }) => query)\n\n/**\n * Sets the page of the url module.\n *\n * @public\n */\nexport const setUrlPage = wireCommit('setPage')\n\n/**\n * Sets the sort of the url module.\n *\n * @public\n */\nexport const setUrlSort = wireCommit('setSort')\n\n/**\n * Sets the extra params of the url module.\n *\n * @public\n */\nexport const setParams = wireCommit('setParams')\n\n/**\n * Sets the extra params of the url module from a selectedQueryPreview's extraParams.\n *\n * @public\n */\nexport const setUrlParamsFromPreview = wireCommit(\n 'setParams',\n ({ eventPayload: { extraParams } }) => extraParams,\n)\n\n/**\n * Sets the filters of the url module from a selectedQueryPreview's filters.\n *\n * @public\n */\nexport const setUrlSelectedFiltersFromPreview = wireCommit(\n 'setFilters',\n ({ eventPayload: { filters } }) => (filters ? createRawFilters(filters) : []),\n)\n\n/**\n * Sets the scroll of the url module.\n *\n * @public\n */\nexport const setUrlScroll = wireCommit('setScroll')\n\n/**\n * Sets the browseCategory of the url module.\n *\n * @public\n */\nexport const resetUrlBrowseCategory = wireCommit('setBrowseCategory', {\n browseField: '',\n browseValue: '',\n})\n\n/**\n * Sets the browseCategory of the url module.\n *\n * @public\n */\nexport const setUrlBrowseCategory = wireCommit('setBrowseCategory')\n\n/**\n * Sets the initial provided extra params.\n *\n * @public\n */\nexport const setInitialExtraParams = wireCommit('setInitialExtraParams')\n\n/**\n * Sets the filters of the url module.\n *\n * @public\n */\nexport const setUrlFilters = wireCommit('setFilters')\n\n/**\n * Wiring configuration for the {@link UrlXModule | url module}.\n *\n * @internal\n */\nexport const urlWiring = createWiring({\n ParamsLoadedFromUrl: {\n setParams,\n },\n UserAcceptedAQuery: {\n setUrlQuery,\n resetUrlBrowseCategory,\n },\n UserAcceptedAQueryPreview: {\n setUrlQueryFromPreview,\n setUrlParamsFromPreview,\n setUrlSelectedFiltersFromPreview,\n },\n UserClearedQuery: {\n setUrlQuery,\n },\n SelectedRelatedTagsChanged: {\n setUrlRelatedTags,\n },\n SelectedRelatedPromptChanged: {\n setUrlPrompt,\n },\n SelectedFiltersForRequestChanged: {\n setUrlFilters,\n },\n PageChanged: {\n setUrlPage,\n },\n SortChanged: {\n setUrlSort,\n },\n ExtraParamsChanged: {\n setParams,\n },\n ExtraParamsInitialized: {\n setInitialExtraParams,\n },\n UserScrolledToElement: {\n setUrlScroll,\n },\n UserBrowsedToCategory: {\n setUrlBrowseCategory,\n },\n UserClickedCloseX: {\n resetUrlBrowseCategory,\n },\n UserClickedOpenX: {\n resetUrlBrowseCategory,\n },\n SelectedBrowseSortProvided: {\n setUrlSort,\n },\n UserClickedABrowseSort: {\n setUrlSort,\n },\n UserSelectedABrowsePage: {\n setUrlPage,\n },\n})\n"],"names":[],"mappings":";;;;AAIA;;;;AAIG;AACH,MAAM,UAAU,GAAG,oBAAoB,CAAC,KAAK,CAAC;AAE9C;;;;AAIG;MACU,iBAAiB,GAAG,UAAU,CAAC,gBAAgB;AAE5D;;;;AAIG;MACU,YAAY,GAAG,UAAU,CAAC,WAAW;AAElD;;;;AAIG;MACU,WAAW,GAAG,UAAU,CAAC,UAAU;AAEhD;;;;AAIG;MACU,sBAAsB,GAAG,UAAU,CAAC,UAAU,EAAE,CAAC,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,KAAK;A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Aa;AACd,KAAA;AACD,IAAA,WAAW,EAAE;QACX,UAAU;AACX,KAAA;AACD,IAAA,WAAW,EAAE;QACX,UAAU;AACX,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,SAAS;AACV,KAAA;AACD,IAAA,sBAAsB,EAAE;QACtB,qBAAqB;AACtB,KAAA;AACD,IAAA,qBAAqB,EAAE;QACrB,YAAY;AACb,KAAA;AACD,IAAA,qBAAqB,EAAE;QACrB,oBAAoB;AACrB,KAAA;AACD,IAAA,iBAAiB,EAAE;QACjB,sBAAsB;AACvB,KAAA;AACD,IAAA,gBAAgB,EAAE;QAChB,sBAAsB;AACvB,KAAA;AACD,IAAA,0BAA0B,EAAE;QAC1B,UAAU;AACX,KAAA;AACD,IAAA,sBAAsB,EAAE;QACtB,UAAU;AACX,KAAA;AACD,IAAA,uBAAuB,EAAE;QACvB,UAAU;AACX,KAAA;AACF,CAAA;;;;"}
1
+ {"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/url/wiring.ts"],"sourcesContent":["import { createRawFilters } from '../../utils/filters'\nimport { namespacedWireCommit } from '../../wiring/namespaced-wires.factory'\nimport { createWiring } from '../../wiring/wiring.utils'\n\n/**\n * WireCommit for {@link UrlXModule}.\n *\n * @internal\n */\nconst wireCommit = namespacedWireCommit('url')\n\n/**\n * Sets the {@link RelatedTag | related tags }.\n *\n * @public\n */\nexport const setUrlRelatedTags = wireCommit('setRelatedTags')\n\n/**\n * Sets the related prompt of the URL module.\n *\n * @public\n */\nexport const setUrlPrompt = wireCommit('setPrompt')\n\n/**\n * Sets the query of the url module.\n *\n * @public\n */\nexport const setUrlQuery = wireCommit('setQuery')\n\n/**\n * Sets to empathy string the query of the url module.\n *\n * @public\n */\nexport const resetUrlQuery = wireCommit('setQuery', '')\n\n/**\n * Sets the url state `query` with a selectedQueryPreview's query.\n *\n * @public\n */\nexport const setUrlQueryFromPreview = wireCommit('setQuery', ({ eventPayload: { query } }) => query)\n\n/**\n * Sets the page of the url module.\n *\n * @public\n */\nexport const setUrlPage = wireCommit('setPage')\n\n/**\n * Sets the sort of the url module.\n *\n * @public\n */\nexport const setUrlSort = wireCommit('setSort')\n\n/**\n * Sets the extra params of the url module.\n *\n * @public\n */\nexport const setParams = wireCommit('setParams')\n\n/**\n * Sets the extra params of the url module from a selectedQueryPreview's extraParams.\n *\n * @public\n */\nexport const setUrlParamsFromPreview = wireCommit(\n 'setParams',\n ({ eventPayload: { extraParams } }) => extraParams,\n)\n\n/**\n * Sets the filters of the url module from a selectedQueryPreview's filters.\n *\n * @public\n */\nexport const setUrlSelectedFiltersFromPreview = wireCommit(\n 'setFilters',\n ({ eventPayload: { filters } }) => (filters ? createRawFilters(filters) : []),\n)\n\n/**\n * Sets the scroll of the url module.\n *\n * @public\n */\nexport const setUrlScroll = wireCommit('setScroll')\n\n/**\n * Sets the browseCategory of the url module.\n *\n * @public\n */\nexport const resetUrlBrowseCategory = wireCommit('setBrowseCategory', {\n browseField: '',\n browseValue: '',\n})\n\n/**\n * Sets the browseCategory of the url module.\n *\n * @public\n */\nexport const setUrlBrowseCategory = wireCommit('setBrowseCategory')\n\n/**\n * Sets the initial provided extra params.\n *\n * @public\n */\nexport const setInitialExtraParams = wireCommit('setInitialExtraParams')\n\n/**\n * Sets the filters of the url module.\n *\n * @public\n */\nexport const setUrlFilters = wireCommit('setFilters')\n\n/**\n * Wiring configuration for the {@link UrlXModule | url module}.\n *\n * @internal\n */\nexport const urlWiring = createWiring({\n ParamsLoadedFromUrl: {\n setParams,\n },\n UserAcceptedAQuery: {\n setUrlQuery,\n resetUrlBrowseCategory,\n },\n UserAcceptedAQueryPreview: {\n setUrlQueryFromPreview,\n setUrlParamsFromPreview,\n setUrlSelectedFiltersFromPreview,\n },\n UserClearedQuery: {\n setUrlQuery,\n },\n SelectedRelatedTagsChanged: {\n setUrlRelatedTags,\n },\n SelectedRelatedPromptChanged: {\n setUrlPrompt,\n },\n SelectedFiltersForRequestChanged: {\n setUrlFilters,\n },\n PageChanged: {\n setUrlPage,\n },\n SortChanged: {\n setUrlSort,\n },\n ExtraParamsChanged: {\n setParams,\n },\n ExtraParamsInitialized: {\n setInitialExtraParams,\n },\n UserScrolledToElement: {\n setUrlScroll,\n },\n UserBrowsedToCategory: {\n setUrlBrowseCategory,\n resetUrlQuery,\n },\n UserClickedCloseX: {\n resetUrlBrowseCategory,\n },\n UserClickedOpenX: {\n resetUrlBrowseCategory,\n },\n SelectedBrowseSortProvided: {\n setUrlSort,\n },\n UserClickedABrowseSort: {\n setUrlSort,\n },\n UserSelectedABrowsePage: {\n setUrlPage,\n },\n})\n"],"names":[],"mappings":";;;;AAIA;;;;AAIG;AACH,MAAM,UAAU,GAAG,oBAAoB,CAAC,KAAK,CAAC;AAE9C;;;;AAIG;MACU,iBAAiB,GAAG,UAAU,CAAC,gBAAgB;AAE5D;;;;AAIG;MACU,YAAY,GAAG,UAAU,CAAC,WAAW;AAElD;;;;AAIG;MACU,WAAW,GAAG,UAAU,CAAC,UAAU;AAEhD;;;;AAIG;AACI,MAAM,aAAa,GAAG,UAAU,CAAC,UAAU,EAAE,EAAE;AAEtD;;;;AAIG;MACU,sBAAsB,GAAG,UAAU,CAAC,UAAU,EAAE,CAAC,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,KAAK;AAEnG;;;;AAIG;MACU,UAAU,GAAG,UAAU,CAAC,SAAS;AAE9C;;;;AAIG;MACU,UAAU,GAAG,UAAU,CAAC,SAAS;AAE9C;;;;AAIG;MACU,SAAS,GAAG,UAAU,CAAC,WAAW;AAE/C;;;;AAIG;MACU,uBAAuB,GAAG,UAAU,CAC/C,WAAW,EACX,CAAC,EAAE,YAAY,EAAE,EAAE,WAAW,EAAE,EAAE,KAAK,WAAW;AAGpD;;;;AAIG;AACI,MAAM,gCAAgC,GAAG,UAAU,CACxD,YAAY,EACZ,CAAC,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,MAAM,OAAO,GAAG,gBAAgB,CAAC,OAAO,CAAC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A0B,EAAE;QAC1B,UAAU;AACX,KAAA;AACD,IAAA,sBAAsB,EAAE;QACtB,UAAU;AACX,KAAA;AACD,IAAA,uBAAuB,EAAE;QACvB,UAAU;AACX,KAAA;AACF,CAAA;;;;"}
@@ -0,0 +1,83 @@
1
+ import { defineComponent, inject, computed, provide, h } from 'vue';
2
+ import { LIST_ITEMS_KEY } from '../../../components/decorators/injection.consts.js';
3
+ import ItemsList from '../../../components/items-list.vue.js';
4
+ import { use$x } from '../../../composables/use-_x.js';
5
+ import { useState } from '../../../composables/use-state.js';
6
+ import { AnimationProp } from '../../../types/animation-prop.js';
7
+ import { vendorXModule } from '../x-module.js';
8
+
9
+ /**
10
+ * It renders a {@link ItemsList} list of vendor banners from {@link VendorState.banners}.
11
+ *
12
+ * The component provides a default slot which wraps the whole component with the `vendorBanners`
13
+ * plus the `injectedListItems` which also contains the injected list items from
14
+ * the ancestor.
15
+ *
16
+ * It also provides the parent slots to customize the items.
17
+ *
18
+ * @public
19
+ */
20
+ var _sfc_main = defineComponent({
21
+ name: 'VendorBannersList',
22
+ xModule: vendorXModule.name,
23
+ props: {
24
+ /** Animation component that will be used to animate the vendor banners. */
25
+ animation: {
26
+ type: AnimationProp,
27
+ default: 'ul',
28
+ },
29
+ },
30
+ setup(props, { slots }) {
31
+ const $x = use$x();
32
+ /** The vendor banners to render from the state. */
33
+ const stateItems = useState('vendor').banners;
34
+ /** It injects {@link ListItem} provided by an ancestor as injectedListItems. */
35
+ const injectedListItems = inject(LIST_ITEMS_KEY);
36
+ /**
37
+ * The `stateItems` concatenated with the `injectedListItems` if there are.
38
+ *
39
+ * @remarks This computed defines the merging strategy of the `stateItems` and the
40
+ * `injectedListItems`.
41
+ *
42
+ * @returns List of {@link ListItem}.
43
+ */
44
+ const items = computed(() => {
45
+ if (!injectedListItems?.value.length) {
46
+ return stateItems.value;
47
+ }
48
+ const items = [...injectedListItems.value];
49
+ const positionedBanners = stateItems.value.filter(item => item.position != null);
50
+ const unpositionedBanners = stateItems.value.filter(item => item.position == null);
51
+ for (const item of positionedBanners) {
52
+ let index = item.position - 1;
53
+ while (items.at(index)?.modelName === 'VendorBanner') {
54
+ index++;
55
+ }
56
+ const isIndexInLoadedPages = index <= items.length;
57
+ const areAllPagesLoaded = $x.results.length === $x.totalResults;
58
+ if (!isIndexInLoadedPages && !areAllPagesLoaded) {
59
+ break;
60
+ }
61
+ items.splice(index, 0, item);
62
+ }
63
+ items.unshift(...unpositionedBanners);
64
+ return items;
65
+ });
66
+ /**
67
+ * The computed list items of the entity that uses the mixin.
68
+ *
69
+ * @remarks It should be overridden in the component that uses the mixin and it's intended to be
70
+ * filled with items from the state. Vue doesn't allow mixins as abstract classes.
71
+ * @returns An empty array as fallback in case it is not overridden.
72
+ */
73
+ provide(LIST_ITEMS_KEY, items);
74
+ return () => {
75
+ const innerProps = { items: items.value, animation: props.animation };
76
+ // https://vue-land.github.io/faq/forwarding-slots#passing-all-slots
77
+ return slots.default?.(innerProps)[0] ?? h(ItemsList, innerProps, slots);
78
+ };
79
+ },
80
+ });
81
+
82
+ export { _sfc_main as default };
83
+ //# sourceMappingURL=vendor-banners-list.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vendor-banners-list.vue.js","sources":["../../../../../src/x-modules/vendor/components/vendor-banners-list.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { Ref } from 'vue'\nimport type { ListItem } from '../../../utils/types'\nimport { computed, defineComponent, h, inject, provide } from 'vue'\nimport { LIST_ITEMS_KEY } from '../../../components/decorators/injection.consts'\nimport ItemsList from '../../../components/items-list.vue'\nimport { use$x } from '../../../composables/use-$x'\nimport { useState } from '../../../composables/use-state'\nimport { AnimationProp } from '../../../types/animation-prop'\nimport { vendorXModule } from '../x-module'\n\n/**\n * It renders a {@link ItemsList} list of vendor banners from {@link VendorState.banners}.\n *\n * The component provides a default slot which wraps the whole component with the `vendorBanners`\n * plus the `injectedListItems` which also contains the injected list items from\n * the ancestor.\n *\n * It also provides the parent slots to customize the items.\n *\n * @public\n */\nexport default defineComponent({\n name: 'VendorBannersList',\n xModule: vendorXModule.name,\n props: {\n /** Animation component that will be used to animate the vendor banners. */\n animation: {\n type: AnimationProp,\n default: 'ul',\n },\n },\n setup(props, { slots }) {\n const $x = use$x()\n\n /** The vendor banners to render from the state. */\n const stateItems = useState('vendor').banners\n\n /** It injects {@link ListItem} provided by an ancestor as injectedListItems. */\n const injectedListItems = inject<Ref<ListItem[]>>(LIST_ITEMS_KEY as string)\n\n /**\n * The `stateItems` concatenated with the `injectedListItems` if there are.\n *\n * @remarks This computed defines the merging strategy of the `stateItems` and the\n * `injectedListItems`.\n *\n * @returns List of {@link ListItem}.\n */\n const items = computed(() => {\n if (!injectedListItems?.value!.length) {\n return stateItems.value\n }\n const items = [...injectedListItems.value]\n const positionedBanners = stateItems.value.filter(item => item.position != null)\n const unpositionedBanners = stateItems.value.filter(item => item.position == null)\n for (const item of positionedBanners) {\n let index = item.position! - 1\n while (items.at(index)?.modelName === 'VendorBanner') {\n index++\n }\n const isIndexInLoadedPages = index <= items.length\n const areAllPagesLoaded = $x.results.length === $x.totalResults\n if (!isIndexInLoadedPages && !areAllPagesLoaded) {\n break\n }\n items.splice(index, 0, item)\n }\n items.unshift(...unpositionedBanners)\n return items\n })\n\n /**\n * The computed list items of the entity that uses the mixin.\n *\n * @remarks It should be overridden in the component that uses the mixin and it's intended to be\n * filled with items from the state. Vue doesn't allow mixins as abstract classes.\n * @returns An empty array as fallback in case it is not overridden.\n */\n provide(LIST_ITEMS_KEY as string, items)\n\n return () => {\n const innerProps = { items: items.value, animation: props.animation }\n // https://vue-land.github.io/faq/forwarding-slots#passing-all-slots\n return slots.default?.(innerProps)[0] ?? h(ItemsList, innerProps, slots)\n }\n },\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;AAWA;;;;;;;;;;AAUE;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,aAAa,CAAC,IAAI;A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BACA,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAA;YAC7B;AACA,YAAA,KAAK,CAAC,OAAO,CAAC,GAAG,mBAAmB,CAAA;AACpC,YAAA,OAAO,KAAI;AACb,QAAA,CAAC,CAAA;AAED;;;;;;AAME;AACF,QAAA,OAAO,CAAC,cAAwB,EAAE,KAAK,CAAA;AAEvC,QAAA,OAAO,MAAI;AACT,YAAA,MAAM,UAAS,GAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,SAAQ,EAAE;;AAEpE,YAAA,OAAO,KAAK,CAAC,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,CAAA,IAAK,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,KAAK,CAAA;AACzE,QAAA,CAAA;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
@@ -0,0 +1,6 @@
1
+ import _sfc_main from './vendor-banners-list.vue.js';
2
+
3
+
4
+
5
+ export { _sfc_main as default };
6
+ //# sourceMappingURL=vendor-banners-list.vue2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vendor-banners-list.vue2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1,9 +1,13 @@
1
1
  const vendorXStoreModule = {
2
2
  state: () => ({
3
+ banners: [],
3
4
  results: [],
4
5
  }),
5
6
  getters: {},
6
7
  mutations: {
8
+ setBanners(state, banners) {
9
+ state.banners = banners;
10
+ },
7
11
  setResults(state, results) {
8
12
  state.results = results;
9
13
  },
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sources":["../../../../../src/x-modules/vendor/store/module.ts"],"sourcesContent":["import type { VendorXStoreModule } from './types'\n\nexport const vendorXStoreModule: VendorXStoreModule = {\n state: () => ({\n results: [],\n }),\n getters: {},\n mutations: {\n setResults(state, results) {\n state.results = results\n },\n },\n actions: {},\n}\n"],"names":[],"mappings":"AAEO,MAAM,kBAAkB,GAAuB;AACpD,IAAA,KAAK,EAAE,OAAO;AACZ,QAAA,OAAO,EAAE,EAAE;KACZ,CAAC;AACF,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,SAAS,EAAE;QACT,UAAU,CAAC,KAAK,EAAE,OAAO,EAAA;AACvB,YAAA,KAAK,CAAC,OAAO,GAAG,OAAO;QACzB,CAAC;AACF,KAAA;AACD,IAAA,OAAO,EAAE,EAAE;;;;;"}
1
+ {"version":3,"file":"module.js","sources":["../../../../../src/x-modules/vendor/store/module.ts"],"sourcesContent":["import type { VendorXStoreModule } from './types'\n\nexport const vendorXStoreModule: VendorXStoreModule = {\n state: () => ({\n banners: [],\n results: [],\n }),\n getters: {},\n mutations: {\n setBanners(state, banners) {\n state.banners = banners\n },\n setResults(state, results) {\n state.results = results\n },\n },\n actions: {},\n}\n"],"names":[],"mappings":"AAEO,MAAM,kBAAkB,GAAuB;AACpD,IAAA,KAAK,EAAE,OAAO;AACZ,QAAA,OAAO,EAAE,EAAE;AACX,QAAA,OAAO,EAAE,EAAE;KACZ,CAAC;AACF,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,SAAS,EAAE;QACT,UAAU,CAAC,KAAK,EAAE,OAAO,EAAA;AACvB,YAAA,KAAK,CAAC,OAAO,GAAG,OAAO;QACzB,CAAC;QACD,UAAU,CAAC,KAAK,EAAE,OAAO,EAAA;AACvB,YAAA,KAAK,CAAC,OAAO,GAAG,OAAO;QACzB,CAAC;AACF,KAAA;AACD,IAAA,OAAO,EAAE,EAAE;;;;;"}
@@ -23,12 +23,27 @@ const setResults = wireCommit('setResults', ({ eventPayload }) => eventPayload.m
23
23
  ...vendorResult,
24
24
  modelName: 'VendorResult',
25
25
  })));
26
+ /**
27
+ * Sets the vendor banners of the {@link VendorXModule}.
28
+ *
29
+ * @public
30
+ */
31
+ const setBanners = wireCommit('setBanners', ({ eventPayload }) => eventPayload.map(vendorBanner => ({
32
+ ...vendorBanner,
33
+ modelName: 'VendorBanner',
34
+ })));
26
35
  /**
27
36
  * Resets the vendor results of the {@link VendorXModule}.
28
37
  *
29
38
  * @public
30
39
  */
31
40
  const resetResults = wireCommit('setResults', []);
41
+ /**
42
+ * Resets the vendor banners of the {@link VendorXModule}.
43
+ *
44
+ * @public
45
+ */
46
+ const resetBanners = wireCommit('setBanners', []);
32
47
  /**
33
48
  * Wiring configuration for the {@link VendorXModule | vendor module}.
34
49
  *
@@ -47,10 +62,14 @@ const vendorWiring = createWiring({
47
62
  UserClickedVendorResultAddToCart: {
48
63
  trackResultAddToCart,
49
64
  },
65
+ VendorBannersChanged: {
66
+ setBanners,
67
+ },
50
68
  SearchRequestChanged: {
51
69
  resetResults,
70
+ resetBanners,
52
71
  },
53
72
  });
54
73
 
55
- export { setResults, vendorWiring };
74
+ export { setBanners, setResults, vendorWiring };
56
75
  //# sourceMappingURL=wiring.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/vendor/wiring.ts"],"sourcesContent":["import type { WirePayload, XEventPayload } from '../../wiring'\nimport { createWireFromFunction, createWiring, namespacedWireCommit } from '../../wiring'\n\n/**\n * WireCommit for {@link VendorXModule}.\n *\n * @internal\n */\nconst wireCommit = namespacedWireCommit('vendor')\n\nconst fetchTagging = async (url: string) => fetch(url, { method: 'GET', keepalive: true })\n\nconst trackResultView = createWireFromFunction<XEventPayload<'UserViewedAVendorResult'>>(\n ({ eventPayload: { tagging } }) => tagging?.viewUrl && void fetchTagging(tagging.viewUrl),\n)\nconst trackResultClick = createWireFromFunction<XEventPayload<'UserClickedAVendorResult'>>(\n ({ eventPayload: { tagging } }) => tagging?.clickUrl && void fetchTagging(tagging.clickUrl),\n)\nconst trackResultAddToCart = createWireFromFunction<\n XEventPayload<'UserClickedVendorResultAddToCart'>\n>(({ eventPayload: { tagging } }) => tagging?.add2cartUrl && void fetchTagging(tagging.add2cartUrl))\n/**\n * Sets the vendor results of the {@link VendorXModule}.\n *\n * @public\n */\nexport const setResults = wireCommit(\n 'setResults',\n ({ eventPayload }: WirePayload<XEventPayload<'VendorResultsChanged'>>) =>\n eventPayload.map(vendorResult => ({\n ...vendorResult,\n modelName: 'VendorResult' as const,\n })),\n)\n\n/**\n * Resets the vendor results of the {@link VendorXModule}.\n *\n * @public\n */\nconst resetResults = wireCommit('setResults', [])\n\n/**\n * Wiring configuration for the {@link VendorXModule | vendor module}.\n *\n * @internal\n */\nexport const vendorWiring = createWiring({\n VendorResultsChanged: {\n setResults,\n },\n UserViewedAVendorResult: {\n trackResultView,\n },\n UserClickedAVendorResult: {\n trackResultClick,\n },\n UserClickedVendorResultAddToCart: {\n trackResultAddToCart,\n },\n SearchRequestChanged: {\n resetResults,\n },\n})\n"],"names":[],"mappings":";;;;;;AAGA;;;;AAIG;AACH,MAAM,UAAU,GAAG,oBAAoB,CAAC,QAAQ,CAAC;AAEjD,MAAM,YAAY,GAAG,OAAO,GAAW,KAAK,KAAK,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAE1F,MAAM,eAAe,GAAG,sBAAsB,CAC5C,CAAC,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,OAAO,EAAE,OAAO,IAAI,KAAK,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAC1F;AACD,MAAM,gBAAgB,GAAG,sBAAsB,CAC7C,CAAC,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,OAAO,EAAE,QAAQ,IAAI,KAAK,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,CAC5F;AACD,MAAM,oBAAoB,GAAG,sBAAsB,CAEjD,CAAC,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,OAAO,EAAE,WAAW,IAAI,KAAK,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;AACpG;;;;AAIG;MACU,UAAU,GAAG,UAAU,CAClC,YAAY,EACZ,CAAC,EAAE,YAAY,EAAsD,KACnE,YAAY,CAAC,GAAG,CAAC,YAAY,KAAK;AAChC,IAAA,GAAG,YAAY;AACf,IAAA,SAAS,EAAE,cAAuB;CACnC,CAAC,CAAC;AAGP;;;;AAIG;AACH,MAAM,YAAY,GAAG,UAAU,CAAC,YAAY,EAAE,EAAE,CAAC;AAEjD;;;;AAIG;AACI,MAAM,YAAY,GAAG,YAAY,CAAC;AACvC,IAAA,oBAAoB,EAAE;QACpB,UAAU;AACX,KAAA;AACD,IAAA,uBAAuB,EAAE;QACvB,eAAe;AAChB,KAAA;AACD,IAAA,wBAAwB,EAAE;QACxB,gBAAgB;AACjB,KAAA;AACD,IAAA,gCAAgC,EAAE;QAChC,oBAAoB;AACrB,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,YAAY;AACb,KAAA;AACF,CAAA;;;;"}
1
+ {"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/vendor/wiring.ts"],"sourcesContent":["import type { WirePayload, XEventPayload } from '../../wiring'\nimport { createWireFromFunction, createWiring, namespacedWireCommit } from '../../wiring'\n\n/**\n * WireCommit for {@link VendorXModule}.\n *\n * @internal\n */\nconst wireCommit = namespacedWireCommit('vendor')\n\nconst fetchTagging = async (url: string) => fetch(url, { method: 'GET', keepalive: true })\n\nconst trackResultView = createWireFromFunction<XEventPayload<'UserViewedAVendorResult'>>(\n ({ eventPayload: { tagging } }) => tagging?.viewUrl && void fetchTagging(tagging.viewUrl),\n)\nconst trackResultClick = createWireFromFunction<XEventPayload<'UserClickedAVendorResult'>>(\n ({ eventPayload: { tagging } }) => tagging?.clickUrl && void fetchTagging(tagging.clickUrl),\n)\nconst trackResultAddToCart = createWireFromFunction<\n XEventPayload<'UserClickedVendorResultAddToCart'>\n>(({ eventPayload: { tagging } }) => tagging?.add2cartUrl && void fetchTagging(tagging.add2cartUrl))\n/**\n * Sets the vendor results of the {@link VendorXModule}.\n *\n * @public\n */\nexport const setResults = wireCommit(\n 'setResults',\n ({ eventPayload }: WirePayload<XEventPayload<'VendorResultsChanged'>>) =>\n eventPayload.map(vendorResult => ({\n ...vendorResult,\n modelName: 'VendorResult' as const,\n })),\n)\n\n/**\n * Sets the vendor banners of the {@link VendorXModule}.\n *\n * @public\n */\nexport const setBanners = wireCommit(\n 'setBanners',\n ({ eventPayload }: WirePayload<XEventPayload<'VendorBannersChanged'>>) =>\n eventPayload.map(vendorBanner => ({\n ...vendorBanner,\n modelName: 'VendorBanner' as const,\n })),\n)\n\n/**\n * Resets the vendor results of the {@link VendorXModule}.\n *\n * @public\n */\nconst resetResults = wireCommit('setResults', [])\n\n/**\n * Resets the vendor banners of the {@link VendorXModule}.\n *\n * @public\n */\nconst resetBanners = wireCommit('setBanners', [])\n\n/**\n * Wiring configuration for the {@link VendorXModule | vendor module}.\n *\n * @internal\n */\nexport const vendorWiring = createWiring({\n VendorResultsChanged: {\n setResults,\n },\n UserViewedAVendorResult: {\n trackResultView,\n },\n UserClickedAVendorResult: {\n trackResultClick,\n },\n UserClickedVendorResultAddToCart: {\n trackResultAddToCart,\n },\n VendorBannersChanged: {\n setBanners,\n },\n SearchRequestChanged: {\n resetResults,\n resetBanners,\n },\n})\n"],"names":[],"mappings":";;;;;;AAGA;;;;AAIG;AACH,MAAM,UAAU,GAAG,oBAAoB,CAAC,QAAQ,CAAC;AAEjD,MAAM,YAAY,GAAG,OAAO,GAAW,KAAK,KAAK,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAE1F,MAAM,eAAe,GAAG,sBAAsB,CAC5C,CAAC,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,OAAO,EAAE,OAAO,IAAI,KAAK,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAC1F;AACD,MAAM,gBAAgB,GAAG,sBAAsB,CAC7C,CAAC,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,OAAO,EAAE,QAAQ,IAAI,KAAK,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,CAC5F;AACD,MAAM,oBAAoB,GAAG,sBAAsB,CAEjD,CAAC,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,OAAO,EAAE,WAAW,IAAI,KAAK,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;AACpG;;;;AAIG;MACU,UAAU,GAAG,UAAU,CAClC,YAAY,EACZ,CAAC,EAAE,YAAY,EAAsD,KACnE,YAAY,CAAC,GAAG,CAAC,YAAY,KAAK;AAChC,IAAA,GAAG,YAAY;AACf,IAAA,SAAS,EAAE,cAAuB;CACnC,CAAC,CAAC;AAGP;;;;AAIG;MACU,UAAU,GAAG,UAAU,CAClC,YAAY,EACZ,CAAC,EAAE,YAAY,EAAsD,KACnE,YAAY,CAAC,GAAG,CAAC,YAAY,KAAK;AAChC,IAAA,GAAG,YAAY;AACf,IAAA,SAAS,EAAE,cAAuB;CACnC,CAAC,CAAC;AAGP;;;;AAIG;AACH,MAAM,YAAY,GAAG,UAAU,CAAC,YAAY,EAAE,EAAE,CAAC;AAEjD;;;;AAIG;AACH,MAAM,YAAY,GAAG,UAAU,CAAC,YAAY,EAAE,EAAE,CAAC;AAEjD;;;;AAIG;AACI,MAAM,YAAY,GAAG,YAAY,CAAC;AACvC,IAAA,oBAAoB,EAAE;QACpB,UAAU;AACX,KAAA;AACD,IAAA,uBAAuB,EAAE;QACvB,eAAe;AAChB,KAAA;AACD,IAAA,wBAAwB,EAAE;QACxB,gBAAgB;AACjB,KAAA;AACD,IAAA,gCAAgC,EAAE;QAChC,oBAAoB;AACrB,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,UAAU;AACX,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,YAAY;QACZ,YAAY;AACb,KAAA;AACF,CAAA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empathyco/x-components",
3
- "version": "8.3.0",
3
+ "version": "8.5.0",
4
4
  "description": "Empathy X Components",
5
5
  "author": "Empathy Systems Corporation S.L.",
6
6
  "license": "Apache-2.0",
@@ -117,5 +117,5 @@
117
117
  "access": "public",
118
118
  "directory": "dist"
119
119
  },
120
- "gitHead": "ad499c5844842c3a6b831444274ee6c02b5ab0db"
120
+ "gitHead": "23cadd3838c5517e15f0284e33c568f0faf82078"
121
121
  }