@empathyco/x-components 9.4.0 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/docs/API-reference/api/x-adapter-platform.md +9 -0
- package/docs/API-reference/api/x-adapter-platform.platformaisuggestionsearch.md +0 -19
- package/docs/API-reference/api/x-adapter-platform.platformaisuggestionsearchtagging.add2cart.md +11 -0
- package/docs/API-reference/api/x-adapter-platform.platformaisuggestionsearchtagging.checkout.md +11 -0
- package/docs/API-reference/api/x-adapter-platform.platformaisuggestionsearchtagging.click.md +11 -0
- package/docs/API-reference/api/x-adapter-platform.platformaisuggestionsearchtagging.display.md +11 -0
- package/docs/API-reference/api/x-adapter-platform.platformaisuggestionsearchtagging.displayclick.md +11 -0
- package/docs/API-reference/api/x-adapter-platform.platformaisuggestionsearchtagging.md +139 -0
- package/docs/API-reference/api/x-adapter-platform.platformaisuggestionsearchtagging.query.md +11 -0
- package/docs/API-reference/api/x-adapter-platform.platformaisuggestionssearchresponse.md +17 -0
- package/docs/API-reference/api/x-adapter-platform.platformaisuggestionssearchresponse.tagging.md +11 -0
- package/docs/API-reference/api/x-components.aimutations.md +19 -0
- package/docs/API-reference/api/x-components.aimutations.setsuggestionssearchtagging.md +13 -0
- package/docs/API-reference/api/x-components.aistate.config.md +2 -0
- package/docs/API-reference/api/x-components.aistate.md +21 -0
- package/docs/API-reference/api/x-components.aistate.suggestionstagging.md +13 -0
- package/docs/API-reference/api/x-components.aixevents.aicomponentunmounted.md +11 -0
- package/docs/API-reference/api/x-components.aixevents.aisuggestionssearchtaggingchanged.md +11 -0
- package/docs/API-reference/api/x-components.aixevents.md +34 -0
- package/docs/API-reference/api/x-components.baseeventsmodalclose.md +1 -1
- package/docs/API-reference/api/x-components.baseeventsmodalopen.md +1 -1
- package/docs/API-reference/api/x-components.createtrackaicarouseltaggingwire.md +56 -0
- package/docs/API-reference/api/x-components.hierarchicalfilter.md +2 -0
- package/docs/API-reference/api/x-components.md +46 -2
- package/docs/API-reference/api/x-components.simplefilter.md +2 -0
- package/docs/API-reference/api/x-components.snippetcallbacks.md +2 -0
- package/docs/API-reference/api/x-components.trackaicarouseladdtocartwire.md +13 -0
- package/docs/API-reference/api/x-components.trackaicarouselquerytagginginfodebouncedwire.md +13 -0
- package/docs/API-reference/api/x-components.trackaicarouselquerytagginginfowire.md +13 -0
- package/docs/API-reference/api/x-components.trackaicarouselresultclickedwire.md +13 -0
- package/docs/API-reference/api/x-types.aisuggestionsearch.md +0 -17
- package/docs/API-reference/api/x-types.aisuggestionsearchtagging.add2cart.md +11 -0
- package/docs/API-reference/api/x-types.aisuggestionsearchtagging.checkout.md +11 -0
- package/docs/API-reference/api/x-types.aisuggestionsearchtagging.click.md +11 -0
- package/docs/API-reference/api/x-types.aisuggestionsearchtagging.display.md +11 -0
- package/docs/API-reference/api/x-types.aisuggestionsearchtagging.displayclick.md +11 -0
- package/docs/API-reference/api/x-types.aisuggestionsearchtagging.md +139 -0
- package/docs/API-reference/api/x-types.aisuggestionsearchtagging.query.md +11 -0
- package/docs/API-reference/api/x-types.aisuggestionssearchresponse.md +17 -0
- package/docs/API-reference/api/x-types.aisuggestionssearchresponse.suggestionstagging.md +11 -0
- package/docs/API-reference/api/x-types.md +9 -0
- package/js/index.js +1 -1
- package/js/x-modules/ai/components/ai-carousel.vue.js.map +1 -1
- package/js/x-modules/ai/components/ai-carousel.vue2.js +4 -1
- package/js/x-modules/ai/components/ai-carousel.vue2.js.map +1 -1
- package/js/x-modules/ai/store/actions/fetch-and-save-ai-suggestions-search.action.js +1 -0
- package/js/x-modules/ai/store/actions/fetch-and-save-ai-suggestions-search.action.js.map +1 -1
- package/js/x-modules/ai/store/emitters.js +4 -0
- package/js/x-modules/ai/store/emitters.js.map +1 -1
- package/js/x-modules/ai/store/module.js +4 -0
- package/js/x-modules/ai/store/module.js.map +1 -1
- package/js/x-modules/tagging/store/module.js +1 -1
- package/js/x-modules/tagging/store/module.js.map +1 -1
- package/js/x-modules/tagging/wiring.js +52 -7
- package/js/x-modules/tagging/wiring.js.map +1 -1
- package/package.json +4 -4
- package/report/x-adapter-platform.api.json +186 -5
- package/report/x-components.api.json +351 -17
- package/report/x-components.api.md +39 -6
- package/report/x-types.api.json +184 -6
- package/tagging/index.js +1 -1
- package/types/src/components/modals/base-events-modal-close.vue.d.ts +1 -1
- package/types/src/components/modals/base-events-modal-open.vue.d.ts +1 -1
- package/types/src/components/snippet-callbacks.vue.d.ts +2 -0
- package/types/src/components/snippet-callbacks.vue.d.ts.map +1 -1
- package/types/src/x-modules/ai/components/ai-carousel.vue.d.ts.map +1 -1
- package/types/src/x-modules/ai/events.types.d.ts +3 -1
- package/types/src/x-modules/ai/events.types.d.ts.map +1 -1
- package/types/src/x-modules/ai/store/actions/fetch-and-save-ai-suggestions-search.action.d.ts.map +1 -1
- package/types/src/x-modules/ai/store/emitters.d.ts +4 -0
- package/types/src/x-modules/ai/store/emitters.d.ts.map +1 -1
- package/types/src/x-modules/ai/store/module.d.ts.map +1 -1
- package/types/src/x-modules/ai/store/types.d.ts +10 -1
- package/types/src/x-modules/ai/store/types.d.ts.map +1 -1
- package/types/src/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts +2 -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 +2 -0
- package/types/src/x-modules/facets/components/filters/simple-filter.vue.d.ts.map +1 -1
- package/types/src/x-modules/related-prompts/components/related-prompts-tag-list.vue.d.ts.map +1 -1
- package/types/src/x-modules/tagging/wiring.d.ts +39 -4
- package/types/src/x-modules/tagging/wiring.d.ts.map +1 -1
- package/docs/API-reference/api/x-adapter-platform.platformaisuggestionsearch.tagging.md +0 -13
- package/docs/API-reference/api/x-components.trackaisuggestionssearchwire.md +0 -13
- package/docs/API-reference/api/x-types.aisuggestionsearch.tagging.md +0 -13
|
@@ -195,9 +195,11 @@ _default: import("vue").DefineComponent<{}, {
|
|
|
195
195
|
AiSuggestionsRequestUpdated: (payload: import("@empathyco/x-types").AiSuggestionsRequest | null, metadata: WireMetadata) => unknown;
|
|
196
196
|
AiSuggestionsSearchRequestUpdated: (payload: import("@empathyco/x-types").AiSuggestionsSearchRequest | null, metadata: WireMetadata) => unknown;
|
|
197
197
|
AiSuggestionsSearchChanged: (payload: import("@empathyco/x-types").AiSuggestionSearch[], metadata: WireMetadata) => unknown;
|
|
198
|
+
AiSuggestionsSearchTaggingChanged: (payload: import("@empathyco/x-types").AiSuggestionSearchTagging, metadata: WireMetadata) => unknown;
|
|
198
199
|
UserClickedAnAiCarouselResult: (payload: import("@empathyco/x-types").Result, metadata: WireMetadata) => unknown;
|
|
199
200
|
UserClickedAnAiCarouselAdd2Cart: (payload: import("@empathyco/x-types").Result, metadata: WireMetadata) => unknown;
|
|
200
201
|
AiComponentMounted: (payload: undefined, metadata: WireMetadata) => unknown;
|
|
202
|
+
AiComponentUnmounted: (payload: undefined, metadata: WireMetadata) => unknown;
|
|
201
203
|
VendorResultsChanged: (payload: Omit<import("..").VendorResult, "modelName">[], metadata: WireMetadata) => unknown;
|
|
202
204
|
VendorResultMounted: (payload: import("..").VendorResult, metadata: WireMetadata) => unknown;
|
|
203
205
|
UserViewedAVendorResult: (payload: import("..").VendorResult, metadata: WireMetadata) => unknown;
|
|
@@ -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) > [trackAiCarouselAddToCartWire](./x-components.trackaicarouseladdtocartwire.md)
|
|
4
|
+
|
|
5
|
+
## trackAiCarouselAddToCartWire variable
|
|
6
|
+
|
|
7
|
+
Performs a track of an ai carousel result added to the cart.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
trackAiCarouselAddToCartWire: Wire<Taggable>
|
|
13
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [trackAiCarouselQueryTaggingInfoDebouncedWire](./x-components.trackaicarouselquerytagginginfodebouncedwire.md)
|
|
4
|
+
|
|
5
|
+
## trackAiCarouselQueryTaggingInfoDebouncedWire variable
|
|
6
|
+
|
|
7
|
+
Debounced version of [trackAiCarouselQueryTaggingInfoWire](./x-components.trackaicarouselquerytagginginfowire.md)
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
trackAiCarouselQueryTaggingInfoDebouncedWire: Wire<any>
|
|
13
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [trackAiCarouselQueryTaggingInfoWire](./x-components.trackaicarouselquerytagginginfowire.md)
|
|
4
|
+
|
|
5
|
+
## trackAiCarouselQueryTaggingInfoWire variable
|
|
6
|
+
|
|
7
|
+
Performs a track of a query with no results that used ai carousel as fallback. The query will be changed to the original query of the search in order to associate the return of related results to that query, instead of track a no results query.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
trackAiCarouselQueryTaggingInfoWire: Wire<any>
|
|
13
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [trackAiCarouselResultClickedWire](./x-components.trackaicarouselresultclickedwire.md)
|
|
4
|
+
|
|
5
|
+
## trackAiCarouselResultClickedWire variable
|
|
6
|
+
|
|
7
|
+
Tracks the tagging of an ai carousel result clicked.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
trackAiCarouselResultClickedWire: Wire<Taggable>
|
|
13
|
+
```
|
|
@@ -85,23 +85,6 @@ string
|
|
|
85
85
|
</td><td>
|
|
86
86
|
|
|
87
87
|
|
|
88
|
-
</td></tr>
|
|
89
|
-
<tr><td>
|
|
90
|
-
|
|
91
|
-
[tagging](./x-types.aisuggestionsearch.tagging.md)
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
</td><td>
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
</td><td>
|
|
98
|
-
|
|
99
|
-
{ query: [TaggingRequest](./x-types.taggingrequest.md)<!-- -->; }
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
</td><td>
|
|
103
|
-
|
|
104
|
-
|
|
105
88
|
</td></tr>
|
|
106
89
|
</tbody></table>
|
|
107
90
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-types](./x-types.md) > [AiSuggestionSearchTagging](./x-types.aisuggestionsearchtagging.md) > [add2cart](./x-types.aisuggestionsearchtagging.add2cart.md)
|
|
4
|
+
|
|
5
|
+
## AiSuggestionSearchTagging.add2cart property
|
|
6
|
+
|
|
7
|
+
**Signature:**
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
add2cart: TaggingRequest;
|
|
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-types](./x-types.md) > [AiSuggestionSearchTagging](./x-types.aisuggestionsearchtagging.md) > [checkout](./x-types.aisuggestionsearchtagging.checkout.md)
|
|
4
|
+
|
|
5
|
+
## AiSuggestionSearchTagging.checkout property
|
|
6
|
+
|
|
7
|
+
**Signature:**
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
checkout: TaggingRequest;
|
|
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-types](./x-types.md) > [AiSuggestionSearchTagging](./x-types.aisuggestionsearchtagging.md) > [click](./x-types.aisuggestionsearchtagging.click.md)
|
|
4
|
+
|
|
5
|
+
## AiSuggestionSearchTagging.click property
|
|
6
|
+
|
|
7
|
+
**Signature:**
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
click: TaggingRequest;
|
|
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-types](./x-types.md) > [AiSuggestionSearchTagging](./x-types.aisuggestionsearchtagging.md) > [display](./x-types.aisuggestionsearchtagging.display.md)
|
|
4
|
+
|
|
5
|
+
## AiSuggestionSearchTagging.display property
|
|
6
|
+
|
|
7
|
+
**Signature:**
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
display: TaggingRequest;
|
|
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-types](./x-types.md) > [AiSuggestionSearchTagging](./x-types.aisuggestionsearchtagging.md) > [displayClick](./x-types.aisuggestionsearchtagging.displayclick.md)
|
|
4
|
+
|
|
5
|
+
## AiSuggestionSearchTagging.displayClick property
|
|
6
|
+
|
|
7
|
+
**Signature:**
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
displayClick: TaggingRequest;
|
|
11
|
+
```
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-types](./x-types.md) > [AiSuggestionSearchTagging](./x-types.aisuggestionsearchtagging.md)
|
|
4
|
+
|
|
5
|
+
## AiSuggestionSearchTagging interface
|
|
6
|
+
|
|
7
|
+
**Signature:**
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
export interface AiSuggestionSearchTagging
|
|
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
|
+
[add2cart](./x-types.aisuggestionsearchtagging.add2cart.md)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
</td><td>
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
</td><td>
|
|
45
|
+
|
|
46
|
+
[TaggingRequest](./x-types.taggingrequest.md)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
</td><td>
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
</td></tr>
|
|
53
|
+
<tr><td>
|
|
54
|
+
|
|
55
|
+
[checkout](./x-types.aisuggestionsearchtagging.checkout.md)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
</td><td>
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
</td><td>
|
|
62
|
+
|
|
63
|
+
[TaggingRequest](./x-types.taggingrequest.md)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
</td><td>
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
</td></tr>
|
|
70
|
+
<tr><td>
|
|
71
|
+
|
|
72
|
+
[click](./x-types.aisuggestionsearchtagging.click.md)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
</td><td>
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
</td><td>
|
|
79
|
+
|
|
80
|
+
[TaggingRequest](./x-types.taggingrequest.md)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
</td><td>
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
</td></tr>
|
|
87
|
+
<tr><td>
|
|
88
|
+
|
|
89
|
+
[display](./x-types.aisuggestionsearchtagging.display.md)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
</td><td>
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
</td><td>
|
|
96
|
+
|
|
97
|
+
[TaggingRequest](./x-types.taggingrequest.md)
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
</td><td>
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
</td></tr>
|
|
104
|
+
<tr><td>
|
|
105
|
+
|
|
106
|
+
[displayClick](./x-types.aisuggestionsearchtagging.displayclick.md)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
</td><td>
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
</td><td>
|
|
113
|
+
|
|
114
|
+
[TaggingRequest](./x-types.taggingrequest.md)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
</td><td>
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
</td></tr>
|
|
121
|
+
<tr><td>
|
|
122
|
+
|
|
123
|
+
[query](./x-types.aisuggestionsearchtagging.query.md)
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
</td><td>
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
</td><td>
|
|
130
|
+
|
|
131
|
+
[TaggingRequest](./x-types.taggingrequest.md)
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
</td><td>
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
</td></tr>
|
|
138
|
+
</tbody></table>
|
|
139
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-types](./x-types.md) > [AiSuggestionSearchTagging](./x-types.aisuggestionsearchtagging.md) > [query](./x-types.aisuggestionsearchtagging.query.md)
|
|
4
|
+
|
|
5
|
+
## AiSuggestionSearchTagging.query property
|
|
6
|
+
|
|
7
|
+
**Signature:**
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
query: TaggingRequest;
|
|
11
|
+
```
|
|
@@ -51,6 +51,23 @@ Description
|
|
|
51
51
|
</td><td>
|
|
52
52
|
|
|
53
53
|
|
|
54
|
+
</td></tr>
|
|
55
|
+
<tr><td>
|
|
56
|
+
|
|
57
|
+
[suggestionsTagging](./x-types.aisuggestionssearchresponse.suggestionstagging.md)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
</td><td>
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
</td><td>
|
|
64
|
+
|
|
65
|
+
[AiSuggestionSearchTagging](./x-types.aisuggestionsearchtagging.md)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
</td><td>
|
|
69
|
+
|
|
70
|
+
|
|
54
71
|
</td></tr>
|
|
55
72
|
</tbody></table>
|
|
56
73
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-types](./x-types.md) > [AiSuggestionsSearchResponse](./x-types.aisuggestionssearchresponse.md) > [suggestionsTagging](./x-types.aisuggestionssearchresponse.suggestionstagging.md)
|
|
4
|
+
|
|
5
|
+
## AiSuggestionsSearchResponse.suggestionsTagging property
|
|
6
|
+
|
|
7
|
+
**Signature:**
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
suggestionsTagging: AiSuggestionSearchTagging;
|
|
11
|
+
```
|
|
@@ -246,6 +246,15 @@ Data for each query suggested.
|
|
|
246
246
|
Each suggestion search is a query and the results of that query.
|
|
247
247
|
|
|
248
248
|
|
|
249
|
+
</td></tr>
|
|
250
|
+
<tr><td>
|
|
251
|
+
|
|
252
|
+
[AiSuggestionSearchTagging](./x-types.aisuggestionsearchtagging.md)
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
</td><td>
|
|
256
|
+
|
|
257
|
+
|
|
249
258
|
</td></tr>
|
|
250
259
|
<tr><td>
|
|
251
260
|
|
package/js/index.js
CHANGED
|
@@ -454,7 +454,7 @@ export { DefaultExternalTaggingService } from './x-modules/tagging/service/exter
|
|
|
454
454
|
export { track } from './x-modules/tagging/store/actions/track.action.js';
|
|
455
455
|
export { taggingEmitters } from './x-modules/tagging/store/emitters.js';
|
|
456
456
|
export { taggingXStoreModule } from './x-modules/tagging/store/module.js';
|
|
457
|
-
export { createSetQueryTaggingFromQueryPreview, createTrackDisplayWire, createTrackRelatedPromptToolingDisplayClickWire, createTrackToolingAdd2CartWire, createTrackToolingDisplayWire, createTrackWire, setBrowseTaggingInfo, setConsent, setNoResultsTaggingEnabledWire, setQueryTaggingFromQueryPreview, setQueryTaggingInfo, setTaggingConfig, taggingWiring, trackAddToCartWire,
|
|
457
|
+
export { createSetQueryTaggingFromQueryPreview, createTrackAiCarouselTaggingWire, createTrackDisplayWire, createTrackRelatedPromptToolingDisplayClickWire, createTrackToolingAdd2CartWire, createTrackToolingDisplayWire, createTrackWire, setBrowseTaggingInfo, setConsent, setNoResultsTaggingEnabledWire, setQueryTaggingFromQueryPreview, setQueryTaggingInfo, setTaggingConfig, taggingWiring, trackAddToCartWire, trackAiCarouselAddToCartWire, trackAiCarouselQueryTaggingInfoDebouncedWire, trackAiCarouselQueryTaggingInfoWire, trackAiCarouselResultClickedWire, trackBannerClickedWire, trackBrowseWire, trackDisplayClickedWire, trackElementDisplayedWire, trackNoResultsQueryWithFallbackWire, trackNoResultsQueryWithFallbackWireDebounced, trackNoResultsQueryWithSemanticsWire, trackNoResultsQueryWithSemanticsWireDebounced, trackPromotedClickedWire, trackQueryWire, trackRelatedPromptToolingDisplayClickWire, trackResultClickedWire, trackToolingAdd2CartWire, trackToolingDisplayClickedWire } from './x-modules/tagging/wiring.js';
|
|
458
458
|
export { taggingXModule } from './x-modules/tagging/x-module.js';
|
|
459
459
|
export { default as UrlHandler } from './x-modules/url/components/url-handler.vue.js';
|
|
460
460
|
export { replaceableParams, urlEmitters } from './x-modules/url/store/emitters.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-carousel.vue.js","sources":["../../../../../src/x-modules/ai/components/ai-carousel.vue"],"sourcesContent":["<template>\n <CollapseHeight>\n <div v-if=\"suggestionsSearch.length\" class=\"x-ai-carousel\">\n <DisplayEmitter\n :payload=\"tagging?.toolingDisplay ?? emptyTaggingRequest\"\n :event-metadata=\"{\n feature: 'ai_carousel',\n displayOriginalQuery: query || 'ai-carousel-without-query',\n replaceable: false,\n }\"\n data-test=\"ai-carousel-display-emitter\"\n >\n <span\n class=\"x-ai-carousel-title\"\n :class=\"{ 'x-ai-carousel-title--expanded': titleExpanded }\"\n data-test=\"ai-carousel-title\"\n @click=\"toggleTitleExpansion\"\n >\n <AIStarIcon class=\"x-ai-carousel-title-icon\" />\n <ChangeHeight>\n <span\n ref=\"titleRef\"\n class=\"x-ai-carousel-title-text\"\n :class=\"{ 'x-ai-carousel-title-text--expanded': titleExpanded }\"\n >\n {{ title }}\n </span>\n </ChangeHeight>\n <button\n v-if=\"isTitleOverflowing\"\n class=\"x-ai-carousel-title-button\"\n data-test=\"ai-carousel-title-button\"\n :aria-label=\"titleExpanded ? ariaLabels?.collapse : ariaLabels?.expand\"\n >\n <ChevronDownIcon\n class=\"x-ai-carousel-title-button-icon\"\n :class=\"{ 'x-ai-carousel-title-button-icon--expanded': titleExpanded }\"\n />\n </button>\n </span>\n </DisplayEmitter>\n\n <AiGroupedCarousel\n v-if=\"group\"\n :sliding-panel-classes=\"slidingPanelClasses\"\n :sliding-panel-container-classes=\"slidingPanelContainerClasses\"\n :sliding-panel-buttons-classes=\"slidingPanelButtonsClasses\"\n >\n <template #sliding-panels-addons=\"{ arrivedState }\">\n <slot name=\"sliding-panels-addons\" :arrived-state=\"arrivedState\" />\n </template>\n <template #sliding-panels-left-button>\n <slot name=\"sliding-panels-left-button\" />\n </template>\n <template #sliding-panels-right-button>\n <slot name=\"sliding-panels-right-button\" />\n </template>\n <template #result=\"{ result }\">\n <slot name=\"result\" :result=\"result\" />\n </template>\n </AiGroupedCarousel>\n\n <div v-else class=\"x-ai-carousel-suggestions\" data-test=\"ai-carousel-suggestions-container\">\n <DisplayEmitter\n v-for=\"{ query: suggestionQuery, results: queriesResults } in suggestionsSearch\"\n :key=\"suggestionQuery\"\n :payload=\"tagging?.searchQueries[suggestionQuery].toolingDisplay ?? emptyTaggingRequest\"\n :event-metadata=\"{\n feature: 'ai_carousel',\n displayOriginalQuery: query || 'ai-carousel-without-query',\n replaceable: false,\n }\"\n data-test=\"ai-carousel-query-display-emitter\"\n >\n <div class=\"x-ai-carousel-suggestion\" data-test=\"ai-carousel-suggestion\">\n <BaseEventButton\n class=\"x-ai-carousel-suggestion-query-btn\"\n :events=\"{ UserAcceptedAQuery: suggestionQuery }\"\n >\n {{ suggestionQuery }}\n <ArrowRightIcon class=\"x-ai-carousel-suggestion-query-btn-icon\" />\n </BaseEventButton>\n\n <DisplayClickProvider\n :tooling-display-tagging=\"tagging?.searchQueries[suggestionQuery].toolingDisplayClick\"\n :tooling-add2-cart-tagging=\"\n tagging?.searchQueries[suggestionQuery].toolingDisplayAdd2Cart\n \"\n result-feature=\"ai_carousel\"\n >\n <slot name=\"sliding-panel\" :results=\"queriesResults\">\n <SlidingPanel\n :class=\"slidingPanelClasses\"\n :scroll-container-class=\"slidingPanelContainerClasses\"\n :button-class=\"slidingPanelButtonsClasses\"\n :reset-on-content-change=\"false\"\n >\n <template #sliding-panel-addons=\"{ arrivedState }\">\n <slot name=\"sliding-panels-addons\" :arrived-state=\"arrivedState\" />\n </template>\n <template #sliding-panel-left-button>\n <slot name=\"sliding-panels-left-button\" />\n </template>\n <template #sliding-panel-right-button>\n <slot name=\"sliding-panels-right-button\" />\n </template>\n <ul class=\"x-ai-carousel-suggestion-results\">\n <li\n v-for=\"result in queriesResults\"\n :key=\"result.id\"\n data-test=\"ai-carousel-suggestion-result\"\n >\n <!-- @slot (required) result card -->\n <slot name=\"result\" :result=\"result\" />\n </li>\n </ul>\n </SlidingPanel>\n </slot>\n </DisplayClickProvider>\n </div>\n </DisplayEmitter>\n <slot name=\"suggestions-extra-content\" />\n </div>\n\n <slot name=\"extra-content\" />\n <slot name=\"cta-button\" />\n </div>\n </CollapseHeight>\n</template>\n\n<script lang=\"ts\">\nimport type { TaggingRequest } from '@empathyco/x-types'\nimport { useResizeObserver } from '@vueuse/core'\nimport { computed, defineComponent, onMounted, ref, watch } from 'vue'\nimport {\n AIStarIcon,\n ArrowRightIcon,\n BaseEventButton,\n ChangeHeight,\n ChevronDownIcon,\n CollapseHeight,\n DisplayClickProvider,\n DisplayEmitter,\n SlidingPanel,\n} from '../../../components'\nimport { use$x, useAccessibilityLabels, useState } from '../../../composables'\nimport { aiXModule } from '../x-module'\nimport AiGroupedCarousel from './ai-grouped-carousel.vue'\n\nexport default defineComponent({\n xModule: aiXModule.name,\n components: {\n AIStarIcon,\n AiGroupedCarousel,\n ArrowRightIcon,\n BaseEventButton,\n ChangeHeight,\n ChevronDownIcon,\n CollapseHeight,\n DisplayClickProvider,\n DisplayEmitter,\n SlidingPanel,\n },\n props: {\n /* The title text displayed */\n title: String,\n /* The classes added to the sliding panel. */\n slidingPanelClasses: String,\n /* The classes added to the sliding panel container. */\n slidingPanelContainerClasses: String,\n /* The classes added to the sliding panel buttons. */\n slidingPanelButtonsClasses: String,\n /* Controls whether the carousel should group results or display N carousels per N queries. */\n group: {\n type: Boolean,\n default: true,\n },\n },\n setup(props) {\n const $x = use$x()\n const { query, suggestionsSearch, queries, tagging } = useState('ai')\n const emptyTaggingRequest: TaggingRequest = { url: '', params: {} }\n\n const ariaLabels = useAccessibilityLabels('aiCarousel')\n\n const titleRef = ref<HTMLElement | null>(null)\n const titleExpanded = ref(false)\n const isTitleOverflowing = ref(false)\n\n /**\n * Checks if the title is overflowing and updates the state.\n */\n function updateTitleOverflow() {\n if (titleExpanded.value) {\n return\n }\n if (titleRef.value) {\n isTitleOverflowing.value = titleRef.value.scrollWidth > titleRef.value.clientWidth\n }\n }\n\n /**\n * Toggles the title expanded state if it is overflowing.\n */\n function toggleTitleExpansion() {\n if (isTitleOverflowing.value) {\n titleExpanded.value = !titleExpanded.value\n }\n }\n\n const title = computed(() => {\n if (!props.title) {\n const queriesList = new Intl.ListFormat('en', {\n style: 'long',\n type: 'conjunction',\n }).format(queries.value.map(({ query }) => query))\n return `Searching for ${queriesList}`\n }\n return props.title\n })\n\n watch(queries, () => {\n if (queries.value.length > 0) {\n $x.emit('AiSuggestionsSearchRequestUpdated')\n }\n })\n\n onMounted(() => {\n $x.emit('AiComponentMounted', undefined, { feature: 'ai_carousel' })\n })\n\n useResizeObserver(titleRef, updateTitleOverflow)\n\n return {\n ariaLabels,\n emptyTaggingRequest,\n isTitleOverflowing,\n queries,\n query,\n suggestionsSearch,\n tagging,\n title,\n titleExpanded,\n titleRef,\n toggleTitleExpansion,\n }\n },\n})\n</script>\n\n<style lang=\"css\">\n.x-ai-carousel {\n --color: var(--x-ai-carousel-color, #bbc9cf);\n --color-lighter: var(--x-ai-carousel-color-lighter, color-mix(in srgb, var(--color) 25%, white));\n\n padding: 8px 0;\n position: relative;\n border-radius: 1.5rem;\n background-color: var(--color-lighter);\n}\n\n.x-ai-carousel-title {\n display: flex;\n font-size: 12px;\n gap: 8px;\n align-items: flex-start;\n margin: 0 14px 8px;\n cursor: pointer;\n}\n.x-ai-carousel-title-text {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.x-ai-carousel-title-text--expanded {\n white-space: normal;\n}\n.x-ai-carousel-title-icon {\n height: 1rem;\n aspect-ratio: 1 / 1;\n color: var(--color);\n flex-shrink: 0;\n margin-bottom: auto;\n}\n.x-ai-carousel-title-button {\n background: none;\n border: none;\n padding: 0;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--color);\n margin-bottom: auto;\n}\n.x-ai-carousel-title-button-icon {\n height: 1rem;\n aspect-ratio: 1 / 1;\n transition: transform 0.3s ease;\n}\n.x-ai-carousel-title-button-icon--expanded {\n transform: rotate(180deg);\n}\n\n.x-ai-carousel-suggestions {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n padding-bottom: 1rem;\n}\n\n.x-ai-carousel-suggestion {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.x-ai-carousel-suggestion-query-btn {\n border-color: transparent;\n background-color: transparent;\n margin-left: 1rem;\n margin-right: 1rem;\n font-weight: 700;\n width: fit-content;\n display: flex;\n align-items: center;\n gap: 1rem;\n cursor: pointer;\n}\n\n.x-ai-carousel-suggestion-query-btn-icon {\n height: 1rem;\n aspect-ratio: 1 / 1;\n}\n\n.x-ai-carousel-suggestion-results {\n display: flex;\n gap: 1rem;\n padding-left: 1rem;\n padding-right: 1rem;\n}\n</style>\n"],"names":["_createBlock","_withCtx","_openBlock","_createElementBlock","_createVNode","_createElementVNode","_normalizeClass","_renderSlot","_Fragment","_renderList","_createTextVNode","_toDisplayString","_createCommentVNode"],"mappings":";;;;;;;EAEyC,KAAA,EAAM;;;;;EA4D7B,KAAA,EAAM,2BAAA;AAAA,EAA4B,WAAA,EAAU;;;EAY/C,KAAA,EAAM,0BAAA;AAAA,EAA2B,WAAA,EAAU;;AAgCpC,MAAA,UAAA,GAAA,EAAA,KAAA,EAAM,kCAAA,EAAkC;;;;;;;;;;;;sBAzG5DA,WAAA,CA8HiB,yBAAA,EAAA,IAAA,EAAA;AAAA,IAAA,OAAA,EAAAC,OAAA,CA7Hf,MA4HM;AAAA,MA5HK,IAAA,CAA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CAAuC,yBAAlB,MAAA,EAAc;AAAA,qCAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;UAQjDA,UAAA,CAAyC,IAAA,CAAA,MAAA,EAAA,2BAAA;AAAA,SAAA,CAAA,CAAA;QAG3CA,UAAA,CAA6B,IAAA,CAAA,MAAA,EAAA,eAAA,CAAA;AAAA,QAC7BA,UAAA,CAA0B,IAAA,CAAA,MAAA,EAAA,YAAA;AAAA,OAAA,CAAA,IAAAK,kBAAA,CAAA,MAAA,EAAA,IAAA;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"ai-carousel.vue.js","sources":["../../../../../src/x-modules/ai/components/ai-carousel.vue"],"sourcesContent":["<template>\n <CollapseHeight>\n <div v-if=\"suggestionsSearch.length\" class=\"x-ai-carousel\">\n <DisplayEmitter\n :payload=\"tagging?.toolingDisplay ?? emptyTaggingRequest\"\n :event-metadata=\"{\n feature: 'ai_carousel',\n displayOriginalQuery: query || 'ai-carousel-without-query',\n replaceable: false,\n }\"\n data-test=\"ai-carousel-display-emitter\"\n >\n <span\n class=\"x-ai-carousel-title\"\n :class=\"{ 'x-ai-carousel-title--expanded': titleExpanded }\"\n data-test=\"ai-carousel-title\"\n @click=\"toggleTitleExpansion\"\n >\n <AIStarIcon class=\"x-ai-carousel-title-icon\" />\n <ChangeHeight>\n <span\n ref=\"titleRef\"\n class=\"x-ai-carousel-title-text\"\n :class=\"{ 'x-ai-carousel-title-text--expanded': titleExpanded }\"\n >\n {{ title }}\n </span>\n </ChangeHeight>\n <button\n v-if=\"isTitleOverflowing\"\n class=\"x-ai-carousel-title-button\"\n data-test=\"ai-carousel-title-button\"\n :aria-label=\"titleExpanded ? ariaLabels?.collapse : ariaLabels?.expand\"\n >\n <ChevronDownIcon\n class=\"x-ai-carousel-title-button-icon\"\n :class=\"{ 'x-ai-carousel-title-button-icon--expanded': titleExpanded }\"\n />\n </button>\n </span>\n </DisplayEmitter>\n\n <AiGroupedCarousel\n v-if=\"group\"\n :sliding-panel-classes=\"slidingPanelClasses\"\n :sliding-panel-container-classes=\"slidingPanelContainerClasses\"\n :sliding-panel-buttons-classes=\"slidingPanelButtonsClasses\"\n >\n <template #sliding-panels-addons=\"{ arrivedState }\">\n <slot name=\"sliding-panels-addons\" :arrived-state=\"arrivedState\" />\n </template>\n <template #sliding-panels-left-button>\n <slot name=\"sliding-panels-left-button\" />\n </template>\n <template #sliding-panels-right-button>\n <slot name=\"sliding-panels-right-button\" />\n </template>\n <template #result=\"{ result }\">\n <slot name=\"result\" :result=\"result\" />\n </template>\n </AiGroupedCarousel>\n\n <div v-else class=\"x-ai-carousel-suggestions\" data-test=\"ai-carousel-suggestions-container\">\n <DisplayEmitter\n v-for=\"{ query: suggestionQuery, results: queriesResults } in suggestionsSearch\"\n :key=\"suggestionQuery\"\n :payload=\"tagging?.searchQueries[suggestionQuery].toolingDisplay ?? emptyTaggingRequest\"\n :event-metadata=\"{\n feature: 'ai_carousel',\n displayOriginalQuery: query || 'ai-carousel-without-query',\n replaceable: false,\n }\"\n data-test=\"ai-carousel-query-display-emitter\"\n >\n <div class=\"x-ai-carousel-suggestion\" data-test=\"ai-carousel-suggestion\">\n <BaseEventButton\n class=\"x-ai-carousel-suggestion-query-btn\"\n :events=\"{ UserAcceptedAQuery: suggestionQuery }\"\n >\n {{ suggestionQuery }}\n <ArrowRightIcon class=\"x-ai-carousel-suggestion-query-btn-icon\" />\n </BaseEventButton>\n\n <DisplayClickProvider\n :tooling-display-tagging=\"tagging?.searchQueries[suggestionQuery].toolingDisplayClick\"\n :tooling-add2-cart-tagging=\"\n tagging?.searchQueries[suggestionQuery].toolingDisplayAdd2Cart\n \"\n result-feature=\"ai_carousel\"\n >\n <slot name=\"sliding-panel\" :results=\"queriesResults\">\n <SlidingPanel\n :class=\"slidingPanelClasses\"\n :scroll-container-class=\"slidingPanelContainerClasses\"\n :button-class=\"slidingPanelButtonsClasses\"\n :reset-on-content-change=\"false\"\n >\n <template #sliding-panel-addons=\"{ arrivedState }\">\n <slot name=\"sliding-panels-addons\" :arrived-state=\"arrivedState\" />\n </template>\n <template #sliding-panel-left-button>\n <slot name=\"sliding-panels-left-button\" />\n </template>\n <template #sliding-panel-right-button>\n <slot name=\"sliding-panels-right-button\" />\n </template>\n <ul class=\"x-ai-carousel-suggestion-results\">\n <li\n v-for=\"result in queriesResults\"\n :key=\"result.id\"\n data-test=\"ai-carousel-suggestion-result\"\n >\n <!-- @slot (required) result card -->\n <slot name=\"result\" :result=\"result\" />\n </li>\n </ul>\n </SlidingPanel>\n </slot>\n </DisplayClickProvider>\n </div>\n </DisplayEmitter>\n <slot name=\"suggestions-extra-content\" />\n </div>\n\n <slot name=\"extra-content\" />\n <slot name=\"cta-button\" />\n </div>\n </CollapseHeight>\n</template>\n\n<script lang=\"ts\">\nimport type { TaggingRequest } from '@empathyco/x-types'\nimport { useResizeObserver } from '@vueuse/core'\nimport { computed, defineComponent, onBeforeUnmount, onMounted, ref, watch } from 'vue'\nimport {\n AIStarIcon,\n ArrowRightIcon,\n BaseEventButton,\n ChangeHeight,\n ChevronDownIcon,\n CollapseHeight,\n DisplayClickProvider,\n DisplayEmitter,\n SlidingPanel,\n} from '../../../components'\nimport { use$x, useAccessibilityLabels, useState } from '../../../composables'\nimport { aiXModule } from '../x-module'\nimport AiGroupedCarousel from './ai-grouped-carousel.vue'\n\nexport default defineComponent({\n xModule: aiXModule.name,\n components: {\n AIStarIcon,\n AiGroupedCarousel,\n ArrowRightIcon,\n BaseEventButton,\n ChangeHeight,\n ChevronDownIcon,\n CollapseHeight,\n DisplayClickProvider,\n DisplayEmitter,\n SlidingPanel,\n },\n props: {\n /* The title text displayed */\n title: String,\n /* The classes added to the sliding panel. */\n slidingPanelClasses: String,\n /* The classes added to the sliding panel container. */\n slidingPanelContainerClasses: String,\n /* The classes added to the sliding panel buttons. */\n slidingPanelButtonsClasses: String,\n /* Controls whether the carousel should group results or display N carousels per N queries. */\n group: {\n type: Boolean,\n default: true,\n },\n },\n setup(props) {\n const $x = use$x()\n const { query, suggestionsSearch, queries, tagging } = useState('ai')\n const emptyTaggingRequest: TaggingRequest = { url: '', params: {} }\n\n const ariaLabels = useAccessibilityLabels('aiCarousel')\n\n const titleRef = ref<HTMLElement | null>(null)\n const titleExpanded = ref(false)\n const isTitleOverflowing = ref(false)\n\n /**\n * Checks if the title is overflowing and updates the state.\n */\n function updateTitleOverflow() {\n if (titleExpanded.value) {\n return\n }\n if (titleRef.value) {\n isTitleOverflowing.value = titleRef.value.scrollWidth > titleRef.value.clientWidth\n }\n }\n\n /**\n * Toggles the title expanded state if it is overflowing.\n */\n function toggleTitleExpansion() {\n if (isTitleOverflowing.value) {\n titleExpanded.value = !titleExpanded.value\n }\n }\n\n const title = computed(() => {\n if (!props.title) {\n const queriesList = new Intl.ListFormat('en', {\n style: 'long',\n type: 'conjunction',\n }).format(queries.value.map(({ query }) => query))\n return `Searching for ${queriesList}`\n }\n return props.title\n })\n\n watch(queries, () => {\n if (queries.value.length > 0) {\n $x.emit('AiSuggestionsSearchRequestUpdated')\n }\n })\n\n onMounted(() => {\n $x.emit('AiComponentMounted', undefined, { feature: 'ai_carousel' })\n })\n\n onBeforeUnmount(() => {\n $x.emit('AiComponentUnmounted')\n })\n\n useResizeObserver(titleRef, updateTitleOverflow)\n\n return {\n ariaLabels,\n emptyTaggingRequest,\n isTitleOverflowing,\n queries,\n query,\n suggestionsSearch,\n tagging,\n title,\n titleExpanded,\n titleRef,\n toggleTitleExpansion,\n }\n },\n})\n</script>\n\n<style lang=\"css\">\n.x-ai-carousel {\n --color: var(--x-ai-carousel-color, #bbc9cf);\n --color-lighter: var(--x-ai-carousel-color-lighter, color-mix(in srgb, var(--color) 25%, white));\n\n padding: 8px 0;\n position: relative;\n border-radius: 1.5rem;\n background-color: var(--color-lighter);\n}\n\n.x-ai-carousel-title {\n display: flex;\n font-size: 12px;\n gap: 8px;\n align-items: flex-start;\n margin: 0 14px 8px;\n cursor: pointer;\n}\n.x-ai-carousel-title-text {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.x-ai-carousel-title-text--expanded {\n white-space: normal;\n}\n.x-ai-carousel-title-icon {\n height: 1rem;\n aspect-ratio: 1 / 1;\n color: var(--color);\n flex-shrink: 0;\n margin-bottom: auto;\n}\n.x-ai-carousel-title-button {\n background: none;\n border: none;\n padding: 0;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--color);\n margin-bottom: auto;\n}\n.x-ai-carousel-title-button-icon {\n height: 1rem;\n aspect-ratio: 1 / 1;\n transition: transform 0.3s ease;\n}\n.x-ai-carousel-title-button-icon--expanded {\n transform: rotate(180deg);\n}\n\n.x-ai-carousel-suggestions {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n padding-bottom: 1rem;\n}\n\n.x-ai-carousel-suggestion {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.x-ai-carousel-suggestion-query-btn {\n border-color: transparent;\n background-color: transparent;\n margin-left: 1rem;\n margin-right: 1rem;\n font-weight: 700;\n width: fit-content;\n display: flex;\n align-items: center;\n gap: 1rem;\n cursor: pointer;\n}\n\n.x-ai-carousel-suggestion-query-btn-icon {\n height: 1rem;\n aspect-ratio: 1 / 1;\n}\n\n.x-ai-carousel-suggestion-results {\n display: flex;\n gap: 1rem;\n padding-left: 1rem;\n padding-right: 1rem;\n}\n</style>\n"],"names":["_createBlock","_withCtx","_openBlock","_createElementBlock","_createVNode","_createElementVNode","_normalizeClass","_renderSlot","_Fragment","_renderList","_createTextVNode","_toDisplayString","_createCommentVNode"],"mappings":";;;;;;;EAEyC,KAAA,EAAM;;;;;EA4D7B,KAAA,EAAM,2BAAA;AAAA,EAA4B,WAAA,EAAU;;;EAY/C,KAAA,EAAM,0BAAA;AAAA,EAA2B,WAAA,EAAU;;AAgCpC,MAAA,UAAA,GAAA,EAAA,KAAA,EAAM,kCAAA,EAAkC;;;;;;;;;;;;sBAzG5DA,WAAA,CA8HiB,yBAAA,EAAA,IAAA,EA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AO,EAAA;AAAA,sCACb,WAAA,EAAU;AAAA,qCAAA,EAAA;AAGV,sCAAAI,UAAA,CAAuC,yBAAlB,MAAA,EAAc;AAAA,qCAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;UAQjDA,UAAA,CAAyC,IAAA,CAAA,MAAA,EAAA,2BAAA;AAAA,SAAA,CAAA,CAAA;QAG3CA,UAAA,CAA6B,IAAA,CAAA,MAAA,EAAA,eAAA,CAAA;AAAA,QAC7BA,UAAA,CAA0B,IAAA,CAAA,MAAA,EAAA,YAAA;AAAA,OAAA,CAAA,IAAAK,kBAAA,CAAA,MAAA,EAAA,IAAA;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useResizeObserver } from '@vueuse/core';
|
|
2
|
-
import { defineComponent, ref, computed, watch, onMounted } from 'vue';
|
|
2
|
+
import { defineComponent, ref, computed, watch, onMounted, onBeforeUnmount } from 'vue';
|
|
3
3
|
import '../../../components/animations/animate-clip-path.vue2.js';
|
|
4
4
|
import '../../../components/animations/animate-scale.vue2.js';
|
|
5
5
|
import '../../../components/animations/animate-translate.vue2.js';
|
|
@@ -178,6 +178,9 @@ var _sfc_main = defineComponent({
|
|
|
178
178
|
onMounted(() => {
|
|
179
179
|
$x.emit('AiComponentMounted', undefined, { feature: 'ai_carousel' });
|
|
180
180
|
});
|
|
181
|
+
onBeforeUnmount(() => {
|
|
182
|
+
$x.emit('AiComponentUnmounted');
|
|
183
|
+
});
|
|
181
184
|
useResizeObserver(titleRef, updateTitleOverflow);
|
|
182
185
|
return {
|
|
183
186
|
ariaLabels,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-carousel.vue2.js","sources":["../../../../../src/x-modules/ai/components/ai-carousel.vue"],"sourcesContent":["<template>\n <CollapseHeight>\n <div v-if=\"suggestionsSearch.length\" class=\"x-ai-carousel\">\n <DisplayEmitter\n :payload=\"tagging?.toolingDisplay ?? emptyTaggingRequest\"\n :event-metadata=\"{\n feature: 'ai_carousel',\n displayOriginalQuery: query || 'ai-carousel-without-query',\n replaceable: false,\n }\"\n data-test=\"ai-carousel-display-emitter\"\n >\n <span\n class=\"x-ai-carousel-title\"\n :class=\"{ 'x-ai-carousel-title--expanded': titleExpanded }\"\n data-test=\"ai-carousel-title\"\n @click=\"toggleTitleExpansion\"\n >\n <AIStarIcon class=\"x-ai-carousel-title-icon\" />\n <ChangeHeight>\n <span\n ref=\"titleRef\"\n class=\"x-ai-carousel-title-text\"\n :class=\"{ 'x-ai-carousel-title-text--expanded': titleExpanded }\"\n >\n {{ title }}\n </span>\n </ChangeHeight>\n <button\n v-if=\"isTitleOverflowing\"\n class=\"x-ai-carousel-title-button\"\n data-test=\"ai-carousel-title-button\"\n :aria-label=\"titleExpanded ? ariaLabels?.collapse : ariaLabels?.expand\"\n >\n <ChevronDownIcon\n class=\"x-ai-carousel-title-button-icon\"\n :class=\"{ 'x-ai-carousel-title-button-icon--expanded': titleExpanded }\"\n />\n </button>\n </span>\n </DisplayEmitter>\n\n <AiGroupedCarousel\n v-if=\"group\"\n :sliding-panel-classes=\"slidingPanelClasses\"\n :sliding-panel-container-classes=\"slidingPanelContainerClasses\"\n :sliding-panel-buttons-classes=\"slidingPanelButtonsClasses\"\n >\n <template #sliding-panels-addons=\"{ arrivedState }\">\n <slot name=\"sliding-panels-addons\" :arrived-state=\"arrivedState\" />\n </template>\n <template #sliding-panels-left-button>\n <slot name=\"sliding-panels-left-button\" />\n </template>\n <template #sliding-panels-right-button>\n <slot name=\"sliding-panels-right-button\" />\n </template>\n <template #result=\"{ result }\">\n <slot name=\"result\" :result=\"result\" />\n </template>\n </AiGroupedCarousel>\n\n <div v-else class=\"x-ai-carousel-suggestions\" data-test=\"ai-carousel-suggestions-container\">\n <DisplayEmitter\n v-for=\"{ query: suggestionQuery, results: queriesResults } in suggestionsSearch\"\n :key=\"suggestionQuery\"\n :payload=\"tagging?.searchQueries[suggestionQuery].toolingDisplay ?? emptyTaggingRequest\"\n :event-metadata=\"{\n feature: 'ai_carousel',\n displayOriginalQuery: query || 'ai-carousel-without-query',\n replaceable: false,\n }\"\n data-test=\"ai-carousel-query-display-emitter\"\n >\n <div class=\"x-ai-carousel-suggestion\" data-test=\"ai-carousel-suggestion\">\n <BaseEventButton\n class=\"x-ai-carousel-suggestion-query-btn\"\n :events=\"{ UserAcceptedAQuery: suggestionQuery }\"\n >\n {{ suggestionQuery }}\n <ArrowRightIcon class=\"x-ai-carousel-suggestion-query-btn-icon\" />\n </BaseEventButton>\n\n <DisplayClickProvider\n :tooling-display-tagging=\"tagging?.searchQueries[suggestionQuery].toolingDisplayClick\"\n :tooling-add2-cart-tagging=\"\n tagging?.searchQueries[suggestionQuery].toolingDisplayAdd2Cart\n \"\n result-feature=\"ai_carousel\"\n >\n <slot name=\"sliding-panel\" :results=\"queriesResults\">\n <SlidingPanel\n :class=\"slidingPanelClasses\"\n :scroll-container-class=\"slidingPanelContainerClasses\"\n :button-class=\"slidingPanelButtonsClasses\"\n :reset-on-content-change=\"false\"\n >\n <template #sliding-panel-addons=\"{ arrivedState }\">\n <slot name=\"sliding-panels-addons\" :arrived-state=\"arrivedState\" />\n </template>\n <template #sliding-panel-left-button>\n <slot name=\"sliding-panels-left-button\" />\n </template>\n <template #sliding-panel-right-button>\n <slot name=\"sliding-panels-right-button\" />\n </template>\n <ul class=\"x-ai-carousel-suggestion-results\">\n <li\n v-for=\"result in queriesResults\"\n :key=\"result.id\"\n data-test=\"ai-carousel-suggestion-result\"\n >\n <!-- @slot (required) result card -->\n <slot name=\"result\" :result=\"result\" />\n </li>\n </ul>\n </SlidingPanel>\n </slot>\n </DisplayClickProvider>\n </div>\n </DisplayEmitter>\n <slot name=\"suggestions-extra-content\" />\n </div>\n\n <slot name=\"extra-content\" />\n <slot name=\"cta-button\" />\n </div>\n </CollapseHeight>\n</template>\n\n<script lang=\"ts\">\nimport type { TaggingRequest } from '@empathyco/x-types'\nimport { useResizeObserver } from '@vueuse/core'\nimport { computed, defineComponent, onMounted, ref, watch } from 'vue'\nimport {\n AIStarIcon,\n ArrowRightIcon,\n BaseEventButton,\n ChangeHeight,\n ChevronDownIcon,\n CollapseHeight,\n DisplayClickProvider,\n DisplayEmitter,\n SlidingPanel,\n} from '../../../components'\nimport { use$x, useAccessibilityLabels, useState } from '../../../composables'\nimport { aiXModule } from '../x-module'\nimport AiGroupedCarousel from './ai-grouped-carousel.vue'\n\nexport default defineComponent({\n xModule: aiXModule.name,\n components: {\n AIStarIcon,\n AiGroupedCarousel,\n ArrowRightIcon,\n BaseEventButton,\n ChangeHeight,\n ChevronDownIcon,\n CollapseHeight,\n DisplayClickProvider,\n DisplayEmitter,\n SlidingPanel,\n },\n props: {\n /* The title text displayed */\n title: String,\n /* The classes added to the sliding panel. */\n slidingPanelClasses: String,\n /* The classes added to the sliding panel container. */\n slidingPanelContainerClasses: String,\n /* The classes added to the sliding panel buttons. */\n slidingPanelButtonsClasses: String,\n /* Controls whether the carousel should group results or display N carousels per N queries. */\n group: {\n type: Boolean,\n default: true,\n },\n },\n setup(props) {\n const $x = use$x()\n const { query, suggestionsSearch, queries, tagging } = useState('ai')\n const emptyTaggingRequest: TaggingRequest = { url: '', params: {} }\n\n const ariaLabels = useAccessibilityLabels('aiCarousel')\n\n const titleRef = ref<HTMLElement | null>(null)\n const titleExpanded = ref(false)\n const isTitleOverflowing = ref(false)\n\n /**\n * Checks if the title is overflowing and updates the state.\n */\n function updateTitleOverflow() {\n if (titleExpanded.value) {\n return\n }\n if (titleRef.value) {\n isTitleOverflowing.value = titleRef.value.scrollWidth > titleRef.value.clientWidth\n }\n }\n\n /**\n * Toggles the title expanded state if it is overflowing.\n */\n function toggleTitleExpansion() {\n if (isTitleOverflowing.value) {\n titleExpanded.value = !titleExpanded.value\n }\n }\n\n const title = computed(() => {\n if (!props.title) {\n const queriesList = new Intl.ListFormat('en', {\n style: 'long',\n type: 'conjunction',\n }).format(queries.value.map(({ query }) => query))\n return `Searching for ${queriesList}`\n }\n return props.title\n })\n\n watch(queries, () => {\n if (queries.value.length > 0) {\n $x.emit('AiSuggestionsSearchRequestUpdated')\n }\n })\n\n onMounted(() => {\n $x.emit('AiComponentMounted', undefined, { feature: 'ai_carousel' })\n })\n\n useResizeObserver(titleRef, updateTitleOverflow)\n\n return {\n ariaLabels,\n emptyTaggingRequest,\n isTitleOverflowing,\n queries,\n query,\n suggestionsSearch,\n tagging,\n title,\n titleExpanded,\n titleRef,\n toggleTitleExpansion,\n }\n },\n})\n</script>\n\n<style lang=\"css\">\n.x-ai-carousel {\n --color: var(--x-ai-carousel-color, #bbc9cf);\n --color-lighter: var(--x-ai-carousel-color-lighter, color-mix(in srgb, var(--color) 25%, white));\n\n padding: 8px 0;\n position: relative;\n border-radius: 1.5rem;\n background-color: var(--color-lighter);\n}\n\n.x-ai-carousel-title {\n display: flex;\n font-size: 12px;\n gap: 8px;\n align-items: flex-start;\n margin: 0 14px 8px;\n cursor: pointer;\n}\n.x-ai-carousel-title-text {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.x-ai-carousel-title-text--expanded {\n white-space: normal;\n}\n.x-ai-carousel-title-icon {\n height: 1rem;\n aspect-ratio: 1 / 1;\n color: var(--color);\n flex-shrink: 0;\n margin-bottom: auto;\n}\n.x-ai-carousel-title-button {\n background: none;\n border: none;\n padding: 0;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--color);\n margin-bottom: auto;\n}\n.x-ai-carousel-title-button-icon {\n height: 1rem;\n aspect-ratio: 1 / 1;\n transition: transform 0.3s ease;\n}\n.x-ai-carousel-title-button-icon--expanded {\n transform: rotate(180deg);\n}\n\n.x-ai-carousel-suggestions {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n padding-bottom: 1rem;\n}\n\n.x-ai-carousel-suggestion {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.x-ai-carousel-suggestion-query-btn {\n border-color: transparent;\n background-color: transparent;\n margin-left: 1rem;\n margin-right: 1rem;\n font-weight: 700;\n width: fit-content;\n display: flex;\n align-items: center;\n gap: 1rem;\n cursor: pointer;\n}\n\n.x-ai-carousel-suggestion-query-btn-icon {\n height: 1rem;\n aspect-ratio: 1 / 1;\n}\n\n.x-ai-carousel-suggestion-results {\n display: flex;\n gap: 1rem;\n padding-left: 1rem;\n padding-right: 1rem;\n}\n</style>\n"],"names":["DisplayClickProvider","DisplayEmitter"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqJA,gBAAe,eAAe,CAAC;IAC7B,OAAO,EAAE,SAAS,CAAC,IAAI;AACvB,IAAA,UAAU,EAAE;QACV,UAAU;QACV,iBAAiB;QACjB,cAAc;QACd,eAAe;QACf,YAAY;QACZ,eAAe;QACf,cAAc;8BACdA,WAAoB;wBACpBC,WAAc;QACd,YAAY;AACb,KAAA;AACD,IAAA,KAAK,EAAE;;AAEL,QAAA,KAAK,EAAE,MAAM;;AAEb,QAAA,mBAAmB,EAAE,MAAM;;AAE3B,QAAA,4BAA4B,EAAE,MAAM;;AAEpC,QAAA,0BAA0B,EAAE,MAAM;;AAElC,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,IAAI;AACd,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;AACT,QAAA,MAAM,EAAC,GAAI,KAAK,EAAC;AACjB,QAAA,MAAM,EAAE,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,OAAM,EAAE,GAAI,QAAQ,CAAC,IAAI,CAAA;QACpE,MAAM,mBAAmB,GAAmB,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,EAAC,EAAE;AAElE,QAAA,MAAM,UAAS,GAAI,sBAAsB,CAAC,YAAY,CAAA;AAEtD,QAAA,MAAM,QAAO,GAAI,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AAC,IAAI,CAAC,oBAAoB,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,aAAY,EAAG,CAAA;AACrE,QAAA,CAAC,CAAA;AAED,QAAA,iBAAiB,CAAC,QAAQ,EAAE,mBAAmB,CAAA;QAE/C,OAAO;YACL,UAAU;YACV,mBAAmB;YACnB,kBAAkB;YAClB,OAAO;YACP,KAAK;YACL,iBAAiB;YACjB,OAAO;YACP,KAAK;YACL,aAAa;YACb,QAAQ;YACR,oBAAoB;SACtB;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"ai-carousel.vue2.js","sources":["../../../../../src/x-modules/ai/components/ai-carousel.vue"],"sourcesContent":["<template>\n <CollapseHeight>\n <div v-if=\"suggestionsSearch.length\" class=\"x-ai-carousel\">\n <DisplayEmitter\n :payload=\"tagging?.toolingDisplay ?? emptyTaggingRequest\"\n :event-metadata=\"{\n feature: 'ai_carousel',\n displayOriginalQuery: query || 'ai-carousel-without-query',\n replaceable: false,\n }\"\n data-test=\"ai-carousel-display-emitter\"\n >\n <span\n class=\"x-ai-carousel-title\"\n :class=\"{ 'x-ai-carousel-title--expanded': titleExpanded }\"\n data-test=\"ai-carousel-title\"\n @click=\"toggleTitleExpansion\"\n >\n <AIStarIcon class=\"x-ai-carousel-title-icon\" />\n <ChangeHeight>\n <span\n ref=\"titleRef\"\n class=\"x-ai-carousel-title-text\"\n :class=\"{ 'x-ai-carousel-title-text--expanded': titleExpanded }\"\n >\n {{ title }}\n </span>\n </ChangeHeight>\n <button\n v-if=\"isTitleOverflowing\"\n class=\"x-ai-carousel-title-button\"\n data-test=\"ai-carousel-title-button\"\n :aria-label=\"titleExpanded ? ariaLabels?.collapse : ariaLabels?.expand\"\n >\n <ChevronDownIcon\n class=\"x-ai-carousel-title-button-icon\"\n :class=\"{ 'x-ai-carousel-title-button-icon--expanded': titleExpanded }\"\n />\n </button>\n </span>\n </DisplayEmitter>\n\n <AiGroupedCarousel\n v-if=\"group\"\n :sliding-panel-classes=\"slidingPanelClasses\"\n :sliding-panel-container-classes=\"slidingPanelContainerClasses\"\n :sliding-panel-buttons-classes=\"slidingPanelButtonsClasses\"\n >\n <template #sliding-panels-addons=\"{ arrivedState }\">\n <slot name=\"sliding-panels-addons\" :arrived-state=\"arrivedState\" />\n </template>\n <template #sliding-panels-left-button>\n <slot name=\"sliding-panels-left-button\" />\n </template>\n <template #sliding-panels-right-button>\n <slot name=\"sliding-panels-right-button\" />\n </template>\n <template #result=\"{ result }\">\n <slot name=\"result\" :result=\"result\" />\n </template>\n </AiGroupedCarousel>\n\n <div v-else class=\"x-ai-carousel-suggestions\" data-test=\"ai-carousel-suggestions-container\">\n <DisplayEmitter\n v-for=\"{ query: suggestionQuery, results: queriesResults } in suggestionsSearch\"\n :key=\"suggestionQuery\"\n :payload=\"tagging?.searchQueries[suggestionQuery].toolingDisplay ?? emptyTaggingRequest\"\n :event-metadata=\"{\n feature: 'ai_carousel',\n displayOriginalQuery: query || 'ai-carousel-without-query',\n replaceable: false,\n }\"\n data-test=\"ai-carousel-query-display-emitter\"\n >\n <div class=\"x-ai-carousel-suggestion\" data-test=\"ai-carousel-suggestion\">\n <BaseEventButton\n class=\"x-ai-carousel-suggestion-query-btn\"\n :events=\"{ UserAcceptedAQuery: suggestionQuery }\"\n >\n {{ suggestionQuery }}\n <ArrowRightIcon class=\"x-ai-carousel-suggestion-query-btn-icon\" />\n </BaseEventButton>\n\n <DisplayClickProvider\n :tooling-display-tagging=\"tagging?.searchQueries[suggestionQuery].toolingDisplayClick\"\n :tooling-add2-cart-tagging=\"\n tagging?.searchQueries[suggestionQuery].toolingDisplayAdd2Cart\n \"\n result-feature=\"ai_carousel\"\n >\n <slot name=\"sliding-panel\" :results=\"queriesResults\">\n <SlidingPanel\n :class=\"slidingPanelClasses\"\n :scroll-container-class=\"slidingPanelContainerClasses\"\n :button-class=\"slidingPanelButtonsClasses\"\n :reset-on-content-change=\"false\"\n >\n <template #sliding-panel-addons=\"{ arrivedState }\">\n <slot name=\"sliding-panels-addons\" :arrived-state=\"arrivedState\" />\n </template>\n <template #sliding-panel-left-button>\n <slot name=\"sliding-panels-left-button\" />\n </template>\n <template #sliding-panel-right-button>\n <slot name=\"sliding-panels-right-button\" />\n </template>\n <ul class=\"x-ai-carousel-suggestion-results\">\n <li\n v-for=\"result in queriesResults\"\n :key=\"result.id\"\n data-test=\"ai-carousel-suggestion-result\"\n >\n <!-- @slot (required) result card -->\n <slot name=\"result\" :result=\"result\" />\n </li>\n </ul>\n </SlidingPanel>\n </slot>\n </DisplayClickProvider>\n </div>\n </DisplayEmitter>\n <slot name=\"suggestions-extra-content\" />\n </div>\n\n <slot name=\"extra-content\" />\n <slot name=\"cta-button\" />\n </div>\n </CollapseHeight>\n</template>\n\n<script lang=\"ts\">\nimport type { TaggingRequest } from '@empathyco/x-types'\nimport { useResizeObserver } from '@vueuse/core'\nimport { computed, defineComponent, onBeforeUnmount, onMounted, ref, watch } from 'vue'\nimport {\n AIStarIcon,\n ArrowRightIcon,\n BaseEventButton,\n ChangeHeight,\n ChevronDownIcon,\n CollapseHeight,\n DisplayClickProvider,\n DisplayEmitter,\n SlidingPanel,\n} from '../../../components'\nimport { use$x, useAccessibilityLabels, useState } from '../../../composables'\nimport { aiXModule } from '../x-module'\nimport AiGroupedCarousel from './ai-grouped-carousel.vue'\n\nexport default defineComponent({\n xModule: aiXModule.name,\n components: {\n AIStarIcon,\n AiGroupedCarousel,\n ArrowRightIcon,\n BaseEventButton,\n ChangeHeight,\n ChevronDownIcon,\n CollapseHeight,\n DisplayClickProvider,\n DisplayEmitter,\n SlidingPanel,\n },\n props: {\n /* The title text displayed */\n title: String,\n /* The classes added to the sliding panel. */\n slidingPanelClasses: String,\n /* The classes added to the sliding panel container. */\n slidingPanelContainerClasses: String,\n /* The classes added to the sliding panel buttons. */\n slidingPanelButtonsClasses: String,\n /* Controls whether the carousel should group results or display N carousels per N queries. */\n group: {\n type: Boolean,\n default: true,\n },\n },\n setup(props) {\n const $x = use$x()\n const { query, suggestionsSearch, queries, tagging } = useState('ai')\n const emptyTaggingRequest: TaggingRequest = { url: '', params: {} }\n\n const ariaLabels = useAccessibilityLabels('aiCarousel')\n\n const titleRef = ref<HTMLElement | null>(null)\n const titleExpanded = ref(false)\n const isTitleOverflowing = ref(false)\n\n /**\n * Checks if the title is overflowing and updates the state.\n */\n function updateTitleOverflow() {\n if (titleExpanded.value) {\n return\n }\n if (titleRef.value) {\n isTitleOverflowing.value = titleRef.value.scrollWidth > titleRef.value.clientWidth\n }\n }\n\n /**\n * Toggles the title expanded state if it is overflowing.\n */\n function toggleTitleExpansion() {\n if (isTitleOverflowing.value) {\n titleExpanded.value = !titleExpanded.value\n }\n }\n\n const title = computed(() => {\n if (!props.title) {\n const queriesList = new Intl.ListFormat('en', {\n style: 'long',\n type: 'conjunction',\n }).format(queries.value.map(({ query }) => query))\n return `Searching for ${queriesList}`\n }\n return props.title\n })\n\n watch(queries, () => {\n if (queries.value.length > 0) {\n $x.emit('AiSuggestionsSearchRequestUpdated')\n }\n })\n\n onMounted(() => {\n $x.emit('AiComponentMounted', undefined, { feature: 'ai_carousel' })\n })\n\n onBeforeUnmount(() => {\n $x.emit('AiComponentUnmounted')\n })\n\n useResizeObserver(titleRef, updateTitleOverflow)\n\n return {\n ariaLabels,\n emptyTaggingRequest,\n isTitleOverflowing,\n queries,\n query,\n suggestionsSearch,\n tagging,\n title,\n titleExpanded,\n titleRef,\n toggleTitleExpansion,\n }\n },\n})\n</script>\n\n<style lang=\"css\">\n.x-ai-carousel {\n --color: var(--x-ai-carousel-color, #bbc9cf);\n --color-lighter: var(--x-ai-carousel-color-lighter, color-mix(in srgb, var(--color) 25%, white));\n\n padding: 8px 0;\n position: relative;\n border-radius: 1.5rem;\n background-color: var(--color-lighter);\n}\n\n.x-ai-carousel-title {\n display: flex;\n font-size: 12px;\n gap: 8px;\n align-items: flex-start;\n margin: 0 14px 8px;\n cursor: pointer;\n}\n.x-ai-carousel-title-text {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.x-ai-carousel-title-text--expanded {\n white-space: normal;\n}\n.x-ai-carousel-title-icon {\n height: 1rem;\n aspect-ratio: 1 / 1;\n color: var(--color);\n flex-shrink: 0;\n margin-bottom: auto;\n}\n.x-ai-carousel-title-button {\n background: none;\n border: none;\n padding: 0;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--color);\n margin-bottom: auto;\n}\n.x-ai-carousel-title-button-icon {\n height: 1rem;\n aspect-ratio: 1 / 1;\n transition: transform 0.3s ease;\n}\n.x-ai-carousel-title-button-icon--expanded {\n transform: rotate(180deg);\n}\n\n.x-ai-carousel-suggestions {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n padding-bottom: 1rem;\n}\n\n.x-ai-carousel-suggestion {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.x-ai-carousel-suggestion-query-btn {\n border-color: transparent;\n background-color: transparent;\n margin-left: 1rem;\n margin-right: 1rem;\n font-weight: 700;\n width: fit-content;\n display: flex;\n align-items: center;\n gap: 1rem;\n cursor: pointer;\n}\n\n.x-ai-carousel-suggestion-query-btn-icon {\n height: 1rem;\n aspect-ratio: 1 / 1;\n}\n\n.x-ai-carousel-suggestion-results {\n display: flex;\n gap: 1rem;\n padding-left: 1rem;\n padding-right: 1rem;\n}\n</style>\n"],"names":["DisplayClickProvider","DisplayEmitter"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqJA,gBAAe,eAAe,CAAC;IAC7B,OAAO,EAAE,SAAS,CAAC,IAAI;AACvB,IAAA,UAAU,EAAE;QACV,UAAU;QACV,iBAAiB;QACjB,cAAc;QACd,eAAe;QACf,YAAY;QACZ,eAAe;QACf,cAAc;8BACdA,WAAoB;wBACpBC,WAAc;QACd,YAAY;AACb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AA,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;gBAChB,MAAM,WAAU,GAAI,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;AAC5C,oBAAA,KAAK,EAAE,MAAM;AACb,oBAAA,IAAI,EAAE,aAAa;AACpB,iBAAA,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,KAAK,KAAK,CAAC,CAAA;gBACjD,OAAO,CAAA,cAAA,EAAiB,WAAW,CAAA,CAAC;YACtC;YACA,OAAO,KAAK,CAAC,KAAI;AACnB,QAAA,CAAC,CAAA;AAED,QAAA,KAAK,CAAC,OAAO,EAAE,MAAI;YACjB,IAAI,OAAO,CAAC,KAAK,CAAC,MAAK,GAAI,CAAC,EAAE;AAC5B,gBAAA,EAAE,CAAC,IAAI,CAAC,mCAAmC,CAAA;YAC7C;AACF,QAAA,CAAC,CAAA;QAED,SAAS,CAAC,MAAI;AACZ,YAAA,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,aAAY,EAAG,CAAA;AACrE,QAAA,CAAC,CAAA;QAED,eAAe,CAAC,MAAI;AAClB,YAAA,EAAE,CAAC,IAAI,CAAC,sBAAsB,CAAA;AAChC,QAAA,CAAC,CAAA;AAED,QAAA,iBAAiB,CAAC,QAAQ,EAAE,mBAAmB,CAAA;QAE/C,OAAO;YACL,UAAU;YACV,mBAAmB;YACnB,kBAAkB;YAClB,OAAO;YACP,KAAK;YACL,iBAAiB;YACjB,OAAO;YACP,KAAK;YACL,aAAa;YACb,QAAQ;YACR,oBAAoB;SACtB;IACF,CAAC;AACF,CAAA,CAAA;;;;"}
|
|
@@ -21,6 +21,7 @@ const fetchAndSaveAiSuggestionsSearch = async ({ commit, getters }) => {
|
|
|
21
21
|
.then(response => {
|
|
22
22
|
if (response) {
|
|
23
23
|
commit('setSuggestionsSearch', response.suggestions);
|
|
24
|
+
commit('setSuggestionsSearchTagging', response.suggestionsTagging);
|
|
24
25
|
}
|
|
25
26
|
})
|
|
26
27
|
.catch(error => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-and-save-ai-suggestions-search.action.js","sources":["../../../../../../src/x-modules/ai/store/actions/fetch-and-save-ai-suggestions-search.action.ts"],"sourcesContent":["import type { AiXStoreModule } from '../types'\nimport { XPlugin } from '../../../../plugins'\n\n/**\n * Default implementation for the `AiActions.fetchAndSaveAiSuggestionsSearch`.\n *\n * @param _ - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the commits and\n * getters provided by Vuex.\n * @returns The AI search response.\n * @public\n */\nexport const fetchAndSaveAiSuggestionsSearch: AiXStoreModule['actions']['fetchAndSaveAiSuggestionsSearch'] =\n async ({ commit, getters }) => {\n const request = getters.suggestionsSearchRequest\n if (!request) {\n return\n }\n commit('setSuggestionsSearchStatus', 'loading')\n\n return XPlugin.adapter\n .aiSuggestionsSearch(request)\n .then(response => {\n if (response) {\n commit('setSuggestionsSearch', response.suggestions)\n }\n })\n .catch(error => {\n console.error(error)\n })\n .finally(() => {\n commit('setSuggestionsSearchStatus', 'success')\n })\n }\n"],"names":[],"mappings":";;;;AAGA;;;;;;;AAOG;AACI,MAAM,+BAA+B,GAC1C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAI;AAC5B,IAAA,MAAM,OAAO,GAAG,OAAO,CAAC,wBAAwB;IAChD,IAAI,CAAC,OAAO,EAAE;QACZ;IACF;AACA,IAAA,MAAM,CAAC,4BAA4B,EAAE,SAAS,CAAC;IAE/C,OAAO,OAAO,CAAC;SACZ,mBAAmB,CAAC,OAAO;SAC3B,IAAI,CAAC,QAAQ,IAAG;QACf,IAAI,QAAQ,EAAE;AACZ,YAAA,MAAM,CAAC,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"fetch-and-save-ai-suggestions-search.action.js","sources":["../../../../../../src/x-modules/ai/store/actions/fetch-and-save-ai-suggestions-search.action.ts"],"sourcesContent":["import type { AiXStoreModule } from '../types'\nimport { XPlugin } from '../../../../plugins'\n\n/**\n * Default implementation for the `AiActions.fetchAndSaveAiSuggestionsSearch`.\n *\n * @param _ - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the commits and\n * getters provided by Vuex.\n * @returns The AI search response.\n * @public\n */\nexport const fetchAndSaveAiSuggestionsSearch: AiXStoreModule['actions']['fetchAndSaveAiSuggestionsSearch'] =\n async ({ commit, getters }) => {\n const request = getters.suggestionsSearchRequest\n if (!request) {\n return\n }\n commit('setSuggestionsSearchStatus', 'loading')\n\n return XPlugin.adapter\n .aiSuggestionsSearch(request)\n .then(response => {\n if (response) {\n commit('setSuggestionsSearch', response.suggestions)\n commit('setSuggestionsSearchTagging', response.suggestionsTagging)\n }\n })\n .catch(error => {\n console.error(error)\n })\n .finally(() => {\n commit('setSuggestionsSearchStatus', 'success')\n })\n }\n"],"names":[],"mappings":";;;;AAGA;;;;;;;AAOG;AACI,MAAM,+BAA+B,GAC1C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAI;AAC5B,IAAA,MAAM,OAAO,GAAG,OAAO,CAAC,wBAAwB;IAChD,IAAI,CAAC,OAAO,EAAE;QACZ;IACF;AACA,IAAA,MAAM,CAAC,4BAA4B,EAAE,SAAS,CAAC;IAE/C,OAAO,OAAO,CAAC;SACZ,mBAAmB,CAAC,OAAO;SAC3B,IAAI,CAAC,QAAQ,IAAG;QACf,IAAI,QAAQ,EAAE;AACZ,YAAA,MAAM,CAAC,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAAC;AACpD,YAAA,MAAM,CAAC,6BAA6B,EAAE,QAAQ,CAAC,kBAAkB,CAAC;QACpE;AACF,IAAA,CAAC;SACA,KAAK,CAAC,KAAK,IAAG;AACb,QAAA,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;AACtB,IAAA,CAAC;SACA,OAAO,CAAC,MAAK;AACZ,QAAA,MAAM,CAAC,4BAA4B,EAAE,SAAS,CAAC;AACjD,IAAA,CAAC,CAAC;AACN;;;;"}
|
|
@@ -11,6 +11,10 @@ const aiEmitters = createStoreEmitters(aiXStoreModule, {
|
|
|
11
11
|
AiSuggestionsRequestUpdated: (_, getters) => getters.suggestionsRequest,
|
|
12
12
|
AiSuggestionsSearchRequestUpdated: (_, getters) => getters.suggestionsSearchRequest,
|
|
13
13
|
AiSuggestionsSearchChanged: state => state.suggestionsSearch,
|
|
14
|
+
AiSuggestionsSearchTaggingChanged: {
|
|
15
|
+
selector: state => state.suggestionsTagging,
|
|
16
|
+
filter: (_newValue, _oldValue, state) => state.suggestionsTagging !== undefined,
|
|
17
|
+
},
|
|
14
18
|
});
|
|
15
19
|
|
|
16
20
|
export { aiEmitters };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emitters.js","sources":["../../../../../src/x-modules/ai/store/emitters.ts"],"sourcesContent":["import { createStoreEmitters } from '../../../store'\nimport { aiXStoreModule } from './module'\n\n/**\n * {@link StoreEmitters} For the ai module.\n *\n * @internal\n */\nexport const aiEmitters = createStoreEmitters(aiXStoreModule, {\n AiSuggestionsRequestUpdated: (_, getters) => getters.suggestionsRequest,\n AiSuggestionsSearchRequestUpdated: (_, getters) => getters.suggestionsSearchRequest,\n AiSuggestionsSearchChanged: state => state.suggestionsSearch,\n})\n"],"names":[],"mappings":";;;;AAGA;;;;AAIG;AACI,MAAM,UAAU,GAAG,mBAAmB,CAAC,cAAc,EAAE;IAC5D,2BAA2B,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,kBAAkB;IACvE,iCAAiC,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,wBAAwB;AACnF,IAAA,0BAA0B,EAAE,KAAK,IAAI,KAAK,CAAC,iBAAiB;
|
|
1
|
+
{"version":3,"file":"emitters.js","sources":["../../../../../src/x-modules/ai/store/emitters.ts"],"sourcesContent":["import { createStoreEmitters } from '../../../store'\nimport { aiXStoreModule } from './module'\n\n/**\n * {@link StoreEmitters} For the ai module.\n *\n * @internal\n */\nexport const aiEmitters = createStoreEmitters(aiXStoreModule, {\n AiSuggestionsRequestUpdated: (_, getters) => getters.suggestionsRequest,\n AiSuggestionsSearchRequestUpdated: (_, getters) => getters.suggestionsSearchRequest,\n AiSuggestionsSearchChanged: state => state.suggestionsSearch,\n AiSuggestionsSearchTaggingChanged: {\n selector: state => state.suggestionsTagging!,\n filter: (_newValue, _oldValue, state) => state.suggestionsTagging !== undefined,\n },\n})\n"],"names":[],"mappings":";;;;AAGA;;;;AAIG;AACI,MAAM,UAAU,GAAG,mBAAmB,CAAC,cAAc,EAAE;IAC5D,2BAA2B,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,kBAAkB;IACvE,iCAAiC,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,wBAAwB;AACnF,IAAA,0BAA0B,EAAE,KAAK,IAAI,KAAK,CAAC,iBAAiB;AAC5D,IAAA,iCAAiC,EAAE;AACjC,QAAA,QAAQ,EAAE,KAAK,IAAI,KAAK,CAAC,kBAAmB;AAC5C,QAAA,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,KAAK,KAAK,CAAC,kBAAkB,KAAK,SAAS;AAChF,KAAA;AACF,CAAA;;;;"}
|
|
@@ -45,6 +45,9 @@ const aiXStoreModule = {
|
|
|
45
45
|
setSuggestionsSearch: (state, suggestionsSearch) => {
|
|
46
46
|
state.suggestionsSearch = suggestionsSearch;
|
|
47
47
|
},
|
|
48
|
+
setSuggestionsSearchTagging: (state, suggestionsTagging) => {
|
|
49
|
+
state.suggestionsTagging = suggestionsTagging;
|
|
50
|
+
},
|
|
48
51
|
setSuggestionsStatus: (state, status) => {
|
|
49
52
|
state.suggestionsStatus = status;
|
|
50
53
|
},
|
|
@@ -95,6 +98,7 @@ function resettableAiState() {
|
|
|
95
98
|
return {
|
|
96
99
|
queries: [],
|
|
97
100
|
tagging: undefined,
|
|
101
|
+
suggestionsTagging: undefined,
|
|
98
102
|
suggestionsSearch: [],
|
|
99
103
|
suggestionsStatus: 'initial',
|
|
100
104
|
suggestionsSearchStatus: 'initial',
|