@empathyco/x-components 8.8.1 → 8.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/docs/API-reference/api/x-components.hierarchicalfilter.md +1 -0
- package/docs/API-reference/api/x-components.simplefilter.md +1 -0
- package/docs/API-reference/api/x-components.snippetcallbacks.md +1 -0
- package/docs/API-reference/api/x-components.vendoractions.md +43 -0
- package/docs/API-reference/api/x-components.vendoractions.seturlparams.md +11 -0
- package/docs/API-reference/api/x-components.vendorgetters.md +43 -0
- package/docs/API-reference/api/x-components.vendorgetters.query.md +11 -0
- package/docs/API-reference/api/x-components.vendormutations.md +36 -1
- package/docs/API-reference/api/x-components.vendormutations.resetstate.md +11 -0
- package/docs/API-reference/api/x-components.vendormutations.setrelatedtags.md +11 -0
- package/docs/API-reference/api/x-components.vendorstate.md +19 -1
- package/docs/API-reference/api/x-components.vendorstate.relatedtags.md +11 -0
- package/docs/API-reference/api/x-components.vendorxevents.md +19 -0
- package/docs/API-reference/api/x-components.vendorxevents.vendorquerychanged.md +13 -0
- package/js/index.js +1 -1
- package/js/x-modules/vendor/store/actions/set-url-params.action.js +6 -0
- package/js/x-modules/vendor/store/actions/set-url-params.action.js.map +1 -0
- package/js/x-modules/vendor/store/emitters.js +3 -1
- package/js/x-modules/vendor/store/emitters.js.map +1 -1
- package/js/x-modules/vendor/store/getters/query.getter.js +8 -0
- package/js/x-modules/vendor/store/getters/query.getter.js.map +1 -0
- package/js/x-modules/vendor/store/module.js +34 -5
- package/js/x-modules/vendor/store/module.js.map +1 -1
- package/js/x-modules/vendor/wiring.js +53 -8
- package/js/x-modules/vendor/wiring.js.map +1 -1
- package/package.json +2 -2
- package/report/x-components.api.json +233 -9
- package/report/x-components.api.md +44 -6
- package/types/src/components/snippet-callbacks.vue.d.ts +1 -0
- package/types/src/components/snippet-callbacks.vue.d.ts.map +1 -1
- package/types/src/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts +1 -0
- package/types/src/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts.map +1 -1
- package/types/src/x-modules/facets/components/filters/simple-filter.vue.d.ts +1 -0
- package/types/src/x-modules/facets/components/filters/simple-filter.vue.d.ts.map +1 -1
- package/types/src/x-modules/vendor/events.types.d.ts +5 -0
- package/types/src/x-modules/vendor/events.types.d.ts.map +1 -1
- package/types/src/x-modules/vendor/store/actions/set-url-params.action.d.ts +3 -0
- package/types/src/x-modules/vendor/store/actions/set-url-params.action.d.ts.map +1 -0
- package/types/src/x-modules/vendor/store/emitters.d.ts +3 -1
- package/types/src/x-modules/vendor/store/emitters.d.ts.map +1 -1
- package/types/src/x-modules/vendor/store/getters/index.d.ts +2 -0
- package/types/src/x-modules/vendor/store/getters/index.d.ts.map +1 -0
- package/types/src/x-modules/vendor/store/getters/query.getter.d.ts +3 -0
- package/types/src/x-modules/vendor/store/getters/query.getter.d.ts.map +1 -0
- package/types/src/x-modules/vendor/store/module.d.ts +12 -0
- package/types/src/x-modules/vendor/store/module.d.ts.map +1 -1
- package/types/src/x-modules/vendor/store/types.d.ts +10 -2
- package/types/src/x-modules/vendor/store/types.d.ts.map +1 -1
- package/types/src/x-modules/vendor/wiring.d.ts +18 -3
- package/types/src/x-modules/vendor/wiring.d.ts.map +1 -1
- package/vendor/index.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
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
|
+
## [8.9.0](https://github.com/empathyco/x/compare/@empathyco/x-components@8.8.1...@empathyco/x-components@8.9.0) (2026-07-29)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **vendor:** enhance state management with query reset functionality (#2145)
|
|
11
|
+
|
|
12
|
+
|
|
6
13
|
## [8.8.1](https://github.com/empathyco/x/compare/@empathyco/x-components@8.8.0...@empathyco/x-components@8.8.1) (2026-07-21)
|
|
7
14
|
|
|
8
15
|
### Bug Fixes
|
|
@@ -217,6 +217,7 @@ _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
|
217
217
|
VendorBannersChanged?: Omit<import("../../../vendor").VendorBanner, "modelName">[] | undefined;
|
|
218
218
|
UserViewedAVendorBanner?: import("../../../vendor").VendorBanner | undefined;
|
|
219
219
|
UserClickedAVendorBanner?: import("../../../vendor").VendorBanner | undefined;
|
|
220
|
+
VendorQueryChanged?: string | undefined;
|
|
220
221
|
}>;
|
|
221
222
|
innerCssClasses: import("vue").ComputedRef<(string | Dictionary<boolean>)[]>;
|
|
222
223
|
renderedChildrenFilters: import("vue").ComputedRef<HierarchicalFilterModel[]>;
|
|
@@ -214,6 +214,7 @@ _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
|
214
214
|
VendorBannersChanged?: Omit<import("../../../vendor").VendorBanner, "modelName">[] | undefined;
|
|
215
215
|
UserViewedAVendorBanner?: import("../../../vendor").VendorBanner | undefined;
|
|
216
216
|
UserClickedAVendorBanner?: import("../../../vendor").VendorBanner | undefined;
|
|
217
|
+
VendorQueryChanged?: string | undefined;
|
|
217
218
|
}>;
|
|
218
219
|
innerCssClasses: import("vue").ComputedRef<(string | Dictionary<boolean>)[]>;
|
|
219
220
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -204,6 +204,7 @@ _default: import("vue").DefineComponent<{}, {
|
|
|
204
204
|
VendorBannersChanged: (payload: Omit<import("..").VendorBanner, "modelName">[], metadata: WireMetadata) => unknown;
|
|
205
205
|
UserViewedAVendorBanner: (payload: import("..").VendorBanner, metadata: WireMetadata) => unknown;
|
|
206
206
|
UserClickedAVendorBanner: (payload: import("..").VendorBanner, metadata: WireMetadata) => unknown;
|
|
207
|
+
VendorQueryChanged: (payload: string, metadata: WireMetadata) => unknown;
|
|
207
208
|
}>>;
|
|
208
209
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {
|
|
209
210
|
GlobalXBus: import("vue").DefineComponent<{}, {}, any>;
|
|
@@ -9,3 +9,46 @@
|
|
|
9
9
|
```typescript
|
|
10
10
|
export interface VendorActions
|
|
11
11
|
```
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
<table><thead><tr><th>
|
|
16
|
+
|
|
17
|
+
Property
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
</th><th>
|
|
21
|
+
|
|
22
|
+
Modifiers
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
</th><th>
|
|
26
|
+
|
|
27
|
+
Type
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
</th><th>
|
|
31
|
+
|
|
32
|
+
Description
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
</th></tr></thead>
|
|
36
|
+
<tbody><tr><td>
|
|
37
|
+
|
|
38
|
+
[setUrlParams](./x-components.vendoractions.seturlparams.md)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
</td><td>
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
</td><td>
|
|
45
|
+
|
|
46
|
+
(urlParams: [UrlParams](./x-components.urlparams.md)<!-- -->) => void
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
</td><td>
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
</td></tr>
|
|
53
|
+
</tbody></table>
|
|
54
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [VendorActions](./x-components.vendoractions.md) > [setUrlParams](./x-components.vendoractions.seturlparams.md)
|
|
4
|
+
|
|
5
|
+
## VendorActions.setUrlParams property
|
|
6
|
+
|
|
7
|
+
**Signature:**
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
setUrlParams: (urlParams: UrlParams) => void;
|
|
11
|
+
```
|
|
@@ -9,3 +9,46 @@
|
|
|
9
9
|
```typescript
|
|
10
10
|
export interface VendorGetters
|
|
11
11
|
```
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
<table><thead><tr><th>
|
|
16
|
+
|
|
17
|
+
Property
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
</th><th>
|
|
21
|
+
|
|
22
|
+
Modifiers
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
</th><th>
|
|
26
|
+
|
|
27
|
+
Type
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
</th><th>
|
|
31
|
+
|
|
32
|
+
Description
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
</th></tr></thead>
|
|
36
|
+
<tbody><tr><td>
|
|
37
|
+
|
|
38
|
+
[query](./x-components.vendorgetters.query.md)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
</td><td>
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
</td><td>
|
|
45
|
+
|
|
46
|
+
string
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
</td><td>
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
</td></tr>
|
|
53
|
+
</tbody></table>
|
|
54
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [VendorGetters](./x-components.vendorgetters.md) > [query](./x-components.vendorgetters.query.md)
|
|
4
|
+
|
|
5
|
+
## VendorGetters.query property
|
|
6
|
+
|
|
7
|
+
**Signature:**
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
query: string;
|
|
11
|
+
```
|
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
**Signature:**
|
|
8
8
|
|
|
9
9
|
```typescript
|
|
10
|
-
export interface VendorMutations
|
|
10
|
+
export interface VendorMutations extends QueryMutations
|
|
11
11
|
```
|
|
12
|
+
**Extends:** [QueryMutations](./x-components.querymutations.md)
|
|
12
13
|
|
|
13
14
|
## Properties
|
|
14
15
|
|
|
@@ -35,6 +36,23 @@ Description
|
|
|
35
36
|
</th></tr></thead>
|
|
36
37
|
<tbody><tr><td>
|
|
37
38
|
|
|
39
|
+
[resetState](./x-components.vendormutations.resetstate.md)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
</td><td>
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
</td><td>
|
|
46
|
+
|
|
47
|
+
() => void
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
</td><td>
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
</td></tr>
|
|
54
|
+
<tr><td>
|
|
55
|
+
|
|
38
56
|
[setBanners](./x-components.vendormutations.setbanners.md)
|
|
39
57
|
|
|
40
58
|
|
|
@@ -49,6 +67,23 @@ Description
|
|
|
49
67
|
</td><td>
|
|
50
68
|
|
|
51
69
|
|
|
70
|
+
</td></tr>
|
|
71
|
+
<tr><td>
|
|
72
|
+
|
|
73
|
+
[setRelatedTags](./x-components.vendormutations.setrelatedtags.md)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
</td><td>
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
</td><td>
|
|
80
|
+
|
|
81
|
+
(relatedTags: RelatedTag\[\]) => void
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
</td><td>
|
|
85
|
+
|
|
86
|
+
|
|
52
87
|
</td></tr>
|
|
53
88
|
<tr><td>
|
|
54
89
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [VendorMutations](./x-components.vendormutations.md) > [resetState](./x-components.vendormutations.resetstate.md)
|
|
4
|
+
|
|
5
|
+
## VendorMutations.resetState property
|
|
6
|
+
|
|
7
|
+
**Signature:**
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
resetState: () => void;
|
|
11
|
+
```
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [VendorMutations](./x-components.vendormutations.md) > [setRelatedTags](./x-components.vendormutations.setrelatedtags.md)
|
|
4
|
+
|
|
5
|
+
## VendorMutations.setRelatedTags property
|
|
6
|
+
|
|
7
|
+
**Signature:**
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
setRelatedTags: (relatedTags: RelatedTag[]) => void;
|
|
11
|
+
```
|
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
**Signature:**
|
|
8
8
|
|
|
9
9
|
```typescript
|
|
10
|
-
export interface VendorState
|
|
10
|
+
export interface VendorState extends QueryState
|
|
11
11
|
```
|
|
12
|
+
**Extends:** [QueryState](./x-components.querystate.md)
|
|
12
13
|
|
|
13
14
|
## Properties
|
|
14
15
|
|
|
@@ -49,6 +50,23 @@ Description
|
|
|
49
50
|
</td><td>
|
|
50
51
|
|
|
51
52
|
|
|
53
|
+
</td></tr>
|
|
54
|
+
<tr><td>
|
|
55
|
+
|
|
56
|
+
[relatedTags](./x-components.vendorstate.relatedtags.md)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
</td><td>
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
</td><td>
|
|
63
|
+
|
|
64
|
+
RelatedTag\[\]
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
</td><td>
|
|
68
|
+
|
|
69
|
+
|
|
52
70
|
</td></tr>
|
|
53
71
|
<tr><td>
|
|
54
72
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [VendorState](./x-components.vendorstate.md) > [relatedTags](./x-components.vendorstate.relatedtags.md)
|
|
4
|
+
|
|
5
|
+
## VendorState.relatedTags property
|
|
6
|
+
|
|
7
|
+
**Signature:**
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
relatedTags: RelatedTag[];
|
|
11
|
+
```
|
|
@@ -148,6 +148,25 @@ Omit<[VendorBanner](./x-components.vendorbanner.md)<!-- -->, 'modelName'>\
|
|
|
148
148
|
The x consumer has provided vendor banners to be inserted in the result grid. Payload: The array of vendor banner inputs with their items and positions. modelName is excluded since it is an internal field, and we will assign it under the hood.
|
|
149
149
|
|
|
150
150
|
|
|
151
|
+
</td></tr>
|
|
152
|
+
<tr><td>
|
|
153
|
+
|
|
154
|
+
[VendorQueryChanged](./x-components.vendorxevents.vendorquerychanged.md)
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
</td><td>
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
</td><td>
|
|
161
|
+
|
|
162
|
+
string
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
</td><td>
|
|
166
|
+
|
|
167
|
+
The vendor module query has changed. Payload: The new vendor query string.
|
|
168
|
+
|
|
169
|
+
|
|
151
170
|
</td></tr>
|
|
152
171
|
<tr><td>
|
|
153
172
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [VendorXEvents](./x-components.vendorxevents.md) > [VendorQueryChanged](./x-components.vendorxevents.vendorquerychanged.md)
|
|
4
|
+
|
|
5
|
+
## VendorXEvents.VendorQueryChanged property
|
|
6
|
+
|
|
7
|
+
The vendor module query has changed. Payload: The new vendor query string.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
VendorQueryChanged: string;
|
|
13
|
+
```
|
package/js/index.js
CHANGED
|
@@ -461,7 +461,7 @@ export { urlXModule } from './x-modules/url/x-module.js';
|
|
|
461
461
|
export { default as VendorBannersList } from './x-modules/vendor/components/vendor-banners-list.vue.js';
|
|
462
462
|
export { default as VendorResultsList } from './x-modules/vendor/components/vendor-results-list.vue.js';
|
|
463
463
|
export { vendorEmitters } from './x-modules/vendor/store/emitters.js';
|
|
464
|
-
export { vendorXStoreModule } from './x-modules/vendor/store/module.js';
|
|
464
|
+
export { resettableVendorState, vendorXStoreModule } from './x-modules/vendor/store/module.js';
|
|
465
465
|
export { setBanners, setResults, vendorWiring } from './x-modules/vendor/wiring.js';
|
|
466
466
|
export { vendorXModule } from './x-modules/vendor/x-module.js';
|
|
467
467
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-url-params.action.js","sources":["../../../../../../src/x-modules/vendor/store/actions/set-url-params.action.ts"],"sourcesContent":["import type { VendorXStoreModule } from '../types'\n\nexport const setUrlParams: VendorXStoreModule['actions']['setUrlParams'] = (\n { commit },\n { query },\n) => {\n commit('setQuery', query)\n}\n"],"names":[],"mappings":"AAEO,MAAM,YAAY,GAAkD,CACzE,EAAE,MAAM,EAAE,EACV,EAAE,KAAK,EAAE,KACP;AACF,IAAA,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC;AAC3B;;;;"}
|
|
@@ -7,7 +7,9 @@ import { vendorXStoreModule } from './module.js';
|
|
|
7
7
|
*
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
|
-
const vendorEmitters = createStoreEmitters(vendorXStoreModule, {
|
|
10
|
+
const vendorEmitters = createStoreEmitters(vendorXStoreModule, {
|
|
11
|
+
VendorQueryChanged: (_, getters) => getters.query,
|
|
12
|
+
});
|
|
11
13
|
|
|
12
14
|
export { vendorEmitters };
|
|
13
15
|
//# sourceMappingURL=emitters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emitters.js","sources":["../../../../../src/x-modules/vendor/store/emitters.ts"],"sourcesContent":["import { createStoreEmitters } from '../../../store'\nimport { vendorXStoreModule } from './module'\n\n/**\n * {@link StoreEmitters} For the vendor module.\n *\n * @internal\n */\nexport const vendorEmitters = createStoreEmitters(vendorXStoreModule, {})\n"],"names":[],"mappings":";;;;AAGA;;;;AAIG;AACI,MAAM,cAAc,GAAG,mBAAmB,CAAC,kBAAkB,EAAE,EAAE;;;;"}
|
|
1
|
+
{"version":3,"file":"emitters.js","sources":["../../../../../src/x-modules/vendor/store/emitters.ts"],"sourcesContent":["import { createStoreEmitters } from '../../../store'\nimport { vendorXStoreModule } from './module'\n\n/**\n * {@link StoreEmitters} For the vendor module.\n *\n * @internal\n */\nexport const vendorEmitters = createStoreEmitters(vendorXStoreModule, {\n VendorQueryChanged: (_, getters) => getters.query,\n})\n"],"names":[],"mappings":";;;;AAGA;;;;AAIG;AACI,MAAM,cAAc,GAAG,mBAAmB,CAAC,kBAAkB,EAAE;IACpE,kBAAkB,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,KAAK;AAClD,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.getter.js","sources":["../../../../../../src/x-modules/vendor/store/getters/query.getter.ts"],"sourcesContent":["import type { VendorXStoreModule } from '../types'\nimport { createRelatedTagsQueryGetter } from '../../../../store/utils/query.utils'\n\nexport const query: VendorXStoreModule['getters']['query'] = createRelatedTagsQueryGetter({\n getRelatedTags: state => state.relatedTags,\n})\n"],"names":[],"mappings":";;AAGO,MAAM,KAAK,GAA2C,4BAA4B,CAAC;AACxF,IAAA,cAAc,EAAE,KAAK,IAAI,KAAK,CAAC,WAAW;AAC3C,CAAA;;;;"}
|
|
@@ -1,19 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { setQuery } from '../../../store/utils/query.utils.js';
|
|
2
|
+
import { setUrlParams } from './actions/set-url-params.action.js';
|
|
3
|
+
import { query } from './getters/query.getter.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Function to return the "resettable" part of the state.
|
|
7
|
+
*
|
|
8
|
+
* @returns The "resettable" part of the {@link VendorState}.
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
function resettableVendorState() {
|
|
13
|
+
return {
|
|
3
14
|
banners: [],
|
|
15
|
+
relatedTags: [],
|
|
4
16
|
results: [],
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
const vendorXStoreModule = {
|
|
20
|
+
state: () => ({
|
|
21
|
+
query: '',
|
|
22
|
+
...resettableVendorState(),
|
|
5
23
|
}),
|
|
6
|
-
getters: {
|
|
24
|
+
getters: {
|
|
25
|
+
query,
|
|
26
|
+
},
|
|
7
27
|
mutations: {
|
|
28
|
+
setQuery,
|
|
8
29
|
setBanners(state, banners) {
|
|
9
30
|
state.banners = banners;
|
|
10
31
|
},
|
|
32
|
+
setRelatedTags(state, relatedTags) {
|
|
33
|
+
state.relatedTags = relatedTags;
|
|
34
|
+
},
|
|
11
35
|
setResults(state, results) {
|
|
12
36
|
state.results = results;
|
|
13
37
|
},
|
|
38
|
+
resetState(state) {
|
|
39
|
+
Object.assign(state, resettableVendorState());
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
actions: {
|
|
43
|
+
setUrlParams,
|
|
14
44
|
},
|
|
15
|
-
actions: {},
|
|
16
45
|
};
|
|
17
46
|
|
|
18
|
-
export { vendorXStoreModule };
|
|
47
|
+
export { resettableVendorState, vendorXStoreModule };
|
|
19
48
|
//# sourceMappingURL=module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sources":["../../../../../src/x-modules/vendor/store/module.ts"],"sourcesContent":["import type { VendorXStoreModule } from './types'\n\nexport const vendorXStoreModule: VendorXStoreModule = {\n state: () => ({\n
|
|
1
|
+
{"version":3,"file":"module.js","sources":["../../../../../src/x-modules/vendor/store/module.ts"],"sourcesContent":["import type { VendorXStoreModule } from './types'\nimport { setQuery } from '../../../store/utils/query.utils'\nimport { setUrlParams } from './actions/set-url-params.action'\nimport { query } from './getters/query.getter'\n\n/**\n * Function to return the \"resettable\" part of the state.\n *\n * @returns The \"resettable\" part of the {@link VendorState}.\n *\n * @internal\n */\nexport function resettableVendorState() {\n return {\n banners: [],\n relatedTags: [],\n results: [],\n }\n}\n\nexport const vendorXStoreModule: VendorXStoreModule = {\n state: () => ({\n query: '',\n ...resettableVendorState(),\n }),\n getters: {\n query,\n },\n mutations: {\n setQuery,\n setBanners(state, banners) {\n state.banners = banners\n },\n setRelatedTags(state, relatedTags) {\n state.relatedTags = relatedTags\n },\n setResults(state, results) {\n state.results = results\n },\n resetState(state) {\n Object.assign(state, resettableVendorState())\n },\n },\n actions: {\n setUrlParams,\n },\n}\n"],"names":[],"mappings":";;;;AAKA;;;;;;AAMG;SACa,qBAAqB,GAAA;IACnC,OAAO;AACL,QAAA,OAAO,EAAE,EAAE;AACX,QAAA,WAAW,EAAE,EAAE;AACf,QAAA,OAAO,EAAE,EAAE;KACZ;AACH;AAEO,MAAM,kBAAkB,GAAuB;AACpD,IAAA,KAAK,EAAE,OAAO;AACZ,QAAA,KAAK,EAAE,EAAE;AACT,QAAA,GAAG,qBAAqB,EAAE;KAC3B,CAAC;AACF,IAAA,OAAO,EAAE;QACP,KAAK;AACN,KAAA;AACD,IAAA,SAAS,EAAE;QACT,QAAQ;QACR,UAAU,CAAC,KAAK,EAAE,OAAO,EAAA;AACvB,YAAA,KAAK,CAAC,OAAO,GAAG,OAAO;QACzB,CAAC;QACD,cAAc,CAAC,KAAK,EAAE,WAAW,EAAA;AAC/B,YAAA,KAAK,CAAC,WAAW,GAAG,WAAW;QACjC,CAAC;QACD,UAAU,CAAC,KAAK,EAAE,OAAO,EAAA;AACvB,YAAA,KAAK,CAAC,OAAO,GAAG,OAAO;QACzB,CAAC;AACD,QAAA,UAAU,CAAC,KAAK,EAAA;YACd,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,qBAAqB,EAAE,CAAC;QAC/C,CAAC;AACF,KAAA;AACD,IAAA,OAAO,EAAE;QACP,YAAY;AACb,KAAA;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { namespacedWireCommit } from '../../wiring/namespaced-wires.factory.js';
|
|
1
|
+
import { namespacedWireCommit, namespacedWireCommitWithoutPayload, namespacedWireDispatch } from '../../wiring/namespaced-wires.factory.js';
|
|
2
2
|
import 'rxjs/operators';
|
|
3
3
|
import 'rxjs';
|
|
4
4
|
import { createWiring } from '../../wiring/wiring.utils.js';
|
|
@@ -10,6 +10,18 @@ import { createWireFromFunction } from '../../wiring/wires.factory.js';
|
|
|
10
10
|
* @internal
|
|
11
11
|
*/
|
|
12
12
|
const wireCommit = namespacedWireCommit('vendor');
|
|
13
|
+
/**
|
|
14
|
+
* WireCommitWithoutPayload for {@link VendorXModule}.
|
|
15
|
+
*
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
const wireCommitWithoutPayload = namespacedWireCommitWithoutPayload('vendor');
|
|
19
|
+
/**
|
|
20
|
+
* WireDispatch for {@link VendorXModule}.
|
|
21
|
+
*
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
const wireDispatch = namespacedWireDispatch('vendor');
|
|
13
25
|
const fetchTagging = async (url) => fetch(url, { method: 'GET', keepalive: true });
|
|
14
26
|
const trackResultView = createWireFromFunction(({ eventPayload: { tagging } }) => tagging?.viewUrl && void fetchTagging(tagging.viewUrl));
|
|
15
27
|
const trackResultClick = createWireFromFunction(({ eventPayload: { tagging } }) => tagging?.clickUrl && void fetchTagging(tagging.clickUrl));
|
|
@@ -35,23 +47,44 @@ const setBanners = wireCommit('setBanners', ({ eventPayload }) => eventPayload.m
|
|
|
35
47
|
modelName: 'VendorBanner',
|
|
36
48
|
})));
|
|
37
49
|
/**
|
|
38
|
-
*
|
|
50
|
+
* Sets the vendor query of the {@link VendorXModule}.
|
|
51
|
+
*
|
|
52
|
+
* @public
|
|
53
|
+
*/
|
|
54
|
+
const setVendorQuery = wireCommit('setQuery');
|
|
55
|
+
/**
|
|
56
|
+
* Resets the vendor query of the {@link VendorXModule}.
|
|
39
57
|
*
|
|
40
58
|
* @public
|
|
41
59
|
*/
|
|
42
|
-
const
|
|
60
|
+
const resetVendorQuery = wireCommit('setQuery', '');
|
|
43
61
|
/**
|
|
44
|
-
* Resets the vendor
|
|
62
|
+
* Resets the vendor state of the {@link VendorXModule}.
|
|
45
63
|
*
|
|
46
64
|
* @public
|
|
47
65
|
*/
|
|
48
|
-
const
|
|
66
|
+
const resetVendorState = wireCommitWithoutPayload('resetState');
|
|
67
|
+
/**
|
|
68
|
+
* Sets the vendor state from URL data.
|
|
69
|
+
*
|
|
70
|
+
* @public
|
|
71
|
+
*/
|
|
72
|
+
const setUrlParams = wireDispatch('setUrlParams');
|
|
73
|
+
/**
|
|
74
|
+
* Sets the vendor related tags of the {@link VendorXModule}.
|
|
75
|
+
*
|
|
76
|
+
* @public
|
|
77
|
+
*/
|
|
78
|
+
const setVendorRelatedTags = wireCommit('setRelatedTags');
|
|
49
79
|
/**
|
|
50
80
|
* Wiring configuration for the {@link VendorXModule | vendor module}.
|
|
51
81
|
*
|
|
52
82
|
* @internal
|
|
53
83
|
*/
|
|
54
84
|
const vendorWiring = createWiring({
|
|
85
|
+
ParamsLoadedFromUrl: {
|
|
86
|
+
setUrlParams,
|
|
87
|
+
},
|
|
55
88
|
VendorResultsChanged: {
|
|
56
89
|
setResults,
|
|
57
90
|
},
|
|
@@ -73,9 +106,21 @@ const vendorWiring = createWiring({
|
|
|
73
106
|
UserClickedAVendorBanner: {
|
|
74
107
|
trackBannerClick,
|
|
75
108
|
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
109
|
+
SelectedRelatedTagsChanged: {
|
|
110
|
+
resetVendorState,
|
|
111
|
+
setVendorRelatedTags,
|
|
112
|
+
},
|
|
113
|
+
UserAcceptedAQuery: {
|
|
114
|
+
resetVendorState,
|
|
115
|
+
setVendorQuery,
|
|
116
|
+
},
|
|
117
|
+
UserClearedQuery: {
|
|
118
|
+
resetVendorState,
|
|
119
|
+
resetVendorQuery,
|
|
120
|
+
},
|
|
121
|
+
UserBrowsedToCategory: {
|
|
122
|
+
resetVendorState,
|
|
123
|
+
resetVendorQuery,
|
|
79
124
|
},
|
|
80
125
|
});
|
|
81
126
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/vendor/wiring.ts"],"sourcesContent":["import type { WirePayload, XEventPayload } from '../../wiring'\nimport {
|
|
1
|
+
{"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/vendor/wiring.ts"],"sourcesContent":["import type { WirePayload, XEventPayload } from '../../wiring'\nimport {\n createWireFromFunction,\n createWiring,\n namespacedWireCommit,\n namespacedWireCommitWithoutPayload,\n namespacedWireDispatch,\n} from '../../wiring'\n\n/**\n * WireCommit for {@link VendorXModule}.\n *\n * @internal\n */\nconst wireCommit = namespacedWireCommit('vendor')\n\n/**\n * WireCommitWithoutPayload for {@link VendorXModule}.\n *\n * @internal\n */\nconst wireCommitWithoutPayload = namespacedWireCommitWithoutPayload('vendor')\n\n/**\n * WireDispatch for {@link VendorXModule}.\n *\n * @internal\n */\nconst wireDispatch = namespacedWireDispatch('vendor')\n\nconst fetchTagging = async (url: string) => fetch(url, { method: 'GET', keepalive: true })\n\nconst trackResultView = createWireFromFunction<XEventPayload<'UserViewedAVendorResult'>>(\n ({ eventPayload: { tagging } }) => tagging?.viewUrl && void fetchTagging(tagging.viewUrl),\n)\nconst trackResultClick = createWireFromFunction<XEventPayload<'UserClickedAVendorResult'>>(\n ({ eventPayload: { tagging } }) => tagging?.clickUrl && void fetchTagging(tagging.clickUrl),\n)\nconst trackResultAddToCart = createWireFromFunction<\n XEventPayload<'UserClickedVendorResultAddToCart'>\n>(({ eventPayload: { tagging } }) => tagging?.add2cartUrl && void fetchTagging(tagging.add2cartUrl))\nconst trackBannerView = createWireFromFunction<XEventPayload<'UserViewedAVendorBanner'>>(\n ({ eventPayload: { tagging } }) => tagging?.viewUrl && void fetchTagging(tagging.viewUrl),\n)\nconst trackBannerClick = createWireFromFunction<XEventPayload<'UserClickedAVendorBanner'>>(\n ({ eventPayload: { tagging } }) => tagging?.clickUrl && void fetchTagging(tagging.clickUrl),\n)\n/**\n * Sets the vendor results of the {@link VendorXModule}.\n *\n * @public\n */\nexport const setResults = wireCommit(\n 'setResults',\n ({ eventPayload }: WirePayload<XEventPayload<'VendorResultsChanged'>>) =>\n eventPayload.map(vendorResult => ({\n ...vendorResult,\n modelName: 'VendorResult' as const,\n })),\n)\n\n/**\n * Sets the vendor banners of the {@link VendorXModule}.\n *\n * @public\n */\nexport const setBanners = wireCommit(\n 'setBanners',\n ({ eventPayload }: WirePayload<XEventPayload<'VendorBannersChanged'>>) =>\n eventPayload.map(vendorBanner => ({\n ...vendorBanner,\n modelName: 'VendorBanner' as const,\n })),\n)\n\n/**\n * Sets the vendor query of the {@link VendorXModule}.\n *\n * @public\n */\nconst setVendorQuery = wireCommit('setQuery')\n\n/**\n * Resets the vendor query of the {@link VendorXModule}.\n *\n * @public\n */\nconst resetVendorQuery = wireCommit('setQuery', '')\n\n/**\n * Resets the vendor state of the {@link VendorXModule}.\n *\n * @public\n */\nconst resetVendorState = wireCommitWithoutPayload('resetState')\n\n/**\n * Sets the vendor state from URL data.\n *\n * @public\n */\nconst setUrlParams = wireDispatch('setUrlParams')\n\n/**\n * Sets the vendor related tags of the {@link VendorXModule}.\n *\n * @public\n */\nconst setVendorRelatedTags = wireCommit('setRelatedTags')\n\n/**\n * Wiring configuration for the {@link VendorXModule | vendor module}.\n *\n * @internal\n */\nexport const vendorWiring = createWiring({\n ParamsLoadedFromUrl: {\n setUrlParams,\n },\n VendorResultsChanged: {\n setResults,\n },\n UserViewedAVendorResult: {\n trackResultView,\n },\n UserClickedAVendorResult: {\n trackResultClick,\n },\n UserClickedVendorResultAddToCart: {\n trackResultAddToCart,\n },\n VendorBannersChanged: {\n setBanners,\n },\n UserViewedAVendorBanner: {\n trackBannerView,\n },\n UserClickedAVendorBanner: {\n trackBannerClick,\n },\n SelectedRelatedTagsChanged: {\n resetVendorState,\n setVendorRelatedTags,\n },\n UserAcceptedAQuery: {\n resetVendorState,\n setVendorQuery,\n },\n UserClearedQuery: {\n resetVendorState,\n resetVendorQuery,\n },\n UserBrowsedToCategory: {\n resetVendorState,\n resetVendorQuery,\n },\n})\n"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empathyco/x-components",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.9.0",
|
|
4
4
|
"description": "Empathy X Components",
|
|
5
5
|
"author": "Empathy Systems Corporation S.L.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -117,5 +117,5 @@
|
|
|
117
117
|
"access": "public",
|
|
118
118
|
"directory": "dist"
|
|
119
119
|
},
|
|
120
|
-
"gitHead": "
|
|
120
|
+
"gitHead": "74ab6317251f7d5b762989167c5faf8385771937"
|
|
121
121
|
}
|