@empathyco/x-components 8.15.0 → 9.0.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.
- package/CHANGELOG.md +19 -0
- package/browse/index.js +1 -2
- package/core/index.js +0 -1
- package/core/index.js.map +1 -1
- package/docs/API-reference/api/x-components.browseactions.md +0 -19
- package/docs/API-reference/api/x-components.browsemutations.md +0 -19
- package/docs/API-reference/api/x-components.gethashfromquerypreviewinfo.md +72 -0
- package/docs/API-reference/api/x-components.gethashfromquerypreviewitem.md +56 -0
- package/docs/API-reference/api/x-components.md +22 -121
- package/docs/API-reference/api/x-components.queriespreviewactions.md +0 -19
- package/docs/API-reference/api/x-components.queriespreviewmutations.md +0 -19
- package/docs/API-reference/api/x-components.recommendationsactions.md +0 -38
- package/docs/API-reference/api/x-components.recommendationsmutations.md +0 -19
- package/docs/API-reference/api/x-components.searchactions.md +0 -38
- package/docs/API-reference/api/x-components.searchmutations.md +0 -38
- package/js/index.js +4 -7
- package/js/index.js.map +1 -1
- package/js/x-modules/browse/store/module.js +0 -6
- package/js/x-modules/browse/store/module.js.map +1 -1
- package/js/x-modules/browse/wiring.js +1 -8
- package/js/x-modules/browse/wiring.js.map +1 -1
- package/js/x-modules/facets/wiring.js +1 -0
- package/js/x-modules/facets/wiring.js.map +1 -1
- package/js/x-modules/queries-preview/store/module.js +0 -9
- package/js/x-modules/queries-preview/store/module.js.map +1 -1
- package/js/x-modules/queries-preview/wiring.js +2 -11
- package/js/x-modules/queries-preview/wiring.js.map +1 -1
- package/js/x-modules/recommendations/store/module.js +0 -7
- package/js/x-modules/recommendations/store/module.js.map +1 -1
- package/js/x-modules/recommendations/wiring.js +0 -9
- package/js/x-modules/recommendations/wiring.js.map +1 -1
- package/js/x-modules/search/store/module.js +2 -17
- package/js/x-modules/search/store/module.js.map +1 -1
- package/js/x-modules/search/wiring.js +2 -18
- package/js/x-modules/search/wiring.js.map +1 -1
- package/package.json +2 -2
- package/queries-preview/index.js +2 -1
- package/report/x-components.api.json +143 -1166
- package/report/x-components.api.md +8 -70
- package/search/index.js +1 -3
- package/types/src/services/index.d.ts +0 -1
- package/types/src/services/index.d.ts.map +1 -1
- package/types/src/services/services.types.d.ts +0 -21
- package/types/src/services/services.types.d.ts.map +1 -1
- package/types/src/x-modules/browse/store/actions/index.d.ts +0 -1
- package/types/src/x-modules/browse/store/actions/index.d.ts.map +1 -1
- package/types/src/x-modules/browse/store/module.d.ts.map +1 -1
- package/types/src/x-modules/browse/store/types.d.ts +0 -12
- package/types/src/x-modules/browse/store/types.d.ts.map +1 -1
- package/types/src/x-modules/browse/wiring.d.ts +0 -7
- package/types/src/x-modules/browse/wiring.d.ts.map +1 -1
- package/types/src/x-modules/facets/wiring.d.ts +1 -0
- package/types/src/x-modules/facets/wiring.d.ts.map +1 -1
- package/types/src/x-modules/queries-preview/index.d.ts +1 -0
- package/types/src/x-modules/queries-preview/index.d.ts.map +1 -1
- package/types/src/x-modules/queries-preview/store/module.d.ts.map +1 -1
- package/types/src/x-modules/queries-preview/store/types.d.ts +0 -17
- package/types/src/x-modules/queries-preview/store/types.d.ts.map +1 -1
- package/types/src/x-modules/queries-preview/wiring.d.ts +0 -9
- package/types/src/x-modules/queries-preview/wiring.d.ts.map +1 -1
- package/types/src/x-modules/recommendations/store/module.d.ts.map +1 -1
- package/types/src/x-modules/recommendations/store/types.d.ts +0 -17
- package/types/src/x-modules/recommendations/store/types.d.ts.map +1 -1
- package/types/src/x-modules/recommendations/wiring.d.ts +0 -3
- package/types/src/x-modules/recommendations/wiring.d.ts.map +1 -1
- package/types/src/x-modules/search/store/actions/index.d.ts +0 -2
- package/types/src/x-modules/search/store/actions/index.d.ts.map +1 -1
- package/types/src/x-modules/search/store/module.d.ts.map +1 -1
- package/types/src/x-modules/search/store/types.d.ts +0 -24
- package/types/src/x-modules/search/store/types.d.ts.map +1 -1
- package/types/src/x-modules/search/wiring.d.ts +0 -16
- package/types/src/x-modules/search/wiring.d.ts.map +1 -1
- package/docs/API-reference/api/x-components.browseactions.fetchandsaveresultsenrichment.md +0 -13
- package/docs/API-reference/api/x-components.browsemutations.updateresultsfromenrichment.md +0 -13
- package/docs/API-reference/api/x-components.cancelfetchandsavepartialresultsenrichment.md +0 -17
- package/docs/API-reference/api/x-components.cancelfetchandsaveresultsenrichment.md +0 -17
- package/docs/API-reference/api/x-components.defaultresultsenrichmentservice._constructor_.md +0 -13
- package/docs/API-reference/api/x-components.defaultresultsenrichmentservice.fetchresults.md +0 -52
- package/docs/API-reference/api/x-components.defaultresultsenrichmentservice.instance.md +0 -13
- package/docs/API-reference/api/x-components.defaultresultsenrichmentservice.md +0 -164
- package/docs/API-reference/api/x-components.defaultresultsenrichmentservice.store.md +0 -11
- package/docs/API-reference/api/x-components.defaultresultsenrichmentservice.updateresults.md +0 -66
- package/docs/API-reference/api/x-components.fetchandsavebrowseresultsenrichment.md +0 -66
- package/docs/API-reference/api/x-components.fetchandsavebrowseresultsenrichmentwire.md +0 -13
- package/docs/API-reference/api/x-components.fetchandsavepartialresultsenrichment.md +0 -66
- package/docs/API-reference/api/x-components.fetchandsavepartialresultsenrichmentwire.md +0 -13
- package/docs/API-reference/api/x-components.fetchandsavequerypreviewresultsenrichmentwire.md +0 -13
- package/docs/API-reference/api/x-components.fetchandsaveresultsenrichment.md +0 -66
- package/docs/API-reference/api/x-components.fetchandsaveresultsenrichmentwire.md +0 -13
- package/docs/API-reference/api/x-components.queriespreviewactions.fetchandsavequerypreviewresultsenrichment.md +0 -13
- package/docs/API-reference/api/x-components.queriespreviewmutations.updatequerypreviewresultsfromenrichment.md +0 -16
- package/docs/API-reference/api/x-components.recommendationsactions.cancelfetchandsaverecommendationsenrichment.md +0 -13
- package/docs/API-reference/api/x-components.recommendationsactions.fetchandsaverecommendationsenrichment.md +0 -13
- package/docs/API-reference/api/x-components.recommendationsmutations.updaterecommendationsfromenrichment.md +0 -13
- package/docs/API-reference/api/x-components.resultsenrichmentservice.fetchresults.md +0 -13
- package/docs/API-reference/api/x-components.resultsenrichmentservice.md +0 -77
- package/docs/API-reference/api/x-components.resultsenrichmentservice.updateresults.md +0 -13
- package/docs/API-reference/api/x-components.searchactions.fetchandsavepartialresultsenrichment.md +0 -13
- package/docs/API-reference/api/x-components.searchactions.fetchandsaveresultsenrichment.md +0 -13
- package/docs/API-reference/api/x-components.searchmutations.updatepartialresultsfromenrichment.md +0 -13
- package/docs/API-reference/api/x-components.searchmutations.updateresultsfromenrichment.md +0 -13
- package/js/services/results-enrichment.service.js +0 -37
- package/js/services/results-enrichment.service.js.map +0 -1
- package/js/x-modules/browse/store/actions/fetch-and-save-results-enrichment.action.js +0 -21
- package/js/x-modules/browse/store/actions/fetch-and-save-results-enrichment.action.js.map +0 -1
- package/js/x-modules/queries-preview/store/actions/fetch-and-save-query-preview-results-enrichment.action.js +0 -21
- package/js/x-modules/queries-preview/store/actions/fetch-and-save-query-preview-results-enrichment.action.js.map +0 -1
- package/js/x-modules/recommendations/store/actions/fetch-and-save-recommendations-enrichment.action.js +0 -30
- package/js/x-modules/recommendations/store/actions/fetch-and-save-recommendations-enrichment.action.js.map +0 -1
- package/js/x-modules/search/store/actions/fetch-and-save-partial-results-enrichment.action.js +0 -33
- package/js/x-modules/search/store/actions/fetch-and-save-partial-results-enrichment.action.js.map +0 -1
- package/js/x-modules/search/store/actions/fetch-and-save-results-enrichment.action.js +0 -28
- package/js/x-modules/search/store/actions/fetch-and-save-results-enrichment.action.js.map +0 -1
- package/types/src/services/results-enrichment.service.d.ts +0 -31
- package/types/src/services/results-enrichment.service.d.ts.map +0 -1
- package/types/src/x-modules/browse/store/actions/fetch-and-save-results-enrichment.action.d.ts +0 -17
- package/types/src/x-modules/browse/store/actions/fetch-and-save-results-enrichment.action.d.ts.map +0 -1
- package/types/src/x-modules/queries-preview/store/actions/fetch-and-save-query-preview-results-enrichment.action.d.ts +0 -3
- package/types/src/x-modules/queries-preview/store/actions/fetch-and-save-query-preview-results-enrichment.action.d.ts.map +0 -1
- package/types/src/x-modules/recommendations/store/actions/fetch-and-save-recommendations-enrichment.action.d.ts +0 -17
- package/types/src/x-modules/recommendations/store/actions/fetch-and-save-recommendations-enrichment.action.d.ts.map +0 -1
- package/types/src/x-modules/search/store/actions/fetch-and-save-partial-results-enrichment.action.d.ts +0 -17
- package/types/src/x-modules/search/store/actions/fetch-and-save-partial-results-enrichment.action.d.ts.map +0 -1
- package/types/src/x-modules/search/store/actions/fetch-and-save-results-enrichment.action.d.ts +0 -17
- package/types/src/x-modules/search/store/actions/fetch-and-save-results-enrichment.action.d.ts.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRawFilters } from '../../utils/filters.js';
|
|
2
2
|
import '../../utils/storage.js';
|
|
3
3
|
import { namespacedWireCommit, namespacedWireDispatch, namespacedWireCommitWithoutPayload, namespacedWireDispatchWithoutPayload } from '../../wiring/namespaced-wires.factory.js';
|
|
4
|
-
import {
|
|
4
|
+
import { filterTruthyPayload } from '../../wiring/wires.operators.js';
|
|
5
5
|
import { createWiring } from '../../wiring/wiring.utils.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -52,12 +52,6 @@ const saveOriginWire = wireDispatch('saveOrigin', ({ metadata }) => metadata);
|
|
|
52
52
|
* @public
|
|
53
53
|
*/
|
|
54
54
|
const fetchAndSaveSearchResponseWire = wireDispatch('fetchAndSaveSearchResponse');
|
|
55
|
-
/**
|
|
56
|
-
* Requests and stores the enrichment results for the results.
|
|
57
|
-
*
|
|
58
|
-
* @public
|
|
59
|
-
*/
|
|
60
|
-
const fetchAndSaveResultsEnrichmentWire = filter(wireDispatch('fetchAndSaveResultsEnrichment'), ({ eventPayload: results }) => results.length > 0);
|
|
61
55
|
/**
|
|
62
56
|
* Resets the search state `spellcheckedQuery` to its initial value, an empty string.
|
|
63
57
|
*
|
|
@@ -152,12 +146,6 @@ const resetRequestOnRefinementWire = wireDispatch('resetRequestOnRefinement', ({
|
|
|
152
146
|
newRequest,
|
|
153
147
|
oldRequest: oldValue,
|
|
154
148
|
}));
|
|
155
|
-
/**
|
|
156
|
-
* Requests and stores the enrichment results for the partial results.
|
|
157
|
-
*
|
|
158
|
-
* @public
|
|
159
|
-
*/
|
|
160
|
-
const fetchAndSavePartialResultsEnrichmentWire = wireDispatch('fetchAndSavePartialResultsEnrichment');
|
|
161
149
|
/**
|
|
162
150
|
* Resets the search state when the request is changed to null. See the
|
|
163
151
|
* {@link SearchXStoreModule} for details.
|
|
@@ -199,9 +187,6 @@ const searchWiring = createWiring({
|
|
|
199
187
|
setUrlParams,
|
|
200
188
|
saveOriginWire,
|
|
201
189
|
},
|
|
202
|
-
PartialResultsChanged: {
|
|
203
|
-
fetchAndSavePartialResultsEnrichmentWire,
|
|
204
|
-
},
|
|
205
190
|
UserAcceptedAQuery: {
|
|
206
191
|
setSearchQuery,
|
|
207
192
|
saveOriginWire,
|
|
@@ -239,7 +224,6 @@ const searchWiring = createWiring({
|
|
|
239
224
|
},
|
|
240
225
|
ResultsChanged: {
|
|
241
226
|
resetAppending,
|
|
242
|
-
fetchAndSaveResultsEnrichmentWire,
|
|
243
227
|
},
|
|
244
228
|
ReloadSearchRequested: {
|
|
245
229
|
resetStateForReloadWire,
|
|
@@ -277,5 +261,5 @@ const searchWiring = createWiring({
|
|
|
277
261
|
},
|
|
278
262
|
});
|
|
279
263
|
|
|
280
|
-
export { cancelFetchAndSaveSearchResponseWire, clearSearchQuery,
|
|
264
|
+
export { cancelFetchAndSaveSearchResponseWire, clearSearchQuery, fetchAndSaveSearchResponseWire, increasePageAppendingResultsWire, resetAppending, resetFromNoResultsWithFilters, resetIsNoResults, resetRequestOnRefinementWire, resetSpellcheckQuery, resetStateForReloadWire, resetStateIfNoRequestWire, saveOriginWire, searchWiring, setRelatedTags, setSearchExtraParams, setSearchExtraParamsFromPreview, setSearchPage, setSearchQuery, setSearchQueryFromPreview, setSearchSelectedFiltersFromHistoryQuery, setSearchSelectedFiltersFromPreview, setSelectedFilters, setSort, setUrlParams };
|
|
281
265
|
//# sourceMappingURL=wiring.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/search/wiring.ts"],"sourcesContent":["import type { WirePayload, XEventPayload } from '../../wiring'\nimport type { InternalSearchRequest } from './types'\nimport { createRawFilters } from '../../utils'\nimport {\n createWiring,\n filter,\n filterTruthyPayload,\n namespacedWireCommit,\n namespacedWireCommitWithoutPayload,\n namespacedWireDispatch,\n namespacedWireDispatchWithoutPayload,\n} from '../../wiring'\n\n/**\n * `search` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'search'\n\n/**\n * WireCommit for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireCommit = namespacedWireCommit(moduleName)\n\n/**\n * WireCommit without Payload for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireCommitWithoutPayload = namespacedWireCommitWithoutPayload(moduleName)\n\n/**\n * WireDispatch for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireDispatch = namespacedWireDispatch(moduleName)\n\n/**\n * WireDispatchWithoutPayload for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName)\n\n/**\n * Cancels the {@link SearchActions.fetchAndSaveSearchResponse} request promise.\n *\n * @public\n */\nexport const cancelFetchAndSaveSearchResponseWire = wireDispatchWithoutPayload(\n 'cancelFetchAndSaveSearchResponse',\n)\n\n/**\n * Sets the search state `origin`.\n *\n * @public\n */\nexport const saveOriginWire = wireDispatch('saveOrigin', ({ metadata }) => metadata)\n\n/**\n * Requests and stores the search response.\n *\n * @public\n */\nexport const fetchAndSaveSearchResponseWire = wireDispatch('fetchAndSaveSearchResponse')\n\n/**\n * Requests and stores the enrichment results for the results.\n *\n * @public\n */\nexport const fetchAndSaveResultsEnrichmentWire = filter<XEventPayload<'ResultsChanged'>>(\n wireDispatch('fetchAndSaveResultsEnrichment'),\n ({ eventPayload: results }) => results.length > 0,\n)\n\n/**\n * Resets the search state `spellcheckedQuery` to its initial value, an empty string.\n *\n * @public\n */\nexport const resetSpellcheckQuery = wireCommit('setSpellcheck', '')\n\n/**\n * Sets the search state `relatedTags`.\n *\n * @public\n */\nexport const setRelatedTags = wireCommit('setRelatedTags')\n\n/**\n * Sets the search state `query`.\n *\n * @public\n */\nexport const setSearchQuery = wireCommit('setQuery')\n\n/**\n * Clears the search state `query`.\n *\n * @public\n */\nexport const clearSearchQuery = wireCommit('setQuery', '')\n\n/**\n * Sets the search state `selectedFilters`.\n *\n * @public\n */\nexport const setSelectedFilters = wireCommit('setSelectedFilters')\n\n/**\n * Sets the search state `sort`.\n *\n * @public\n */\nexport const setSort = wireCommit('setSort')\n\n/**\n * Sets the search state `query`.\n *\n * @public\n */\nexport const setUrlParams = wireDispatch('setUrlParams')\n\n/**\n * Sets the search state `page`.\n *\n * @public\n */\nexport const setSearchPage = wireCommit('setPage')\n\n/**\n * Sets the search state `params`.\n *\n * @public\n */\nexport const setSearchExtraParams = wireCommit('setParams')\n\n/**\n * Resets the search state to reload the current search.\n *\n * @public\n */\nexport const resetStateForReloadWire = wireCommitWithoutPayload('resetStateForReload')\n\n/**\n * Resets the search state `isNoResults`.\n *\n * @public\n */\nexport const resetIsNoResults = wireCommit('setIsNoResults', false)\n\n/**\n * Resets the search state `fromNoResultsWithFilters`.\n *\n * @public\n */\nexport const resetFromNoResultsWithFilters = wireCommit('setFromNoResultsWithFilters', false)\n\n/**\n * Increases the current search state `page` by one.\n *\n * @public\n */\nexport const increasePageAppendingResultsWire = wireDispatchWithoutPayload(\n 'increasePageAppendingResults',\n)\n\n/**\n * Resets the search state `isAppendingResults`.\n *\n * @public\n */\nexport const resetAppending = wireCommit('setIsAppendResults', false)\n\n/**\n * Resets the {@link SearchGetters.request} parameters when refining request and before the actual\n * request is launched.\n *\n * @public\n */\nexport const resetRequestOnRefinementWire = wireDispatch(\n 'resetRequestOnRefinement',\n ({ eventPayload: newRequest, metadata: { oldValue } }: WirePayload<InternalSearchRequest>) => ({\n newRequest,\n oldRequest: oldValue as InternalSearchRequest,\n }),\n)\n\n/**\n * Requests and stores the enrichment results for the partial results.\n *\n * @public\n */\nexport const fetchAndSavePartialResultsEnrichmentWire = wireDispatch(\n 'fetchAndSavePartialResultsEnrichment',\n)\n\n/**\n * Resets the search state when the request is changed to null. See the\n * {@link SearchXStoreModule} for details.\n *\n * @public\n */\nexport const resetStateIfNoRequestWire = filterTruthyPayload<InternalSearchRequest | null>(\n wireCommitWithoutPayload('resetState'),\n)\n\n/**\n * Sets the search state `query` with the selectedQueryPreview's query.\n *\n * @public\n */\nexport const setSearchQueryFromPreview = wireCommit(\n 'setQuery',\n ({ eventPayload: { query } }) => query,\n)\n\n/**\n * Sets the search state `params` with the selectedQueryPreview's extraParams.\n *\n * @public\n */\nexport const setSearchExtraParamsFromPreview = wireCommit(\n 'setParams',\n ({ eventPayload: { extraParams } }) => extraParams,\n)\n\n/**\n * Sets the search state `selectedFilters` with the selectedQueryPreview's filters.\n *\n * @public\n */\nexport const setSearchSelectedFiltersFromPreview = wireCommit(\n 'setSelectedFilters',\n ({ eventPayload: { filters } }) => (filters ? createRawFilters(filters) : []),\n)\n\n/**\n * Sets the search state `selectedFilters` with a selectedHistoryQuery's filters.\n *\n * @public\n */\nexport const setSearchSelectedFiltersFromHistoryQuery = wireCommit(\n 'setSelectedFilters',\n ({ eventPayload: { selectedFilters } }) => selectedFilters ?? [],\n)\n\n/**\n * Search wiring.\n *\n * @internal\n */\nexport const searchWiring = createWiring({\n ParamsLoadedFromUrl: {\n setUrlParams,\n saveOriginWire,\n },\n PartialResultsChanged: {\n fetchAndSavePartialResultsEnrichmentWire,\n },\n UserAcceptedAQuery: {\n setSearchQuery,\n saveOriginWire,\n },\n UserAcceptedSpellcheckQuery: {\n resetSpellcheckQuery,\n },\n UserClearedQuery: {\n setSearchQuery,\n cancelFetchAndSaveSearchResponseWire,\n resetFromNoResultsWithFilters,\n resetIsNoResults,\n },\n UserClickedASort: {\n setSort,\n },\n UserPickedARelatedTag: {\n saveOriginWire,\n },\n UserReachedResultsListEnd: {\n increasePageAppendingResultsWire,\n },\n SearchRequestUpdated: {\n resetStateIfNoRequestWire,\n fetchAndSaveSearchResponseWire,\n },\n SearchRequestChanged: {\n resetRequestOnRefinementWire,\n },\n SelectedRelatedTagsChanged: {\n setRelatedTags,\n },\n SelectedFiltersForRequestChanged: {\n setSelectedFilters,\n },\n ResultsChanged: {\n resetAppending,\n fetchAndSaveResultsEnrichmentWire,\n },\n ReloadSearchRequested: {\n resetStateForReloadWire,\n },\n SelectedSortProvided: {\n setSort,\n },\n ExtraParamsChanged: {\n setSearchExtraParams,\n },\n UserClickedCloseX: {\n clearSearchQuery,\n },\n UserClickedOutOfMainModal: {\n clearSearchQuery,\n },\n UserBrowsedToCategory: {\n clearSearchQuery,\n },\n UserAcceptedAQueryPreview: {\n setSearchQueryFromPreview,\n setSearchExtraParamsFromPreview,\n setSearchSelectedFiltersFromPreview,\n saveOriginWire,\n },\n QueryPreviewUnselected: {\n setSearchExtraParams,\n },\n UserSelectedAHistoryQuery: {\n setSearchSelectedFiltersFromHistoryQuery,\n },\n UserSelectedAPage: {\n setSearchPage,\n resetAppending,\n },\n})\n"],"names":[],"mappings":";;;;;;AAaA;;;;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;;;;AAIG;AACH,MAAM,YAAY,GAAG,sBAAsB,CAAC,UAAU,CAAC;AAEvD;;;;AAIG;AACH,MAAM,0BAA0B,GAAG,oCAAoC,CAAC,UAAU,CAAC;AAEnF;;;;AAIG;MACU,oCAAoC,GAAG,0BAA0B,CAC5E,kCAAkC;AAGpC;;;;AAIG;AACI,MAAM,cAAc,GAAG,YAAY,CAAC,YAAY,EAAE,CAAC,EAAE,QAAQ,EAAE,K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AAyB,EAAE;QACzB,gCAAgC;AACjC,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,yBAAyB;QACzB,8BAA8B;AAC/B,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,4BAA4B;AAC7B,KAAA;AACD,IAAA,0BAA0B,EAAE;QAC1B,cAAc;AACf,KAAA;AACD,IAAA,gCAAgC,EAAE;QAChC,kBAAkB;AACnB,KAAA;AACD,IAAA,cAAc,EAAE;QACd,cAAc;QACd,iCAAiC;AAClC,KAAA;AACD,IAAA,qBAAqB,EAAE;QACrB,uBAAuB;AACxB,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,OAAO;AACR,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,oBAAoB;AACrB,KAAA;AACD,IAAA,iBAAiB,EAAE;QACjB,gBAAgB;AACjB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,gBAAgB;AACjB,KAAA;AACD,IAAA,qBAAqB,EAAE;QACrB,gBAAgB;AACjB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,yBAAyB;QACzB,+BAA+B;QAC/B,mCAAmC;QACnC,cAAc;AACf,KAAA;AACD,IAAA,sBAAsB,EAAE;QACtB,oBAAoB;AACrB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,wCAAwC;AACzC,KAAA;AACD,IAAA,iBAAiB,EAAE;QACjB,aAAa;QACb,cAAc;AACf,KAAA;AACF,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/search/wiring.ts"],"sourcesContent":["import type { WirePayload } from '../../wiring'\nimport type { InternalSearchRequest } from './types'\nimport { createRawFilters } from '../../utils'\nimport {\n createWiring,\n filterTruthyPayload,\n namespacedWireCommit,\n namespacedWireCommitWithoutPayload,\n namespacedWireDispatch,\n namespacedWireDispatchWithoutPayload,\n} from '../../wiring'\n\n/**\n * `search` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'search'\n\n/**\n * WireCommit for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireCommit = namespacedWireCommit(moduleName)\n\n/**\n * WireCommit without Payload for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireCommitWithoutPayload = namespacedWireCommitWithoutPayload(moduleName)\n\n/**\n * WireDispatch for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireDispatch = namespacedWireDispatch(moduleName)\n\n/**\n * WireDispatchWithoutPayload for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName)\n\n/**\n * Cancels the {@link SearchActions.fetchAndSaveSearchResponse} request promise.\n *\n * @public\n */\nexport const cancelFetchAndSaveSearchResponseWire = wireDispatchWithoutPayload(\n 'cancelFetchAndSaveSearchResponse',\n)\n\n/**\n * Sets the search state `origin`.\n *\n * @public\n */\nexport const saveOriginWire = wireDispatch('saveOrigin', ({ metadata }) => metadata)\n\n/**\n * Requests and stores the search response.\n *\n * @public\n */\nexport const fetchAndSaveSearchResponseWire = wireDispatch('fetchAndSaveSearchResponse')\n\n/**\n * Resets the search state `spellcheckedQuery` to its initial value, an empty string.\n *\n * @public\n */\nexport const resetSpellcheckQuery = wireCommit('setSpellcheck', '')\n\n/**\n * Sets the search state `relatedTags`.\n *\n * @public\n */\nexport const setRelatedTags = wireCommit('setRelatedTags')\n\n/**\n * Sets the search state `query`.\n *\n * @public\n */\nexport const setSearchQuery = wireCommit('setQuery')\n\n/**\n * Clears the search state `query`.\n *\n * @public\n */\nexport const clearSearchQuery = wireCommit('setQuery', '')\n\n/**\n * Sets the search state `selectedFilters`.\n *\n * @public\n */\nexport const setSelectedFilters = wireCommit('setSelectedFilters')\n\n/**\n * Sets the search state `sort`.\n *\n * @public\n */\nexport const setSort = wireCommit('setSort')\n\n/**\n * Sets the search state `query`.\n *\n * @public\n */\nexport const setUrlParams = wireDispatch('setUrlParams')\n\n/**\n * Sets the search state `page`.\n *\n * @public\n */\nexport const setSearchPage = wireCommit('setPage')\n\n/**\n * Sets the search state `params`.\n *\n * @public\n */\nexport const setSearchExtraParams = wireCommit('setParams')\n\n/**\n * Resets the search state to reload the current search.\n *\n * @public\n */\nexport const resetStateForReloadWire = wireCommitWithoutPayload('resetStateForReload')\n\n/**\n * Resets the search state `isNoResults`.\n *\n * @public\n */\nexport const resetIsNoResults = wireCommit('setIsNoResults', false)\n\n/**\n * Resets the search state `fromNoResultsWithFilters`.\n *\n * @public\n */\nexport const resetFromNoResultsWithFilters = wireCommit('setFromNoResultsWithFilters', false)\n\n/**\n * Increases the current search state `page` by one.\n *\n * @public\n */\nexport const increasePageAppendingResultsWire = wireDispatchWithoutPayload(\n 'increasePageAppendingResults',\n)\n\n/**\n * Resets the search state `isAppendingResults`.\n *\n * @public\n */\nexport const resetAppending = wireCommit('setIsAppendResults', false)\n\n/**\n * Resets the {@link SearchGetters.request} parameters when refining request and before the actual\n * request is launched.\n *\n * @public\n */\nexport const resetRequestOnRefinementWire = wireDispatch(\n 'resetRequestOnRefinement',\n ({ eventPayload: newRequest, metadata: { oldValue } }: WirePayload<InternalSearchRequest>) => ({\n newRequest,\n oldRequest: oldValue as InternalSearchRequest,\n }),\n)\n\n/**\n * Resets the search state when the request is changed to null. See the\n * {@link SearchXStoreModule} for details.\n *\n * @public\n */\nexport const resetStateIfNoRequestWire = filterTruthyPayload<InternalSearchRequest | null>(\n wireCommitWithoutPayload('resetState'),\n)\n\n/**\n * Sets the search state `query` with the selectedQueryPreview's query.\n *\n * @public\n */\nexport const setSearchQueryFromPreview = wireCommit(\n 'setQuery',\n ({ eventPayload: { query } }) => query,\n)\n\n/**\n * Sets the search state `params` with the selectedQueryPreview's extraParams.\n *\n * @public\n */\nexport const setSearchExtraParamsFromPreview = wireCommit(\n 'setParams',\n ({ eventPayload: { extraParams } }) => extraParams,\n)\n\n/**\n * Sets the search state `selectedFilters` with the selectedQueryPreview's filters.\n *\n * @public\n */\nexport const setSearchSelectedFiltersFromPreview = wireCommit(\n 'setSelectedFilters',\n ({ eventPayload: { filters } }) => (filters ? createRawFilters(filters) : []),\n)\n\n/**\n * Sets the search state `selectedFilters` with a selectedHistoryQuery's filters.\n *\n * @public\n */\nexport const setSearchSelectedFiltersFromHistoryQuery = wireCommit(\n 'setSelectedFilters',\n ({ eventPayload: { selectedFilters } }) => selectedFilters ?? [],\n)\n\n/**\n * Search wiring.\n *\n * @internal\n */\nexport const searchWiring = createWiring({\n ParamsLoadedFromUrl: {\n setUrlParams,\n saveOriginWire,\n },\n UserAcceptedAQuery: {\n setSearchQuery,\n saveOriginWire,\n },\n UserAcceptedSpellcheckQuery: {\n resetSpellcheckQuery,\n },\n UserClearedQuery: {\n setSearchQuery,\n cancelFetchAndSaveSearchResponseWire,\n resetFromNoResultsWithFilters,\n resetIsNoResults,\n },\n UserClickedASort: {\n setSort,\n },\n UserPickedARelatedTag: {\n saveOriginWire,\n },\n UserReachedResultsListEnd: {\n increasePageAppendingResultsWire,\n },\n SearchRequestUpdated: {\n resetStateIfNoRequestWire,\n fetchAndSaveSearchResponseWire,\n },\n SearchRequestChanged: {\n resetRequestOnRefinementWire,\n },\n SelectedRelatedTagsChanged: {\n setRelatedTags,\n },\n SelectedFiltersForRequestChanged: {\n setSelectedFilters,\n },\n ResultsChanged: {\n resetAppending,\n },\n ReloadSearchRequested: {\n resetStateForReloadWire,\n },\n SelectedSortProvided: {\n setSort,\n },\n ExtraParamsChanged: {\n setSearchExtraParams,\n },\n UserClickedCloseX: {\n clearSearchQuery,\n },\n UserClickedOutOfMainModal: {\n clearSearchQuery,\n },\n UserBrowsedToCategory: {\n clearSearchQuery,\n },\n UserAcceptedAQueryPreview: {\n setSearchQueryFromPreview,\n setSearchExtraParamsFromPreview,\n setSearchSelectedFiltersFromPreview,\n saveOriginWire,\n },\n QueryPreviewUnselected: {\n setSearchExtraParams,\n },\n UserSelectedAHistoryQuery: {\n setSearchSelectedFiltersFromHistoryQuery,\n },\n UserSelectedAPage: {\n setSearchPage,\n resetAppending,\n },\n})\n"],"names":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ACrB,KAAA;AACD,IAAA,gBAAgB,EAAE;QAChB,cAAc;QACd,oCAAoC;QACpC,6BAA6B;QAC7B,gBAAgB;AACjB,KAAA;AACD,IAAA,gBAAgB,EAAE;QAChB,OAAO;AACR,KAAA;AACD,IAAA,qBAAqB,EAAE;QACrB,cAAc;AACf,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,gCAAgC;AACjC,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,yBAAyB;QACzB,8BAA8B;AAC/B,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,4BAA4B;AAC7B,KAAA;AACD,IAAA,0BAA0B,EAAE;QAC1B,cAAc;AACf,KAAA;AACD,IAAA,gCAAgC,EAAE;QAChC,kBAAkB;AACnB,KAAA;AACD,IAAA,cAAc,EAAE;QACd,cAAc;AACf,KAAA;AACD,IAAA,qBAAqB,EAAE;QACrB,uBAAuB;AACxB,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,OAAO;AACR,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,oBAAoB;AACrB,KAAA;AACD,IAAA,iBAAiB,EAAE;QACjB,gBAAgB;AACjB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,gBAAgB;AACjB,KAAA;AACD,IAAA,qBAAqB,EAAE;QACrB,gBAAgB;AACjB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,yBAAyB;QACzB,+BAA+B;QAC/B,mCAAmC;QACnC,cAAc;AACf,KAAA;AACD,IAAA,sBAAsB,EAAE;QACtB,oBAAoB;AACrB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,wCAAwC;AACzC,KAAA;AACD,IAAA,iBAAiB,EAAE;QACjB,aAAa;QACb,cAAc;AACf,KAAA;AACF,CAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empathyco/x-components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.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": "
|
|
120
|
+
"gitHead": "d284e912e5fa4e7d650d955e412593d09a81a9ac"
|
|
121
121
|
}
|
package/queries-preview/index.js
CHANGED
|
@@ -6,5 +6,6 @@ export { fetchAndSaveQueryPreview } from '../js/x-modules/queries-preview/store/
|
|
|
6
6
|
export { fetchQueryPreview } from '../js/x-modules/queries-preview/store/actions/fetch-query-preview.action.js';
|
|
7
7
|
export { queriesPreviewEmitters } from '../js/x-modules/queries-preview/store/emitters.js';
|
|
8
8
|
export { queriesPreviewXStoreModule } from '../js/x-modules/queries-preview/store/module.js';
|
|
9
|
-
export {
|
|
9
|
+
export { getHashFromQueryPreviewInfo, getHashFromQueryPreviewItem } from '../js/x-modules/queries-preview/utils/get-hash-from-query-preview.js';
|
|
10
|
+
export { addQueryPreviewInstanceWire, clearQueryPreviewWire, clearSelectedQueryPreviewWire, fetchAndSaveQueryPreviewWire, queriesPreviewWiring, removeQueryPreviewInstanceWire, setQueriesPreviewExtraParamsWire, setSelectedQueryPreviewWire } from '../js/x-modules/queries-preview/wiring.js';
|
|
10
11
|
export { queriesPreviewXModule } from '../js/x-modules/queries-preview/x-module.js';
|