@empathyco/x-components 3.1.0-alpha.3 → 4.0.0-alpha.1
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 +26 -0
- package/design-system/deprecated-full-theme.css +69 -69
- package/docs/API-reference/api/x-components.resultfeature.md +1 -1
- package/docs/API-reference/api/x-components.selectedfiltersbyfacet.md +1 -1
- package/js/x-modules/facets/entities/filter-entity.factory.js +2 -1
- package/js/x-modules/facets/entities/filter-entity.factory.js.map +1 -1
- package/js/x-modules/facets/store/constants.js +4 -0
- package/js/x-modules/facets/store/constants.js.map +1 -0
- package/js/x-modules/facets/store/getters/facets.getter.js +2 -1
- package/js/x-modules/facets/store/getters/facets.getter.js.map +1 -1
- package/js/x-modules/facets/store/getters/selected-filters-by-facet.getter.js +4 -3
- package/js/x-modules/facets/store/getters/selected-filters-by-facet.getter.js.map +1 -1
- package/js/x-modules/history-queries/store/actions/update-history-queries-with-search-response.action.js +3 -1
- package/js/x-modules/history-queries/store/actions/update-history-queries-with-search-response.action.js.map +1 -1
- package/js/x-modules/search/store/module.js +2 -1
- package/js/x-modules/search/store/module.js.map +1 -1
- package/package.json +4 -4
- package/report/x-components.api.json +3 -8
- package/report/x-components.api.md +3 -4
- package/types/types/origin.d.ts +1 -6
- package/types/types/origin.d.ts.map +1 -1
- package/types/x-modules/facets/entities/filter-entity.factory.d.ts +2 -1
- package/types/x-modules/facets/entities/filter-entity.factory.d.ts.map +1 -1
- package/types/x-modules/facets/store/constants.d.ts +2 -0
- package/types/x-modules/facets/store/constants.d.ts.map +1 -0
- package/types/x-modules/facets/store/getters/facets.getter.d.ts.map +1 -1
- package/types/x-modules/facets/store/getters/selected-filters-by-facet.getter.d.ts +2 -2
- package/types/x-modules/facets/store/getters/selected-filters-by-facet.getter.d.ts.map +1 -1
- package/types/x-modules/history-queries/store/actions/update-history-queries-with-search-response.action.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,32 @@
|
|
|
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
|
+
## [4.0.0-alpha.1](https://github.com/empathyco/x/compare/@empathyco/x-components@4.0.0-alpha.0...@empathyco/x-components@4.0.0-alpha.1) (2023-11-20)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* use `cypress run` for headless testing (#1357) ([bc88050](https://github.com/empathyco/x/commit/bc88050a6c525e65d8b0e2d1adacf5d823df9137))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [4.0.0-alpha.0](https://github.com/empathyco/x/compare/@empathyco/x-components@3.1.0-alpha.3...@empathyco/x-components@4.0.0-alpha.0) (2023-11-16)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### ⚠ BREAKING CHANGES
|
|
19
|
+
|
|
20
|
+
* **components:** remove deprecated origins from (#1344)
|
|
21
|
+
* **facets:** The '__unknown-facet__' value for a facetId is deprecated: it has been replaced by the UNKNOWN_FACET_KEY constant, whose value is '__unknown__'.
|
|
22
|
+
|
|
23
|
+
Co-authored-by: Guillermo Cacheda <cachedacodes@gmail.com>
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* **components:** remove deprecated origins (#1355) ([3d7c981](https://github.com/empathyco/x/commit/3d7c981380bd8af30724780f7810808d563db471))
|
|
28
|
+
* **facets:** Unify __unknown__ and __unknown-facet__ in a constant (#1351) ([30585f2](https://github.com/empathyco/x/commit/30585f2d57653aa33c68f748ff10f93202f1887e))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
6
32
|
## [3.1.0-alpha.3](https://github.com/empathyco/x/compare/@empathyco/x-components@3.1.0-alpha.2...@empathyco/x-components@3.1.0-alpha.3) (2023-11-13)
|
|
7
33
|
|
|
8
34
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
2
|
.x-uppercase {
|
|
4
3
|
text-transform: uppercase;
|
|
5
4
|
}
|
|
@@ -15,25 +14,6 @@
|
|
|
15
14
|
.x-normal-case {
|
|
16
15
|
text-transform: none;
|
|
17
16
|
}
|
|
18
|
-
.x-static {
|
|
19
|
-
position: static !important;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.x-fixed {
|
|
23
|
-
position: fixed !important;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.x-absolute {
|
|
27
|
-
position: absolute !important;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.x-relative {
|
|
31
|
-
position: relative !important;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.x-sticky {
|
|
35
|
-
position: sticky !important;
|
|
36
|
-
}
|
|
37
17
|
.x-underline {
|
|
38
18
|
-webkit-text-decoration-line: underline;
|
|
39
19
|
text-decoration-line: underline;
|
|
@@ -53,6 +33,25 @@
|
|
|
53
33
|
-webkit-text-decoration-line: none;
|
|
54
34
|
text-decoration-line: none;
|
|
55
35
|
}
|
|
36
|
+
.x-static {
|
|
37
|
+
position: static !important;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.x-fixed {
|
|
41
|
+
position: fixed !important;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.x-absolute {
|
|
45
|
+
position: absolute !important;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.x-relative {
|
|
49
|
+
position: relative !important;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.x-sticky {
|
|
53
|
+
position: sticky !important;
|
|
54
|
+
}
|
|
56
55
|
.x-padding--00 {
|
|
57
56
|
padding: 0 !important;
|
|
58
57
|
}
|
|
@@ -3578,13 +3577,6 @@
|
|
|
3578
3577
|
--x-size-border-radius-bottom-right-tag-pill: var(--x-size-border-radius-tag-pill);
|
|
3579
3578
|
--x-size-border-radius-bottom-left-tag-pill: var(--x-size-border-radius-tag-pill);
|
|
3580
3579
|
}
|
|
3581
|
-
:root {
|
|
3582
|
-
--x-size-border-radius-tag-pill: var(--x-size-border-radius-base-pill);
|
|
3583
|
-
--x-size-border-radius-top-left-tag-pill: var(--x-size-border-radius-tag-pill);
|
|
3584
|
-
--x-size-border-radius-top-right-tag-pill: var(--x-size-border-radius-tag-pill);
|
|
3585
|
-
--x-size-border-radius-bottom-right-tag-pill: var(--x-size-border-radius-tag-pill);
|
|
3586
|
-
--x-size-border-radius-bottom-left-tag-pill: var(--x-size-border-radius-tag-pill);
|
|
3587
|
-
}
|
|
3588
3580
|
|
|
3589
3581
|
.x-tag--pill.x-tag,
|
|
3590
3582
|
.x-tag--pill .x-tag {
|
|
@@ -3596,6 +3588,13 @@
|
|
|
3596
3588
|
);
|
|
3597
3589
|
--x-size-border-radius-bottom-left-tag-default: var(--x-size-border-radius-bottom-left-tag-pill);
|
|
3598
3590
|
}
|
|
3591
|
+
:root {
|
|
3592
|
+
--x-size-border-radius-tag-pill: var(--x-size-border-radius-base-pill);
|
|
3593
|
+
--x-size-border-radius-top-left-tag-pill: var(--x-size-border-radius-tag-pill);
|
|
3594
|
+
--x-size-border-radius-top-right-tag-pill: var(--x-size-border-radius-tag-pill);
|
|
3595
|
+
--x-size-border-radius-bottom-right-tag-pill: var(--x-size-border-radius-tag-pill);
|
|
3596
|
+
--x-size-border-radius-bottom-left-tag-pill: var(--x-size-border-radius-tag-pill);
|
|
3597
|
+
}
|
|
3599
3598
|
:root {
|
|
3600
3599
|
--x-color-background-tag-ghost: transparent;
|
|
3601
3600
|
--x-color-border-tag-ghost: transparent;
|
|
@@ -4405,6 +4404,13 @@
|
|
|
4405
4404
|
--x-size-padding-sliding-panel-button: var(--x-size-base-03);
|
|
4406
4405
|
--x-size-horizontal-margin-sliding-panel-button-overflow: var(--x-size-base-02);
|
|
4407
4406
|
}
|
|
4407
|
+
:root {
|
|
4408
|
+
--x-string-overflow-scroll: auto;
|
|
4409
|
+
--x-color-background-scroll-bar: transparent;
|
|
4410
|
+
--x-color-thumb-scroll-bar: var(--x-color-base-neutral-95);
|
|
4411
|
+
--x-color-background-scroll-bar-hover: transparent;
|
|
4412
|
+
--x-color-thumb-scroll-bar-hover: var(--x-color-base-neutral-70);
|
|
4413
|
+
}
|
|
4408
4414
|
.x-sliding-panel {
|
|
4409
4415
|
z-index: 0;
|
|
4410
4416
|
background-color: var(--x-color-background-sliding-panel);
|
|
@@ -4470,13 +4476,6 @@
|
|
|
4470
4476
|
--x-color-background-scroll-bar-hover: transparent;
|
|
4471
4477
|
--x-color-thumb-scroll-bar-hover: var(--x-color-base-neutral-70);
|
|
4472
4478
|
}
|
|
4473
|
-
:root {
|
|
4474
|
-
--x-string-overflow-scroll: auto;
|
|
4475
|
-
--x-color-background-scroll-bar: transparent;
|
|
4476
|
-
--x-color-thumb-scroll-bar: var(--x-color-base-neutral-95);
|
|
4477
|
-
--x-color-background-scroll-bar-hover: transparent;
|
|
4478
|
-
--x-color-thumb-scroll-bar-hover: var(--x-color-base-neutral-70);
|
|
4479
|
-
}
|
|
4480
4479
|
|
|
4481
4480
|
.x-scroll {
|
|
4482
4481
|
overflow-y: var(--x-string-overflow-scroll);
|
|
@@ -4677,14 +4676,6 @@
|
|
|
4677
4676
|
--x-size-span-row-item: 1;
|
|
4678
4677
|
--x-size-start-row-item: 0;
|
|
4679
4678
|
}
|
|
4680
|
-
:root {
|
|
4681
|
-
--x-size-gap-row: 0;
|
|
4682
|
-
--x-size-padding-row: 0;
|
|
4683
|
-
--x-size-justify-row: stretch;
|
|
4684
|
-
--x-size-align-row: center;
|
|
4685
|
-
--x-size-span-row-item: 1;
|
|
4686
|
-
--x-size-start-row-item: 0;
|
|
4687
|
-
}
|
|
4688
4679
|
|
|
4689
4680
|
.x-row {
|
|
4690
4681
|
display: grid;
|
|
@@ -4805,6 +4796,14 @@
|
|
|
4805
4796
|
.x-row--align-stretch {
|
|
4806
4797
|
--x-size-align-row: stretch;
|
|
4807
4798
|
}
|
|
4799
|
+
:root {
|
|
4800
|
+
--x-size-gap-row: 0;
|
|
4801
|
+
--x-size-padding-row: 0;
|
|
4802
|
+
--x-size-justify-row: stretch;
|
|
4803
|
+
--x-size-align-row: center;
|
|
4804
|
+
--x-size-span-row-item: 1;
|
|
4805
|
+
--x-size-start-row-item: 0;
|
|
4806
|
+
}
|
|
4808
4807
|
:root {
|
|
4809
4808
|
--x-color-border-result-default: var(--x-color-base-lead);
|
|
4810
4809
|
--x-color-border-result-overlay-default: var(--x-color-border-result-default);
|
|
@@ -5041,26 +5040,6 @@
|
|
|
5041
5040
|
--x-color-background-picture-cover-hover-from: rgba(0, 0, 0, 0);
|
|
5042
5041
|
--x-color-background-picture-cover-hover-to: rgba(0, 0, 0, 0.5);
|
|
5043
5042
|
}
|
|
5044
|
-
:root {
|
|
5045
|
-
--x-color-background-picture-cover-hover-from: rgba(0, 0, 0, 0);
|
|
5046
|
-
--x-color-background-picture-cover-hover-to: rgba(0, 0, 0, 0.5);
|
|
5047
|
-
}
|
|
5048
|
-
|
|
5049
|
-
.x-picture--cover.x-picture {
|
|
5050
|
-
position: relative;
|
|
5051
|
-
}
|
|
5052
|
-
|
|
5053
|
-
.x-result:hover .x-picture--cover:after,
|
|
5054
|
-
.x-picture--cover:hover:after {
|
|
5055
|
-
content: "";
|
|
5056
|
-
display: block;
|
|
5057
|
-
position: absolute;
|
|
5058
|
-
top: 0;
|
|
5059
|
-
left: 0;
|
|
5060
|
-
background: linear-gradient(to bottom, var(--x-color-background-picture-cover-hover-from) 50%, var(--x-color-background-picture-cover-hover-to) 100%);
|
|
5061
|
-
width: 100%;
|
|
5062
|
-
height: 100%;
|
|
5063
|
-
}
|
|
5064
5043
|
:root {
|
|
5065
5044
|
--x-color-background-picture-colored: var(--x-color-base-neutral-95);
|
|
5066
5045
|
--x-mix-blend-mode-picture-colored: multiply;
|
|
@@ -8468,6 +8447,13 @@
|
|
|
8468
8447
|
--x-size-border-width-bottom-button-secondary: var(--x-size-border-width-button-secondary);
|
|
8469
8448
|
--x-size-border-width-left-button-secondary: var(--x-size-border-width-button-secondary);
|
|
8470
8449
|
}
|
|
8450
|
+
:root {
|
|
8451
|
+
--x-size-border-radius-button-round: var(--x-size-border-radius-base-pill);
|
|
8452
|
+
--x-size-border-radius-top-left-button-round: var(--x-size-border-radius-button-round);
|
|
8453
|
+
--x-size-border-radius-top-right-button-round: var(--x-size-border-radius-button-round);
|
|
8454
|
+
--x-size-border-radius-bottom-right-button-round: var(--x-size-border-radius-button-round);
|
|
8455
|
+
--x-size-border-radius-bottom-left-button-round: var(--x-size-border-radius-button-round);
|
|
8456
|
+
}
|
|
8471
8457
|
:root {
|
|
8472
8458
|
--x-color-background-button-secondary: transparent;
|
|
8473
8459
|
--x-color-border-button-secondary: var(--x-color-border-button-default);
|
|
@@ -8496,13 +8482,6 @@
|
|
|
8496
8482
|
--x-size-border-radius-bottom-right-button-round: var(--x-size-border-radius-button-round);
|
|
8497
8483
|
--x-size-border-radius-bottom-left-button-round: var(--x-size-border-radius-button-round);
|
|
8498
8484
|
}
|
|
8499
|
-
:root {
|
|
8500
|
-
--x-size-border-radius-button-round: var(--x-size-border-radius-base-pill);
|
|
8501
|
-
--x-size-border-radius-top-left-button-round: var(--x-size-border-radius-button-round);
|
|
8502
|
-
--x-size-border-radius-top-right-button-round: var(--x-size-border-radius-button-round);
|
|
8503
|
-
--x-size-border-radius-bottom-right-button-round: var(--x-size-border-radius-button-round);
|
|
8504
|
-
--x-size-border-radius-bottom-left-button-round: var(--x-size-border-radius-button-round);
|
|
8505
|
-
}
|
|
8506
8485
|
|
|
8507
8486
|
.x-button--round.x-button,
|
|
8508
8487
|
.x-button--round .x-button {
|
|
@@ -8845,4 +8824,25 @@
|
|
|
8845
8824
|
--x-size-border-radius-base-m: var(--x-size-base-06);
|
|
8846
8825
|
--x-size-border-radius-base-pill: 99999px;
|
|
8847
8826
|
--x-size-border-width-base: 1px;
|
|
8827
|
+
}
|
|
8828
|
+
|
|
8829
|
+
:root {
|
|
8830
|
+
--x-color-background-picture-cover-hover-from: rgba(0, 0, 0, 0);
|
|
8831
|
+
--x-color-background-picture-cover-hover-to: rgba(0, 0, 0, 0.5);
|
|
8832
|
+
}
|
|
8833
|
+
|
|
8834
|
+
.x-picture--cover.x-picture {
|
|
8835
|
+
position: relative;
|
|
8836
|
+
}
|
|
8837
|
+
|
|
8838
|
+
.x-result:hover .x-picture--cover:after,
|
|
8839
|
+
.x-picture--cover:hover:after {
|
|
8840
|
+
content: "";
|
|
8841
|
+
display: block;
|
|
8842
|
+
position: absolute;
|
|
8843
|
+
top: 0;
|
|
8844
|
+
left: 0;
|
|
8845
|
+
background: linear-gradient(to bottom, var(--x-color-background-picture-cover-hover-from) 50%, var(--x-color-background-picture-cover-hover-to) 100%);
|
|
8846
|
+
width: 100%;
|
|
8847
|
+
height: 100%;
|
|
8848
8848
|
}
|
|
@@ -9,5 +9,5 @@ The name of the tool that generated the results.
|
|
|
9
9
|
**Signature:**
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
|
-
export type ResultFeature = 'search' | 'topclicked_recommendations' | 'brand_recommendations' | 'next_query_recommendations' | 'semantic_recommendations' | 'partial_results' | 'identifier_result'
|
|
12
|
+
export type ResultFeature = 'search' | 'topclicked_recommendations' | 'brand_recommendations' | 'next_query_recommendations' | 'semantic_recommendations' | 'partial_results' | 'identifier_result';
|
|
13
13
|
```
|
|
@@ -14,5 +14,5 @@ selectedFiltersByFacet: FacetsXStoreModule['getters']['selectedFiltersByFacet']
|
|
|
14
14
|
|
|
15
15
|
## Remarks
|
|
16
16
|
|
|
17
|
-
If there are filters without
|
|
17
|
+
If there are filters without facetId (RawFilter), they will be grouped under the UNKNOWN\_FACET\_KEY constant.
|
|
18
18
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isFacetFilter } from '@empathyco/x-types';
|
|
2
|
+
import { UNKNOWN_FACET_KEY } from '../store/constants.js';
|
|
2
3
|
import { EditableNumberRangeFilterEntity } from './editable-number-range-filter.entity.js';
|
|
3
4
|
import { HierarchicalFilterEntity } from './hierarchical-filter.entity.js';
|
|
4
5
|
import { NumberRangeFilterEntity } from './number-range-filter.entity.js';
|
|
@@ -47,7 +48,7 @@ class FilterEntityFactory {
|
|
|
47
48
|
* @returns The {@link FilterEntity} created by the factory.
|
|
48
49
|
*/
|
|
49
50
|
getFilterEntity(store, filter) {
|
|
50
|
-
const cacheKey = isFacetFilter(filter) ? filter.facetId :
|
|
51
|
+
const cacheKey = isFacetFilter(filter) ? filter.facetId : UNKNOWN_FACET_KEY;
|
|
51
52
|
return this.cache[cacheKey] ?? (this.cache[cacheKey] = this.createFilterEntity(store, filter));
|
|
52
53
|
}
|
|
53
54
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-entity.factory.js","sources":["../../../../../src/x-modules/facets/entities/filter-entity.factory.ts"],"sourcesContent":["import { Facet, FilterModelName, Filter, isFacetFilter } from '@empathyco/x-types';\nimport { Store } from 'vuex';\nimport { RootXStoreState } from '../../../store/store.types';\nimport { EditableNumberRangeFilterEntity } from './editable-number-range-filter.entity';\nimport { HierarchicalFilterEntity } from './hierarchical-filter.entity';\nimport { NumberRangeFilterEntity } from './number-range-filter.entity';\nimport { RawFilterEntity } from './raw-filter.entity';\nimport { SimpleFilterEntity } from './simple-filter.entity';\nimport { FilterEntity, FilterEntityConstructor, FilterEntityModifier } from './types';\n\n/**\n * Creates {@link FilterEntity | FilterEntities} based on the provided configs.\n *\n * @internal\n */\nexport class FilterEntityFactory {\n /**\n * The public global instance of the Singleton.\n *\n * @remarks The constructor is not private, so it's possible to create more instances,\n * to simplify the testing.\n */\n public static instance = new FilterEntityFactory();\n\n /**\n * The registered entities by default to be used by the Factory.\n */\n protected entities: FilterEntityConstructor[] = [\n SimpleFilterEntity,\n HierarchicalFilterEntity,\n NumberRangeFilterEntity,\n EditableNumberRangeFilterEntity,\n RawFilterEntity\n ];\n\n /**\n * The registered modifiers grouped by the facetId to be applied.\n */\n protected modifiersByFacetId: Record<Facet['id'], FilterEntityModifier[]> = {};\n\n /**\n * The registered modifiers grouped by the filter `ModelName` to be applied.\n */\n protected modifiersByFilterModelName: Partial<Record<FilterModelName, FilterEntityModifier[]>> =\n {};\n\n /**\n * Contains the instantiated entities for each facet.\n *\n * @internal\n */\n protected cache: Record<Facet['id'] |
|
|
1
|
+
{"version":3,"file":"filter-entity.factory.js","sources":["../../../../../src/x-modules/facets/entities/filter-entity.factory.ts"],"sourcesContent":["import { Facet, FilterModelName, Filter, isFacetFilter } from '@empathyco/x-types';\nimport { Store } from 'vuex';\nimport { RootXStoreState } from '../../../store/store.types';\nimport { UNKNOWN_FACET_KEY } from '../store/constants';\nimport { EditableNumberRangeFilterEntity } from './editable-number-range-filter.entity';\nimport { HierarchicalFilterEntity } from './hierarchical-filter.entity';\nimport { NumberRangeFilterEntity } from './number-range-filter.entity';\nimport { RawFilterEntity } from './raw-filter.entity';\nimport { SimpleFilterEntity } from './simple-filter.entity';\nimport { FilterEntity, FilterEntityConstructor, FilterEntityModifier } from './types';\n\n/**\n * Creates {@link FilterEntity | FilterEntities} based on the provided configs.\n *\n * @internal\n */\nexport class FilterEntityFactory {\n /**\n * The public global instance of the Singleton.\n *\n * @remarks The constructor is not private, so it's possible to create more instances,\n * to simplify the testing.\n */\n public static instance = new FilterEntityFactory();\n\n /**\n * The registered entities by default to be used by the Factory.\n */\n protected entities: FilterEntityConstructor[] = [\n SimpleFilterEntity,\n HierarchicalFilterEntity,\n NumberRangeFilterEntity,\n EditableNumberRangeFilterEntity,\n RawFilterEntity\n ];\n\n /**\n * The registered modifiers grouped by the facetId to be applied.\n */\n protected modifiersByFacetId: Record<Facet['id'], FilterEntityModifier[]> = {};\n\n /**\n * The registered modifiers grouped by the filter `ModelName` to be applied.\n */\n protected modifiersByFilterModelName: Partial<Record<FilterModelName, FilterEntityModifier[]>> =\n {};\n\n /**\n * Contains the instantiated entities for each facet.\n *\n * @internal\n */\n protected cache: Record<Facet['id'] | typeof UNKNOWN_FACET_KEY, FilterEntity> = {};\n\n /**\n * Creates a new FilterEntity from a filter.\n *\n * @param store - The {@link https://vuex.vuejs.org/guide/ | Vuex Store} that the entity will\n * use.\n * @param filter - The {@link @empathyco/x-types#Filter | Filter} necessary to know what\n * {@link FilterEntity} to create.\n * @returns The {@link FilterEntity} created by the factory.\n */\n getFilterEntity(store: Store<RootXStoreState>, filter: Filter): FilterEntity {\n const cacheKey = isFacetFilter(filter) ? filter.facetId : UNKNOWN_FACET_KEY;\n return this.cache[cacheKey] ?? (this.cache[cacheKey] = this.createFilterEntity(store, filter));\n }\n\n /**\n * Creates a brand new {@link FilterEntity} for the given\n * {@link @empathyco/x-types#Filter | Filter}.\n *\n * @param store - The store which should be mutated through the entity.\n * @param filter - The filter to create the entity for.\n * @returns A new {@link FilterEntity} for the given {@link @empathyco/x-types#Filter | Filter}.\n * @internal\n */\n protected createFilterEntity(store: Store<RootXStoreState>, filter: Filter): FilterEntity {\n const filterEntityConstructor = this.entities.find(entity => entity.accepts(filter));\n if (!filterEntityConstructor) {\n throw new Error(`Entity configuration for ${filter.modelName} not registered.`);\n }\n const entity = new filterEntityConstructor(store);\n const modifiers = isFacetFilter(filter)\n ? this.modifiersByFacetId[filter.facetId] ??\n this.modifiersByFilterModelName[filter.modelName] ??\n []\n : [];\n return modifiers.reduce(\n (modifiedEntity, modifier) => new modifier(store, modifiedEntity),\n entity\n );\n }\n\n /**\n * Registers a new {@link FilterEntity} to be used by the factory.\n *\n * @param entity - The new {@link FilterEntity} to be registered in the factory.\n */\n registerFilterEntity(entity: FilterEntityConstructor): void {\n if (!this.entities.includes(entity)) {\n this.entities.push(entity);\n }\n }\n\n /**\n * Registers a list of modifiers to be used with the {@link FilterEntity | FilterEntities} of a\n * particular facet.\n *\n * @param facetId - The facet id whose Entities will be modified.\n * @param modifiers - The list of modifiers to be registered.\n */\n registerModifierByFacetId(facetId: Facet['id'], ...modifiers: FilterEntityModifier[]): void {\n this.updateModifiers(this.modifiersByFacetId, facetId, modifiers);\n }\n\n /**\n * Registers a list of modifiers to be used with the {@link FilterEntity | FilterEntities} of a\n * particular facet.\n *\n * @param filterModelName - The facet ModelName whose Entities will be modified.\n * @param modifiers - The list of modifiers to be registered.\n */\n registerModifierByFilterModelName(\n filterModelName: FilterModelName,\n ...modifiers: FilterEntityModifier[]\n ): void {\n this.updateModifiers(this.modifiersByFilterModelName, filterModelName, modifiers);\n }\n\n /**\n * Updates the modifiers for a particular facet.\n *\n * @param modifiersRecord - The map of modifiers to be updated.\n * @param modifierKey - The id whose modifiers will be updated.\n * @param modifiers - The list of new modifiers to be registered.\n */\n protected updateModifiers(\n modifiersRecord: Record<string, FilterEntityModifier[]>,\n modifierKey: string | number,\n modifiers: FilterEntityModifier[]\n ): void {\n if (!modifiersRecord[modifierKey]) {\n modifiersRecord[modifierKey] = [];\n }\n const facetModifiers = modifiersRecord[modifierKey];\n const newModifiers = modifiers.filter(modifier => !facetModifiers.includes(modifier));\n facetModifiers.push(...newModifiers);\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAWA;;;;AAIG;MACU,mBAAmB,CAAA;AAAhC,IAAA,WAAA,GAAA;AASE;;AAEG;AACO,QAAA,IAAA,CAAA,QAAQ,GAA8B;YAC9C,kBAAkB;YAClB,wBAAwB;YACxB,uBAAuB;YACvB,+BAA+B;YAC/B,eAAe;SAChB,CAAC;AAEF;;AAEG;QACO,IAAkB,CAAA,kBAAA,GAAgD,EAAE,CAAC;AAE/E;;AAEG;QACO,IAA0B,CAAA,0BAAA,GAClC,EAAE,CAAC;AAEL;;;;AAIG;QACO,IAAK,CAAA,KAAA,GAAiE,EAAE,CAAC;KAiGpF;AA/FC;;;;;;;;AAQG;IACH,eAAe,CAAC,KAA6B,EAAE,MAAc,EAAA;AAC3D,QAAA,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,OAAO,GAAG,iBAAiB,CAAC;QAC5E,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ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SAAS,CAAC,CAAC;KACnE;AAED;;;;;;AAMG;AACH,IAAA,iCAAiC,CAC/B,eAAgC,EAChC,GAAG,SAAiC,EAAA;QAEpC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,0BAA0B,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;KACnF;AAED;;;;;;AAMG;AACO,IAAA,eAAe,CACvB,eAAuD,EACvD,WAA4B,EAC5B,SAAiC,EAAA;AAEjC,QAAA,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE;AACjC,YAAA,eAAe,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC;AACnC,SAAA;AACD,QAAA,MAAM,cAAc,GAAG,eAAe,CAAC,WAAW,CAAC,CAAC;AACpD,QAAA,MAAM,YAAY,GAAG,SAAS,CAAC,MAAM,CAAC,QAAQ,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;AACtF,QAAA,cAAc,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,CAAC;KACtC;;AAnID;;;;;AAKG;AACW,mBAAA,CAAA,QAAQ,GAAG,IAAI,mBAAmB,EAAE;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../../src/x-modules/facets/store/constants.ts"],"sourcesContent":["export const UNKNOWN_FACET_KEY = '__unknown__';\n"],"names":[],"mappings":"AAAO,MAAM,iBAAiB,GAAG;;;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isFacetFilter } from '@empathyco/x-types';
|
|
2
2
|
import { map } from '@empathyco/x-utils';
|
|
3
3
|
import { groupItemsBy } from '../../../../utils/array.js';
|
|
4
|
+
import { UNKNOWN_FACET_KEY } from '../constants.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Default implementation for the {@link FacetsGetters.facets} getter.
|
|
@@ -12,7 +13,7 @@ import { groupItemsBy } from '../../../../utils/array.js';
|
|
|
12
13
|
* @public
|
|
13
14
|
*/
|
|
14
15
|
const facets = state => {
|
|
15
|
-
const filtersByFacet = groupItemsBy(Object.values(state.filters), filter => isFacetFilter(filter) ? filter.facetId :
|
|
16
|
+
const filtersByFacet = groupItemsBy(Object.values(state.filters), filter => isFacetFilter(filter) ? filter.facetId : UNKNOWN_FACET_KEY);
|
|
16
17
|
return map(state.facets, (_id, facet) => ({
|
|
17
18
|
...facet,
|
|
18
19
|
filters: filtersByFacet[facet.id] ?? []
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facets.getter.js","sources":["../../../../../../src/x-modules/facets/store/getters/facets.getter.ts"],"sourcesContent":["import { isFacetFilter } from '@empathyco/x-types';\nimport { map } from '@empathyco/x-utils';\nimport { groupItemsBy } from '../../../../utils/array';\nimport { FacetsXStoreModule } from '../types';\n\n/**\n * Default implementation for the {@link FacetsGetters.facets} getter.\n *\n * @param state - Current {@link https://vuex.vuejs.org/guide/state.html | state} of the facets'\n * module.\n * @returns An array containing the facets with the filters.\n *\n * @public\n */\nexport const facets: FacetsXStoreModule['getters']['facets'] = state => {\n const filtersByFacet = groupItemsBy(Object.values(state.filters), filter =>\n isFacetFilter(filter) ? filter.facetId :
|
|
1
|
+
{"version":3,"file":"facets.getter.js","sources":["../../../../../../src/x-modules/facets/store/getters/facets.getter.ts"],"sourcesContent":["import { isFacetFilter } from '@empathyco/x-types';\nimport { map } from '@empathyco/x-utils';\nimport { groupItemsBy } from '../../../../utils/array';\nimport { FacetsXStoreModule } from '../types';\nimport { UNKNOWN_FACET_KEY } from '../constants';\n\n/**\n * Default implementation for the {@link FacetsGetters.facets} getter.\n *\n * @param state - Current {@link https://vuex.vuejs.org/guide/state.html | state} of the facets'\n * module.\n * @returns An array containing the facets with the filters.\n *\n * @public\n */\nexport const facets: FacetsXStoreModule['getters']['facets'] = state => {\n const filtersByFacet = groupItemsBy(Object.values(state.filters), filter =>\n isFacetFilter(filter) ? filter.facetId : UNKNOWN_FACET_KEY\n );\n return map(state.facets, (_id, facet) => ({\n ...facet,\n filters: filtersByFacet[facet.id] ?? []\n }));\n};\n"],"names":[],"mappings":";;;;;AAMA;;;;;;;;AAQG;AACU,MAAA,MAAM,GAA4C,KAAK,IAAG;AACrE,IAAA,MAAM,cAAc,GAAG,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,IACtE,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,OAAO,GAAG,iBAAiB,CAC3D,CAAC;AACF,IAAA,OAAO,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,KAAK,MAAM;AACxC,QAAA,GAAG,KAAK;QACR,OAAO,EAAE,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE;AACxC,KAAA,CAAC,CAAC,CAAC;AACN;;;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isFacetFilter } from '@empathyco/x-types';
|
|
2
2
|
import { map } from '@empathyco/x-utils';
|
|
3
3
|
import { groupItemsBy } from '../../../../utils/array.js';
|
|
4
|
+
import { UNKNOWN_FACET_KEY } from '../constants.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Default implementation for the {@link FacetsGetters.selectedFiltersByFacet} getter.
|
|
@@ -11,15 +12,15 @@ import { groupItemsBy } from '../../../../utils/array.js';
|
|
|
11
12
|
* facets' module.
|
|
12
13
|
*
|
|
13
14
|
* @returns A record containing the selected filters indexed by its facet id.
|
|
14
|
-
* @remarks If there are filters without
|
|
15
|
-
*
|
|
15
|
+
* @remarks If there are filters without facetId (RawFilter), they will be grouped under
|
|
16
|
+
* the UNKNOWN_FACET_KEY constant.
|
|
16
17
|
*
|
|
17
18
|
* @public
|
|
18
19
|
*/
|
|
19
20
|
const selectedFiltersByFacet = (state, getters) => {
|
|
20
21
|
// The `emptyRecord` is to return an empty array for those facets that haven't selected filters.
|
|
21
22
|
const emptyRecord = map(state.facets, () => []);
|
|
22
|
-
const filtersByFacet = groupItemsBy(getters.selectedFilters, filter => isFacetFilter(filter) ? filter.facetId :
|
|
23
|
+
const filtersByFacet = groupItemsBy(getters.selectedFilters, filter => isFacetFilter(filter) ? filter.facetId : UNKNOWN_FACET_KEY);
|
|
23
24
|
return Object.assign(emptyRecord, filtersByFacet);
|
|
24
25
|
};
|
|
25
26
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selected-filters-by-facet.getter.js","sources":["../../../../../../src/x-modules/facets/store/getters/selected-filters-by-facet.getter.ts"],"sourcesContent":["import { isFacetFilter } from '@empathyco/x-types';\nimport { map } from '@empathyco/x-utils';\nimport { groupItemsBy } from '../../../../utils/array';\nimport { FacetsXStoreModule, FiltersByFacet } from '../types';\n\n/**\n * Default implementation for the {@link FacetsGetters.selectedFiltersByFacet} getter.\n *\n * @param state - Current {@link https://vuex.vuejs.org/guide/state.html | state} of the facets\n * module.\n * @param getters - Current {@link https://vuex.vuejs.org/guide/getters.html | getters} of the\n * facets' module.\n *\n * @returns A record containing the selected filters indexed by its facet id.\n * @remarks If there are filters without
|
|
1
|
+
{"version":3,"file":"selected-filters-by-facet.getter.js","sources":["../../../../../../src/x-modules/facets/store/getters/selected-filters-by-facet.getter.ts"],"sourcesContent":["import { isFacetFilter } from '@empathyco/x-types';\nimport { map } from '@empathyco/x-utils';\nimport { groupItemsBy } from '../../../../utils/array';\nimport { FacetsXStoreModule, FiltersByFacet } from '../types';\nimport { UNKNOWN_FACET_KEY } from '../constants';\n\n/**\n * Default implementation for the {@link FacetsGetters.selectedFiltersByFacet} getter.\n *\n * @param state - Current {@link https://vuex.vuejs.org/guide/state.html | state} of the facets\n * module.\n * @param getters - Current {@link https://vuex.vuejs.org/guide/getters.html | getters} of the\n * facets' module.\n *\n * @returns A record containing the selected filters indexed by its facet id.\n * @remarks If there are filters without facetId (RawFilter), they will be grouped under\n * the UNKNOWN_FACET_KEY constant.\n *\n * @public\n */\nexport const selectedFiltersByFacet: FacetsXStoreModule['getters']['selectedFiltersByFacet'] = (\n state,\n getters\n): FiltersByFacet => {\n // The `emptyRecord` is to return an empty array for those facets that haven't selected filters.\n const emptyRecord: FiltersByFacet = map(state.facets, () => []);\n const filtersByFacet = groupItemsBy(getters.selectedFilters, filter =>\n isFacetFilter(filter) ? filter.facetId : UNKNOWN_FACET_KEY\n );\n return Object.assign(emptyRecord, filtersByFacet);\n};\n"],"names":[],"mappings":";;;;;AAMA;;;;;;;;;;;;;AAaG;MACU,sBAAsB,GAA4D,CAC7F,KAAK,EACL,OAAO,KACW;;AAElB,IAAA,MAAM,WAAW,GAAmB,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAChE,MAAM,cAAc,GAAG,YAAY,CAAC,OAAO,CAAC,eAAe,EAAE,MAAM,IACjE,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,OAAO,GAAG,iBAAiB,CAC3D,CAAC;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;AACpD;;;;"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { UNKNOWN_FACET_KEY } from '../../../facets/store/constants.js';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Default implementation for the
|
|
3
5
|
* {@link HistoryQueriesActions.updateHistoryQueriesWithSearchResponse} action.
|
|
@@ -52,7 +54,7 @@ function getHistoryQueriesFiltersList(responseFacets, requestFilters) {
|
|
|
52
54
|
}
|
|
53
55
|
else {
|
|
54
56
|
return Object.entries(requestFilters).flatMap(([facetId, facetFilters]) => {
|
|
55
|
-
const matchingFacet = facetId !==
|
|
57
|
+
const matchingFacet = facetId !== UNKNOWN_FACET_KEY ? responseFacets.find(facet => facet.id === facetId) : null;
|
|
56
58
|
return facetFilters.reduce((accFilters, requestFilter) => {
|
|
57
59
|
const matchingFilter = matchingFacet
|
|
58
60
|
? matchingFacet.filters.find(filter => filter.id === requestFilter.id)
|
|
@@ -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 { 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 = getHistoryQueriesFiltersList(\n searchResponse.facets,\n searchResponse.request.filters\n );\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 * Creates a selected filters list by comparing request filters and response facets.\n * Uses the 'filter.id' to match and merge the objects in a single one with all the keys.\n *\n * @param responseFacets - Facets from the response.\n * @param requestFilters - Filters from the request.\n *\n * @returns A list of selected filters in the history query.\n *\n */\nfunction getHistoryQueriesFiltersList(\n responseFacets: InternalSearchResponse['facets'],\n requestFilters: InternalSearchResponse['request']['filters']\n): Filter[] {\n if (!requestFilters || !responseFacets) {\n return [];\n } else {\n return Object.entries(requestFilters).flatMap(([facetId, facetFilters]) => {\n const matchingFacet =\n facetId !==
|
|
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';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { HistoryQueriesActions, HistoryQueriesXStoreModule } from '../types';\nimport { InternalSearchResponse } from '../../../search/index';\nimport { UNKNOWN_FACET_KEY } from '../../../facets/store/constants';\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 = getHistoryQueriesFiltersList(\n searchResponse.facets,\n searchResponse.request.filters\n );\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 * Creates a selected filters list by comparing request filters and response facets.\n * Uses the 'filter.id' to match and merge the objects in a single one with all the keys.\n *\n * @param responseFacets - Facets from the response.\n * @param requestFilters - Filters from the request.\n *\n * @returns A list of selected filters in the history query.\n *\n */\nfunction getHistoryQueriesFiltersList(\n responseFacets: InternalSearchResponse['facets'],\n requestFilters: InternalSearchResponse['request']['filters']\n): Filter[] {\n if (!requestFilters || !responseFacets) {\n return [];\n } else {\n return Object.entries(requestFilters).flatMap(([facetId, facetFilters]) => {\n const matchingFacet =\n facetId !== UNKNOWN_FACET_KEY ? responseFacets.find(facet => facet.id === facetId) : null;\n\n return facetFilters.reduce<Filter[]>((accFilters, requestFilter) => {\n const matchingFilter = matchingFacet\n ? matchingFacet.filters.find(filter => filter.id === requestFilter.id)\n : responseFacets\n .flatMap(facet => facet.filters)\n .find(filter => filter.id === requestFilter.id);\n\n if (matchingFilter) {\n accFilters.push({ ...matchingFilter, selected: requestFilter.selected });\n }\n\n return accFilters;\n }, []);\n });\n }\n}\n"],"names":[],"mappings":";;AAMA;;;;;;;;;;;;;;;;;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,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BACX,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC;AAC/B,yBAAA,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,EAAE,KAAK,aAAa,CAAC,EAAE,CAAC,CAAC;AAEtD,gBAAA,IAAI,cAAc,EAAE;AAClB,oBAAA,UAAU,CAAC,IAAI,CAAC,EAAE,GAAG,cAAc,EAAE,QAAQ,EAAE,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC;AAC1E,iBAAA;AAED,gBAAA,OAAO,UAAU,CAAC;aACnB,EAAE,EAAE,CAAC,CAAC;AACT,SAAC,CAAC,CAAC;AACJ,KAAA;AACH;;;;"}
|
|
@@ -3,6 +3,7 @@ import { setQuery } from '../../../store/utils/query.utils.js';
|
|
|
3
3
|
import { setStatus } from '../../../store/utils/status-store.utils.js';
|
|
4
4
|
import { groupItemsBy } from '../../../utils/array.js';
|
|
5
5
|
import { setConfig, mergeConfig } from '../../../store/utils/config-store.utils.js';
|
|
6
|
+
import { UNKNOWN_FACET_KEY } from '../../facets/store/constants.js';
|
|
6
7
|
import { cancelFetchAndSaveSearchResponse, fetchAndSaveSearchResponse } from './actions/fetch-and-save-search-response.action.js';
|
|
7
8
|
import { fetchSearchResponse } from './actions/fetch-search-response.action.js';
|
|
8
9
|
import { increasePageAppendingResults } from './actions/increase-page-apending-results.action.js';
|
|
@@ -55,7 +56,7 @@ const searchXStoreModule = {
|
|
|
55
56
|
state.relatedTags = relatedTags;
|
|
56
57
|
},
|
|
57
58
|
setSelectedFilters(state, selectedFilters) {
|
|
58
|
-
state.selectedFilters = groupItemsBy(selectedFilters, filter => isFacetFilter(filter) ? filter.facetId :
|
|
59
|
+
state.selectedFilters = groupItemsBy(selectedFilters, filter => isFacetFilter(filter) ? filter.facetId : UNKNOWN_FACET_KEY);
|
|
59
60
|
},
|
|
60
61
|
setBanners(state, banners) {
|
|
61
62
|
state.banners = banners;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sources":["../../../../../src/x-modules/search/store/module.ts"],"sourcesContent":["import { isFacetFilter } from '@empathyco/x-types';\nimport { setQuery } from '../../../store/utils/query.utils';\nimport { setStatus } from '../../../store/utils/status-store.utils';\nimport { groupItemsBy } from '../../../utils/array';\nimport { mergeConfig, setConfig } from '../../../store/utils/config-store.utils';\
|
|
1
|
+
{"version":3,"file":"module.js","sources":["../../../../../src/x-modules/search/store/module.ts"],"sourcesContent":["import { isFacetFilter } from '@empathyco/x-types';\nimport { setQuery } from '../../../store/utils/query.utils';\nimport { setStatus } from '../../../store/utils/status-store.utils';\nimport { groupItemsBy } from '../../../utils/array';\nimport { mergeConfig, setConfig } from '../../../store/utils/config-store.utils';\nimport { UNKNOWN_FACET_KEY } from '../../facets/store/constants';\nimport {\n cancelFetchAndSaveSearchResponse,\n fetchAndSaveSearchResponse\n} from './actions/fetch-and-save-search-response.action';\nimport { fetchSearchResponse } from './actions/fetch-search-response.action';\nimport { increasePageAppendingResults } from './actions/increase-page-apending-results.action';\nimport { resetRequestOnRefinement } from './actions/reset-request-on-refinement.action';\nimport { saveOrigin } from './actions/save-origin.action';\nimport { saveSearchResponse } from './actions/save-search-response.action';\nimport { setUrlParams } from './actions/set-url-params.action';\nimport { query } from './getters/query.getter';\nimport { request } from './getters/request.getter';\nimport { SearchXStoreModule } from './types';\n\n/**\n * {@link XStoreModule} For the search module.\n *\n * @internal\n */\nexport const searchXStoreModule: SearchXStoreModule = {\n state: () => ({\n ...resettableState(),\n selectedFilters: {},\n params: {},\n config: {\n pageSize: 24\n },\n status: 'initial',\n isNoResults: false,\n fromNoResultsWithFilters: false\n }),\n getters: {\n request,\n query\n },\n mutations: {\n appendResults(state, results) {\n state.results.push(...results);\n },\n resetState(state) {\n Object.assign(state, resettableState());\n },\n setQuery,\n setResults(state, results) {\n state.results = results;\n },\n setPartialResults(state, partialResults) {\n state.partialResults = partialResults;\n },\n setFacets(state, facets) {\n state.facets = facets;\n },\n setRelatedTags(state, relatedTags) {\n state.relatedTags = relatedTags;\n },\n setSelectedFilters(state, selectedFilters) {\n state.selectedFilters = groupItemsBy(selectedFilters, filter =>\n isFacetFilter(filter) ? filter.facetId : UNKNOWN_FACET_KEY\n );\n },\n setBanners(state, banners) {\n state.banners = banners;\n },\n setPromoteds(state, promoteds) {\n state.promoteds = promoteds;\n },\n setSpellcheck(state, spellcheckedQuery) {\n state.spellcheckedQuery = spellcheckedQuery;\n },\n setTotalResults(state, totalResults) {\n state.totalResults = totalResults;\n },\n setSort(state, sort) {\n state.sort = sort;\n },\n setPage(state, page) {\n state.page = page;\n },\n setConfig,\n mergeConfig,\n setIsAppendResults(state, isAppendResults) {\n state.isAppendResults = isAppendResults;\n },\n setIsNoResults(state, isNoResults) {\n state.isNoResults = isNoResults;\n },\n setFromNoResultsWithFilters(state, fromNoResultsWithFilters) {\n state.fromNoResultsWithFilters = fromNoResultsWithFilters;\n },\n setStatus,\n setParams(state, params) {\n state.params = params;\n },\n setOrigin(state, origin = null) {\n state.origin = origin;\n },\n setRedirections(state, redirections) {\n state.redirections = redirections;\n },\n setQueryTagging(state, queryTagging) {\n state.queryTagging = queryTagging;\n },\n updateResult(state, result) {\n const stateResult = state.results.find(stateResult => result.id === stateResult.id);\n if (stateResult) {\n Object.assign(stateResult, result);\n }\n }\n },\n actions: {\n cancelFetchAndSaveSearchResponse,\n fetchSearchResponse,\n fetchAndSaveSearchResponse,\n increasePageAppendingResults,\n resetRequestOnRefinement,\n saveSearchResponse,\n setUrlParams,\n saveOrigin\n }\n};\n\n/**\n * Function to return the \"resettable\" part of the state. This will be used in the `resetState`\n * mutation to reset to the initial state.\n *\n * @returns The \"resettable\" part of the {@link SearchState}.\n *\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function resettableState() {\n return {\n query: '',\n results: [],\n partialResults: [],\n facets: [],\n relatedTags: [],\n banners: [],\n promoteds: [],\n totalResults: 0,\n spellcheckedQuery: '',\n sort: '',\n page: 1,\n origin: null,\n isAppendResults: false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|
2
2
|
"name": "@empathyco/x-components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-alpha.1",
|
|
4
4
|
"description": "Empathy X Components",
|
|
5
5
|
"author": "Empathy Systems Corporation S.L.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"test:unit-watch": "jest --watch",
|
|
60
60
|
"test:e2e": "start-server-and-test preview http://localhost:8080 cypress:open",
|
|
61
61
|
"test:e2e:firefox": "start-server-and-test serve http://localhost:8080 cypress:open:firefox",
|
|
62
|
-
"test:e2e:ci": "start-server-and-test serve http://localhost:8080 cypress:
|
|
62
|
+
"test:e2e:ci": "start-server-and-test serve http://localhost:8080 cypress:run:ci",
|
|
63
63
|
"test": "pnpm run test:unit && pnpm run test:e2e:ci",
|
|
64
|
-
"cypress:
|
|
64
|
+
"cypress:run:ci": "cypress run --e2e --headless --browser chrome",
|
|
65
65
|
"cypress:open": "cypress open --e2e --browser chrome",
|
|
66
66
|
"cypress:open:firefox": "cypress open --e2e --browser firefox",
|
|
67
67
|
"cypress:open:component": "cypress open --component --browser chrome",
|
|
@@ -144,5 +144,5 @@
|
|
|
144
144
|
"access": "public",
|
|
145
145
|
"directory": "dist"
|
|
146
146
|
},
|
|
147
|
-
"gitHead": "
|
|
147
|
+
"gitHead": "d58959b631114a7973f8485538e1ac3a35777171"
|
|
148
148
|
}
|
|
@@ -44934,12 +44934,7 @@
|
|
|
44934
44934
|
},
|
|
44935
44935
|
{
|
|
44936
44936
|
"kind": "Content",
|
|
44937
|
-
"text": "'search' | 'topclicked_recommendations' | 'brand_recommendations' | 'next_query_recommendations' | 'semantic_recommendations' | 'partial_results' | 'identifier_result'
|
|
44938
|
-
},
|
|
44939
|
-
{
|
|
44940
|
-
"kind": "Reference",
|
|
44941
|
-
"text": "deprecatedFeatureNames",
|
|
44942
|
-
"canonicalReference": "@empathyco/x-components!~deprecatedFeatureNames:type"
|
|
44937
|
+
"text": "'search' | 'topclicked_recommendations' | 'brand_recommendations' | 'next_query_recommendations' | 'semantic_recommendations' | 'partial_results' | 'identifier_result'"
|
|
44943
44938
|
},
|
|
44944
44939
|
{
|
|
44945
44940
|
"kind": "Content",
|
|
@@ -44951,7 +44946,7 @@
|
|
|
44951
44946
|
"name": "ResultFeature",
|
|
44952
44947
|
"typeTokenRange": {
|
|
44953
44948
|
"startIndex": 1,
|
|
44954
|
-
"endIndex":
|
|
44949
|
+
"endIndex": 2
|
|
44955
44950
|
}
|
|
44956
44951
|
},
|
|
44957
44952
|
{
|
|
@@ -52295,7 +52290,7 @@
|
|
|
52295
52290
|
{
|
|
52296
52291
|
"kind": "Variable",
|
|
52297
52292
|
"canonicalReference": "@empathyco/x-components!selectedFiltersByFacet:var",
|
|
52298
|
-
"docComment": "/**\n * Default implementation for the {@link FacetsGetters.selectedFiltersByFacet} getter.\n *\n * @remarks\n *\n * If there are filters without
|
|
52293
|
+
"docComment": "/**\n * Default implementation for the {@link FacetsGetters.selectedFiltersByFacet} getter.\n *\n * @remarks\n *\n * If there are filters without facetId (RawFilter), they will be grouped under the UNKNOWN_FACET_KEY constant.\n *\n * @param state - Current {@link https://vuex.vuejs.org/guide/state.html | state} of the facets module.\n *\n * @param getters - Current {@link https://vuex.vuejs.org/guide/getters.html | getters} of the facets' module.\n *\n * @returns A record containing the selected filters indexed by its facet id.\n *\n * @public\n */\n",
|
|
52299
52294
|
"excerptTokens": [
|
|
52300
52295
|
{
|
|
52301
52296
|
"kind": "Content",
|
|
@@ -2216,7 +2216,8 @@ export interface FilterEntityConstructor {
|
|
|
2216
2216
|
|
|
2217
2217
|
// @internal
|
|
2218
2218
|
export class FilterEntityFactory {
|
|
2219
|
-
|
|
2219
|
+
// Warning: (ae-forgotten-export) The symbol "UNKNOWN_FACET_KEY" needs to be exported by the entry point index.d.ts
|
|
2220
|
+
protected cache: Record<Facet['id'] | typeof UNKNOWN_FACET_KEY, FilterEntity>;
|
|
2220
2221
|
protected createFilterEntity(store: Store<RootXStoreState>, filter: Filter): FilterEntity;
|
|
2221
2222
|
protected entities: FilterEntityConstructor[];
|
|
2222
2223
|
getFilterEntity(store: Store<RootXStoreState>, filter: Filter): FilterEntity;
|
|
@@ -4226,10 +4227,8 @@ export function resettableState(): {
|
|
|
4226
4227
|
// @internal
|
|
4227
4228
|
export const RESULT_WITH_VARIANTS_KEY: XInjectKey<Result>;
|
|
4228
4229
|
|
|
4229
|
-
// Warning: (ae-forgotten-export) The symbol "deprecatedFeatureNames" needs to be exported by the entry point index.d.ts
|
|
4230
|
-
//
|
|
4231
4230
|
// @public
|
|
4232
|
-
export type ResultFeature = 'search' | 'topclicked_recommendations' | 'brand_recommendations' | 'next_query_recommendations' | 'semantic_recommendations' | 'partial_results' | 'identifier_result'
|
|
4231
|
+
export type ResultFeature = 'search' | 'topclicked_recommendations' | 'brand_recommendations' | 'next_query_recommendations' | 'semantic_recommendations' | 'partial_results' | 'identifier_result';
|
|
4233
4232
|
|
|
4234
4233
|
// @public
|
|
4235
4234
|
export type ResultOrigin = `${ResultFeature}:${FeatureLocation}`;
|
package/types/types/origin.d.ts
CHANGED
|
@@ -19,16 +19,12 @@ export type ResultOrigin = `${ResultFeature}:${FeatureLocation}`;
|
|
|
19
19
|
* @public
|
|
20
20
|
*/
|
|
21
21
|
export type QueryFeature = 'search_box' | 'url' | 'query_suggestion' | 'next_query' | 'popular_search' | 'history_query' | 'partial_result' | 'related_tag' | 'spellcheck' | 'customer' | 'semantics';
|
|
22
|
-
/**
|
|
23
|
-
* @deprecated Use other features instead.
|
|
24
|
-
*/
|
|
25
|
-
type deprecatedFeatureNames = 'recommendations' | 'next_query_results' | 'semantics';
|
|
26
22
|
/**
|
|
27
23
|
* The name of the tool that generated the results.
|
|
28
24
|
*
|
|
29
25
|
* @public
|
|
30
26
|
*/
|
|
31
|
-
export type ResultFeature = 'search' | 'topclicked_recommendations' | 'brand_recommendations' | 'next_query_recommendations' | 'semantic_recommendations' | 'partial_results' | 'identifier_result'
|
|
27
|
+
export type ResultFeature = 'search' | 'topclicked_recommendations' | 'brand_recommendations' | 'next_query_recommendations' | 'semantic_recommendations' | 'partial_results' | 'identifier_result';
|
|
32
28
|
/**
|
|
33
29
|
* Indicates where the feature is placed.
|
|
34
30
|
*
|
|
@@ -47,5 +43,4 @@ export type FeatureLocation = 'external' | 'my_history' | 'no_query' | 'results'
|
|
|
47
43
|
* @public
|
|
48
44
|
*/
|
|
49
45
|
export type QueryOriginInit = Partial<Pick<WireMetadata, 'feature' | 'location'>>;
|
|
50
|
-
export {};
|
|
51
46
|
//# sourceMappingURL=origin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"origin.d.ts","sourceRoot":"","sources":["../../../src/types/origin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,GAAG,YAAY,IAAI,eAAe,EAAE,CAAC;AAC/D;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,GAAG,aAAa,IAAI,eAAe,EAAE,CAAC;AAEjE;;;;GAIG;AACH,MAAM,MAAM,YAAY,GACpB,YAAY,GACZ,KAAK,GACL,kBAAkB,GAClB,YAAY,GACZ,gBAAgB,GAChB,eAAe,GACf,gBAAgB,GAChB,aAAa,GACb,YAAY,GACZ,UAAU,GACV,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"origin.d.ts","sourceRoot":"","sources":["../../../src/types/origin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,GAAG,YAAY,IAAI,eAAe,EAAE,CAAC;AAC/D;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,GAAG,aAAa,IAAI,eAAe,EAAE,CAAC;AAEjE;;;;GAIG;AACH,MAAM,MAAM,YAAY,GACpB,YAAY,GACZ,KAAK,GACL,kBAAkB,GAClB,YAAY,GACZ,gBAAgB,GAChB,eAAe,GACf,gBAAgB,GAChB,aAAa,GACb,YAAY,GACZ,UAAU,GACV,WAAW,CAAC;AAEhB;;;;GAIG;AACH,MAAM,MAAM,aAAa,GACrB,QAAQ,GACR,4BAA4B,GAC5B,uBAAuB,GACvB,4BAA4B,GAC5B,0BAA0B,GAC1B,iBAAiB,GACjB,mBAAmB,CAAC;AAExB;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,GACvB,UAAU,GACV,YAAY,GACZ,UAAU,GACV,SAAS,GACT,YAAY,GACZ,aAAa,GACb,MAAM,GACN,kBAAkB,GAClB,KAAK,GACL,aAAa,GACb,iBAAiB,CAAC;AAEtB;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Facet, FilterModelName, Filter } from '@empathyco/x-types';
|
|
2
2
|
import { Store } from 'vuex';
|
|
3
3
|
import { RootXStoreState } from '../../../store/store.types';
|
|
4
|
+
import { UNKNOWN_FACET_KEY } from '../store/constants';
|
|
4
5
|
import { FilterEntity, FilterEntityConstructor, FilterEntityModifier } from './types';
|
|
5
6
|
/**
|
|
6
7
|
* Creates {@link FilterEntity | FilterEntities} based on the provided configs.
|
|
@@ -32,7 +33,7 @@ export declare class FilterEntityFactory {
|
|
|
32
33
|
*
|
|
33
34
|
* @internal
|
|
34
35
|
*/
|
|
35
|
-
protected cache: Record<Facet['id'] |
|
|
36
|
+
protected cache: Record<Facet['id'] | typeof UNKNOWN_FACET_KEY, FilterEntity>;
|
|
36
37
|
/**
|
|
37
38
|
* Creates a new FilterEntity from a filter.
|
|
38
39
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-entity.factory.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/facets/entities/filter-entity.factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,EAAiB,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"filter-entity.factory.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/facets/entities/filter-entity.factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,EAAiB,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAMvD,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEtF;;;;GAIG;AACH,qBAAa,mBAAmB;IAC9B;;;;;OAKG;IACH,OAAc,QAAQ,sBAA6B;IAEnD;;OAEG;IACH,SAAS,CAAC,QAAQ,EAAE,uBAAuB,EAAE,CAM3C;IAEF;;OAEG;IACH,SAAS,CAAC,kBAAkB,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,oBAAoB,EAAE,CAAC,CAAM;IAE/E;;OAEG;IACH,SAAS,CAAC,0BAA0B,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,oBAAoB,EAAE,CAAC,CAAC,CACzF;IAEL;;;;OAIG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,iBAAiB,EAAE,YAAY,CAAC,CAAM;IAEnF;;;;;;;;OAQG;IACH,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,YAAY;IAK5E;;;;;;;;OAQG;IACH,SAAS,CAAC,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,YAAY;IAiBzF;;;;OAIG;IACH,oBAAoB,CAAC,MAAM,EAAE,uBAAuB,GAAG,IAAI;IAM3D;;;;;;OAMG;IACH,yBAAyB,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,SAAS,EAAE,oBAAoB,EAAE,GAAG,IAAI;IAI3F;;;;;;OAMG;IACH,iCAAiC,CAC/B,eAAe,EAAE,eAAe,EAChC,GAAG,SAAS,EAAE,oBAAoB,EAAE,GACnC,IAAI;IAIP;;;;;;OAMG;IACH,SAAS,CAAC,eAAe,CACvB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,EAAE,CAAC,EACvD,WAAW,EAAE,MAAM,GAAG,MAAM,EAC5B,SAAS,EAAE,oBAAoB,EAAE,GAChC,IAAI;CAQR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/facets/store/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facets.getter.d.ts","sourceRoot":"","sources":["../../../../../../src/x-modules/facets/store/getters/facets.getter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"facets.getter.d.ts","sourceRoot":"","sources":["../../../../../../src/x-modules/facets/store/getters/facets.getter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAG9C;;;;;;;;GAQG;AACH,eAAO,MAAM,MAAM,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC,QAAQ,CAQ1D,CAAC"}
|
|
@@ -8,8 +8,8 @@ import { FacetsXStoreModule } from '../types';
|
|
|
8
8
|
* facets' module.
|
|
9
9
|
*
|
|
10
10
|
* @returns A record containing the selected filters indexed by its facet id.
|
|
11
|
-
* @remarks If there are filters without
|
|
12
|
-
*
|
|
11
|
+
* @remarks If there are filters without facetId (RawFilter), they will be grouped under
|
|
12
|
+
* the UNKNOWN_FACET_KEY constant.
|
|
13
13
|
*
|
|
14
14
|
* @public
|
|
15
15
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selected-filters-by-facet.getter.d.ts","sourceRoot":"","sources":["../../../../../../src/x-modules/facets/store/getters/selected-filters-by-facet.getter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAkB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"selected-filters-by-facet.getter.d.ts","sourceRoot":"","sources":["../../../../../../src/x-modules/facets/store/getters/selected-filters-by-facet.getter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAkB,MAAM,UAAU,CAAC;AAG9D;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC,wBAAwB,CAU1F,CAAC"}
|
|
@@ -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":"AAEA,OAAO,EAAyB,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAI7E;;;;;;;;;;;;;;;;;GAiBG;AAEH,eAAO,MAAM,sCAAsC,EAAE,0BAA0B,CAAC,SAAS,CAAC,CAAC,wCAAwC,CAyBhI,CAAC"}
|