@empathyco/x-components 3.0.0-alpha.144 → 3.0.0-alpha.147

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/design-system/default-theme.css +28 -28
  3. package/design-system/full-theme.css +53 -54
  4. package/docs/API-reference/api/x-adapter-platform.md +0 -1
  5. package/docs/API-reference/api/x-adapter-platform.searchresponsemapper.md +1 -11
  6. package/docs/API-reference/api/x-components.facetsmutations.md +1 -1
  7. package/docs/API-reference/api/x-components.facetsmutations.mutatefilter.md +24 -0
  8. package/docs/API-reference/api/x-components.flathierarchicalfilters.md +26 -0
  9. package/docs/API-reference/api/x-components.md +2 -0
  10. package/docs/API-reference/api/x-components.mutatefilterpayload.filter.md +13 -0
  11. package/docs/API-reference/api/x-components.mutatefilterpayload.md +21 -0
  12. package/docs/API-reference/api/x-components.mutatefilterpayload.newfilterstate.md +13 -0
  13. package/docs/API-reference/api/x-types.hierarchicalfilter.children.md +2 -2
  14. package/docs/API-reference/api/x-types.hierarchicalfilter.md +2 -2
  15. package/docs/API-reference/api/x-types.hierarchicalfilter.parentid.md +1 -1
  16. package/docs/build-search-ui/web-archetype-development-guide.md +10 -7
  17. package/docs/build-search-ui/web-archetype-integration-guide.md +15 -14
  18. package/docs/build-search-ui/web-x-components-development-guide.md +5 -4
  19. package/docs/experience-search-&-discovery/README.md +119 -0
  20. package/docs/experience-search-&-discovery/empathize.md +102 -0
  21. package/docs/experience-search-&-discovery/facets-and-filters.md +138 -0
  22. package/docs/experience-search-&-discovery/history-queries.md +56 -0
  23. package/docs/experience-search-&-discovery/id-results.md +40 -0
  24. package/docs/experience-search-&-discovery/next-queries.md +52 -0
  25. package/docs/experience-search-&-discovery/popular-searches.md +32 -0
  26. package/docs/experience-search-&-discovery/product-results-ui.md +68 -0
  27. package/docs/experience-search-&-discovery/query-suggestions.md +32 -0
  28. package/docs/experience-search-&-discovery/recommendations.md +32 -0
  29. package/docs/experience-search-&-discovery/related-tags.md +41 -0
  30. package/docs/experience-search-&-discovery/search-box.md +81 -0
  31. package/docs/experience-search-&-discovery/serp-ui.md +109 -0
  32. package/docs/experience-search-&-discovery/web-local-storage.md +25 -0
  33. package/facets/index.js +1 -1
  34. package/js/index.js +1 -1
  35. package/js/x-modules/facets/components/facets/facets-provider.vue.js +2 -2
  36. package/js/x-modules/facets/components/facets/facets-provider.vue.js.map +1 -1
  37. package/js/x-modules/facets/components/facets/facets-provider.vue_rollup-plugin-vue_script.vue.js +7 -2
  38. package/js/x-modules/facets/components/facets/facets-provider.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  39. package/js/x-modules/facets/components/filters/hierarchical-filter.vue.js.map +1 -1
  40. package/js/x-modules/facets/components/filters/hierarchical-filter.vue_rollup-plugin-vue_script.vue.js +2 -130
  41. package/js/x-modules/facets/components/filters/hierarchical-filter.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  42. package/js/x-modules/facets/entities/editable-number-range-filter.entity.js +11 -10
  43. package/js/x-modules/facets/entities/editable-number-range-filter.entity.js.map +1 -1
  44. package/js/x-modules/facets/entities/hierarchical-filter.entity.js +9 -11
  45. package/js/x-modules/facets/entities/hierarchical-filter.entity.js.map +1 -1
  46. package/js/x-modules/facets/entities/number-range-filter.entity.js +2 -2
  47. package/js/x-modules/facets/entities/number-range-filter.entity.js.map +1 -1
  48. package/js/x-modules/facets/entities/raw-filter.entity.js +1 -1
  49. package/js/x-modules/facets/entities/raw-filter.entity.js.map +1 -1
  50. package/js/x-modules/facets/entities/simple-filter.entity.js +2 -2
  51. package/js/x-modules/facets/entities/simple-filter.entity.js.map +1 -1
  52. package/js/x-modules/facets/entities/single-select.modifier.js +1 -1
  53. package/js/x-modules/facets/entities/single-select.modifier.js.map +1 -1
  54. package/js/x-modules/facets/service/facets.service.js +18 -2
  55. package/js/x-modules/facets/service/facets.service.js.map +1 -1
  56. package/js/x-modules/facets/store/module.js +4 -3
  57. package/js/x-modules/facets/store/module.js.map +1 -1
  58. package/js/x-modules/facets/utils.js +16 -1
  59. package/js/x-modules/facets/utils.js.map +1 -1
  60. package/js/x-modules/search-box/components/search-input.vue.js +54 -45
  61. package/js/x-modules/search-box/components/search-input.vue.js.map +1 -1
  62. package/js/x-modules/search-box/components/search-input.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  63. package/package.json +4 -4
  64. package/report/x-adapter-platform.api.json +5 -133
  65. package/report/x-components.api.json +181 -45
  66. package/report/x-components.api.md +14 -5
  67. package/report/x-types.api.json +5 -5
  68. package/types/x-modules/facets/components/facets/facets-provider.vue.d.ts.map +1 -1
  69. package/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts +0 -6
  70. package/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts.map +1 -1
  71. package/types/x-modules/facets/entities/editable-number-range-filter.entity.d.ts +1 -1
  72. package/types/x-modules/facets/entities/editable-number-range-filter.entity.d.ts.map +1 -1
  73. package/types/x-modules/facets/entities/hierarchical-filter.entity.d.ts +2 -1
  74. package/types/x-modules/facets/entities/hierarchical-filter.entity.d.ts.map +1 -1
  75. package/types/x-modules/facets/entities/single-select.modifier.d.ts.map +1 -1
  76. package/types/x-modules/facets/service/facets.service.d.ts +13 -0
  77. package/types/x-modules/facets/service/facets.service.d.ts.map +1 -1
  78. package/types/x-modules/facets/store/module.d.ts.map +1 -1
  79. package/types/x-modules/facets/store/types.d.ts +22 -6
  80. package/types/x-modules/facets/store/types.d.ts.map +1 -1
  81. package/types/x-modules/facets/utils.d.ts +11 -0
  82. package/types/x-modules/facets/utils.d.ts.map +1 -1
  83. package/types/x-modules/search-box/components/search-input.vue.d.ts.map +1 -1
  84. package/docs/API-reference/api/x-adapter-platform.searchresponsefacetsmapper.md +0 -27
  85. package/docs/API-reference/api/x-components.facetsmutations.setfilter.md +0 -24
  86. package/docs/functional-doc/web-local-storage.md +0 -22
package/CHANGELOG.md CHANGED
@@ -3,6 +3,51 @@
3
3
  All notable changes to this project will be documented in this file. See
4
4
  [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.0.0-alpha.147](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.146...@empathyco/x-components@3.0.0-alpha.147) (2022-08-03)
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ - **facets:** Removed the `setFilter`mutation from `facets` X-Module. Use `mutateFilter` instead.
11
+ - **facets:** Modified the `HierarchicalFilter.children` Model type. Now it is an
12
+ `Array<HierarchicalFilter>` instead of an array of ids.
13
+
14
+ ### Features
15
+
16
+ - **facets:** Move filters flattening from `x-adapter-platform` to `x-components`. (#626)
17
+ ([2bebaeb](https://github.com/empathyco/x/commit/2bebaeb2863fe794f1b3bea924904651b9302ef6)),
18
+ closes [EX-6484](https://searchbroker.atlassian.net/browse/EX-6484)
19
+
20
+ # Change Log
21
+
22
+ All notable changes to this project will be documented in this file. See
23
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
24
+
25
+ ## [3.0.0-alpha.146](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.145...@empathyco/x-components@3.0.0-alpha.146) (2022-08-03)
26
+
27
+ ### Documentation
28
+
29
+ - bring functional docs from eDocs project (#630)
30
+ ([27e6dd6](https://github.com/empathyco/x/commit/27e6dd646084983c37fc52894dc95544253405d5)),
31
+ closes [EX-6237](https://searchbroker.atlassian.net/browse/EX-6237)
32
+
33
+ # Change Log
34
+
35
+ All notable changes to this project will be documented in this file. See
36
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
37
+
38
+ ## [3.0.0-alpha.145](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.144...@empathyco/x-components@3.0.0-alpha.145) (2022-08-01)
39
+
40
+ ### Documentation
41
+
42
+ - update archetype integration and x-adapter docs (#628)
43
+ ([247899e](https://github.com/empathyco/x/commit/247899e39d4f415f59b8ec1b7376fc72530028c2)),
44
+ closes [EX-6728](https://searchbroker.atlassian.net/browse/EX-6728)
45
+
46
+ # Change Log
47
+
48
+ All notable changes to this project will be documented in this file. See
49
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
50
+
6
51
  ## [3.0.0-alpha.144](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.143...@empathyco/x-components@3.0.0-alpha.144) (2022-08-01)
7
52
 
8
53
  ### ⚠ BREAKING CHANGES
@@ -1166,6 +1166,34 @@
1166
1166
  font-weight: var(--x-number-font-weight-input-placeholder-default);
1167
1167
  line-height: var(--x-size-line-height-input-placeholder-default);
1168
1168
  }
1169
+ :root {
1170
+ --x-color-background-input-default: var(--x-color-base-neutral-100);
1171
+ --x-color-border-input-default: var(--x-color-base-neutral-70);
1172
+ --x-color-border-input-default-focus: var(--x-color-base-lead);
1173
+ --x-color-text-input-default: var(--x-color-text-default);
1174
+ --x-color-text-input-placeholder-default: var(--x-color-base-neutral-35);
1175
+ --x-size-border-width-input-default: var(--x-size-border-width-base);
1176
+ --x-size-border-width-top-input-default: var(--x-size-border-width-input-default);
1177
+ --x-size-border-width-right-input-default: var(--x-size-border-width-input-default);
1178
+ --x-size-border-width-bottom-input-default: var(--x-size-border-width-input-default);
1179
+ --x-size-border-width-left-input-default: var(--x-size-border-width-input-default);
1180
+ --x-size-border-radius-input-default: var(--x-size-border-radius-base-none);
1181
+ --x-size-border-radius-top-left-input-default: var(--x-size-border-radius-input-default);
1182
+ --x-size-border-radius-top-right-input-default: var(--x-size-border-radius-input-default);
1183
+ --x-size-border-radius-bottom-right-input-default: var(--x-size-border-radius-input-default);
1184
+ --x-size-border-radius-bottom-left-input-default: var(--x-size-border-radius-input-default);
1185
+ --x-size-height-input-default: var(--x-size-base-07);
1186
+ --x-size-padding-right-input-default: var(--x-size-base-04);
1187
+ --x-size-padding-left-input-default: var(--x-size-base-04);
1188
+ --x-font-family-input-default: var(--x-font-family-text);
1189
+ --x-size-font-input-default: var(--x-size-font-text);
1190
+ --x-size-line-height-input-default: var(--x-size-line-height-text);
1191
+ --x-number-font-weight-input-default: var(--x-number-font-weight-text);
1192
+ --x-font-family-input-placeholder-default: var(--x-font-family-input-default);
1193
+ --x-size-font-input-placeholder-default: var(--x-size-font-input-default);
1194
+ --x-size-line-height-input-placeholder-default: var(--x-size-line-height-input-default);
1195
+ --x-number-font-weight-input-placeholder-default: var(--x-number-font-weight-input-default);
1196
+ }
1169
1197
  :root {
1170
1198
  --x-string-flow-list: column nowrap;
1171
1199
  --x-size-padding-list: 0;
@@ -2878,32 +2906,4 @@
2878
2906
  --x-size-line-height-base-s: 16px;
2879
2907
  --x-size-line-height-base-m: 24px;
2880
2908
  --x-size-line-height-base-l: 32px;
2881
- }
2882
- :root {
2883
- --x-color-background-input-default: var(--x-color-base-neutral-100);
2884
- --x-color-border-input-default: var(--x-color-base-neutral-70);
2885
- --x-color-border-input-default-focus: var(--x-color-base-lead);
2886
- --x-color-text-input-default: var(--x-color-text-default);
2887
- --x-color-text-input-placeholder-default: var(--x-color-base-neutral-35);
2888
- --x-size-border-width-input-default: var(--x-size-border-width-base);
2889
- --x-size-border-width-top-input-default: var(--x-size-border-width-input-default);
2890
- --x-size-border-width-right-input-default: var(--x-size-border-width-input-default);
2891
- --x-size-border-width-bottom-input-default: var(--x-size-border-width-input-default);
2892
- --x-size-border-width-left-input-default: var(--x-size-border-width-input-default);
2893
- --x-size-border-radius-input-default: var(--x-size-border-radius-base-none);
2894
- --x-size-border-radius-top-left-input-default: var(--x-size-border-radius-input-default);
2895
- --x-size-border-radius-top-right-input-default: var(--x-size-border-radius-input-default);
2896
- --x-size-border-radius-bottom-right-input-default: var(--x-size-border-radius-input-default);
2897
- --x-size-border-radius-bottom-left-input-default: var(--x-size-border-radius-input-default);
2898
- --x-size-height-input-default: var(--x-size-base-07);
2899
- --x-size-padding-right-input-default: var(--x-size-base-04);
2900
- --x-size-padding-left-input-default: var(--x-size-base-04);
2901
- --x-font-family-input-default: var(--x-font-family-text);
2902
- --x-size-font-input-default: var(--x-size-font-text);
2903
- --x-size-line-height-input-default: var(--x-size-line-height-text);
2904
- --x-number-font-weight-input-default: var(--x-number-font-weight-text);
2905
- --x-font-family-input-placeholder-default: var(--x-font-family-input-default);
2906
- --x-size-font-input-placeholder-default: var(--x-size-font-input-default);
2907
- --x-size-line-height-input-placeholder-default: var(--x-size-line-height-input-default);
2908
- --x-number-font-weight-input-placeholder-default: var(--x-number-font-weight-input-default);
2909
2909
  }
@@ -121,6 +121,59 @@
121
121
  --x-size-border-radius-bottom-right-button-card: var(--x-size-border-radius-button-card);
122
122
  --x-size-border-radius-bottom-left-button-card: var(--x-size-border-radius-button-card);
123
123
  }
124
+ [dir="ltr"] .x-button {
125
+ padding-right: var(--x-size-padding-right-button-default);
126
+ }
127
+ [dir="rtl"] .x-button {
128
+ padding-left: var(--x-size-padding-right-button-default);
129
+ }
130
+ [dir="ltr"] .x-button {
131
+ padding-left: var(--x-size-padding-left-button-default);
132
+ }
133
+ [dir="rtl"] .x-button {
134
+ padding-right: var(--x-size-padding-left-button-default);
135
+ }
136
+ [dir="ltr"] .x-button {
137
+ border-left-width: var(--x-size-border-width-left-button-default);
138
+ }
139
+ [dir="rtl"] .x-button {
140
+ border-right-width: var(--x-size-border-width-left-button-default);
141
+ }
142
+ [dir="ltr"] .x-button {
143
+ border-right-width: var(--x-size-border-width-right-button-default);
144
+ }
145
+ [dir="rtl"] .x-button {
146
+ border-left-width: var(--x-size-border-width-right-button-default);
147
+ }
148
+ .x-button {
149
+ display: inline-flex;
150
+ justify-content: center;
151
+ align-items: center;
152
+ box-sizing: border-box;
153
+ margin: 0;
154
+ gap: var(--x-size-gap-button-default);
155
+ min-height: var(--x-size-height-button-default);
156
+ background-color: var(--x-color-background-button-default);
157
+ border-color: var(--x-color-border-button-default);
158
+ color: var(--x-color-text-button-default);
159
+ border-style: solid;
160
+ border-top-width: var(--x-size-border-width-top-button-default);
161
+ border-bottom-width: var(--x-size-border-width-bottom-button-default);
162
+ border-radius: var(--x-size-border-radius-top-left-button-default) var(--x-size-border-radius-top-right-button-default) var(--x-size-border-radius-bottom-right-button-default) var(--x-size-border-radius-bottom-left-button-default);
163
+ font-family: var(--x-font-family-button-default);
164
+ font-size: var(--x-size-font-button-default);
165
+ font-weight: var(--x-number-font-weight-button-default);
166
+ line-height: var(--x-size-line-height-button-default);
167
+ cursor: pointer;
168
+ }
169
+ @media not all and (min-resolution: 0.001dpcm) {
170
+ .x-button {
171
+ gap: 0;
172
+ }
173
+ .x-button > *:not(:last-child) {
174
+ margin-right: var(--x-size-gap-button-default);
175
+ }
176
+ }
124
177
  :root {
125
178
  --x-color-background-button-default: var(--x-color-base-lead);
126
179
  --x-color-border-button-default: var(--x-color-background-button-default);
@@ -7540,57 +7593,3 @@
7540
7593
  .x-normal-case {
7541
7594
  text-transform: none;
7542
7595
  }
7543
-
7544
- [dir="ltr"] .x-button {
7545
- padding-right: var(--x-size-padding-right-button-default);
7546
- }
7547
- [dir="rtl"] .x-button {
7548
- padding-left: var(--x-size-padding-right-button-default);
7549
- }
7550
- [dir="ltr"] .x-button {
7551
- padding-left: var(--x-size-padding-left-button-default);
7552
- }
7553
- [dir="rtl"] .x-button {
7554
- padding-right: var(--x-size-padding-left-button-default);
7555
- }
7556
- [dir="ltr"] .x-button {
7557
- border-left-width: var(--x-size-border-width-left-button-default);
7558
- }
7559
- [dir="rtl"] .x-button {
7560
- border-right-width: var(--x-size-border-width-left-button-default);
7561
- }
7562
- [dir="ltr"] .x-button {
7563
- border-right-width: var(--x-size-border-width-right-button-default);
7564
- }
7565
- [dir="rtl"] .x-button {
7566
- border-left-width: var(--x-size-border-width-right-button-default);
7567
- }
7568
- .x-button {
7569
- display: inline-flex;
7570
- justify-content: center;
7571
- align-items: center;
7572
- box-sizing: border-box;
7573
- margin: 0;
7574
- gap: var(--x-size-gap-button-default);
7575
- min-height: var(--x-size-height-button-default);
7576
- background-color: var(--x-color-background-button-default);
7577
- border-color: var(--x-color-border-button-default);
7578
- color: var(--x-color-text-button-default);
7579
- border-style: solid;
7580
- border-top-width: var(--x-size-border-width-top-button-default);
7581
- border-bottom-width: var(--x-size-border-width-bottom-button-default);
7582
- border-radius: var(--x-size-border-radius-top-left-button-default) var(--x-size-border-radius-top-right-button-default) var(--x-size-border-radius-bottom-right-button-default) var(--x-size-border-radius-bottom-left-button-default);
7583
- font-family: var(--x-font-family-button-default);
7584
- font-size: var(--x-size-font-button-default);
7585
- font-weight: var(--x-number-font-weight-button-default);
7586
- line-height: var(--x-size-line-height-button-default);
7587
- cursor: pointer;
7588
- }
7589
- @media not all and (min-resolution: 0.001dpcm) {
7590
- .x-button {
7591
- gap: 0;
7592
- }
7593
- .x-button > *:not(:last-child) {
7594
- margin-right: var(--x-size-gap-button-default);
7595
- }
7596
- }
@@ -11,7 +11,6 @@
11
11
  | [extractUrlParameters(url)](./x-adapter-platform.extracturlparameters.md) | Returns the base url path and an object with the query parameters. |
12
12
  | [getFacetConfig(facet)](./x-adapter-platform.getfacetconfig.md) | Returns the facet's config. |
13
13
  | [getTaggingInfoFromUrl(taggingUrl)](./x-adapter-platform.gettagginginfofromurl.md) | Extracts the tagging info from a URL. |
14
- | [searchResponseFacetsMapper(from, { mappedValue })](./x-adapter-platform.searchresponsefacetsmapper.md) | Mapper to flatten hierarchical facet filters. |
15
14
 
16
15
  ## Interfaces
17
16
 
@@ -7,15 +7,5 @@
7
7
  <b>Signature:</b>
8
8
 
9
9
  ```typescript
10
- searchResponseMapper: import("@empathyco/x-adapter").Mapper<PlatformSearchResponse, {
11
- banners: import("@empathyco/x-types").Banner[];
12
- facets: import("@empathyco/x-types").Facet[];
13
- partialResults: import("@empathyco/x-types").PartialResult[];
14
- promoteds: import("@empathyco/x-types").Promoted[];
15
- queryTagging: import("@empathyco/x-types").TaggingRequest;
16
- redirections: import("@empathyco/x-types").Redirection[];
17
- results: import("@empathyco/x-types").Result[];
18
- spellcheck: string;
19
- totalResults: number;
20
- }>
10
+ searchResponseMapper: import("@empathyco/x-adapter").Mapper<PlatformSearchResponse, SearchResponse>
21
11
  ```
@@ -16,12 +16,12 @@ export interface FacetsMutations
16
16
 
17
17
  | Method | Description |
18
18
  | --- | --- |
19
+ | [mutateFilter(payload)](./x-components.facetsmutations.mutatefilter.md) | Updates the state of a filter. |
19
20
  | [removeFacet(facet)](./x-components.facetsmutations.removefacet.md) | Removes the facet from the [facets](./x-components.facetsstate.facets.md) record. |
20
21
  | [removeFilter(filter)](./x-components.facetsmutations.removefilter.md) | Removes the filter from the [filters](./x-components.facetsstate.filters.md) record. |
21
22
  | [removeFilters(filters)](./x-components.facetsmutations.removefilters.md) | Removes a list of filters from the [filters](./x-components.facetsstate.filters.md) record. |
22
23
  | [setFacet(facet)](./x-components.facetsmutations.setfacet.md) | Adds the facet to the [facets](./x-components.facetsstate.facets.md) record. |
23
24
  | [setFacetGroup(facetGroupEntry)](./x-components.facetsmutations.setfacetgroup.md) | Sets the group id of the facet. |
24
- | [setFilter(filter)](./x-components.facetsmutations.setfilter.md) | Adds the filter to the [filters](./x-components.facetsstate.filters.md) record. |
25
25
  | [setFilters(filters)](./x-components.facetsmutations.setfilters.md) | Adds a list of filters to the [filters](./x-components.facetsstate.filters.md) record. |
26
26
  | [setPreselectedFilters(filters)](./x-components.facetsmutations.setpreselectedfilters.md) | Adds a list of filters to the [preselectedFilters](./x-components.facetsstate.preselectedfilters.md) record. |
27
27
 
@@ -0,0 +1,24 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [FacetsMutations](./x-components.facetsmutations.md) &gt; [mutateFilter](./x-components.facetsmutations.mutatefilter.md)
4
+
5
+ ## FacetsMutations.mutateFilter() method
6
+
7
+ Updates the state of a filter.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ mutateFilter(payload: MutateFilterPayload): void;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ | Parameter | Type | Description |
18
+ | --- | --- | --- |
19
+ | payload | [MutateFilterPayload](./x-components.mutatefilterpayload.md) | An object containing the filter to update, and the properties to modify. |
20
+
21
+ <b>Returns:</b>
22
+
23
+ void
24
+
@@ -0,0 +1,26 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [flatHierarchicalFilters](./x-components.flathierarchicalfilters.md)
4
+
5
+ ## flatHierarchicalFilters() function
6
+
7
+ This function flattens the Hierarchical Filters, returning an array with all filters including the children.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ export declare function flatHierarchicalFilters(hierarchicalFilters: HierarchicalFilter[]): HierarchicalFilter[];
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ | Parameter | Type | Description |
18
+ | --- | --- | --- |
19
+ | hierarchicalFilters | HierarchicalFilter\[\] | The list of Hierarchical Filters to flatten. |
20
+
21
+ <b>Returns:</b>
22
+
23
+ HierarchicalFilter\[\]
24
+
25
+ An array with all the Hierarchical filters.
26
+
@@ -166,6 +166,7 @@ X-Components is a library usable everywhere not only for search experiences.
166
166
  | [filterFalsyPayload(wire)](./x-components.filterfalsypayload.md) | Creates a [Wire](./x-components.wire.md) that is only executed when the payload is truthy. A truthy value is whatever is not a [falsy value](https://developer.mozilla.org/en-US/docs/Glossary/Falsy)<!-- -->. |
167
167
  | [filterTruthyPayload(wire)](./x-components.filtertruthypayload.md) | Creates a [Wire](./x-components.wire.md) that is only executed when the payload is a [falsy value](https://developer.mozilla.org/en-US/docs/Glossary/Falsy)<!-- -->. |
168
168
  | [filterWhitelistedModules(wire, whitelist)](./x-components.filterwhitelistedmodules.md) | Creates a [Wire](./x-components.wire.md) that is only executed if the event is emitted from a [XModule](./x-components.xmodule.md) that is included in the <code>whitelist</code> array passed as parameter. |
169
+ | [flatHierarchicalFilters(hierarchicalFilters)](./x-components.flathierarchicalfilters.md) | This function flattens the Hierarchical Filters, returning an array with all filters including the children. |
169
170
  | [getRootXComponent(component)](./x-components.getrootxcomponent.md) | Given a component, finds the root XComponent in the ancestors hierarchy. |
170
171
  | [getStateAndGettersFromModule(state, getters, moduleName)](./x-components.getstateandgettersfrommodule.md) | Returns an object with the getters and state of a module of store defined by the moduleName parameter. |
171
172
  | [Getter(module, getter)](./x-components.getter.md) | Generates a computed property which returns the selected getter value.<!-- -->The decorated property needs to be public for type inference to work. |
@@ -253,6 +254,7 @@ X-Components is a library usable everywhere not only for search experiences.
253
254
  | [InitWrapper](./x-components.initwrapper.md) | Interface for the returned type of the [XInstaller.init()](./x-components.xinstaller.init.md) function. |
254
255
  | [InstallXOptions](./x-components.installxoptions.md) | Interface for the parameter of the constructor of [XInstaller](./x-components.xinstaller.md) function. It is an extended version of [XPluginOptions](./x-components.xpluginoptions.md)<!-- -->. |
255
256
  | [InternalSearchRequest](./x-components.internalsearchrequest.md) | An internal search request containing the page used to calculate the start and rows properties of a [SearchRequest](./x-types.searchrequest.md)<!-- -->. |
257
+ | [MutateFilterPayload](./x-components.mutatefilterpayload.md) | Payload to use in the <code>mutateFilter</code> mutation. |
256
258
  | [NamespacedWireCommit](./x-components.namespacedwirecommit.md) | Namespaced type for the [wireCommit()](./x-components.wirecommit.md) which creates a wire with its payload associated. Possible ways for creating a wire that commits a mutation. If a payload is passed, then the observable payload can be ignored, so the wire is applicable to any event. If no payload is passed, then the wire is only applicable to events with the same payload type than the mutation. |
257
259
  | [NamespacedWireDispatch](./x-components.namespacedwiredispatch.md) | Namespaced type for the [wireDispatch()](./x-components.wiredispatch.md) which creates a wire with its payload associated. Possible ways for creating a wire that dispatches an action. If a payload is passed, then the observable payload can be ignored, so the wire is applicable to any event. If no payload is passed, then the wire is only applicable to events with the same payload type than the action. |
258
260
  | [NextQueriesActions](./x-components.nextqueriesactions.md) | Next queries module actions. |
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [MutateFilterPayload](./x-components.mutatefilterpayload.md) &gt; [filter](./x-components.mutatefilterpayload.filter.md)
4
+
5
+ ## MutateFilterPayload.filter property
6
+
7
+ The filter to modify. If it does not belong to the store it will be added.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ filter: Filter;
13
+ ```
@@ -0,0 +1,21 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [MutateFilterPayload](./x-components.mutatefilterpayload.md)
4
+
5
+ ## MutateFilterPayload interface
6
+
7
+ Payload to use in the `mutateFilter` mutation.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ export interface MutateFilterPayload
13
+ ```
14
+
15
+ ## Properties
16
+
17
+ | Property | Type | Description |
18
+ | --- | --- | --- |
19
+ | [filter](./x-components.mutatefilterpayload.filter.md) | Filter | The filter to modify. If it does not belong to the store it will be added. |
20
+ | [newFilterState](./x-components.mutatefilterpayload.newfilterstate.md) | Partial&lt;Filter&gt; | The new fields values to modify in the filter. |
21
+
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [MutateFilterPayload](./x-components.mutatefilterpayload.md) &gt; [newFilterState](./x-components.mutatefilterpayload.newfilterstate.md)
4
+
5
+ ## MutateFilterPayload.newFilterState property
6
+
7
+ The new fields values to modify in the filter.
8
+
9
+ <b>Signature:</b>
10
+
11
+ ```typescript
12
+ newFilterState: Partial<Filter>;
13
+ ```
@@ -4,10 +4,10 @@
4
4
 
5
5
  ## HierarchicalFilter.children property
6
6
 
7
- Descendants filters id.
7
+ Descendants filters.
8
8
 
9
9
  <b>Signature:</b>
10
10
 
11
11
  ```typescript
12
- children?: Filter['id'][];
12
+ children?: HierarchicalFilter[];
13
13
  ```
@@ -17,7 +17,7 @@ export interface HierarchicalFilter extends BooleanFilter
17
17
 
18
18
  | Property | Type | Description |
19
19
  | --- | --- | --- |
20
- | [children?](./x-types.hierarchicalfilter.children.md) | [Filter](./x-types.filter.md)<!-- -->\['id'\]\[\] | <i>(Optional)</i> Descendants filters id. |
20
+ | [children?](./x-types.hierarchicalfilter.children.md) | [HierarchicalFilter](./x-types.hierarchicalfilter.md)<!-- -->\[\] | <i>(Optional)</i> Descendants filters. |
21
21
  | [modelName](./x-types.hierarchicalfilter.modelname.md) | 'HierarchicalFilter' | Model name to indicate the filter type. |
22
- | [parentId](./x-types.hierarchicalfilter.parentid.md) | [Filter](./x-types.filter.md)<!-- -->\['id'\] \| null | An unique id used to reference the parent filter or null if it hasn't. |
22
+ | [parentId](./x-types.hierarchicalfilter.parentid.md) | [Filter](./x-types.filter.md)<!-- -->\['id'\] \| null | A unique id used to reference the parent filter or null if it hasn't. |
23
23
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## HierarchicalFilter.parentId property
6
6
 
7
- An unique id used to reference the parent filter or null if it hasn't.
7
+ A unique id used to reference the parent filter or null if it hasn't.
8
8
 
9
9
  <b>Signature:</b>
10
10
 
@@ -22,9 +22,9 @@ requires knowledge of JavaScript and Vue.js.
22
22
 
23
23
  To use Interface&nbsp;X&nbsp;Archetype as a search UI layer, you need:
24
24
 
25
- - **Empathy Search API** (or any search API that you use to retrieve search data).
26
- - **Empathy Search Adapter** to communicate with the Empathy Search API (or any search adapter to
27
- connect with the search API you are using).
25
+ - **Empathy Platform Search API** (or any search API that you use to retrieve search data).
26
+ - **Empathy Platform Search Adapter** to communicate with the Empathy Platform Search API (or the
27
+ Empathy Search Adapter to connect with the search API you are using).
28
28
 
29
29
  :::
30
30
 
@@ -102,16 +102,19 @@ Interface&nbsp;X&nbsp;Archetype repository.
102
102
 
103
103
  ## Configuring the search adapter
104
104
 
105
- Before using your project, configure the Empathy Search Adapter in the
106
- `x-archetype/src/adapter/adapter.ts` file to make it work with the Empathy Search API.
105
+ Before using your project, configure the Empathy Platform Search Adapter in the
106
+ `x-archetype/src/adapter/adapter.ts` file. The Empathy Platform Search Adapter contains a sample
107
+ configuration for setup, global configurations, or mappers that points to a demo environment. You
108
+ need to adjust the configuration according to the search features you use in your project.
107
109
 
108
110
  Export the required search adapter with your configuration as you will need it for the search
109
111
  [xPlugin configuration](#configuring-the-plugin).
110
112
 
111
113
  ::: interact
112
114
 
113
- For detailed information about other configuration options in the Empathy Search Adapter, go to the
114
- [x-adapter repository](https://github.com/empathyco/x/tree/main/packages/x-adapter).
115
+ For detailed information about other configuration options in the Empathy Platform Search Adapter,
116
+ go to the
117
+ [x-adapter-platform repository](https://github.com/empathyco/x/tree/main/packages/x-adapter-platform).
115
118
 
116
119
  :::
117
120
 
@@ -69,7 +69,6 @@ initialize Interface&nbsp;X:
69
69
  ```js
70
70
  window.initX = {
71
71
  instance: 'my-store',
72
- env: 'live',
73
72
  scope: 'desktop',
74
73
  lang: 'en',
75
74
  currency: 'EUR',
@@ -83,7 +82,7 @@ window.initX = {
83
82
  window.initX = function () {
84
83
  return {
85
84
  instance: 'my-store',
86
- env: location.href.includes('.pre.') ? 'staging' : 'live',
85
+ env: location.href.includes('.pre.') ? 'staging' : undefined,
87
86
  scope: 'web',
88
87
  lang: localStorage.get('lang'),
89
88
  currency: localStorage.get('currency'),
@@ -105,7 +104,9 @@ more information on the supported parameters, check out
105
104
 
106
105
  Once the snippet configuration is ready, add the Interface&nbsp;X script to your webpage. The script
107
106
  is hosted in a URL with the following syntax:
108
- `https://x.<environment?>.empathy.co/<instance>/app.js`.
107
+
108
+ - **Production**: `https://x.empathy.co/{INSTANCE}/app.js`
109
+ - **Staging**: `https://x.staging.empathy.co/{INSTANCE}/app.js`
109
110
 
110
111
  For example, to load the production version script for the instance _my-store_, you need to add the
111
112
  following scripts to your HTML:
@@ -114,7 +115,6 @@ following scripts to your HTML:
114
115
  <script>
115
116
  window.initX = {
116
117
  instance: 'my-store',
117
- env: 'live',
118
118
  scope: 'desktop',
119
119
  lang: 'en',
120
120
  currency: 'EUR',
@@ -131,7 +131,7 @@ attribute `src` so that it points to the staging environment as follows:
131
131
  <script>
132
132
  window.initX = {
133
133
  instance: 'my-store',
134
- env: 'live', // Note that here you are using a production API with the staging version of Interface X
134
+ env: 'staging', // By removing this param you would be using a production API with the staging version of Interface X
135
135
  scope: 'desktop',
136
136
  lang: 'en',
137
137
  currency: 'EUR',
@@ -156,7 +156,9 @@ On-demand initialization allows you to control when Interface&nbsp;X is loaded.
156
156
  #### Loading the script
157
157
 
158
158
  Add the Interface&nbsp;X script hosted in a URL with the following syntax:
159
- `https://x.<environment?>.empathy.co/<instance>/app.js`.
159
+
160
+ - **Production**: `https://x.empathy.co/{INSTANCE}/app.js`
161
+ - **Staging**: `https://x.staging.empathy.co/{INSTANCE}/app.js`
160
162
 
161
163
  For example, to load the production version script for the instance _my-store_, you need to add the
162
164
  following script to your HTML:
@@ -180,11 +182,10 @@ initialization function** created automatically in the
180
182
  object to provide the initialization options:
181
183
 
182
184
  ```html
183
- <script src="https://x.empathy.co/my-store/app.js"></script>
185
+ <script src="https://x.empathy.co/my-store/app.js" type="module"></script>
184
186
  <script>
185
187
  window.InterfaceX.init({
186
188
  instance: 'my-store',
187
- env: 'live',
188
189
  scope: 'desktop',
189
190
  lang: 'en',
190
191
  currency: 'EUR',
@@ -219,12 +220,12 @@ The
219
220
  [snippet configuration](https://github.com/empathyco/x-archetype/blob/main/public/snippet-script.js)
220
221
  allows you to configure multiple initialization options for the Interface&nbsp;X project such as
221
222
  language, currency, and shopper's personal data consent. The snippet configuration supports the
222
- following configuration options:
223
+ following configuration parameters:
223
224
 
224
- | Name | Type | Description |
225
+ | Parameter | Type | Description |
225
226
  | ------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
226
227
  | `instance` | `string` | _Required._ ID of the API client instance. It's provided by Empathy. |
227
- | `env` | `'live'` &#124; `'staging'` | _Optional_. API environment to use. You can use the Interface&nbsp;X production version with the staging API, and vice versa. |
228
+ | `env` | `staging` | _Optional_. API environment to use. Note that if you **do not** declare this parameter, you'll use the production API. Instead, use `env: 'staging'` to point to the staging API. |
228
229
  | `scope` | `string` | _Optional_. Context where the search interface is executed, i.e. `mobile`, `mobile-app`, `tablet`, `desktop`. |
229
230
  | `lang` | `string` | _Required._ Language to use. By default, it's used for both the frontend and the API requests. |
230
231
  | `searchLang` | `string` | _Optional_. Language to use for the API requests **only**. |
@@ -260,11 +261,10 @@ For example, you subscribe to the `UserClickedResultAddToCart` event to add a pr
260
261
  shopping cart:
261
262
 
262
263
  ```html
263
- <script src="https://x.empathy.co/my-store/app.js"></script>
264
+ <script src="https://x.empathy.co/my-store/app.js" type="module"></script>
264
265
  <script>
265
266
  window.InterfaceX.init({
266
267
  instance: 'my-store',
267
- env: 'live',
268
268
  scope: 'desktop',
269
269
  lang: 'en',
270
270
  currency: 'EUR',
@@ -297,7 +297,8 @@ etc.). See the corresponding `events.types.ts` file for each module in the
297
297
  The
298
298
  [X&nbsp;API](https://github.com/empathyco/x/blob/main/packages/x-components/src/x-installer/api/base-api.ts)
299
299
  object allows your commerce store to communicate with Interface&nbsp;X. It supports multiple
300
- functions to integrate Interface&nbsp;X in your website.
300
+ functions to integrate Interface&nbsp;X in your website. You can access these functions inside the
301
+ `window.InterfaceX` object.
301
302
 
302
303
  | Function | Parameters | Description |
303
304
  | ------------------ | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
@@ -33,8 +33,7 @@ You can find the X&nbsp;Components library in the
33
33
  To integrate the X&nbsp;Components in a frontend UI, you need:
34
34
 
35
35
  - **Empathy Search API** to retrieve search data (or any other search API)
36
- - A **search adapter** to communicate with the search API. You can use the
37
- [Empathy Platform Adapter](https://github.com/empathyco/x/tree/main/packages/x-adapter-platform)
36
+ - A **search adapter** to communicate with the search API.
38
37
  - Your commerce store built on a **Vue** project, or on a **React** project using the
39
38
  [React Wrapper](https://github.com/empathyco/x/tree/main/packages/react-wrapper).
40
39
 
@@ -93,8 +92,10 @@ If you do not use the Empathy Search API, you need to build your own adapter.
93
92
 
94
93
  :::
95
94
 
96
- For more information, see
97
- [Using the Empathy Search Adapter](https://github.com/empathyco/x/tree/main/packages/x-adapter).
95
+ For more information, see the
96
+ [Empathy Search Adapter](https://github.com/empathyco/x/tree/main/packages/x-adapter) and
97
+ [Empathy Platform Search Adapter](https://github.com/empathyco/x/tree/main/packages/x-adapter-platform)
98
+ libraries.
98
99
 
99
100
  ## Configuring the plugin
100
101