@empathyco/x-components 3.0.0-alpha.420 → 3.0.0-alpha.421
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 +9 -0
- package/docs/API-reference/api/x-components.historyqueriesmutations.md +1 -0
- package/docs/API-reference/api/x-components.historyqueriesmutations.setsearchselectedfilters.md +24 -0
- package/docs/API-reference/api/x-components.md +3 -0
- package/docs/API-reference/api/x-components.setfiltersfromhistoryqueries.md +13 -0
- package/docs/API-reference/api/x-components.setsearchselectedfilters.md +13 -0
- package/docs/API-reference/api/x-components.setsearchselectedfiltersfrompreviewable.md +13 -0
- package/docs/API-reference/api/x-types.historyquery.md +1 -0
- package/docs/API-reference/api/x-types.historyquery.selectedfilters.md +13 -0
- package/facets/index.js +1 -1
- package/history-queries/index.js +1 -1
- package/js/index.js +3 -3
- package/js/x-modules/facets/wiring.js +10 -1
- package/js/x-modules/facets/wiring.js.map +1 -1
- package/js/x-modules/history-queries/store/actions/update-history-queries-with-search-response.action.js +22 -7
- package/js/x-modules/history-queries/store/actions/update-history-queries-with-search-response.action.js.map +1 -1
- package/js/x-modules/history-queries/store/module.js +3 -0
- package/js/x-modules/history-queries/store/module.js.map +1 -1
- package/js/x-modules/history-queries/wiring.js +10 -1
- package/js/x-modules/history-queries/wiring.js.map +1 -1
- package/js/x-modules/search/wiring.js +10 -1
- package/js/x-modules/search/wiring.js.map +1 -1
- package/package.json +4 -4
- package/report/x-components.api.json +134 -0
- package/report/x-components.api.md +19 -0
- package/report/x-types.api.json +32 -0
- package/search/index.js +1 -1
- package/types/x-modules/facets/wiring.d.ts +9 -0
- package/types/x-modules/facets/wiring.d.ts.map +1 -1
- package/types/x-modules/history-queries/store/actions/update-history-queries-with-search-response.action.d.ts +1 -2
- package/types/x-modules/history-queries/store/actions/update-history-queries-with-search-response.action.d.ts.map +1 -1
- package/types/x-modules/history-queries/store/module.d.ts.map +1 -1
- package/types/x-modules/history-queries/store/types.d.ts +7 -1
- package/types/x-modules/history-queries/store/types.d.ts.map +1 -1
- package/types/x-modules/history-queries/wiring.d.ts +9 -0
- package/types/x-modules/history-queries/wiring.d.ts.map +1 -1
- package/types/x-modules/search/wiring.d.ts +9 -0
- package/types/x-modules/search/wiring.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.0.0-alpha.421](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.420...@empathyco/x-components@3.0.0-alpha.421) (2023-10-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* filters in history queries (#1315) ([1e266d9](https://github.com/empathyco/x/commit/1e266d9ce8dbf5661488800bc9566f117c1616f5))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
6
15
|
## [3.0.0-alpha.420](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.419...@empathyco/x-components@3.0.0-alpha.420) (2023-10-11)
|
|
7
16
|
|
|
8
17
|
**Note:** Version bump only for package @empathyco/x-components
|
|
@@ -20,5 +20,6 @@ export interface HistoryQueriesMutations extends QueryMutations
|
|
|
20
20
|
| [setHistoryQueries(historyQueries)](./x-components.historyqueriesmutations.sethistoryqueries.md) | Sets the [HistoryQueriesState.historyQueries](./x-components.historyqueriesstate.historyqueries.md) property. |
|
|
21
21
|
| [setIsEnabled(isEnabled)](./x-components.historyqueriesmutations.setisenabled.md) | Sets the [HistoryQueriesState.isEnabled](./x-components.historyqueriesstate.isenabled.md) property. |
|
|
22
22
|
| [setQuery(query)](./x-components.historyqueriesmutations.setquery.md) | Sets the [HistoryQueriesState.query](./x-components.historyqueriesstate.query.md) property. |
|
|
23
|
+
| [setSearchSelectedFilters(filters)](./x-components.historyqueriesmutations.setsearchselectedfilters.md) | Sets the [HistoryQueriesState.historyQueries](./x-components.historyqueriesstate.historyqueries.md) filters property. |
|
|
23
24
|
| [setSessionTimeStamp(timeStamp)](./x-components.historyqueriesmutations.setsessiontimestamp.md) | Sets the [HistoryQueriesState.sessionTimeStampInMs](./x-components.historyqueriesstate.sessiontimestampinms.md) property. |
|
|
24
25
|
|
package/docs/API-reference/api/x-components.historyqueriesmutations.setsearchselectedfilters.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [HistoryQueriesMutations](./x-components.historyqueriesmutations.md) > [setSearchSelectedFilters](./x-components.historyqueriesmutations.setsearchselectedfilters.md)
|
|
4
|
+
|
|
5
|
+
## HistoryQueriesMutations.setSearchSelectedFilters() method
|
|
6
|
+
|
|
7
|
+
Sets the [HistoryQueriesState.historyQueries](./x-components.historyqueriesstate.historyqueries.md) filters property.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
setSearchSelectedFilters(filters: Filter[]): void;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| filters | Filter\[\] | The new [HistoryQueriesState.historyQueries](./x-components.historyqueriesstate.historyqueries.md) filters. |
|
|
20
|
+
|
|
21
|
+
**Returns:**
|
|
22
|
+
|
|
23
|
+
void
|
|
24
|
+
|
|
@@ -586,6 +586,7 @@ X-Components is a library usable everywhere not only for search experiences.
|
|
|
586
586
|
| [sessionHistoryQueries](./x-components.sessionhistoryqueries.md) | Default implementation for the [HistoryQueriesGetters.sessionHistoryQueries](./x-components.historyqueriesgetters.sessionhistoryqueries.md) getter. |
|
|
587
587
|
| [setConsent](./x-components.setconsent.md) | Sets the tagging state <code>consent</code>. |
|
|
588
588
|
| [setExtraParams](./x-components.setextraparams.md) | Sets the extra params of the [ExtraParamsXModule](./x-components.extraparamsxmodule.md)<!-- -->. |
|
|
589
|
+
| [setFiltersFromHistoryQueries](./x-components.setfiltersfromhistoryqueries.md) | Sets the filters of the facets module from a selectedHistoryQuery's filters. |
|
|
589
590
|
| [setHistoryQueries](./x-components.sethistoryqueries.md) | Default implementation for the [HistoryQueriesActions.setHistoryQueries()](./x-components.historyqueriesactions.sethistoryqueries.md)<!-- -->. |
|
|
590
591
|
| [setHistoryQueriesDisabled](./x-components.sethistoryqueriesdisabled.md) | Disables history queries. |
|
|
591
592
|
| [setHistoryQueriesEnabled](./x-components.sethistoryqueriesenabled.md) | Enables history queries. |
|
|
@@ -632,7 +633,9 @@ X-Components is a library usable everywhere not only for search experiences.
|
|
|
632
633
|
| [setSearchPage](./x-components.setsearchpage.md) | Sets the search state <code>page</code>. |
|
|
633
634
|
| [setSearchQuery](./x-components.setsearchquery.md) | Sets the search state <code>query</code>. |
|
|
634
635
|
| [setSearchQueryFromPreview](./x-components.setsearchqueryfrompreview.md) | Sets the search state <code>query</code> with the selectedQueryPreview's query. |
|
|
636
|
+
| [setSearchSelectedFilters](./x-components.setsearchselectedfilters.md) | Sets the history queries state <code>filters</code> with a selectedHistoryQuery's filters. |
|
|
635
637
|
| [setSearchSelectedFiltersFromPreview](./x-components.setsearchselectedfiltersfrompreview.md) | Sets the search state <code>selectedFilters</code> with the selectedQueryPreview's filters. |
|
|
638
|
+
| [setSearchSelectedFiltersFromPreviewable](./x-components.setsearchselectedfiltersfrompreviewable.md) | Sets the search state <code>selectedFilters</code> with a selectedHistoryQuery's filters. |
|
|
636
639
|
| [setSearchUrlParams](./x-components.setsearchurlparams.md) | Default implementation for the [SearchActions.setUrlParams()](./x-components.searchactions.seturlparams.md)<!-- -->. |
|
|
637
640
|
| [setSelectedFilters](./x-components.setselectedfilters.md) | Sets the search state <code>selectedFilters</code>. |
|
|
638
641
|
| [setSelectedFiltersFromPreview](./x-components.setselectedfiltersfrompreview.md) | Sets the filters of the facets module from a queryPreview's filters. |
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [setFiltersFromHistoryQueries](./x-components.setfiltersfromhistoryqueries.md)
|
|
4
|
+
|
|
5
|
+
## setFiltersFromHistoryQueries variable
|
|
6
|
+
|
|
7
|
+
Sets the filters of the facets module from a selectedHistoryQuery's filters.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
setFiltersFromHistoryQueries: import("../../wiring/wiring.types").AnyWire
|
|
13
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [setSearchSelectedFilters](./x-components.setsearchselectedfilters.md)
|
|
4
|
+
|
|
5
|
+
## setSearchSelectedFilters variable
|
|
6
|
+
|
|
7
|
+
Sets the history queries state `filters` with a selectedHistoryQuery's filters.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
setSearchSelectedFilters: import("../..").AnyWire
|
|
13
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [setSearchSelectedFiltersFromPreviewable](./x-components.setsearchselectedfiltersfrompreviewable.md)
|
|
4
|
+
|
|
5
|
+
## setSearchSelectedFiltersFromPreviewable variable
|
|
6
|
+
|
|
7
|
+
Sets the search state `selectedFilters` with a selectedHistoryQuery's filters.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
setSearchSelectedFiltersFromPreviewable: import("../../wiring").AnyWire
|
|
13
|
+
```
|
|
@@ -17,5 +17,6 @@ export interface HistoryQuery extends Previewable, NamedModel<'HistoryQuery'>
|
|
|
17
17
|
|
|
18
18
|
| Property | Modifiers | Type | Description |
|
|
19
19
|
| --- | --- | --- | --- |
|
|
20
|
+
| [selectedFilters?](./x-types.historyquery.selectedfilters.md) | | [Filter](./x-types.filter.md)<!-- -->\[\] | _(Optional)_ Filters selected for the query to search for. |
|
|
20
21
|
| [timestamp](./x-types.historyquery.timestamp.md) | | number | Timestamp when the history query was created. |
|
|
21
22
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-types](./x-types.md) > [HistoryQuery](./x-types.historyquery.md) > [selectedFilters](./x-types.historyquery.selectedfilters.md)
|
|
4
|
+
|
|
5
|
+
## HistoryQuery.selectedFilters property
|
|
6
|
+
|
|
7
|
+
Filters selected for the query to search for.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
selectedFilters?: Filter[];
|
|
13
|
+
```
|
package/facets/index.js
CHANGED
|
@@ -4,7 +4,7 @@ export { selectedFilters } from '../js/x-modules/facets/store/getters/selected-f
|
|
|
4
4
|
export { selectedFiltersByFacet } from '../js/x-modules/facets/store/getters/selected-filters-by-facet.getter.js';
|
|
5
5
|
export { facetsEmitters } from '../js/x-modules/facets/store/emitters.js';
|
|
6
6
|
export { facetsXStoreModule } from '../js/x-modules/facets/store/module.js';
|
|
7
|
-
export { facetsWiring, setQueryFromPreview, setSelectedFiltersFromPreview } from '../js/x-modules/facets/wiring.js';
|
|
7
|
+
export { facetsWiring, setFiltersFromHistoryQueries, setQueryFromPreview, setSelectedFiltersFromPreview } from '../js/x-modules/facets/wiring.js';
|
|
8
8
|
export { DefaultFacetsService } from '../js/x-modules/facets/service/facets.service.js';
|
|
9
9
|
export { EditableNumberRangeFilterEntity } from '../js/x-modules/facets/entities/editable-number-range-filter.entity.js';
|
|
10
10
|
export { FilterEntityFactory } from '../js/x-modules/facets/entities/filter-entity.factory.js';
|
package/history-queries/index.js
CHANGED
|
@@ -14,5 +14,5 @@ export { HistoryQueriesGetter, historyQueries } from '../js/x-modules/history-qu
|
|
|
14
14
|
export { sessionHistoryQueries } from '../js/x-modules/history-queries/store/getters/session-history-queries.getter.js';
|
|
15
15
|
export { storageKey } from '../js/x-modules/history-queries/store/getters/storage-key.getter.js';
|
|
16
16
|
export { historyQueriesXStoreModule } from '../js/x-modules/history-queries/store/module.js';
|
|
17
|
-
export { addQueryToHistoryQueries, addQueryToHistoryQueriesFromPreview, clearHistoryQueries, clearHistoryQueriesQuery, historyQueriesWiring, loadHistoryQueriesFromBrowserStorageWire, refreshHistoryQueriesSession, removeHistoryQuery, setHistoryQueriesDisabled, setHistoryQueriesEnabled, setHistoryQueriesQuery, setHistoryQueriesQueryFromPreview, updateHistoryQueriesWithSearchResponse } from '../js/x-modules/history-queries/wiring.js';
|
|
17
|
+
export { addQueryToHistoryQueries, addQueryToHistoryQueriesFromPreview, clearHistoryQueries, clearHistoryQueriesQuery, historyQueriesWiring, loadHistoryQueriesFromBrowserStorageWire, refreshHistoryQueriesSession, removeHistoryQuery, setHistoryQueriesDisabled, setHistoryQueriesEnabled, setHistoryQueriesQuery, setHistoryQueriesQueryFromPreview, setSearchSelectedFilters, updateHistoryQueriesWithSearchResponse } from '../js/x-modules/history-queries/wiring.js';
|
|
18
18
|
export { historyQueriesXModule } from '../js/x-modules/history-queries/x-module.js';
|
package/js/index.js
CHANGED
|
@@ -210,7 +210,7 @@ export { selectedFilters } from './x-modules/facets/store/getters/selected-filte
|
|
|
210
210
|
export { selectedFiltersByFacet } from './x-modules/facets/store/getters/selected-filters-by-facet.getter.js';
|
|
211
211
|
export { facetsEmitters } from './x-modules/facets/store/emitters.js';
|
|
212
212
|
export { facetsXStoreModule } from './x-modules/facets/store/module.js';
|
|
213
|
-
export { facetsWiring, setQueryFromPreview, setSelectedFiltersFromPreview } from './x-modules/facets/wiring.js';
|
|
213
|
+
export { facetsWiring, setFiltersFromHistoryQueries, setQueryFromPreview, setSelectedFiltersFromPreview } from './x-modules/facets/wiring.js';
|
|
214
214
|
export { DefaultFacetsService } from './x-modules/facets/service/facets.service.js';
|
|
215
215
|
export { EditableNumberRangeFilterEntity } from './x-modules/facets/entities/editable-number-range-filter.entity.js';
|
|
216
216
|
export { FilterEntityFactory } from './x-modules/facets/entities/filter-entity.factory.js';
|
|
@@ -257,7 +257,7 @@ export { HistoryQueriesGetter, historyQueries } from './x-modules/history-querie
|
|
|
257
257
|
export { sessionHistoryQueries } from './x-modules/history-queries/store/getters/session-history-queries.getter.js';
|
|
258
258
|
export { storageKey } from './x-modules/history-queries/store/getters/storage-key.getter.js';
|
|
259
259
|
export { historyQueriesXStoreModule } from './x-modules/history-queries/store/module.js';
|
|
260
|
-
export { addQueryToHistoryQueries, addQueryToHistoryQueriesFromPreview, clearHistoryQueries, clearHistoryQueriesQuery, historyQueriesWiring, loadHistoryQueriesFromBrowserStorageWire, refreshHistoryQueriesSession, removeHistoryQuery, setHistoryQueriesDisabled, setHistoryQueriesEnabled, setHistoryQueriesQuery, setHistoryQueriesQueryFromPreview, updateHistoryQueriesWithSearchResponse } from './x-modules/history-queries/wiring.js';
|
|
260
|
+
export { addQueryToHistoryQueries, addQueryToHistoryQueriesFromPreview, clearHistoryQueries, clearHistoryQueriesQuery, historyQueriesWiring, loadHistoryQueriesFromBrowserStorageWire, refreshHistoryQueriesSession, removeHistoryQuery, setHistoryQueriesDisabled, setHistoryQueriesEnabled, setHistoryQueriesQuery, setHistoryQueriesQueryFromPreview, setSearchSelectedFilters, updateHistoryQueriesWithSearchResponse } from './x-modules/history-queries/wiring.js';
|
|
261
261
|
export { historyQueriesXModule } from './x-modules/history-queries/x-module.js';
|
|
262
262
|
export { default as IdentifierResult } from './x-modules/identifier-results/components/identifier-result.vue.js';
|
|
263
263
|
export { default as IdentifierResults } from './x-modules/identifier-results/components/identifier-results.vue.js';
|
|
@@ -373,7 +373,7 @@ export { searchEmitters } from './x-modules/search/store/emitters.js';
|
|
|
373
373
|
export { request as searchRequest } from './x-modules/search/store/getters/request.getter.js';
|
|
374
374
|
export { query as searchQuery } from './x-modules/search/store/getters/query.getter.js';
|
|
375
375
|
export { resettableState, searchXStoreModule } from './x-modules/search/store/module.js';
|
|
376
|
-
export { cancelFetchAndSaveSearchResponseWire, clearSearchQuery, fetchAndSaveSearchResponseWire, increasePageAppendingResultsWire, resetAppending, resetFromNoResultsWithFilters, resetIsNoResults, resetRequestOnRefinementWire, resetSpellcheckQuery, resetStateIfNoRequestWire, saveOriginWire, searchWiring, setRelatedTags, setSearchExtraParams, setSearchExtraParamsFromPreview, setSearchPage, setSearchQuery, setSearchQueryFromPreview, setSearchSelectedFiltersFromPreview, setSelectedFilters, setSort, setUrlParams } from './x-modules/search/wiring.js';
|
|
376
|
+
export { cancelFetchAndSaveSearchResponseWire, clearSearchQuery, fetchAndSaveSearchResponseWire, increasePageAppendingResultsWire, resetAppending, resetFromNoResultsWithFilters, resetIsNoResults, resetRequestOnRefinementWire, resetSpellcheckQuery, resetStateIfNoRequestWire, saveOriginWire, searchWiring, setRelatedTags, setSearchExtraParams, setSearchExtraParamsFromPreview, setSearchPage, setSearchQuery, setSearchQueryFromPreview, setSearchSelectedFiltersFromPreview, setSearchSelectedFiltersFromPreviewable, setSelectedFilters, setSort, setUrlParams } from './x-modules/search/wiring.js';
|
|
377
377
|
export { searchXModule } from './x-modules/search/x-module.js';
|
|
378
378
|
export { default as ClearSearchInput } from './x-modules/search-box/components/clear-search-input.vue.js';
|
|
379
379
|
export { default as SearchButton } from './x-modules/search-box/components/search-button.vue.js';
|
|
@@ -127,6 +127,12 @@ const clearStickyFilters = filter(wireCommitWithoutPayload('clearStickyFilters')
|
|
|
127
127
|
* @public
|
|
128
128
|
*/
|
|
129
129
|
const setSelectedFiltersFromPreview = wireCommit('setFilters', ({ eventPayload: { filters } }) => (filters ? createRawFilters(filters) : []));
|
|
130
|
+
/**
|
|
131
|
+
* Sets the filters of the facets module from a selectedHistoryQuery's filters.
|
|
132
|
+
*
|
|
133
|
+
* @public
|
|
134
|
+
*/
|
|
135
|
+
const setFiltersFromHistoryQueries = wireCommit('setFilters', ({ eventPayload: { selectedFilters } }) => selectedFilters);
|
|
130
136
|
/**
|
|
131
137
|
* Sets the query of the facets module from a queryPreview.
|
|
132
138
|
*
|
|
@@ -187,8 +193,11 @@ const facetsWiring = createWiring({
|
|
|
187
193
|
UserAcceptedAQueryPreview: {
|
|
188
194
|
setQueryFromPreview,
|
|
189
195
|
setSelectedFiltersFromPreview
|
|
196
|
+
},
|
|
197
|
+
UserSelectedAHistoryQuery: {
|
|
198
|
+
setFiltersFromHistoryQueries
|
|
190
199
|
}
|
|
191
200
|
});
|
|
192
201
|
|
|
193
|
-
export { facetsWiring, setQueryFromPreview, setSelectedFiltersFromPreview };
|
|
202
|
+
export { facetsWiring, setFiltersFromHistoryQueries, setQueryFromPreview, setSelectedFiltersFromPreview };
|
|
194
203
|
//# sourceMappingURL=wiring.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/facets/wiring.ts"],"sourcesContent":["import { Facet } from '@empathyco/x-types';\nimport { UrlParams } from '../../types/url-params';\nimport { createRawFilters } from '../../utils/filters';\nimport { wireService, wireServiceWithoutPayload } from '../../wiring/wires.factory';\nimport { filter, mapWire } from '../../wiring/wires.operators';\nimport { createWiring } from '../../wiring/wiring.utils';\nimport {\n namespacedWireCommit,\n namespacedWireCommitWithoutPayload,\n XEventPayload\n} from '../../wiring/index';\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 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});\n"],"names":[],"mappings":";;;;;;;AAaA;;;;AAIG;AACH,MAAM,UAAU,GAAG,QAAQ,CAAC;AAE5B;;;;AAIG;AACH,MAAM,UAAU,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAEpD;;;;AAIG;AACH,MAAM,wBAAwB,GAAG,kCAAkC,CAAC,UAAU,CAAC,CAAC;AAEhF;;AAEG;AACH,MAAM,iBAAiB,GAAG,WAAW,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;AAErE;;AAEG;AACH,MAAM,+BAA+B,GAAG,yBAAyB,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;AAEjG;;;;;AAKG;AACH,MAAM,qCAAqC,GAAG,OAAO,CACnD,iBAAiB,CAAC,cAAc,CAAC,EACjC,CAAC,MAAe,MAAM;IACpB,MAAM;AACN,IAAA,EAAE,EAAE,QAAQ;AACb,CAAA,CAAC,CACH,CAAC;AAEF;;;;;AAKG;AACH,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,WAAW,CAAC,CAAC;AAE1D;;;;AAIG;AACH,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAErD;;;;;AAKG;AACH,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,cAAc,CAAC,CAAC;AAE3D;;;;AAIG;AACH,MAAM,mBAAmB,GAAG,+BAA+B,CAAC,cAAc,CAAC,CAAC;AAE5E;;;;AAIG;AACH,MAAM,4BAA4B,GAAG,iBAAiB,CAAC,0BAA0B,EAAE;AACjF,IAAA,QAAQ,EAAE;AACR,QAAA,UAAU,EAAE,IAAI;AACjB,KAAA;AACF,CAAA,CAAC,CAAC;AAEH;;;;AAIG;AACH,MAAM,4BAA4B,GAAG,MAAM,CACzC,4BAA4B,EAC5B,CAAC,EAAE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qC;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,gBAAgB,EAAE;QAChB,2BAA2B;AAC5B,KAAA;AACD,IAAA,qBAAqB,EAAE;QACrB,kBAAkB;AACnB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,mBAAmB;QACnB,6BAA6B;AAC9B,KAAA;AACF,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/facets/wiring.ts"],"sourcesContent":["import { Facet } from '@empathyco/x-types';\nimport { UrlParams } from '../../types/url-params';\nimport { createRawFilters } from '../../utils/filters';\nimport { wireService, wireServiceWithoutPayload } from '../../wiring/wires.factory';\nimport { filter, mapWire } from '../../wiring/wires.operators';\nimport { createWiring } from '../../wiring/wiring.utils';\nimport {\n namespacedWireCommit,\n namespacedWireCommitWithoutPayload,\n XEventPayload\n} from '../../wiring/index';\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":";;;;;;;AAaA;;;;AAIG;AACH,MAAM,UAAU,GAAG,QAAQ,CAAC;AAE5B;;;;AAIG;AACH,MAAM,UAAU,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAEpD;;;;AAIG;AACH,MAAM,wBAAwB,GAAG,kCAAkC,CAAC,UAAU,CAAC,CAAC;AAEhF;;AAEG;AACH,MAAM,iBAAiB,GAAG,WAAW,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;AAErE;;AAEG;AACH,MAAM,+BAA+B,GAAG,yBAAyB,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;AAEjG;;;;;AAKG;AACH,MAAM,qCAAqC,GAAG,OAAO,CACnD,iBAAiB,CAAC,cAAc,CAAC,EACjC,CAAC,MAAe,MAAM;IACpB,MAAM;AACN,IAAA,EAAE,EAAE,QAAQ;AACb,CAAA,CAAC,CACH,CAAC;AAEF;;;;;AAKG;AACH,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,WAAW,CAAC,CAAC;AAE1D;;;;AAIG;AACH,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAErD;;;;;AAKG;AACH,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,cAAc,CAAC,CAAC;AAE3D;;;;AAIG;AACH,MAAM,mBAAmB,GAAG,+BAA+B,CAAC,cAAc,CAAC,CAAC;AAE5E;;;;AAIG;AACH,MAAM,4BAA4B,GAAG,iBAAiB,CAAC,0BAA0B,EAAE;AACjF,IAAA,QAAQ,EAAE;AACR,QAAA,UAAU,EAAE,IAAI;AACjB,KAAA;AACF,CAAA,CAA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K,EAAE;AAElG;;;;AAIG;AACI,MAAM,YAAY,GAAG,YAAY,CAAC;AACvC,IAAA,mBAAmB,EAAE;;QAEnB,mBAAmB;QACnB,iBAAiB;AAClB,KAAA;AACD,IAAA,0BAA0B,EAAE;QAC1B,wBAAwB;AACzB,KAAA;AACD,IAAA,aAAa,EAAE;QACb,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,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;;;;"}
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
* The matching history query will only be updated on the following scenarios:
|
|
6
6
|
* 1. If it is part of a previous session, not the current one.
|
|
7
7
|
* 2. If its total results count has not been registered yet.
|
|
8
|
-
* 3. If
|
|
9
|
-
* meaning that the previous update was part of a filtered request.
|
|
8
|
+
* 3. If there is a new search response.
|
|
10
9
|
*
|
|
11
10
|
* @param context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,
|
|
12
11
|
* provided by Vuex.
|
|
@@ -24,19 +23,35 @@ const updateHistoryQueriesWithSearchResponse = ({ state, dispatch }, searchRespo
|
|
|
24
23
|
if (indexOfHistoryQuery >= 0) {
|
|
25
24
|
const historyQuery = state.historyQueries[indexOfHistoryQuery];
|
|
26
25
|
const isCurrentSessionHistoryQuery = historyQuery.timestamp > state.sessionTimeStampInMs;
|
|
27
|
-
if (!isCurrentSessionHistoryQuery ||
|
|
28
|
-
|
|
29
|
-
historyQuery.totalResults < searchResponse.totalResults) {
|
|
26
|
+
if (!isCurrentSessionHistoryQuery || historyQuery.totalResults == null || searchResponse) {
|
|
27
|
+
const filters = createHistoryQueriesFiltersList(searchResponse.request.filters);
|
|
30
28
|
const newHistoryQueries = state.historyQueries.slice();
|
|
31
29
|
newHistoryQueries[indexOfHistoryQuery] = {
|
|
32
30
|
...historyQuery,
|
|
33
|
-
totalResults: searchResponse.totalResults
|
|
31
|
+
totalResults: searchResponse.totalResults,
|
|
32
|
+
selectedFilters: filters
|
|
34
33
|
};
|
|
35
34
|
return dispatch('setHistoryQueries', newHistoryQueries);
|
|
36
35
|
}
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
|
-
};
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Take filters from the request and push them into a list.
|
|
41
|
+
*
|
|
42
|
+
* @param requestFilters - Filters from the request.
|
|
43
|
+
*
|
|
44
|
+
* @returns A list of selected filters in the history query.
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
47
|
+
function createHistoryQueriesFiltersList(requestFilters) {
|
|
48
|
+
return requestFilters
|
|
49
|
+
? Object.values(requestFilters).reduce((accFilters, filters) => {
|
|
50
|
+
accFilters.push(...filters);
|
|
51
|
+
return accFilters;
|
|
52
|
+
}, [])
|
|
53
|
+
: [];
|
|
54
|
+
}
|
|
40
55
|
|
|
41
56
|
export { updateHistoryQueriesWithSearchResponse };
|
|
42
57
|
//# sourceMappingURL=update-history-queries-with-search-response.action.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-history-queries-with-search-response.action.js","sources":["../../../../../../src/x-modules/history-queries/store/actions/update-history-queries-with-search-response.action.ts"],"sourcesContent":["import { HistoryQueriesXStoreModule } from '../types';\n\n/**\n * Default implementation for the\n * {@link HistoryQueriesActions.updateHistoryQueriesWithSearchResponse} action.\n *\n * The matching history query will only be updated on the following scenarios:\n * 1. If it is part of a previous session, not the current one.\n * 2. If its total results count has not been registered yet.\n * 3. If
|
|
1
|
+
{"version":3,"file":"update-history-queries-with-search-response.action.js","sources":["../../../../../../src/x-modules/history-queries/store/actions/update-history-queries-with-search-response.action.ts"],"sourcesContent":["import { Filter } from '@empathyco/x-types';\nimport { HistoryQueriesXStoreModule } from '../types';\nimport { InternalSearchResponse } from '../../../search/index';\n\n/**\n * Default implementation for the\n * {@link HistoryQueriesActions.updateHistoryQueriesWithSearchResponse} action.\n *\n * The matching history query will only be updated on the following scenarios:\n * 1. If it is part of a previous session, not the current one.\n * 2. If its total results count has not been registered yet.\n * 3. If there is a new search response.\n *\n * @param context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,\n * provided by Vuex.\n *\n * @param searchResponse - The search response to update history queries with.\n *\n * @returns A `void` promise that resolves when the history query finishes updating.\n *\n * @public\n */\n// eslint-disable-next-line max-len\nexport const updateHistoryQueriesWithSearchResponse: HistoryQueriesXStoreModule['actions']['updateHistoryQueriesWithSearchResponse'] =\n ({ state, dispatch }, searchResponse) => {\n if (searchResponse.status === 'success') {\n const indexOfHistoryQuery = state.historyQueries.findIndex(\n ({ query }) => query === searchResponse.request.query\n );\n if (indexOfHistoryQuery >= 0) {\n const historyQuery = state.historyQueries[indexOfHistoryQuery];\n const isCurrentSessionHistoryQuery = historyQuery.timestamp > state.sessionTimeStampInMs;\n if (!isCurrentSessionHistoryQuery || historyQuery.totalResults == null || searchResponse) {\n const filters = createHistoryQueriesFiltersList(searchResponse.request.filters);\n\n const newHistoryQueries = state.historyQueries.slice();\n newHistoryQueries[indexOfHistoryQuery] = {\n ...historyQuery,\n totalResults: searchResponse.totalResults,\n selectedFilters: filters\n };\n return dispatch('setHistoryQueries', newHistoryQueries);\n }\n }\n }\n };\n\n/**\n * Take filters from the request and push them into a list.\n *\n * @param requestFilters - Filters from the request.\n *\n * @returns A list of selected filters in the history query.\n *\n */\nfunction createHistoryQueriesFiltersList(\n requestFilters: InternalSearchResponse['request']['filters']\n): Filter[] {\n return requestFilters\n ? Object.values(requestFilters).reduce((accFilters, filters) => {\n accFilters.push(...filters);\n return accFilters;\n }, [])\n : [];\n}\n"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;AAiBG;AACH;AACO,MAAM,sCAAsC,GACjD,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,cAAc,KAAI;AACtC,IAAA,IAAI,cAAc,CAAC,MAAM,KAAK,SAAS,EAAE;QACvC,MAAM,mBAAmB,GAAG,KAAK,CAAC,cAAc,CAAC,SAAS,CACxD,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,KAAK,cAAc,CAAC,OAAO,CAAC,KAAK,CACtD,CAAC;QACF,IAAI,mBAAmB,IAAI,CAAC,EAAE;YAC5B,MAAM,YAAY,GAAG,KAAK,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;YAC/D,MAAM,4BAA4B,GAAG,YAAY,CAAC,SAAS,GAAG,KAAK,CAAC,oBAAoB,CAAC;YACzF,IAAI,CAAC,4BAA4B,IAAI,YAAY,CAAC,YAAY,IAAI,IAAI,IAAI,cAAc,EAAE;gBACxF,MAAM,OAAO,GAAG,+BAA+B,CAAC,cAAc,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAEhF,MAAM,iBAAiB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;gBACvD,iBAAiB,CAAC,mBAAmB,CAAC,GAAG;AACvC,oBAAA,GAAG,YAAY;oBACf,YAAY,EAAE,cAAc,CAAC,YAAY;AACzC,oBAAA,eAAe,EAAE,OAAO;iBACzB,CAAC;AACF,gBAAA,OAAO,QAAQ,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,CAAC;AACzD,aAAA;AACF,SAAA;AACF,KAAA;AACH,EAAE;AAEJ;;;;;;;AAOG;AACH,SAAS,+BAA+B,CACtC,cAA4D,EAAA;AAE5D,IAAA,OAAO,cAAc;AACnB,UAAE,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,OAAO,KAAI;AAC3D,YAAA,UAAU,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC;AAC5B,YAAA,OAAO,UAAU,CAAC;SACnB,EAAE,EAAE,CAAC;UACN,EAAE,CAAC;AACT;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sources":["../../../../../src/x-modules/history-queries/store/module.ts"],"sourcesContent":["import { setQuery } from '../../../store/utils/query.utils';\nimport { localStorageService } from '../../../utils/storage';\nimport { addQueryToHistory } from './actions/add-query-to-history.action';\n// eslint-disable-next-line max-len\nimport { loadHistoryQueriesFromBrowserStorage } from './actions/load-history-queries-from-browser-storage.action';\nimport { refreshSession } from './actions/refresh-session.action';\nimport { removeFromHistory } from './actions/remove-query-from-history.action';\nimport { setHistoryQueries } from './actions/set-history-queries.action';\nimport { setUrlParams } from './actions/set-url-params.action';\nimport { toggleHistoryQueries } from './actions/toggle-history-queries.action';\n// eslint-disable-next-line max-len\nimport { updateHistoryQueriesWithSearchResponse } from './actions/update-history-queries-with-search-response.action';\nimport { HISTORY_QUERIES_ENABLED_KEY } from './constants';\nimport { historyQueries } from './getters/history-queries.getter';\nimport { normalizedQuery } from './getters/normalized-query.getter';\nimport { historyQueriesWithResults } from './getters/history-queries-with-results.getter';\nimport { sessionHistoryQueries } from './getters/session-history-queries.getter';\nimport { storageKey } from './getters/storage-key.getter';\nimport { HistoryQueriesXStoreModule } from './types';\n\n/**\n * {@link XStoreModule} For the history-queries module.\n *\n * @internal\n */\nexport const historyQueriesXStoreModule: HistoryQueriesXStoreModule = {\n state: () => ({\n config: {\n debounceInMs: 150,\n maxItemsToStore: 50,\n hideIfEqualsQuery: true,\n sessionTTLInMs: 30 * 60 * 1000\n },\n query: '',\n historyQueries: [],\n sessionTimeStampInMs: Date.now(),\n isEnabled: localStorageService.getItem<boolean>(HISTORY_QUERIES_ENABLED_KEY) ?? true\n }),\n getters: {\n historyQueries,\n normalizedQuery,\n historyQueriesWithResults,\n sessionHistoryQueries,\n storageKey\n },\n mutations: {\n setHistoryQueries(state, historyQueries) {\n state.historyQueries = historyQueries;\n },\n setSessionTimeStamp(state, sessionTimeStamp) {\n state.sessionTimeStampInMs = sessionTimeStamp;\n },\n setQuery,\n setIsEnabled(state, isEnabled) {\n state.isEnabled = isEnabled;\n }\n },\n actions: {\n addQueryToHistory,\n loadHistoryQueriesFromBrowserStorage,\n refreshSession,\n removeFromHistory,\n setHistoryQueries,\n setUrlParams,\n toggleHistoryQueries,\n updateHistoryQueriesWithSearchResponse\n }\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAoBA;;;;AAIG;AACU,MAAA,0BAA0B,GAA+B;AACpE,IAAA,KAAK,EAAE,OAAO;AACZ,QAAA,MAAM,EAAE;AACN,YAAA,YAAY,EAAE,GAAG;AACjB,YAAA,eAAe,EAAE,EAAE;AACnB,YAAA,iBAAiB,EAAE,IAAI;AACvB,YAAA,cAAc,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI;AAC/B,SAAA;AACD,QAAA,KAAK,EAAE,EAAE;AACT,QAAA,cAAc,EAAE,EAAE;AAClB,QAAA,oBAAoB,EAAE,IAAI,CAAC,GAAG,EAAE;QAChC,SAAS,EAAE,mBAAmB,CAAC,OAAO,CAAU,2BAA2B,CAAC,IAAI,IAAI;KACrF,CAAC;AACF,IAAA,OAAO,EAAE;QACP,cAAc;QACd,eAAe;QACf,yBAAyB;QACzB,qBAAqB;QACrB,UAAU;AACX,KAAA;AACD,IAAA,SAAS,EAAE;QACT,iBAAiB,CAAC,KAAK,EAAE,cAAc,EAAA;AACrC,YAAA,KAAK,CAAC,cAAc,GAAG,cAAc,CAAC;SACvC;QACD,mBAAmB,CAAC,KAAK,EAAE,gBAAgB,EAAA;AACzC,YAAA,KAAK,CAAC,oBAAoB,GAAG,gBAAgB,CAAC;SAC/C;QACD,QAAQ;QACR,YAAY,CAAC,KAAK,EAAE,SAAS,EAAA;AAC3B,YAAA,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;SAC7B;AACF,KAAA;AACD,IAAA,OAAO,EAAE;QACP,iBAAiB;QACjB,oCAAoC;QACpC,cAAc;QACd,iBAAiB;QACjB,iBAAiB;QACjB,YAAY;QACZ,oBAAoB;QACpB,sCAAsC;AACvC,KAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"module.js","sources":["../../../../../src/x-modules/history-queries/store/module.ts"],"sourcesContent":["import { setQuery } from '../../../store/utils/query.utils';\nimport { localStorageService } from '../../../utils/storage';\nimport { addQueryToHistory } from './actions/add-query-to-history.action';\n// eslint-disable-next-line max-len\nimport { loadHistoryQueriesFromBrowserStorage } from './actions/load-history-queries-from-browser-storage.action';\nimport { refreshSession } from './actions/refresh-session.action';\nimport { removeFromHistory } from './actions/remove-query-from-history.action';\nimport { setHistoryQueries } from './actions/set-history-queries.action';\nimport { setUrlParams } from './actions/set-url-params.action';\nimport { toggleHistoryQueries } from './actions/toggle-history-queries.action';\n// eslint-disable-next-line max-len\nimport { updateHistoryQueriesWithSearchResponse } from './actions/update-history-queries-with-search-response.action';\nimport { HISTORY_QUERIES_ENABLED_KEY } from './constants';\nimport { historyQueries } from './getters/history-queries.getter';\nimport { normalizedQuery } from './getters/normalized-query.getter';\nimport { historyQueriesWithResults } from './getters/history-queries-with-results.getter';\nimport { sessionHistoryQueries } from './getters/session-history-queries.getter';\nimport { storageKey } from './getters/storage-key.getter';\nimport { HistoryQueriesXStoreModule } from './types';\n\n/**\n * {@link XStoreModule} For the history-queries module.\n *\n * @internal\n */\nexport const historyQueriesXStoreModule: HistoryQueriesXStoreModule = {\n state: () => ({\n config: {\n debounceInMs: 150,\n maxItemsToStore: 50,\n hideIfEqualsQuery: true,\n sessionTTLInMs: 30 * 60 * 1000\n },\n query: '',\n historyQueries: [],\n sessionTimeStampInMs: Date.now(),\n isEnabled: localStorageService.getItem<boolean>(HISTORY_QUERIES_ENABLED_KEY) ?? true\n }),\n getters: {\n historyQueries,\n normalizedQuery,\n historyQueriesWithResults,\n sessionHistoryQueries,\n storageKey\n },\n mutations: {\n setHistoryQueries(state, historyQueries) {\n state.historyQueries = historyQueries;\n },\n setSessionTimeStamp(state, sessionTimeStamp) {\n state.sessionTimeStampInMs = sessionTimeStamp;\n },\n setQuery,\n setIsEnabled(state, isEnabled) {\n state.isEnabled = isEnabled;\n },\n setSearchSelectedFilters(state, filters) {\n state.historyQueries[0].selectedFilters = filters;\n }\n },\n actions: {\n addQueryToHistory,\n loadHistoryQueriesFromBrowserStorage,\n refreshSession,\n removeFromHistory,\n setHistoryQueries,\n setUrlParams,\n toggleHistoryQueries,\n updateHistoryQueriesWithSearchResponse\n }\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAoBA;;;;AAIG;AACU,MAAA,0BAA0B,GAA+B;AACpE,IAAA,KAAK,EAAE,OAAO;AACZ,QAAA,MAAM,EAAE;AACN,YAAA,YAAY,EAAE,GAAG;AACjB,YAAA,eAAe,EAAE,EAAE;AACnB,YAAA,iBAAiB,EAAE,IAAI;AACvB,YAAA,cAAc,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI;AAC/B,SAAA;AACD,QAAA,KAAK,EAAE,EAAE;AACT,QAAA,cAAc,EAAE,EAAE;AAClB,QAAA,oBAAoB,EAAE,IAAI,CAAC,GAAG,EAAE;QAChC,SAAS,EAAE,mBAAmB,CAAC,OAAO,CAAU,2BAA2B,CAAC,IAAI,IAAI;KACrF,CAAC;AACF,IAAA,OAAO,EAAE;QACP,cAAc;QACd,eAAe;QACf,yBAAyB;QACzB,qBAAqB;QACrB,UAAU;AACX,KAAA;AACD,IAAA,SAAS,EAAE;QACT,iBAAiB,CAAC,KAAK,EAAE,cAAc,EAAA;AACrC,YAAA,KAAK,CAAC,cAAc,GAAG,cAAc,CAAC;SACvC;QACD,mBAAmB,CAAC,KAAK,EAAE,gBAAgB,EAAA;AACzC,YAAA,KAAK,CAAC,oBAAoB,GAAG,gBAAgB,CAAC;SAC/C;QACD,QAAQ;QACR,YAAY,CAAC,KAAK,EAAE,SAAS,EAAA;AAC3B,YAAA,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;SAC7B;QACD,wBAAwB,CAAC,KAAK,EAAE,OAAO,EAAA;YACrC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,eAAe,GAAG,OAAO,CAAC;SACnD;AACF,KAAA;AACD,IAAA,OAAO,EAAE;QACP,iBAAiB;QACjB,oCAAoC;QACpC,cAAc;QACd,iBAAiB;QACjB,iBAAiB;QACjB,YAAY;QACZ,oBAAoB;QACpB,sCAAsC;AACvC,KAAA;;;;;"}
|
|
@@ -107,6 +107,12 @@ const setHistoryQueriesDisabled = wireDispatch('toggleHistoryQueries', false);
|
|
|
107
107
|
* @public
|
|
108
108
|
*/
|
|
109
109
|
const updateHistoryQueriesWithSearchResponse = wireDispatch('updateHistoryQueriesWithSearchResponse');
|
|
110
|
+
/**
|
|
111
|
+
* Sets the history queries state `filters` with a selectedHistoryQuery's filters.
|
|
112
|
+
*
|
|
113
|
+
* @public
|
|
114
|
+
*/
|
|
115
|
+
const setSearchSelectedFilters = wireCommit('setSearchSelectedFilters', ({ eventPayload: { filters } }) => filters);
|
|
110
116
|
/**
|
|
111
117
|
* Debounce function for the module.
|
|
112
118
|
*/
|
|
@@ -133,6 +139,9 @@ const historyQueriesWiring = createWiring({
|
|
|
133
139
|
setHistoryQueriesQuery,
|
|
134
140
|
addQueryToHistoryQueries
|
|
135
141
|
},
|
|
142
|
+
UserSelectedAHistoryQuery: {
|
|
143
|
+
setSearchSelectedFilters
|
|
144
|
+
},
|
|
136
145
|
UserIsTypingAQuery: {
|
|
137
146
|
setHistoryQueriesQueryDebounce: moduleDebounce(setHistoryQueriesQuery, ({ state }) => state.config.debounceInMs, { cancelOn: 'UserAcceptedAQuery' })
|
|
138
147
|
},
|
|
@@ -163,5 +172,5 @@ const historyQueriesWiring = createWiring({
|
|
|
163
172
|
}
|
|
164
173
|
});
|
|
165
174
|
|
|
166
|
-
export { addQueryToHistoryQueries, addQueryToHistoryQueriesFromPreview, clearHistoryQueries, clearHistoryQueriesQuery, historyQueriesWiring, loadHistoryQueriesFromBrowserStorageWire, refreshHistoryQueriesSession, removeHistoryQuery, setHistoryQueriesDisabled, setHistoryQueriesEnabled, setHistoryQueriesQuery, setHistoryQueriesQueryFromPreview, updateHistoryQueriesWithSearchResponse };
|
|
175
|
+
export { addQueryToHistoryQueries, addQueryToHistoryQueriesFromPreview, clearHistoryQueries, clearHistoryQueriesQuery, historyQueriesWiring, loadHistoryQueriesFromBrowserStorageWire, refreshHistoryQueriesSession, removeHistoryQuery, setHistoryQueriesDisabled, setHistoryQueriesEnabled, setHistoryQueriesQuery, setHistoryQueriesQueryFromPreview, setSearchSelectedFilters, updateHistoryQueriesWithSearchResponse };
|
|
167
176
|
//# sourceMappingURL=wiring.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/history-queries/wiring.ts"],"sourcesContent":["import {\n namespacedWireCommit,\n namespacedWireDispatch,\n namespacedWireDispatchWithoutPayload\n} from '../../wiring/namespaced-wires.factory';\nimport { namespacedDebounce } from '../../wiring/namespaced-wires.operators';\nimport { NamespacedWireCommit, NamespacedWireDispatch } from '../../wiring/namespaced-wiring.types';\nimport { createWiring } from '../../wiring/wiring.utils';\n\n/**\n * `historyQueries` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'historyQueries';\n/**\n * WireCommit for {@link HistoryQueriesXModule}.\n *\n * @internal\n */\nconst wireCommit: NamespacedWireCommit<typeof moduleName> = namespacedWireCommit(moduleName);\n/**\n * WireDispatch for {@link HistoryQueriesXModule}.\n *\n * @internal\n */\nconst wireDispatch: NamespacedWireDispatch<typeof moduleName> = namespacedWireDispatch(moduleName);\n/**\n * WireDispatchWithoutPayload for {@link HistoryQueriesXModule}.\n *\n * @internal\n */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName);\n\n/**\n * Saves a new query into the history queries.\n *\n * @public\n */\nexport const addQueryToHistoryQueries = wireDispatch('addQueryToHistory');\n\n/**\n * Saves the selectedQueryPreview query into the history queries.\n *\n * @public\n */\nexport const addQueryToHistoryQueriesFromPreview = wireDispatch(\n 'addQueryToHistory',\n ({ eventPayload: { query } }) => query\n);\n\n/**\n * Sets the query of the history queries module. Used for searching into the history queries.\n *\n * @public\n */\nexport const setHistoryQueriesQuery = wireCommit('setQuery');\n\n/**\n * Sets the query of the history queries module from a selectedQueryPreview's query.\n * Used for searching into the history queries.\n *\n * @public\n */\nexport const setHistoryQueriesQueryFromPreview = wireCommit(\n 'setQuery',\n ({ eventPayload: { query } }) => query\n);\n\n/**\n * Sets the history queries state `query` from url.\n *\n * @public\n */\nconst setUrlParams = wireDispatch('setUrlParams');\n\n/**\n * Sets the query of the history queries module to an empty string.\n *\n * @public\n */\nexport const clearHistoryQueriesQuery = wireCommit('setQuery', '');\n\n/**\n * Triggers a session refresh, extending its validity for the time configured in the\n * {@link HistoryQueriesConfig.sessionTTLInMs}.\n *\n * @public\n */\nexport const refreshHistoryQueriesSession = wireDispatchWithoutPayload('refreshSession');\n\n/**\n * Loads the history queries from the browser storage, saving them to the\n * {@link HistoryQueriesState.historyQueries}.\n *\n * @public\n */\nexport const loadHistoryQueriesFromBrowserStorageWire = wireDispatchWithoutPayload(\n 'loadHistoryQueriesFromBrowserStorage'\n);\n\n/**\n * Clears the history queries.\n *\n * @public\n */\nexport const clearHistoryQueries = wireDispatch('setHistoryQueries', []);\n\n/**\n * Removes a single history query from the history queries.\n *\n * @public\n */\nexport const removeHistoryQuery = wireDispatch('removeFromHistory');\n\n/**\n * Enables history queries.\n *\n * @public\n */\nexport const setHistoryQueriesEnabled = wireDispatch('toggleHistoryQueries', true);\n\n/**\n * Disables history queries.\n *\n * @public\n */\nexport const setHistoryQueriesDisabled = wireDispatch('toggleHistoryQueries', false);\n\n/**\n * Updates the history queries with the relevant info included in a search response.\n *\n * @public\n */\nexport const updateHistoryQueriesWithSearchResponse = wireDispatch(\n 'updateHistoryQueriesWithSearchResponse'\n);\n\n/**\n * Debounce function for the module.\n */\nconst moduleDebounce = namespacedDebounce(moduleName);\n\n/**\n * Default wiring for the {@link HistoryQueries} module.\n *\n * @internal\n */\nexport const historyQueriesWiring = createWiring({\n ParamsLoadedFromUrl: {\n setUrlParams\n },\n HistoryQueriesQueryChanged: {\n refreshHistoryQueriesSession\n },\n HistoryQueriesStorageKeyChanged: {\n loadHistoryQueriesFromBrowserStorageWire\n },\n UserClearedQuery: {\n clearHistoryQueriesQuery\n },\n UserAcceptedAQuery: {\n setHistoryQueriesQuery,\n addQueryToHistoryQueries\n },\n UserIsTypingAQuery: {\n setHistoryQueriesQueryDebounce: moduleDebounce(\n setHistoryQueriesQuery,\n ({ state }) => state.config.debounceInMs,\n { cancelOn: 'UserAcceptedAQuery' }\n )\n },\n UserPressedClearHistoryQueries: {\n clearHistoryQueries\n },\n UserPressedRemoveHistoryQuery: {\n removeHistoryQuery\n },\n UserClickedEnableHistoryQueries: {\n setHistoryQueriesEnabled\n },\n UserClickedConfirmDisableHistoryQueries: {\n setHistoryQueriesDisabled\n },\n UserClickedCloseX: {\n clearHistoryQueriesQuery\n },\n UserClickedOutOfMainModal: {\n clearHistoryQueriesQuery\n },\n SearchResponseChanged: {\n updateHistoryQueriesWithSearchResponse\n },\n UserAcceptedAQueryPreview: {\n setHistoryQueriesQueryFromPreview,\n addQueryToHistoryQueriesFromPreview\n }\n});\n"],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E,KAAK,EAAE;AAErF;;;;AAIG;MACU,sCAAsC,GAAG,YAAY,CAChE,wCAAwC,EACxC;AAEF;;AAEG;AACH,MAAM,cAAc,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;AAEtD;;;;AAIG;AACI,MAAM,oBAAoB,GAAG,YAAY,CAAC;AAC/C,IAAA,mBAAmB,EAAE;QACnB,YAAY;AACb,KAAA;AACD,IAAA,0BAA0B,EAAE;QAC1B,4BAA4B;AAC7B,KAAA;AACD,IAAA,+BAA+B,EAAE;QAC/B,wCAAwC;AACzC,KAAA;AACD,IAAA,gBAAgB,EAAE;QAChB,wBAAwB;AACzB,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,sBAAsB;QACtB,wBAAwB;AACzB,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,8BAA8B,EAAE,cAAc,CAC5C,sBAAsB,EACtB,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,CAAC,MAAM,CAAC,YAAY,EACxC,EAAE,QAAQ,EAAE,oBAAoB,EAAE,CACnC;AACF,KAAA;AACD,IAAA,8BAA8B,EAAE;QAC9B,mBAAmB;AACpB,KAAA;AACD,IAAA,6BAA6B,EAAE;QAC7B,kBAAkB;AACnB,KAAA;AACD,IAAA,+BAA+B,EAAE;QAC/B,wBAAwB;AACzB,KAAA;AACD,IAAA,uCAAuC,EAAE;QACvC,yBAAyB;AAC1B,KAAA;AACD,IAAA,iBAAiB,EAAE;QACjB,wBAAwB;AACzB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,wBAAwB;AACzB,KAAA;AACD,IAAA,qBAAqB,EAAE;QACrB,sCAAsC;AACvC,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,iCAAiC;QACjC,mCAAmC;AACpC,KAAA;AACF,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/history-queries/wiring.ts"],"sourcesContent":["import {\n namespacedWireCommit,\n namespacedWireDispatch,\n namespacedWireDispatchWithoutPayload\n} from '../../wiring/namespaced-wires.factory';\nimport { namespacedDebounce } from '../../wiring/namespaced-wires.operators';\nimport { NamespacedWireCommit, NamespacedWireDispatch } from '../../wiring/namespaced-wiring.types';\nimport { createWiring } from '../../wiring/wiring.utils';\n\n/**\n * `historyQueries` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'historyQueries';\n/**\n * WireCommit for {@link HistoryQueriesXModule}.\n *\n * @internal\n */\nconst wireCommit: NamespacedWireCommit<typeof moduleName> = namespacedWireCommit(moduleName);\n/**\n * WireDispatch for {@link HistoryQueriesXModule}.\n *\n * @internal\n */\nconst wireDispatch: NamespacedWireDispatch<typeof moduleName> = namespacedWireDispatch(moduleName);\n/**\n * WireDispatchWithoutPayload for {@link HistoryQueriesXModule}.\n *\n * @internal\n */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName);\n\n/**\n * Saves a new query into the history queries.\n *\n * @public\n */\nexport const addQueryToHistoryQueries = wireDispatch('addQueryToHistory');\n\n/**\n * Saves the selectedQueryPreview query into the history queries.\n *\n * @public\n */\nexport const addQueryToHistoryQueriesFromPreview = wireDispatch(\n 'addQueryToHistory',\n ({ eventPayload: { query } }) => query\n);\n\n/**\n * Sets the query of the history queries module. Used for searching into the history queries.\n *\n * @public\n */\nexport const setHistoryQueriesQuery = wireCommit('setQuery');\n\n/**\n * Sets the query of the history queries module from a selectedQueryPreview's query.\n * Used for searching into the history queries.\n *\n * @public\n */\nexport const setHistoryQueriesQueryFromPreview = wireCommit(\n 'setQuery',\n ({ eventPayload: { query } }) => query\n);\n\n/**\n * Sets the history queries state `query` from url.\n *\n * @public\n */\nconst setUrlParams = wireDispatch('setUrlParams');\n\n/**\n * Sets the query of the history queries module to an empty string.\n *\n * @public\n */\nexport const clearHistoryQueriesQuery = wireCommit('setQuery', '');\n\n/**\n * Triggers a session refresh, extending its validity for the time configured in the\n * {@link HistoryQueriesConfig.sessionTTLInMs}.\n *\n * @public\n */\nexport const refreshHistoryQueriesSession = wireDispatchWithoutPayload('refreshSession');\n\n/**\n * Loads the history queries from the browser storage, saving them to the\n * {@link HistoryQueriesState.historyQueries}.\n *\n * @public\n */\nexport const loadHistoryQueriesFromBrowserStorageWire = wireDispatchWithoutPayload(\n 'loadHistoryQueriesFromBrowserStorage'\n);\n\n/**\n * Clears the history queries.\n *\n * @public\n */\nexport const clearHistoryQueries = wireDispatch('setHistoryQueries', []);\n\n/**\n * Removes a single history query from the history queries.\n *\n * @public\n */\nexport const removeHistoryQuery = wireDispatch('removeFromHistory');\n\n/**\n * Enables history queries.\n *\n * @public\n */\nexport const setHistoryQueriesEnabled = wireDispatch('toggleHistoryQueries', true);\n\n/**\n * Disables history queries.\n *\n * @public\n */\nexport const setHistoryQueriesDisabled = wireDispatch('toggleHistoryQueries', false);\n\n/**\n * Updates the history queries with the relevant info included in a search response.\n *\n * @public\n */\nexport const updateHistoryQueriesWithSearchResponse = wireDispatch(\n 'updateHistoryQueriesWithSearchResponse'\n);\n\n/**\n * Sets the history queries state `filters` with a selectedHistoryQuery's filters.\n *\n * @public\n */\nexport const setSearchSelectedFilters = wireCommit(\n 'setSearchSelectedFilters',\n ({ eventPayload: { filters } }) => filters\n);\n/**\n * Debounce function for the module.\n */\nconst moduleDebounce = namespacedDebounce(moduleName);\n\n/**\n * Default wiring for the {@link HistoryQueries} module.\n *\n * @internal\n */\nexport const historyQueriesWiring = createWiring({\n ParamsLoadedFromUrl: {\n setUrlParams\n },\n HistoryQueriesQueryChanged: {\n refreshHistoryQueriesSession\n },\n HistoryQueriesStorageKeyChanged: {\n loadHistoryQueriesFromBrowserStorageWire\n },\n UserClearedQuery: {\n clearHistoryQueriesQuery\n },\n UserAcceptedAQuery: {\n setHistoryQueriesQuery,\n addQueryToHistoryQueries\n },\n UserSelectedAHistoryQuery: {\n setSearchSelectedFilters\n },\n UserIsTypingAQuery: {\n setHistoryQueriesQueryDebounce: moduleDebounce(\n setHistoryQueriesQuery,\n ({ state }) => state.config.debounceInMs,\n { cancelOn: 'UserAcceptedAQuery' }\n )\n },\n UserPressedClearHistoryQueries: {\n clearHistoryQueries\n },\n UserPressedRemoveHistoryQuery: {\n removeHistoryQuery\n },\n UserClickedEnableHistoryQueries: {\n setHistoryQueriesEnabled\n },\n UserClickedConfirmDisableHistoryQueries: {\n setHistoryQueriesDisabled\n },\n UserClickedCloseX: {\n clearHistoryQueriesQuery\n },\n UserClickedOutOfMainModal: {\n clearHistoryQueriesQuery\n },\n SearchResponseChanged: {\n updateHistoryQueriesWithSearchResponse\n },\n UserAcceptedAQueryPreview: {\n setHistoryQueriesQueryFromPreview,\n addQueryToHistoryQueriesFromPreview\n }\n});\n"],"names":[],"mappings":";;;;AASA;;;;AAIG;AACH,MAAM,UAAU,GAAG,gBAAgB,CAAC;AACpC;;;;AAIG;AACH,MAAM,UAAU,GAA4C,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAC7F;;;;AAIG;AACH,MAAM,YAAY,GAA8C,sBAAsB,CAAC,UAAU,CAAC,CAAC;AACnG;;;;AAIG;AACH,MAAM,0BAA0B,GAAG,oCAAoC,CAAC,UAAU,CAAC,CAAC;AAEpF;;;;AAIG;MACU,wBAAwB,GAAG,YAAY,CAAC,mBAAmB,EAAE;AAE1E;;;;AAIG;MACU,mCAAmC,GAAG,YAAY,CAC7D,mBAAmB,EACnB,CAAC,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,KAAK,EACtC;AAEF;;;;AAIG;MACU,sBAAsB,GAAG,UAAU,CAAC,UAAU,EAAE;AAE7D;;;;;AAKG;MACU,iCAAiC,GAAG,UAAU,CACzD,UAAU,EACV,CAAC,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,KAAK,EACtC;AAEF;;;;AAIG;AACH,MAAM,YAAY,GAAG,YAAY,CAAC,cAAc,CAAC,CAAC;AAElD;;;;AAIG;AACU,MAAA,wBAAwB,GAAG,UAAU,CAAC,UAAU,EAAE,EAA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AQ,EAAE,oBAAoB,EAAE,CACnC;AACF,KAAA;AACD,IAAA,8BAA8B,EAAE;QAC9B,mBAAmB;AACpB,KAAA;AACD,IAAA,6BAA6B,EAAE;QAC7B,kBAAkB;AACnB,KAAA;AACD,IAAA,+BAA+B,EAAE;QAC/B,wBAAwB;AACzB,KAAA;AACD,IAAA,uCAAuC,EAAE;QACvC,yBAAyB;AAC1B,KAAA;AACD,IAAA,iBAAiB,EAAE;QACjB,wBAAwB;AACzB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,wBAAwB;AACzB,KAAA;AACD,IAAA,qBAAqB,EAAE;QACrB,sCAAsC;AACvC,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,iCAAiC;QACjC,mCAAmC;AACpC,KAAA;AACF,CAAA;;;;"}
|
|
@@ -164,6 +164,12 @@ const setSearchExtraParamsFromPreview = wireCommit('setParams', ({ eventPayload:
|
|
|
164
164
|
* @public
|
|
165
165
|
*/
|
|
166
166
|
const setSearchSelectedFiltersFromPreview = wireCommit('setSelectedFilters', ({ eventPayload: { filters } }) => (filters ? createRawFilters(filters) : []));
|
|
167
|
+
/**
|
|
168
|
+
* Sets the search state `selectedFilters` with a selectedHistoryQuery's filters.
|
|
169
|
+
*
|
|
170
|
+
* @public
|
|
171
|
+
*/
|
|
172
|
+
const setSearchSelectedFiltersFromPreviewable = wireCommit('setSelectedFilters', ({ eventPayload: { selectedFilters } }) => selectedFilters);
|
|
167
173
|
/**
|
|
168
174
|
* Search wiring.
|
|
169
175
|
*
|
|
@@ -232,8 +238,11 @@ const searchWiring = createWiring({
|
|
|
232
238
|
},
|
|
233
239
|
QueryPreviewUnselected: {
|
|
234
240
|
setSearchExtraParams
|
|
241
|
+
},
|
|
242
|
+
UserSelectedAHistoryQuery: {
|
|
243
|
+
setSearchSelectedFiltersFromPreviewable
|
|
235
244
|
}
|
|
236
245
|
});
|
|
237
246
|
|
|
238
|
-
export { cancelFetchAndSaveSearchResponseWire, clearSearchQuery, fetchAndSaveSearchResponseWire, increasePageAppendingResultsWire, resetAppending, resetFromNoResultsWithFilters, resetIsNoResults, resetRequestOnRefinementWire, resetSpellcheckQuery, resetStateIfNoRequestWire, saveOriginWire, searchWiring, setRelatedTags, setSearchExtraParams, setSearchExtraParamsFromPreview, setSearchPage, setSearchQuery, setSearchQueryFromPreview, setSearchSelectedFiltersFromPreview, setSelectedFilters, setSort, setUrlParams };
|
|
247
|
+
export { cancelFetchAndSaveSearchResponseWire, clearSearchQuery, fetchAndSaveSearchResponseWire, increasePageAppendingResultsWire, resetAppending, resetFromNoResultsWithFilters, resetIsNoResults, resetRequestOnRefinementWire, resetSpellcheckQuery, resetStateIfNoRequestWire, saveOriginWire, searchWiring, setRelatedTags, setSearchExtraParams, setSearchExtraParamsFromPreview, setSearchPage, setSearchQuery, setSearchQueryFromPreview, setSearchSelectedFiltersFromPreview, setSearchSelectedFiltersFromPreviewable, setSelectedFilters, setSort, setUrlParams };
|
|
239
248
|
//# sourceMappingURL=wiring.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/search/wiring.ts"],"sourcesContent":["import { filterTruthyPayload, namespacedWireCommitWithoutPayload } from '../../wiring';\nimport {\n namespacedWireCommit,\n namespacedWireDispatch,\n namespacedWireDispatchWithoutPayload\n} from '../../wiring/namespaced-wires.factory';\nimport { WirePayload } from '../../wiring/wiring.types';\nimport { createWiring } from '../../wiring/wiring.utils';\nimport { createRawFilters } from '../../utils/filters';\nimport { InternalSearchRequest } from './types';\n\n/**\n * `search` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'search';\n\n/**\n * WireCommit for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireCommit = namespacedWireCommit(moduleName);\n\n/**\n * WireCommit without Payload for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireCommitWithoutPayload = namespacedWireCommitWithoutPayload(moduleName);\n\n/**\n * WireDispatch for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireDispatch = namespacedWireDispatch(moduleName);\n\n/**\n * WireDispatchWithoutPayload for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName);\n\n/**\n * Cancels the {@link SearchActions.fetchAndSaveSearchResponse} request promise.\n *\n * @public\n */\nexport const cancelFetchAndSaveSearchResponseWire = wireDispatchWithoutPayload(\n 'cancelFetchAndSaveSearchResponse'\n);\n\n/**\n * Sets the search state `origin`.\n *\n * @public\n */\nexport const saveOriginWire = wireDispatch('saveOrigin', ({ metadata }) => metadata);\n\n/**\n * Requests and stores the search response.\n *\n * @public\n */\nexport const fetchAndSaveSearchResponseWire = wireDispatch('fetchAndSaveSearchResponse');\n\n/**\n * Resets the search state `spellcheckedQuery` to its initial value, an empty string.\n *\n * @public\n */\nexport const resetSpellcheckQuery = wireCommit('setSpellcheck', '');\n\n/**\n * Sets the search state `relatedTags`.\n *\n * @public\n */\nexport const setRelatedTags = wireCommit('setRelatedTags');\n\n/**\n * Sets the search state `query`.\n *\n * @public\n */\nexport const setSearchQuery = wireCommit('setQuery');\n\n/**\n * Clears the search state `query`.\n *\n * @public\n */\nexport const clearSearchQuery = wireCommit('setQuery', '');\n\n/**\n * Sets the search state `selectedFilters`.\n *\n * @public\n */\nexport const setSelectedFilters = wireCommit('setSelectedFilters');\n\n/**\n * Sets the search state `sort`.\n *\n * @public\n */\nexport const setSort = wireCommit('setSort');\n\n/**\n * Sets the search state `query`.\n *\n * @public\n */\nexport const setUrlParams = wireDispatch('setUrlParams');\n\n/**\n * Sets the search state `page`.\n *\n * @public\n */\nexport const setSearchPage = wireCommit('setPage');\n\n/**\n * Sets the search state `params`.\n *\n * @public\n */\nexport const setSearchExtraParams = wireCommit('setParams');\n\n/**\n * Resets the search state `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 * 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 SelectedSortProvided: {\n setSort\n },\n ExtraParamsChanged: {\n setSearchExtraParams\n },\n UserClickedCloseX: {\n clearSearchQuery\n },\n UserClickedOutOfMainModal: {\n clearSearchQuery\n },\n UserAcceptedAQueryPreview: {\n setSearchQueryFromPreview,\n setSearchExtraParamsFromPreview,\n setSearchSelectedFiltersFromPreview,\n saveOriginWire\n },\n QueryPreviewUnselected: {\n setSearchExtraParams\n }\n});\n"],"names":[],"mappings":";;;;;AAWA;;;;AAIG;AACH,MAAM,UAAU,GAAG,QAAQ,CAAC;AAE5B;;;;AAIG;AACH,MAAM,UAAU,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAEpD;;;;AAIG;AACH,MAAM,wBAAwB,GAAG,kCAAkC,CAAC,UAAU,CAAC,CAAC;AAEhF;;;;AAIG;AACH,MAAM,YAAY,GAAG,sBAAsB,CAAC,UAAU,CAAC,CAAC;AAExD;;;;AAIG;AACH,MAAM,0BAA0B,GAAG,oCAAoC,CAAC,UAAU,CAAC,CAAC;AAEpF;;;;AAIG;MACU,oCAAoC,GAAG,0BAA0B,CAC5E,kCAAkC,EAClC;AAEF;;;;AAIG;AACU,MAAA,cAAc,GAAG,YAAY,CAAC,YAAY,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,QAAQ,EAAE;AAErF;;;;AAIG;MACU,8BAA8B,GAAG,YAAY,CAAC,4BAA4B,EAAE;AAEzF;;;;AAIG;AACU,MAAA,oBAAoB,GAAG,U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AAyB,EAAE;QACzB,gBAAgB;AACjB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,yBAAyB;QACzB,+BAA+B;QAC/B,mCAAmC;QACnC,cAAc;AACf,KAAA;AACD,IAAA,sBAAsB,EAAE;QACtB,oBAAoB;AACrB,KAAA;AACF,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/search/wiring.ts"],"sourcesContent":["import { filterTruthyPayload, namespacedWireCommitWithoutPayload } from '../../wiring';\nimport {\n namespacedWireCommit,\n namespacedWireDispatch,\n namespacedWireDispatchWithoutPayload\n} from '../../wiring/namespaced-wires.factory';\nimport { WirePayload } from '../../wiring/wiring.types';\nimport { createWiring } from '../../wiring/wiring.utils';\nimport { createRawFilters } from '../../utils/filters';\nimport { InternalSearchRequest } from './types';\n\n/**\n * `search` {@link XModuleName | XModule name}.\n *\n * @internal\n */\nconst moduleName = 'search';\n\n/**\n * WireCommit for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireCommit = namespacedWireCommit(moduleName);\n\n/**\n * WireCommit without Payload for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireCommitWithoutPayload = namespacedWireCommitWithoutPayload(moduleName);\n\n/**\n * WireDispatch for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireDispatch = namespacedWireDispatch(moduleName);\n\n/**\n * WireDispatchWithoutPayload for {@link SearchXModule}.\n *\n * @internal\n */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName);\n\n/**\n * Cancels the {@link SearchActions.fetchAndSaveSearchResponse} request promise.\n *\n * @public\n */\nexport const cancelFetchAndSaveSearchResponseWire = wireDispatchWithoutPayload(\n 'cancelFetchAndSaveSearchResponse'\n);\n\n/**\n * Sets the search state `origin`.\n *\n * @public\n */\nexport const saveOriginWire = wireDispatch('saveOrigin', ({ metadata }) => metadata);\n\n/**\n * Requests and stores the search response.\n *\n * @public\n */\nexport const fetchAndSaveSearchResponseWire = wireDispatch('fetchAndSaveSearchResponse');\n\n/**\n * Resets the search state `spellcheckedQuery` to its initial value, an empty string.\n *\n * @public\n */\nexport const resetSpellcheckQuery = wireCommit('setSpellcheck', '');\n\n/**\n * Sets the search state `relatedTags`.\n *\n * @public\n */\nexport const setRelatedTags = wireCommit('setRelatedTags');\n\n/**\n * Sets the search state `query`.\n *\n * @public\n */\nexport const setSearchQuery = wireCommit('setQuery');\n\n/**\n * Clears the search state `query`.\n *\n * @public\n */\nexport const clearSearchQuery = wireCommit('setQuery', '');\n\n/**\n * Sets the search state `selectedFilters`.\n *\n * @public\n */\nexport const setSelectedFilters = wireCommit('setSelectedFilters');\n\n/**\n * Sets the search state `sort`.\n *\n * @public\n */\nexport const setSort = wireCommit('setSort');\n\n/**\n * Sets the search state `query`.\n *\n * @public\n */\nexport const setUrlParams = wireDispatch('setUrlParams');\n\n/**\n * Sets the search state `page`.\n *\n * @public\n */\nexport const setSearchPage = wireCommit('setPage');\n\n/**\n * Sets the search state `params`.\n *\n * @public\n */\nexport const setSearchExtraParams = wireCommit('setParams');\n\n/**\n * Resets the search state `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 setSearchSelectedFiltersFromPreviewable = 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 SelectedSortProvided: {\n setSort\n },\n ExtraParamsChanged: {\n setSearchExtraParams\n },\n UserClickedCloseX: {\n clearSearchQuery\n },\n UserClickedOutOfMainModal: {\n clearSearchQuery\n },\n UserAcceptedAQueryPreview: {\n setSearchQueryFromPreview,\n setSearchExtraParamsFromPreview,\n setSearchSelectedFiltersFromPreview,\n saveOriginWire\n },\n QueryPreviewUnselected: {\n setSearchExtraParams\n },\n UserSelectedAHistoryQuery: {\n setSearchSelectedFiltersFromPreviewable\n }\n});\n"],"names":[],"mappings":";;;;;AAWA;;;;AAIG;AACH,MAAM,UAAU,GAAG,QAAQ,CAAC;AAE5B;;;;AAIG;AACH,MAAM,UAAU,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAEpD;;;;AAIG;AACH,MAAM,wBAAwB,GAAG,kCAAkC,CAAC,UAAU,CAAC,CAAC;AAEhF;;;;AAIG;AACH,MAAM,YAAY,GAAG,sBAAsB,CAAC,UAAU,CAAC,CAAC;AAExD;;;;AAIG;AACH,MAAM,0BAA0B,GAAG,oCAAoC,CAAC,UAAU,CAAC,CAAC;AAEpF;;;;AAIG;MACU,oCAAoC,GAAG,0BAA0B,CAC5E,kCAAkC,EAClC;AAEF;;;;AAIG;AACU,MAAA,cAAc,GAAG,YAAY,CAAC,YAAY,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,QAAQ,EAAE;AAErF;;;;AAIG;MACU,8BAA8B,GAAG,YAAY,CAAC,4BAA4B,EAAE;AAEzF;;;;AAIG;AACU,MAAA,oBAAoB,GAAG,UAAU,CAAC,eAAe,EAAE,EAAE,EAAE;AAEpE;;;;AAIG;MACU,cAAc,GAAG,UAAU,CAAC,gBAAgB,EAAE;AAE3D;;;;AAIG;MACU,cAAc,GAAG,UAAU,CAAC,UAAU,EAAE;AAErD;;;;AAIG;AACU,MAAA,gBAAgB,GAAG,UAAU,CAAC,UAAU,EAAE,EAAE,EAAE;AAE3D;;;;AAI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cAAc;AACf,KAAA;AACD,IAAA,sBAAsB,EAAE;QACtB,oBAAoB;AACrB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,uCAAuC;AACxC,KAAA;AACF,CAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empathyco/x-components",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.421",
|
|
4
4
|
"description": "Empathy X Components",
|
|
5
5
|
"author": "Empathy Systems Corporation S.L.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -68,12 +68,12 @@
|
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@empathyco/x-adapter": "^8.0.0-alpha.34",
|
|
71
|
-
"@empathyco/x-adapter-platform": "^1.0.0-alpha.
|
|
71
|
+
"@empathyco/x-adapter-platform": "^1.0.0-alpha.88",
|
|
72
72
|
"@empathyco/x-bus": "^1.0.0-alpha.4",
|
|
73
73
|
"@empathyco/x-deep-merge": "^2.0.0-alpha.3",
|
|
74
74
|
"@empathyco/x-logger": "^1.2.0-alpha.11",
|
|
75
75
|
"@empathyco/x-storage-service": "^2.0.0-alpha.15",
|
|
76
|
-
"@empathyco/x-types": "^10.0.0-alpha.
|
|
76
|
+
"@empathyco/x-types": "^10.0.0-alpha.75",
|
|
77
77
|
"@empathyco/x-utils": "^1.0.0-alpha.23",
|
|
78
78
|
"@vue/devtools-api": "~6.5.0",
|
|
79
79
|
"@vueuse/core": "~10.1.0",
|
|
@@ -143,5 +143,5 @@
|
|
|
143
143
|
"access": "public",
|
|
144
144
|
"directory": "dist"
|
|
145
145
|
},
|
|
146
|
-
"gitHead": "
|
|
146
|
+
"gitHead": "129534ddc4d09da3fe8c96c3dbab2eeaa162ed90"
|
|
147
147
|
}
|
|
@@ -26208,6 +26208,56 @@
|
|
|
26208
26208
|
],
|
|
26209
26209
|
"name": "setQuery"
|
|
26210
26210
|
},
|
|
26211
|
+
{
|
|
26212
|
+
"kind": "MethodSignature",
|
|
26213
|
+
"canonicalReference": "@empathyco/x-components!HistoryQueriesMutations#setSearchSelectedFilters:member(1)",
|
|
26214
|
+
"docComment": "/**\n * Sets the {@link HistoryQueriesState.historyQueries} filters property.\n *\n * @param filters - The new {@link HistoryQueriesState.historyQueries} filters.\n */\n",
|
|
26215
|
+
"excerptTokens": [
|
|
26216
|
+
{
|
|
26217
|
+
"kind": "Content",
|
|
26218
|
+
"text": "setSearchSelectedFilters(filters: "
|
|
26219
|
+
},
|
|
26220
|
+
{
|
|
26221
|
+
"kind": "Reference",
|
|
26222
|
+
"text": "Filter",
|
|
26223
|
+
"canonicalReference": "@empathyco/x-components!Filter:interface"
|
|
26224
|
+
},
|
|
26225
|
+
{
|
|
26226
|
+
"kind": "Content",
|
|
26227
|
+
"text": "[]"
|
|
26228
|
+
},
|
|
26229
|
+
{
|
|
26230
|
+
"kind": "Content",
|
|
26231
|
+
"text": "): "
|
|
26232
|
+
},
|
|
26233
|
+
{
|
|
26234
|
+
"kind": "Content",
|
|
26235
|
+
"text": "void"
|
|
26236
|
+
},
|
|
26237
|
+
{
|
|
26238
|
+
"kind": "Content",
|
|
26239
|
+
"text": ";"
|
|
26240
|
+
}
|
|
26241
|
+
],
|
|
26242
|
+
"isOptional": false,
|
|
26243
|
+
"returnTypeTokenRange": {
|
|
26244
|
+
"startIndex": 4,
|
|
26245
|
+
"endIndex": 5
|
|
26246
|
+
},
|
|
26247
|
+
"releaseTag": "Public",
|
|
26248
|
+
"overloadIndex": 1,
|
|
26249
|
+
"parameters": [
|
|
26250
|
+
{
|
|
26251
|
+
"parameterName": "filters",
|
|
26252
|
+
"parameterTypeTokenRange": {
|
|
26253
|
+
"startIndex": 1,
|
|
26254
|
+
"endIndex": 3
|
|
26255
|
+
},
|
|
26256
|
+
"isOptional": false
|
|
26257
|
+
}
|
|
26258
|
+
],
|
|
26259
|
+
"name": "setSearchSelectedFilters"
|
|
26260
|
+
},
|
|
26211
26261
|
{
|
|
26212
26262
|
"kind": "MethodSignature",
|
|
26213
26263
|
"canonicalReference": "@empathyco/x-components!HistoryQueriesMutations#setSessionTimeStamp:member(1)",
|
|
@@ -53828,6 +53878,34 @@
|
|
|
53828
53878
|
"endIndex": 6
|
|
53829
53879
|
}
|
|
53830
53880
|
},
|
|
53881
|
+
{
|
|
53882
|
+
"kind": "Variable",
|
|
53883
|
+
"canonicalReference": "@empathyco/x-components!setFiltersFromHistoryQueries:var",
|
|
53884
|
+
"docComment": "/**\n * Sets the filters of the facets module from a selectedHistoryQuery's filters.\n *\n * @public\n */\n",
|
|
53885
|
+
"excerptTokens": [
|
|
53886
|
+
{
|
|
53887
|
+
"kind": "Content",
|
|
53888
|
+
"text": "setFiltersFromHistoryQueries: "
|
|
53889
|
+
},
|
|
53890
|
+
{
|
|
53891
|
+
"kind": "Content",
|
|
53892
|
+
"text": "import(\"../../wiring/wiring.types\")."
|
|
53893
|
+
},
|
|
53894
|
+
{
|
|
53895
|
+
"kind": "Reference",
|
|
53896
|
+
"text": "AnyWire",
|
|
53897
|
+
"canonicalReference": "@empathyco/x-components!AnyWire:type"
|
|
53898
|
+
}
|
|
53899
|
+
],
|
|
53900
|
+
"fileUrlPath": "src/x-modules/facets/wiring.ts",
|
|
53901
|
+
"isReadonly": true,
|
|
53902
|
+
"releaseTag": "Public",
|
|
53903
|
+
"name": "setFiltersFromHistoryQueries",
|
|
53904
|
+
"variableTypeTokenRange": {
|
|
53905
|
+
"startIndex": 1,
|
|
53906
|
+
"endIndex": 3
|
|
53907
|
+
}
|
|
53908
|
+
},
|
|
53831
53909
|
{
|
|
53832
53910
|
"kind": "Variable",
|
|
53833
53911
|
"canonicalReference": "@empathyco/x-components!setHistoryQueries:var",
|
|
@@ -55365,6 +55443,34 @@
|
|
|
55365
55443
|
"endIndex": 3
|
|
55366
55444
|
}
|
|
55367
55445
|
},
|
|
55446
|
+
{
|
|
55447
|
+
"kind": "Variable",
|
|
55448
|
+
"canonicalReference": "@empathyco/x-components!setSearchSelectedFilters:var",
|
|
55449
|
+
"docComment": "/**\n * Sets the history queries state `filters` with a selectedHistoryQuery's filters.\n *\n * @public\n */\n",
|
|
55450
|
+
"excerptTokens": [
|
|
55451
|
+
{
|
|
55452
|
+
"kind": "Content",
|
|
55453
|
+
"text": "setSearchSelectedFilters: "
|
|
55454
|
+
},
|
|
55455
|
+
{
|
|
55456
|
+
"kind": "Content",
|
|
55457
|
+
"text": "import(\"../..\")."
|
|
55458
|
+
},
|
|
55459
|
+
{
|
|
55460
|
+
"kind": "Reference",
|
|
55461
|
+
"text": "AnyWire",
|
|
55462
|
+
"canonicalReference": "@empathyco/x-components!AnyWire:type"
|
|
55463
|
+
}
|
|
55464
|
+
],
|
|
55465
|
+
"fileUrlPath": "src/x-modules/history-queries/wiring.ts",
|
|
55466
|
+
"isReadonly": true,
|
|
55467
|
+
"releaseTag": "Public",
|
|
55468
|
+
"name": "setSearchSelectedFilters",
|
|
55469
|
+
"variableTypeTokenRange": {
|
|
55470
|
+
"startIndex": 1,
|
|
55471
|
+
"endIndex": 3
|
|
55472
|
+
}
|
|
55473
|
+
},
|
|
55368
55474
|
{
|
|
55369
55475
|
"kind": "Variable",
|
|
55370
55476
|
"canonicalReference": "@empathyco/x-components!setSearchSelectedFiltersFromPreview:var",
|
|
@@ -55393,6 +55499,34 @@
|
|
|
55393
55499
|
"endIndex": 3
|
|
55394
55500
|
}
|
|
55395
55501
|
},
|
|
55502
|
+
{
|
|
55503
|
+
"kind": "Variable",
|
|
55504
|
+
"canonicalReference": "@empathyco/x-components!setSearchSelectedFiltersFromPreviewable:var",
|
|
55505
|
+
"docComment": "/**\n * Sets the search state `selectedFilters` with a selectedHistoryQuery's filters.\n *\n * @public\n */\n",
|
|
55506
|
+
"excerptTokens": [
|
|
55507
|
+
{
|
|
55508
|
+
"kind": "Content",
|
|
55509
|
+
"text": "setSearchSelectedFiltersFromPreviewable: "
|
|
55510
|
+
},
|
|
55511
|
+
{
|
|
55512
|
+
"kind": "Content",
|
|
55513
|
+
"text": "import(\"../../wiring\")."
|
|
55514
|
+
},
|
|
55515
|
+
{
|
|
55516
|
+
"kind": "Reference",
|
|
55517
|
+
"text": "AnyWire",
|
|
55518
|
+
"canonicalReference": "@empathyco/x-components!AnyWire:type"
|
|
55519
|
+
}
|
|
55520
|
+
],
|
|
55521
|
+
"fileUrlPath": "src/x-modules/search/wiring.ts",
|
|
55522
|
+
"isReadonly": true,
|
|
55523
|
+
"releaseTag": "Public",
|
|
55524
|
+
"name": "setSearchSelectedFiltersFromPreviewable",
|
|
55525
|
+
"variableTypeTokenRange": {
|
|
55526
|
+
"startIndex": 1,
|
|
55527
|
+
"endIndex": 3
|
|
55528
|
+
}
|
|
55529
|
+
},
|
|
55396
55530
|
{
|
|
55397
55531
|
"kind": "Variable",
|
|
55398
55532
|
"canonicalReference": "@empathyco/x-components!setSearchUrlParams:var",
|
|
@@ -2017,6 +2017,9 @@ export const facetsWiring: {
|
|
|
2017
2017
|
setQueryFromPreview: AnyWire;
|
|
2018
2018
|
setSelectedFiltersFromPreview: AnyWire;
|
|
2019
2019
|
};
|
|
2020
|
+
UserSelectedAHistoryQuery: {
|
|
2021
|
+
setFiltersFromHistoryQueries: AnyWire;
|
|
2022
|
+
};
|
|
2020
2023
|
};
|
|
2021
2024
|
|
|
2022
2025
|
// @public
|
|
@@ -2529,6 +2532,7 @@ export interface HistoryQueriesMutations extends QueryMutations {
|
|
|
2529
2532
|
setHistoryQueries(historyQueries: HistoryQuery_2[]): void;
|
|
2530
2533
|
setIsEnabled(isEnabled: boolean): void;
|
|
2531
2534
|
setQuery(query: string): void;
|
|
2535
|
+
setSearchSelectedFilters(filters: Filter[]): void;
|
|
2532
2536
|
setSessionTimeStamp(timeStamp: number): void;
|
|
2533
2537
|
}
|
|
2534
2538
|
|
|
@@ -2571,6 +2575,9 @@ export const historyQueriesWiring: {
|
|
|
2571
2575
|
setHistoryQueriesQuery: Wire<string>;
|
|
2572
2576
|
addQueryToHistoryQueries: Wire<string>;
|
|
2573
2577
|
};
|
|
2578
|
+
UserSelectedAHistoryQuery: {
|
|
2579
|
+
setSearchSelectedFilters: AnyWire;
|
|
2580
|
+
};
|
|
2574
2581
|
UserIsTypingAQuery: {
|
|
2575
2582
|
setHistoryQueriesQueryDebounce: Wire<string>;
|
|
2576
2583
|
};
|
|
@@ -4912,6 +4919,9 @@ export const searchWiring: {
|
|
|
4912
4919
|
QueryPreviewUnselected: {
|
|
4913
4920
|
setSearchExtraParams: Wire<Dictionary<unknown>>;
|
|
4914
4921
|
};
|
|
4922
|
+
UserSelectedAHistoryQuery: {
|
|
4923
|
+
setSearchSelectedFiltersFromPreviewable: AnyWire;
|
|
4924
|
+
};
|
|
4915
4925
|
};
|
|
4916
4926
|
|
|
4917
4927
|
// @public
|
|
@@ -5077,6 +5087,9 @@ export const setConsent: Wire<boolean>;
|
|
|
5077
5087
|
// @public
|
|
5078
5088
|
export const setExtraParams: Wire<Dictionary<unknown>>;
|
|
5079
5089
|
|
|
5090
|
+
// @public
|
|
5091
|
+
export const setFiltersFromHistoryQueries: AnyWire;
|
|
5092
|
+
|
|
5080
5093
|
// @public
|
|
5081
5094
|
export const setHistoryQueries: HistoryQueriesXStoreModule['actions']['setHistoryQueries'];
|
|
5082
5095
|
|
|
@@ -5218,9 +5231,15 @@ export const setSearchQuery: Wire<string>;
|
|
|
5218
5231
|
// @public
|
|
5219
5232
|
export const setSearchQueryFromPreview: AnyWire;
|
|
5220
5233
|
|
|
5234
|
+
// @public
|
|
5235
|
+
export const setSearchSelectedFilters: AnyWire;
|
|
5236
|
+
|
|
5221
5237
|
// @public
|
|
5222
5238
|
export const setSearchSelectedFiltersFromPreview: AnyWire;
|
|
5223
5239
|
|
|
5240
|
+
// @public
|
|
5241
|
+
export const setSearchSelectedFiltersFromPreviewable: AnyWire;
|
|
5242
|
+
|
|
5224
5243
|
// @public
|
|
5225
5244
|
export const setSearchUrlParams: SearchXStoreModule['actions']['setUrlParams'];
|
|
5226
5245
|
|
package/report/x-types.api.json
CHANGED
|
@@ -1740,6 +1740,38 @@
|
|
|
1740
1740
|
"name": "HistoryQuery",
|
|
1741
1741
|
"preserveMemberOrder": false,
|
|
1742
1742
|
"members": [
|
|
1743
|
+
{
|
|
1744
|
+
"kind": "PropertySignature",
|
|
1745
|
+
"canonicalReference": "@empathyco/x-types!HistoryQuery#selectedFilters:member",
|
|
1746
|
+
"docComment": "/**\n * Filters selected for the query to search for.\n */\n",
|
|
1747
|
+
"excerptTokens": [
|
|
1748
|
+
{
|
|
1749
|
+
"kind": "Content",
|
|
1750
|
+
"text": "selectedFilters?: "
|
|
1751
|
+
},
|
|
1752
|
+
{
|
|
1753
|
+
"kind": "Reference",
|
|
1754
|
+
"text": "Filter",
|
|
1755
|
+
"canonicalReference": "@empathyco/x-types!Filter:interface"
|
|
1756
|
+
},
|
|
1757
|
+
{
|
|
1758
|
+
"kind": "Content",
|
|
1759
|
+
"text": "[]"
|
|
1760
|
+
},
|
|
1761
|
+
{
|
|
1762
|
+
"kind": "Content",
|
|
1763
|
+
"text": ";"
|
|
1764
|
+
}
|
|
1765
|
+
],
|
|
1766
|
+
"isReadonly": false,
|
|
1767
|
+
"isOptional": true,
|
|
1768
|
+
"releaseTag": "Public",
|
|
1769
|
+
"name": "selectedFilters",
|
|
1770
|
+
"propertyTypeTokenRange": {
|
|
1771
|
+
"startIndex": 1,
|
|
1772
|
+
"endIndex": 3
|
|
1773
|
+
}
|
|
1774
|
+
},
|
|
1743
1775
|
{
|
|
1744
1776
|
"kind": "PropertySignature",
|
|
1745
1777
|
"canonicalReference": "@empathyco/x-types!HistoryQuery#timestamp:member",
|
package/search/index.js
CHANGED
|
@@ -24,5 +24,5 @@ export { searchEmitters } from '../js/x-modules/search/store/emitters.js';
|
|
|
24
24
|
export { request as searchRequest } from '../js/x-modules/search/store/getters/request.getter.js';
|
|
25
25
|
export { query as searchQuery } from '../js/x-modules/search/store/getters/query.getter.js';
|
|
26
26
|
export { resettableState, searchXStoreModule } from '../js/x-modules/search/store/module.js';
|
|
27
|
-
export { cancelFetchAndSaveSearchResponseWire, clearSearchQuery, fetchAndSaveSearchResponseWire, increasePageAppendingResultsWire, resetAppending, resetFromNoResultsWithFilters, resetIsNoResults, resetRequestOnRefinementWire, resetSpellcheckQuery, resetStateIfNoRequestWire, saveOriginWire, searchWiring, setRelatedTags, setSearchExtraParams, setSearchExtraParamsFromPreview, setSearchPage, setSearchQuery, setSearchQueryFromPreview, setSearchSelectedFiltersFromPreview, setSelectedFilters, setSort, setUrlParams } from '../js/x-modules/search/wiring.js';
|
|
27
|
+
export { cancelFetchAndSaveSearchResponseWire, clearSearchQuery, fetchAndSaveSearchResponseWire, increasePageAppendingResultsWire, resetAppending, resetFromNoResultsWithFilters, resetIsNoResults, resetRequestOnRefinementWire, resetSpellcheckQuery, resetStateIfNoRequestWire, saveOriginWire, searchWiring, setRelatedTags, setSearchExtraParams, setSearchExtraParamsFromPreview, setSearchPage, setSearchQuery, setSearchQueryFromPreview, setSearchSelectedFiltersFromPreview, setSearchSelectedFiltersFromPreviewable, setSelectedFilters, setSort, setUrlParams } from '../js/x-modules/search/wiring.js';
|
|
28
28
|
export { searchXModule } from '../js/x-modules/search/x-module.js';
|
|
@@ -6,6 +6,12 @@ import { UrlParams } from '../../types/url-params';
|
|
|
6
6
|
* @public
|
|
7
7
|
*/
|
|
8
8
|
export declare const setSelectedFiltersFromPreview: import("../../wiring/wiring.types").AnyWire;
|
|
9
|
+
/**
|
|
10
|
+
* Sets the filters of the facets module from a selectedHistoryQuery's filters.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export declare const setFiltersFromHistoryQueries: import("../../wiring/wiring.types").AnyWire;
|
|
9
15
|
/**
|
|
10
16
|
* Sets the query of the facets module from a queryPreview.
|
|
11
17
|
*
|
|
@@ -66,5 +72,8 @@ export declare const facetsWiring: {
|
|
|
66
72
|
setQueryFromPreview: import("../../wiring/wiring.types").AnyWire;
|
|
67
73
|
setSelectedFiltersFromPreview: import("../../wiring/wiring.types").AnyWire;
|
|
68
74
|
};
|
|
75
|
+
UserSelectedAHistoryQuery: {
|
|
76
|
+
setFiltersFromHistoryQueries: import("../../wiring/wiring.types").AnyWire;
|
|
77
|
+
};
|
|
69
78
|
};
|
|
70
79
|
//# sourceMappingURL=wiring.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring.d.ts","sourceRoot":"","sources":["../../../../src/x-modules/facets/wiring.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AA6JnD;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,6CAGzC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,6CAAiE,CAAC;AAElG;;;;GAIG;AACH,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"wiring.d.ts","sourceRoot":"","sources":["../../../../src/x-modules/facets/wiring.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AA6JnD;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,6CAGzC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,6CAGxC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,6CAAiE,CAAC;AAElG;;;;GAIG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDvB,CAAC"}
|
|
@@ -6,8 +6,7 @@ import { HistoryQueriesXStoreModule } from '../types';
|
|
|
6
6
|
* The matching history query will only be updated on the following scenarios:
|
|
7
7
|
* 1. If it is part of a previous session, not the current one.
|
|
8
8
|
* 2. If its total results count has not been registered yet.
|
|
9
|
-
* 3. If
|
|
10
|
-
* meaning that the previous update was part of a filtered request.
|
|
9
|
+
* 3. If there is a new search response.
|
|
11
10
|
*
|
|
12
11
|
* @param context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,
|
|
13
12
|
* provided by Vuex.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-history-queries-with-search-response.action.d.ts","sourceRoot":"","sources":["../../../../../../src/x-modules/history-queries/store/actions/update-history-queries-with-search-response.action.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update-history-queries-with-search-response.action.d.ts","sourceRoot":"","sources":["../../../../../../src/x-modules/history-queries/store/actions/update-history-queries-with-search-response.action.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAGtD;;;;;;;;;;;;;;;;;GAiBG;AAEH,eAAO,MAAM,sCAAsC,EAAE,0BAA0B,CAAC,SAAS,CAAC,CAAC,wCAAwC,CAsBhI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/history-queries/store/module.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,EAAE,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/history-queries/store/module.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,EAAE,0BA6CxC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HistoryQuery } from '@empathyco/x-types';
|
|
1
|
+
import { Filter, HistoryQuery } from '@empathyco/x-types';
|
|
2
2
|
import { XActionContext, XStoreModule } from '../../../store';
|
|
3
3
|
import { QueryMutations, QueryState } from '../../../store/utils/query.utils';
|
|
4
4
|
import { UrlParams } from '../../../types/url-params';
|
|
@@ -91,6 +91,12 @@ export interface HistoryQueriesMutations extends QueryMutations {
|
|
|
91
91
|
* @param isEnabled - The new {@link HistoryQueriesState.isEnabled }.
|
|
92
92
|
*/
|
|
93
93
|
setIsEnabled(isEnabled: boolean): void;
|
|
94
|
+
/**
|
|
95
|
+
* Sets the {@link HistoryQueriesState.historyQueries } filters property.
|
|
96
|
+
*
|
|
97
|
+
* @param filters - The new {@link HistoryQueriesState.historyQueries } filters.
|
|
98
|
+
*/
|
|
99
|
+
setSearchSelectedFilters(filters: Filter[]): void;
|
|
94
100
|
}
|
|
95
101
|
/**
|
|
96
102
|
* HistoryQueries store actions.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/history-queries/store/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/history-queries/store/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D;;;;GAIG;AACH,MAAM,WAAW,mBAAoB,SAAQ,UAAU;IACrD;;OAEG;IACH,MAAM,EAAE,oBAAoB,CAAC;IAC7B;;OAEG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAC7B;;;OAGG;IACH,cAAc,EA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;;OAIG;IACH,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;IACzC;;;;;OAKG;IACH,oBAAoB,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/C;;;;OAIG;IACH,sCAAsC,CAAC,cAAc,EAAE,sBAAsB,GAAG,IAAI,CAAC;CACtF;AACD;;;;GAIG;AACH,MAAM,MAAM,0BAA0B,GAAG,YAAY,CACnD,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,CACtB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,2BAA2B,GAAG,cAAc,CACtD,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,CACtB,CAAC"}
|
|
@@ -73,6 +73,12 @@ export declare const setHistoryQueriesDisabled: import("../..").AnyWire;
|
|
|
73
73
|
* @public
|
|
74
74
|
*/
|
|
75
75
|
export declare const updateHistoryQueriesWithSearchResponse: import("../..").Wire<import("../search").InternalSearchResponse>;
|
|
76
|
+
/**
|
|
77
|
+
* Sets the history queries state `filters` with a selectedHistoryQuery's filters.
|
|
78
|
+
*
|
|
79
|
+
* @public
|
|
80
|
+
*/
|
|
81
|
+
export declare const setSearchSelectedFilters: import("../..").AnyWire;
|
|
76
82
|
/**
|
|
77
83
|
* Default wiring for the {@link HistoryQueries} module.
|
|
78
84
|
*
|
|
@@ -95,6 +101,9 @@ export declare const historyQueriesWiring: {
|
|
|
95
101
|
setHistoryQueriesQuery: import("../..").Wire<string>;
|
|
96
102
|
addQueryToHistoryQueries: import("../..").Wire<string>;
|
|
97
103
|
};
|
|
104
|
+
UserSelectedAHistoryQuery: {
|
|
105
|
+
setSearchSelectedFilters: import("../..").AnyWire;
|
|
106
|
+
};
|
|
98
107
|
UserIsTypingAQuery: {
|
|
99
108
|
setHistoryQueriesQueryDebounce: import("../..").Wire<string>;
|
|
100
109
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring.d.ts","sourceRoot":"","sources":["../../../../src/x-modules/history-queries/wiring.ts"],"names":[],"mappings":"AAkCA;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,8BAAoC,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,mCAAmC,yBAG/C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,8BAAyB,CAAC;AAE7D;;;;;GAKG;AACH,eAAO,MAAM,iCAAiC,yBAG7C,CAAC;AASF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,yBAA6B,CAAC;AAEnE;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,yBAA+C,CAAC;AAEzF;;;;;GAKG;AACH,eAAO,MAAM,wCAAwC,yBAEpD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,yBAAwC,CAAC;AAEzE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,iEAAoC,CAAC;AAEpE;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,yBAA6C,CAAC;AAEnF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,yBAA8C,CAAC;AAErF;;;;GAIG;AACH,eAAO,MAAM,sCAAsC,kEAElD,CAAC;
|
|
1
|
+
{"version":3,"file":"wiring.d.ts","sourceRoot":"","sources":["../../../../src/x-modules/history-queries/wiring.ts"],"names":[],"mappings":"AAkCA;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,8BAAoC,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,mCAAmC,yBAG/C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,8BAAyB,CAAC;AAE7D;;;;;GAKG;AACH,eAAO,MAAM,iCAAiC,yBAG7C,CAAC;AASF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,yBAA6B,CAAC;AAEnE;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,yBAA+C,CAAC;AAEzF;;;;;GAKG;AACH,eAAO,MAAM,wCAAwC,yBAEpD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,yBAAwC,CAAC;AAEzE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,iEAAoC,CAAC;AAEpE;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,yBAA6C,CAAC;AAEnF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,yBAA8C,CAAC;AAErF;;;;GAIG;AACH,eAAO,MAAM,sCAAsC,kEAElD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,yBAGpC,CAAC;AAMF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoD/B,CAAC"}
|
|
@@ -127,6 +127,12 @@ export declare const setSearchExtraParamsFromPreview: import("../../wiring").Any
|
|
|
127
127
|
* @public
|
|
128
128
|
*/
|
|
129
129
|
export declare const setSearchSelectedFiltersFromPreview: import("../../wiring").AnyWire;
|
|
130
|
+
/**
|
|
131
|
+
* Sets the search state `selectedFilters` with a selectedHistoryQuery's filters.
|
|
132
|
+
*
|
|
133
|
+
* @public
|
|
134
|
+
*/
|
|
135
|
+
export declare const setSearchSelectedFiltersFromPreviewable: import("../../wiring").AnyWire;
|
|
130
136
|
/**
|
|
131
137
|
* Search wiring.
|
|
132
138
|
*
|
|
@@ -196,5 +202,8 @@ export declare const searchWiring: {
|
|
|
196
202
|
QueryPreviewUnselected: {
|
|
197
203
|
setSearchExtraParams: import("../../wiring").Wire<import("@empathyco/x-utils").Dictionary<unknown>>;
|
|
198
204
|
};
|
|
205
|
+
UserSelectedAHistoryQuery: {
|
|
206
|
+
setSearchSelectedFiltersFromPreviewable: import("../../wiring").AnyWire;
|
|
207
|
+
};
|
|
199
208
|
};
|
|
200
209
|
//# sourceMappingURL=wiring.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring.d.ts","sourceRoot":"","sources":["../../../../src/x-modules/search/wiring.ts"],"names":[],"m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