@empathyco/x-components 6.0.0-alpha.161 → 6.0.0-alpha.163
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 +17 -0
- package/docs/API-reference/api/x-adapter-platform.mapfilters.md +80 -0
- package/docs/API-reference/api/x-adapter-platform.md +1 -0
- package/docs/API-reference/api/x-components.aimutations.md +1 -0
- package/docs/API-reference/api/x-components.aimutations.setselectedfilters.md +13 -0
- package/docs/API-reference/api/x-components.aistate.md +1 -0
- package/docs/API-reference/api/x-components.aistate.selectedfilters.md +13 -0
- package/docs/API-reference/api/x-types.aisuggestionsrequest.md +2 -2
- package/docs/API-reference/api/x-types.aisuggestionssearchrequest.md +2 -2
- package/docs/API-reference/components/ai/x-components.ai-overview.md +1 -0
- package/js/x-modules/ai/components/ai-overview.vue.js +2 -1
- package/js/x-modules/ai/components/ai-overview.vue.js.map +1 -1
- package/js/x-modules/ai/components/ai-overview.vue2.js.map +1 -1
- package/js/x-modules/ai/store/getters/suggestions-request.getter.js +2 -2
- package/js/x-modules/ai/store/getters/suggestions-request.getter.js.map +1 -1
- package/js/x-modules/ai/store/getters/suggestions-search-request.getter.js +2 -2
- package/js/x-modules/ai/store/getters/suggestions-search-request.getter.js.map +1 -1
- package/js/x-modules/ai/store/module.js +9 -2
- package/js/x-modules/ai/store/module.js.map +1 -1
- package/js/x-modules/ai/wiring.js +26 -21
- package/js/x-modules/ai/wiring.js.map +1 -1
- package/package.json +4 -4
- package/report/x-adapter-platform.api.json +59 -0
- package/report/x-components.api.json +77 -0
- package/report/x-components.api.md +14 -10
- package/report/x-types.api.json +26 -0
- package/types/x-modules/ai/store/getters/suggestions-search-request.getter.d.ts.map +1 -1
- package/types/x-modules/ai/store/module.d.ts.map +1 -1
- package/types/x-modules/ai/store/types.d.ts +12 -1
- package/types/x-modules/ai/store/types.d.ts.map +1 -1
- package/types/x-modules/ai/wiring.d.ts +11 -8
- package/types/x-modules/ai/wiring.d.ts.map +1 -1
- package/types/x-modules/related-prompts/components/related-prompts-tag-list.vue.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
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
|
+
## 6.0.0-alpha.163 (2025-10-15)
|
|
7
|
+
|
|
8
|
+
* fix: minor improvements in implementation ([454fb8c](https://github.com/empathyco/x/commit/454fb8c))
|
|
9
|
+
* feat(AiOverview): add selected filters to requests ([2a6a446](https://github.com/empathyco/x/commit/2a6a446))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## 6.0.0-alpha.162 (2025-10-13)
|
|
16
|
+
|
|
17
|
+
* feat(ai): add `suggestions-extra-content` slot to ai-overview component ([350a7c1](https://github.com/empathyco/x/commit/350a7c1))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
6
23
|
## 6.0.0-alpha.161 (2025-10-02)
|
|
7
24
|
|
|
8
25
|
* fix: fire search only if Empathise is open (#1895) ([2412415](https://github.com/empathyco/x/commit/2412415)), closes [#1895](https://github.com/empathyco/x/issues/1895) [#1894](https://github.com/empathyco/x/issues/1894)
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-adapter-platform](./x-adapter-platform.md) > [mapFilters](./x-adapter-platform.mapfilters.md)
|
|
4
|
+
|
|
5
|
+
## mapFilters() function
|
|
6
|
+
|
|
7
|
+
Converts the filters to the shape the Platform's API is expecting.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export declare function mapFilters(filters?: Record<string, Filter[]>): string[];
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| filters | Record<string, Filter\[\]> | _(Optional)_ The filters from our internal request. |
|
|
20
|
+
|
|
21
|
+
**Returns:**
|
|
22
|
+
|
|
23
|
+
string\[\]
|
|
24
|
+
|
|
25
|
+
The filters ready to be consumed for the API.
|
|
26
|
+
|
|
27
|
+
## Example
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
const filters = {
|
|
32
|
+
offer: [
|
|
33
|
+
{
|
|
34
|
+
facetId: 'offer',
|
|
35
|
+
modelName: 'SimpleFilter',
|
|
36
|
+
id: 'price:[0 TO 10]',
|
|
37
|
+
selected: true,
|
|
38
|
+
label: 'In Offer'
|
|
39
|
+
} as SimpleFilter
|
|
40
|
+
],
|
|
41
|
+
categoryPaths: [
|
|
42
|
+
{
|
|
43
|
+
facetId: 'categoryPaths',
|
|
44
|
+
id: 'categoryIds:ffc61e1e9__be257cb26',
|
|
45
|
+
label: 'Fragrance',
|
|
46
|
+
modelName: 'HierarchicalFilter',
|
|
47
|
+
parentId: 'categoryIds:ffc61e1e9',
|
|
48
|
+
selected: true,
|
|
49
|
+
totalResults: 1
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
facetId: 'categoryPaths',
|
|
53
|
+
id: 'categoryIds:ffc61e1e9__fa5ef54f2',
|
|
54
|
+
label: 'Fragrance',
|
|
55
|
+
modelName: 'HierarchicalFilter',
|
|
56
|
+
parentId: 'categoryIds:ffc61e1e9',
|
|
57
|
+
selected: true,
|
|
58
|
+
totalResults: 1
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
children: ['categoryIds:ffc61e1e9__be257cb26', 'categoryIds:ffc61e1e9__fa5ef54f2'],
|
|
62
|
+
facetId: 'categoryPaths',
|
|
63
|
+
id: 'categoryIds:ffc61e1e9',
|
|
64
|
+
label: 'Personal Care',
|
|
65
|
+
modelName: 'HierarchicalFilter',
|
|
66
|
+
parentId: null,
|
|
67
|
+
selected: true,
|
|
68
|
+
totalResults: 1
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const mappedFilters = mapFilters({ filters });
|
|
74
|
+
mappedFilters is [
|
|
75
|
+
'price:[0 TO 10]',
|
|
76
|
+
'categoryIds:ffc61e1e9__be257cb26',
|
|
77
|
+
'categoryIds:ffc61e1e9__fa5ef54f2'
|
|
78
|
+
];
|
|
79
|
+
```
|
|
80
|
+
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
| [getDisplayTaggingInfoFromUrl(displayTaggingUrl)](./x-adapter-platform.getdisplaytagginginfofromurl.md) | Generates the displayClick tagging info. |
|
|
13
13
|
| [getFacetConfig(type)](./x-adapter-platform.getfacetconfig.md) | Returns the facet's config. |
|
|
14
14
|
| [getTaggingInfoFromUrl(taggingUrl)](./x-adapter-platform.gettagginginfofromurl.md) | Extracts the tagging info from a URL. |
|
|
15
|
+
| [mapFilters(filters)](./x-adapter-platform.mapfilters.md) | Converts the filters to the shape the Platform's API is expecting. |
|
|
15
16
|
|
|
16
17
|
## Interfaces
|
|
17
18
|
|
|
@@ -24,6 +24,7 @@ export interface AiMutations extends ConfigMutations<AiState>, QueryMutations
|
|
|
24
24
|
| [setParams](./x-components.aimutations.setparams.md) | | (params: Dictionary<unknown>) => void | Sets the extra params of the module. |
|
|
25
25
|
| [setQueries](./x-components.aimutations.setqueries.md) | | (queries: AiSuggestionQuery\[\]) => void | Sets the queries from the streamed response. |
|
|
26
26
|
| [setResponseText](./x-components.aimutations.setresponsetext.md) | | (responseText: string) => void | Sets the responseText from the streamed response. |
|
|
27
|
+
| [setSelectedFilters](./x-components.aimutations.setselectedfilters.md) | | (selectedFilters: Filter\[\]) => void | Sets the selected filters of the module. |
|
|
27
28
|
| [setSuggestionsLoading](./x-components.aimutations.setsuggestionsloading.md) | | (value: boolean) => void | Sets the loading for the suggestions response. |
|
|
28
29
|
| [setSuggestionsSearch](./x-components.aimutations.setsuggestionssearch.md) | | (suggestionsSearch: AiSuggestionSearch\[\]) => void | Sets the suggestions search from the suggestions search response. |
|
|
29
30
|
| [setSuggestionsSearchLoading](./x-components.aimutations.setsuggestionssearchloading.md) | | (value: boolean) => void | Sets the loading fot the suggestions search response. |
|
|
@@ -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) > [AiMutations](./x-components.aimutations.md) > [setSelectedFilters](./x-components.aimutations.setselectedfilters.md)
|
|
4
|
+
|
|
5
|
+
## AiMutations.setSelectedFilters property
|
|
6
|
+
|
|
7
|
+
Sets the selected filters of the module.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
setSelectedFilters: (selectedFilters: Filter[]) => void;
|
|
13
|
+
```
|
|
@@ -24,6 +24,7 @@ export interface AiState extends QueryState
|
|
|
24
24
|
| [queries](./x-components.aistate.queries.md) | | AiSuggestionQuery\[\] | |
|
|
25
25
|
| [relatedTags](./x-components.aistate.relatedtags.md) | | RelatedTag\[\] | The list of the related tags, related to the <code>query</code> property of the state. |
|
|
26
26
|
| [responseText](./x-components.aistate.responsetext.md) | | string | The streamed field from suggestion response. |
|
|
27
|
+
| [selectedFilters](./x-components.aistate.selectedfilters.md) | | Dictionary<Filter\[\]> | The dictionary of selected filters, used to perform the AI requests. The key is the facet ID, and the value the list of filters for that facet. |
|
|
27
28
|
| [suggestionsLoading](./x-components.aistate.suggestionsloading.md) | | boolean | Loading state for the suggestions response |
|
|
28
29
|
| [suggestionsSearch](./x-components.aistate.suggestionssearch.md) | | AiSuggestionSearch\[\] | The results per query retrieved by the suggestion search endpoint |
|
|
29
30
|
| [suggestionsSearchLoading](./x-components.aistate.suggestionssearchloading.md) | | boolean | Loading state for the suggestions search response |
|
|
@@ -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) > [AiState](./x-components.aistate.md) > [selectedFilters](./x-components.aistate.selectedfilters.md)
|
|
4
|
+
|
|
5
|
+
## AiState.selectedFilters property
|
|
6
|
+
|
|
7
|
+
The dictionary of selected filters, used to perform the AI requests. The key is the facet ID, and the value the list of filters for that facet.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
selectedFilters: Dictionary<Filter[]>;
|
|
13
|
+
```
|
|
@@ -9,9 +9,9 @@ Request for the ai suggestions endpoint.
|
|
|
9
9
|
**Signature:**
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
|
-
export interface AiSuggestionsRequest extends ExtraParamsRequest, TrackableRequest
|
|
12
|
+
export interface AiSuggestionsRequest extends ExtraParamsRequest, TrackableRequest, FilterableRequest
|
|
13
13
|
```
|
|
14
|
-
**Extends:** [ExtraParamsRequest](./x-types.extraparamsrequest.md)<!-- -->, [TrackableRequest](./x-types.trackablerequest.md)
|
|
14
|
+
**Extends:** [ExtraParamsRequest](./x-types.extraparamsrequest.md)<!-- -->, [TrackableRequest](./x-types.trackablerequest.md)<!-- -->, [FilterableRequest](./x-types.filterablerequest.md)
|
|
15
15
|
|
|
16
16
|
## Properties
|
|
17
17
|
|
|
@@ -9,9 +9,9 @@ Request for the suggestions-search endpoint.
|
|
|
9
9
|
**Signature:**
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
|
-
export interface AiSuggestionsSearchRequest extends ExtraParamsRequest, TrackableRequest
|
|
12
|
+
export interface AiSuggestionsSearchRequest extends ExtraParamsRequest, TrackableRequest, FilterableRequest
|
|
13
13
|
```
|
|
14
|
-
**Extends:** [ExtraParamsRequest](./x-types.extraparamsrequest.md)<!-- -->, [TrackableRequest](./x-types.trackablerequest.md)
|
|
14
|
+
**Extends:** [ExtraParamsRequest](./x-types.extraparamsrequest.md)<!-- -->, [TrackableRequest](./x-types.trackablerequest.md)<!-- -->, [FilterableRequest](./x-types.filterablerequest.md)
|
|
15
15
|
|
|
16
16
|
## Properties
|
|
17
17
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-overview.vue.js","sources":["../../../../../src/x-modules/ai/components/ai-overview.vue"],"sourcesContent":["<template>\n <CollapseHeight>\n <div\n v-if=\"!isNoResults\"\n ref=\"aiOverviewRef\"\n class=\"x-ai-overview\"\n data-test=\"ai-overview-wrapper\"\n >\n <div class=\"x-ai-overview-main\">\n <Fade mode=\"out-in\">\n <span\n v-if=\"suggestionsLoading\"\n class=\"x-ai-overview-title-loading\"\n data-test=\"ai-overview-title-loading\"\n >\n <span class=\"x-ai-overview-title-loading-indicator\" />\n <span\n class=\"x-ai-overview-title-loading-text\"\n data-test=\"ai-overview-title-loading-text\"\n >\n <slot name=\"title-loading\">\n {{ titleLoading }}\n </slot>\n </span>\n </span>\n <DisplayEmitter\n v-else\n :payload=\"tagging?.toolingDisplay ?? emptyTaggingRequest\"\n :event-metadata=\"{\n feature: 'overview',\n displayOriginalQuery: query || 'overview-without-query',\n replaceable: false,\n }\"\n data-test=\"ai-overview-display-emitter\"\n >\n <span class=\"x-ai-overview-title\" data-test=\"ai-overview-title\">\n <AIStarIcon class=\"x-ai-overview-title-icon\" />{{ !!title ? title : suggestionText }}\n </span>\n </DisplayEmitter>\n </Fade>\n <ChangeHeight>\n <div class=\"x-ai-overview-content\" data-test=\"ai-overview-content\">\n <span v-if=\"title\">{{ suggestionText }}</span>\n <p>{{ responseText }}</p>\n </div>\n </ChangeHeight>\n </div>\n <CollapseHeight\n :style=\"{\n '--x-collapse-height-transition-duration': `${300 * suggestionsSearch.length}ms`,\n }\"\n data-test=\"ai-overview-collapse-height-suggestions\"\n >\n <div v-show=\"expanded\">\n <SpinnerIcon\n v-if=\"!suggestionsSearch.length\"\n class=\"x-ai-overview-suggestions-loading\"\n data-test=\"ai-overview-suggestions-loading\"\n />\n <div\n v-else\n class=\"x-ai-overview-suggestions\"\n data-test=\"ai-overview-suggestions-container\"\n >\n <DisplayEmitter\n v-for=\"(\n { query: suggestionQuery, results: queriesResults, tagging: suggestionTagging },\n suggestionIndex\n ) in suggestionsSearch\"\n :key=\"suggestionQuery\"\n :payload=\"\n tagging?.searchQueries[suggestionQuery].toolingDisplay ?? emptyTaggingRequest\n \"\n :event-metadata=\"{\n feature: 'overview',\n displayOriginalQuery: query || 'overview-without-query',\n replaceable: false,\n }\"\n data-test=\"ai-overview-query-display-emitter\"\n >\n <div\n class=\"x-ai-overview-suggestion\"\n data-test=\"ai-overview-suggestion\"\n :class=\"{\n 'x-ai-overview-result-animation': shouldAnimateSuggestion,\n }\"\n :style=\"{ animationDelay: `${suggestionIndex * 300}ms` }\"\n >\n <BaseEventButton\n class=\"x-ai-overview-suggestion-query-btn\"\n :events=\"{ UserAcceptedAQuery: suggestionQuery }\"\n >\n {{ suggestionQuery }}\n <ArrowRightIcon class=\"x-ai-overview-suggestion-query-btn-icon\" />\n </BaseEventButton>\n\n <DisplayClickProvider\n :query-tagging=\"suggestionTagging.query\"\n :tooling-display-tagging=\"\n tagging?.searchQueries[suggestionQuery].toolingDisplayClick\n \"\n :tooling-add2-cart-tagging=\"\n tagging?.searchQueries[suggestionQuery].toolingDisplayAdd2Cart\n \"\n result-feature=\"overview\"\n >\n <slot name=\"sliding-panel\" :results=\"queriesResults\">\n <SlidingPanel\n :class=\"slidingPanelsClasses\"\n :scroll-container-class=\"slidingPanelContainersClasses\"\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-overview-suggestion-results\">\n <li\n v-for=\"(result, resultIndex) in queriesResults\"\n :key=\"result.id\"\n data-test=\"ai-overview-suggestion-result\"\n :class=\"{\n 'x-ai-overview-result-animation': shouldAnimateSuggestion,\n }\"\n :style=\"{\n animationDelay: `${suggestionIndex * 300 + resultIndex * 300}ms`,\n }\"\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 </div>\n </div>\n </CollapseHeight>\n\n <Fade>\n <div\n v-if=\"queries.length\"\n class=\"x-cursor-pointer\"\n data-test=\"ai-overview-toggle-button-wrapper\"\n @click=\"onExpandButtonClick(!expanded)\"\n >\n <div v-show=\"!expanded\" class=\"x-ai-overview-gradient\" data-test=\"ai-overview-gradient\" />\n <div class=\"x-ai-overview-toggle-wrapper\">\n <button\n class=\"x-ai-overview-toggle-btn\"\n data-test=\"ai-overview-toggle-button\"\n @click.stop=\"onExpandButtonClick(!expanded)\"\n >\n {{ buttonText }}\n <ChevronDownIcon\n class=\"x-ai-overview-toggle-btn-icon\"\n :class=\"{ 'x-ai-overview-toggle-btn-icon-expanded': expanded }\"\n />\n </button>\n </div>\n </div>\n </Fade>\n </div>\n </CollapseHeight>\n</template>\n\n<script lang=\"ts\">\nimport type { TaggingRequest } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport { computed, defineComponent, onMounted, ref, watch } from 'vue'\nimport {\n AIStarIcon,\n ArrowRightIcon,\n BaseEventButton,\n ChangeHeight,\n ChevronDownIcon,\n CollapseHeight,\n DisplayClickProvider,\n Fade,\n SlidingPanel,\n SpinnerIcon,\n} from '../../../components'\nimport DisplayEmitter from '../../../components/display-emitter.vue'\nimport { use$x, useGetter, useState } from '../../../composables'\nimport { typing } from '../../../directives'\nimport { aiXModule } from '../x-module'\n\nexport default defineComponent({\n directives: {\n typing,\n },\n xModule: aiXModule.name,\n components: {\n AIStarIcon,\n ArrowRightIcon,\n BaseEventButton,\n ChevronDownIcon,\n CollapseHeight,\n ChangeHeight,\n Fade,\n SlidingPanel,\n SpinnerIcon,\n DisplayEmitter,\n DisplayClickProvider,\n },\n props: {\n /**\n * The text displayed when the question ended loading\n *\n * @public\n */\n title: {\n type: String as PropType<string>,\n },\n /**\n * The text displayed when the question is loading.\n *\n * @public\n */\n titleLoading: {\n type: String as PropType<string>,\n default: 'Generating with Empathy AI',\n },\n /**\n * The text displayed on the toggle button when collapsed.\n *\n * @public\n */\n expandText: {\n type: String as PropType<string>,\n default: 'Show more',\n },\n /**\n * The text displayed on the toggle button when expanded.\n *\n * @public\n */\n collapseText: {\n type: String as PropType<string>,\n default: 'Show less',\n },\n\n /**\n * The classes added to each sliding panel for each query.\n *\n * @public\n */\n slidingPanelsClasses: {\n type: String as PropType<string>,\n },\n /**\n * The classes added to each sliding panel container of each query.\n *\n * @public\n */\n slidingPanelContainersClasses: {\n type: String as PropType<string>,\n },\n /**\n * The classes added to each sliding panel buttons of each query.\n *\n * @public\n */\n slidingPanelButtonsClasses: {\n type: String as PropType<string>,\n },\n },\n setup(props) {\n const $x = use$x()\n const { query } = useGetter('ai')\n const {\n suggestionText,\n responseText,\n suggestionsSearch,\n suggestionsLoading,\n tagging,\n isNoResults,\n queries,\n } = useState('ai')\n\n const emptyTaggingRequest: TaggingRequest = { url: '', params: {} }\n\n const aiOverviewRef = ref<HTMLDivElement | null>(null)\n const expanded = ref(false)\n const shouldAnimateSuggestion = ref(true)\n\n const buttonText = computed(() => (expanded.value ? props.collapseText : props.expandText))\n\n function onExpandButtonClick(newValue: boolean) {\n $x.emit('UserClickedAiOverviewExpandButton', expanded.value, {\n suggestionText: suggestionText.value,\n toolingDisplayClick: tagging.value?.toolingDisplayClick,\n })\n setExpanded(newValue)\n }\n\n function setExpanded(newValue: boolean) {\n expanded.value = newValue\n if (!expanded.value) {\n aiOverviewRef.value?.scrollIntoView({ behavior: 'smooth' })\n shouldAnimateSuggestion.value = false\n }\n }\n\n watch(query, () => {\n expanded.value = false\n shouldAnimateSuggestion.value = true\n })\n\n onMounted(() => {\n $x.emit('AiOverviewMounted', undefined, { feature: 'overview' })\n })\n\n return {\n aiOverviewRef,\n buttonText,\n emptyTaggingRequest,\n expanded,\n responseText,\n suggestionsLoading,\n suggestionsSearch,\n suggestionText,\n setExpanded,\n onExpandButtonClick,\n shouldAnimateSuggestion,\n query,\n tagging,\n isNoResults,\n queries,\n }\n },\n})\n</script>\n\n<style lang=\"css\">\n.x-ai-overview {\n --color: var(--x-ai-overview-color, #bbc9cf);\n --color-lighter: var(--x-ai-overview-color-lighter, color-mix(in srgb, var(--color) 25%, white));\n\n position: relative;\n border-radius: 1.5rem;\n background-color: var(--color-lighter);\n}\n\n.x-ai-overview-main {\n padding: 1rem;\n}\n\n.x-ai-overview-title {\n display: flex;\n font-size: 0.875rem;\n font-weight: 700;\n gap: 0.25rem;\n align-items: center;\n margin-bottom: 0.5rem;\n}\n\n.x-ai-overview-title-loading {\n display: flex;\n align-items: center;\n gap: 0.375rem;\n margin-bottom: 0.5rem;\n}\n\n.x-ai-overview-title-loading-indicator {\n width: 0.75rem;\n height: 0.75rem;\n animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n border-radius: 9999px;\n background-color: var(--color);\n}\n\n.x-ai-overview-title-loading-text {\n animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n font-size: 0.75rem;\n}\n\n.x-ai-overview-title-icon {\n height: 1rem;\n aspect-ratio: 1 / 1;\n color: var(--color);\n flex-shrink: 0;\n}\n\n.x-ai-overview-content {\n display: flex;\n flex-direction: column;\n text-align: left;\n line-height: 1.25rem;\n gap: 0.5rem;\n}\n\n.x-ai-overview-content span {\n font-weight: 500;\n}\n\n.x-ai-overview-gradient {\n border-radius: 1.5rem;\n cursor: pointer;\n content: none;\n position: absolute;\n width: 100%;\n height: 100%;\n bottom: 0;\n background-image: linear-gradient(to bottom, transparent 0%, var(--color-lighter) 100%);\n}\n\n.x-ai-overview-toggle-wrapper {\n display: flex;\n position: relative;\n}\n\n.x-ai-overview-toggle-btn {\n border-color: var(--button-color-50, #283034);\n background-color: #ffffff;\n color: var(--button-color-50, #283034);\n border-radius: 9999px;\n width: 100%;\n margin: auto;\n padding-right: 1rem;\n padding-left: 1rem;\n display: flex;\n justify-content: center;\n align-items: center;\n border-style: solid;\n border-width: 1px;\n font-weight: 700;\n min-height: 2.5rem;\n gap: 0.5rem;\n font-size: 0.875rem;\n}\n\n.x-ai-overview-toggle-btn:hover {\n border-color: var(--button-color-50, #283034);\n background-color: var(--button-color-50, #283034);\n color: #ffffff;\n}\n\n@media (min-width: 640px) {\n .x-ai-overview-toggle-btn {\n transition-property: all;\n transition-duration: 500ms;\n transform: translateY(50%);\n width: var(--expand-button-width, 200px);\n }\n}\n\n.x-ai-overview-toggle-btn-icon {\n transform: rotate(0deg);\n height: 1rem;\n aspect-ratio: 1 / 1;\n transition-property: all;\n transition-duration: 300ms;\n}\n\n.x-ai-overview-toggle-btn-icon-expanded {\n transform: rotate(180deg);\n}\n\n.x-ai-overview-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}\n\n.x-ai-overview-suggestion-query-btn-icon {\n height: 1rem;\n aspect-ratio: 1 / 1;\n}\n\n.x-ai-overview-suggestions {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n padding-bottom: 1rem;\n}\n\n.x-ai-overview-suggestions-loading {\n width: 2.5rem;\n height: 2.5rem;\n margin: auto;\n animation: x-spin 1s linear infinite;\n}\n\n.x-ai-overview-suggestion {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n}\n\n.x-ai-overview-suggestion-results {\n display: flex;\n gap: 1rem;\n padding-left: 1rem;\n padding-right: 1rem;\n}\n\n@keyframes x-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n@keyframes pulse {\n 50% {\n opacity: 0.5;\n }\n}\n</style>\n"],"names":["_createElementVNode","_createBlock","_openBlock","_createElementBlock","_createVNode","_renderSlot","_createTextVNode","_toDisplayString","_withCtx","_createCommentVNode","_normalizeStyle","_withDirectives","_Fragment","_renderList","_normalizeClass","_vShow","_withModifiers"],"mappings":";;;;;;AAAA,EAAA,GAAA,EAAA,CAAA;AAAA,EAIM,GAAI,EAAA,eAAA;AAAA,EACJ,KAAM,EAAA,eAAA;AAAA,EACN,WAAU,EAAA,qBAAA;;AAEL,MAAA,UAAA,GAAA,EAAA,KAAA,EAAM,oBAAoB,EAAA,CAAA;;AARrC,EAAA,GAAA,EAAA,CAAA;AAAA,EAYY,KAAM,EAAA,6BAAA;AAAA,EACN,WAAU,EAAA,2BAAA;;AAEV,MAAA,UAAA,mBAAAA,kBAAA;AAAA,EAAsD,MAAA;AAAA,EAAA,EAAhD,OAAM,uCAAuC,EAAA;AAAA,EAAA,IAAA;AAAA,EAAA,CAAA,CAAA;AAAA;AAAA,CAAA,CAAA;;EAEjD,KAAM,EAAA,kCAAA;AAAA,EACN,WAAU,EAAA,gCAAA;;;EAiBN,KAAM,EAAA,qBAAA;AAAA,EAAsB,WAAU,EAAA,mBAAA;;;EAMzC,KAAM,EAAA,uBAAA;AAAA,EAAwB,WAAU,EAAA,qBAAA;;AAzCvD,MAAA,UAAA,GAAA,EAAA,GAAA,EAAA,CAAA,EAAA,CAAA;;AAAA,EAAA,GAAA,EAAA,CAAA;AAAA,EA6DY,KAAM,EAAA,2BAAA;AAAA,EACN,WAAU,EAAA,mCAAA;;AA4DI,MAAA,WAAA,GAAA,EAAA,KAAA,EAAM,kCAAkC,EAAA,CAAA;;EAgChC,KAAM,EAAA,wBAAA;AAAA,EAAyB,WAAU,EAAA,sBAAA;;AAC5D,MAAA,WAAA,GAAA,EAAA,KAAA,EAAM,8BAA8B,EAAA,CAAA;;;;;;;;;;;;;sBA1JjDC,WA0KiB,CAAA,yBAAA,EAAA,IAAA,E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,CAAA,CAAA,CAAA,GA/JpBgB,aA+J2B,CAAA,CAAA,MAAA,KAAA,IAAA,CAAA,mBAAA,CAAmB,CAAE,IAAQ,CAAA,QAAA,CAAA,EAAA,CAAA,MAAA,CAAA,CAAA,CAAA;AAAA,mBAAA,EAAA;AA/JxD,oBAAAV,eAAA;AAAA,sBAAAC,eAAA,CAiKiB,eAAU,CAAG,GAAA,GAAA;AAAA,sBAChB,CAAA;AAAA;AAAA,qBAAA;AAAA,oBAGEH,WAAA,CAAA,0BAAA,EAAA;AAAA,sBAFA,KAnKhB,EAAAU,cAAA,CAAA,CAmKsB,+BAA+B,EAAA,EAAA,wCAAA,EACe,IAAQ,CAAA,QAAA,EAAA,CAAA,CAAA;AAAA,qBAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,OAAA,CAAA,CAAA;;;AApK5E,eAAA,CAAA,IAAAL,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA;AAAA,aAAA,CAAA;AAAA,YAAA,CAAA,EAAA,CAAA;AAAA;AAAA,WAAA,CAAA;;;;AAAA,OAAA,IAAAA,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA;AAAA,KAAA,CAAA;AAAA,IAAA,CAAA,EAAA,CAAA;AAAA;AAAA,GAAA,CAAA,CAAA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"ai-overview.vue.js","sources":["../../../../../src/x-modules/ai/components/ai-overview.vue"],"sourcesContent":["<template>\n <CollapseHeight>\n <div\n v-if=\"!isNoResults\"\n ref=\"aiOverviewRef\"\n class=\"x-ai-overview\"\n data-test=\"ai-overview-wrapper\"\n >\n <div class=\"x-ai-overview-main\">\n <Fade mode=\"out-in\">\n <span\n v-if=\"suggestionsLoading\"\n class=\"x-ai-overview-title-loading\"\n data-test=\"ai-overview-title-loading\"\n >\n <span class=\"x-ai-overview-title-loading-indicator\" />\n <span\n class=\"x-ai-overview-title-loading-text\"\n data-test=\"ai-overview-title-loading-text\"\n >\n <slot name=\"title-loading\">\n {{ titleLoading }}\n </slot>\n </span>\n </span>\n <DisplayEmitter\n v-else\n :payload=\"tagging?.toolingDisplay ?? emptyTaggingRequest\"\n :event-metadata=\"{\n feature: 'overview',\n displayOriginalQuery: query || 'overview-without-query',\n replaceable: false,\n }\"\n data-test=\"ai-overview-display-emitter\"\n >\n <span class=\"x-ai-overview-title\" data-test=\"ai-overview-title\">\n <AIStarIcon class=\"x-ai-overview-title-icon\" />{{ !!title ? title : suggestionText }}\n </span>\n </DisplayEmitter>\n </Fade>\n <ChangeHeight>\n <div class=\"x-ai-overview-content\" data-test=\"ai-overview-content\">\n <span v-if=\"title\">{{ suggestionText }}</span>\n <p>{{ responseText }}</p>\n </div>\n </ChangeHeight>\n </div>\n <CollapseHeight\n :style=\"{\n '--x-collapse-height-transition-duration': `${300 * suggestionsSearch.length}ms`,\n }\"\n data-test=\"ai-overview-collapse-height-suggestions\"\n >\n <div v-show=\"expanded\">\n <SpinnerIcon\n v-if=\"!suggestionsSearch.length\"\n class=\"x-ai-overview-suggestions-loading\"\n data-test=\"ai-overview-suggestions-loading\"\n />\n <div\n v-else\n class=\"x-ai-overview-suggestions\"\n data-test=\"ai-overview-suggestions-container\"\n >\n <DisplayEmitter\n v-for=\"(\n { query: suggestionQuery, results: queriesResults, tagging: suggestionTagging },\n suggestionIndex\n ) in suggestionsSearch\"\n :key=\"suggestionQuery\"\n :payload=\"\n tagging?.searchQueries[suggestionQuery].toolingDisplay ?? emptyTaggingRequest\n \"\n :event-metadata=\"{\n feature: 'overview',\n displayOriginalQuery: query || 'overview-without-query',\n replaceable: false,\n }\"\n data-test=\"ai-overview-query-display-emitter\"\n >\n <div\n class=\"x-ai-overview-suggestion\"\n data-test=\"ai-overview-suggestion\"\n :class=\"{\n 'x-ai-overview-result-animation': shouldAnimateSuggestion,\n }\"\n :style=\"{ animationDelay: `${suggestionIndex * 300}ms` }\"\n >\n <BaseEventButton\n class=\"x-ai-overview-suggestion-query-btn\"\n :events=\"{ UserAcceptedAQuery: suggestionQuery }\"\n >\n {{ suggestionQuery }}\n <ArrowRightIcon class=\"x-ai-overview-suggestion-query-btn-icon\" />\n </BaseEventButton>\n\n <DisplayClickProvider\n :query-tagging=\"suggestionTagging.query\"\n :tooling-display-tagging=\"\n tagging?.searchQueries[suggestionQuery].toolingDisplayClick\n \"\n :tooling-add2-cart-tagging=\"\n tagging?.searchQueries[suggestionQuery].toolingDisplayAdd2Cart\n \"\n result-feature=\"overview\"\n >\n <slot name=\"sliding-panel\" :results=\"queriesResults\">\n <SlidingPanel\n :class=\"slidingPanelsClasses\"\n :scroll-container-class=\"slidingPanelContainersClasses\"\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-overview-suggestion-results\">\n <li\n v-for=\"(result, resultIndex) in queriesResults\"\n :key=\"result.id\"\n data-test=\"ai-overview-suggestion-result\"\n :class=\"{\n 'x-ai-overview-result-animation': shouldAnimateSuggestion,\n }\"\n :style=\"{\n animationDelay: `${suggestionIndex * 300 + resultIndex * 300}ms`,\n }\"\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 </div>\n </CollapseHeight>\n\n <Fade>\n <div\n v-if=\"queries.length\"\n class=\"x-cursor-pointer\"\n data-test=\"ai-overview-toggle-button-wrapper\"\n @click=\"onExpandButtonClick(!expanded)\"\n >\n <div v-show=\"!expanded\" class=\"x-ai-overview-gradient\" data-test=\"ai-overview-gradient\" />\n <div class=\"x-ai-overview-toggle-wrapper\">\n <button\n class=\"x-ai-overview-toggle-btn\"\n data-test=\"ai-overview-toggle-button\"\n @click.stop=\"onExpandButtonClick(!expanded)\"\n >\n {{ buttonText }}\n <ChevronDownIcon\n class=\"x-ai-overview-toggle-btn-icon\"\n :class=\"{ 'x-ai-overview-toggle-btn-icon-expanded': expanded }\"\n />\n </button>\n </div>\n </div>\n </Fade>\n </div>\n </CollapseHeight>\n</template>\n\n<script lang=\"ts\">\nimport type { TaggingRequest } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport { computed, defineComponent, onMounted, ref, watch } from 'vue'\nimport {\n AIStarIcon,\n ArrowRightIcon,\n BaseEventButton,\n ChangeHeight,\n ChevronDownIcon,\n CollapseHeight,\n DisplayClickProvider,\n Fade,\n SlidingPanel,\n SpinnerIcon,\n} from '../../../components'\nimport DisplayEmitter from '../../../components/display-emitter.vue'\nimport { use$x, useGetter, useState } from '../../../composables'\nimport { typing } from '../../../directives'\nimport { aiXModule } from '../x-module'\n\nexport default defineComponent({\n directives: {\n typing,\n },\n xModule: aiXModule.name,\n components: {\n AIStarIcon,\n ArrowRightIcon,\n BaseEventButton,\n ChevronDownIcon,\n CollapseHeight,\n ChangeHeight,\n Fade,\n SlidingPanel,\n SpinnerIcon,\n DisplayEmitter,\n DisplayClickProvider,\n },\n props: {\n /**\n * The text displayed when the question ended loading\n *\n * @public\n */\n title: {\n type: String as PropType<string>,\n },\n /**\n * The text displayed when the question is loading.\n *\n * @public\n */\n titleLoading: {\n type: String as PropType<string>,\n default: 'Generating with Empathy AI',\n },\n /**\n * The text displayed on the toggle button when collapsed.\n *\n * @public\n */\n expandText: {\n type: String as PropType<string>,\n default: 'Show more',\n },\n /**\n * The text displayed on the toggle button when expanded.\n *\n * @public\n */\n collapseText: {\n type: String as PropType<string>,\n default: 'Show less',\n },\n\n /**\n * The classes added to each sliding panel for each query.\n *\n * @public\n */\n slidingPanelsClasses: {\n type: String as PropType<string>,\n },\n /**\n * The classes added to each sliding panel container of each query.\n *\n * @public\n */\n slidingPanelContainersClasses: {\n type: String as PropType<string>,\n },\n /**\n * The classes added to each sliding panel buttons of each query.\n *\n * @public\n */\n slidingPanelButtonsClasses: {\n type: String as PropType<string>,\n },\n },\n setup(props) {\n const $x = use$x()\n const { query } = useGetter('ai')\n const {\n suggestionText,\n responseText,\n suggestionsSearch,\n suggestionsLoading,\n tagging,\n isNoResults,\n queries,\n } = useState('ai')\n\n const emptyTaggingRequest: TaggingRequest = { url: '', params: {} }\n\n const aiOverviewRef = ref<HTMLDivElement | null>(null)\n const expanded = ref(false)\n const shouldAnimateSuggestion = ref(true)\n\n const buttonText = computed(() => (expanded.value ? props.collapseText : props.expandText))\n\n function onExpandButtonClick(newValue: boolean) {\n $x.emit('UserClickedAiOverviewExpandButton', expanded.value, {\n suggestionText: suggestionText.value,\n toolingDisplayClick: tagging.value?.toolingDisplayClick,\n })\n setExpanded(newValue)\n }\n\n function setExpanded(newValue: boolean) {\n expanded.value = newValue\n if (!expanded.value) {\n aiOverviewRef.value?.scrollIntoView({ behavior: 'smooth' })\n shouldAnimateSuggestion.value = false\n }\n }\n\n watch(query, () => {\n expanded.value = false\n shouldAnimateSuggestion.value = true\n })\n\n onMounted(() => {\n $x.emit('AiOverviewMounted', undefined, { feature: 'overview' })\n })\n\n return {\n aiOverviewRef,\n buttonText,\n emptyTaggingRequest,\n expanded,\n responseText,\n suggestionsLoading,\n suggestionsSearch,\n suggestionText,\n setExpanded,\n onExpandButtonClick,\n shouldAnimateSuggestion,\n query,\n tagging,\n isNoResults,\n queries,\n }\n },\n})\n</script>\n\n<style lang=\"css\">\n.x-ai-overview {\n --color: var(--x-ai-overview-color, #bbc9cf);\n --color-lighter: var(--x-ai-overview-color-lighter, color-mix(in srgb, var(--color) 25%, white));\n\n position: relative;\n border-radius: 1.5rem;\n background-color: var(--color-lighter);\n}\n\n.x-ai-overview-main {\n padding: 1rem;\n}\n\n.x-ai-overview-title {\n display: flex;\n font-size: 0.875rem;\n font-weight: 700;\n gap: 0.25rem;\n align-items: center;\n margin-bottom: 0.5rem;\n}\n\n.x-ai-overview-title-loading {\n display: flex;\n align-items: center;\n gap: 0.375rem;\n margin-bottom: 0.5rem;\n}\n\n.x-ai-overview-title-loading-indicator {\n width: 0.75rem;\n height: 0.75rem;\n animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n border-radius: 9999px;\n background-color: var(--color);\n}\n\n.x-ai-overview-title-loading-text {\n animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n font-size: 0.75rem;\n}\n\n.x-ai-overview-title-icon {\n height: 1rem;\n aspect-ratio: 1 / 1;\n color: var(--color);\n flex-shrink: 0;\n}\n\n.x-ai-overview-content {\n display: flex;\n flex-direction: column;\n text-align: left;\n line-height: 1.25rem;\n gap: 0.5rem;\n}\n\n.x-ai-overview-content span {\n font-weight: 500;\n}\n\n.x-ai-overview-gradient {\n border-radius: 1.5rem;\n cursor: pointer;\n content: none;\n position: absolute;\n width: 100%;\n height: 100%;\n bottom: 0;\n background-image: linear-gradient(to bottom, transparent 0%, var(--color-lighter) 100%);\n}\n\n.x-ai-overview-toggle-wrapper {\n display: flex;\n position: relative;\n}\n\n.x-ai-overview-toggle-btn {\n border-color: var(--button-color-50, #283034);\n background-color: #ffffff;\n color: var(--button-color-50, #283034);\n border-radius: 9999px;\n width: 100%;\n margin: auto;\n padding-right: 1rem;\n padding-left: 1rem;\n display: flex;\n justify-content: center;\n align-items: center;\n border-style: solid;\n border-width: 1px;\n font-weight: 700;\n min-height: 2.5rem;\n gap: 0.5rem;\n font-size: 0.875rem;\n}\n\n.x-ai-overview-toggle-btn:hover {\n border-color: var(--button-color-50, #283034);\n background-color: var(--button-color-50, #283034);\n color: #ffffff;\n}\n\n@media (min-width: 640px) {\n .x-ai-overview-toggle-btn {\n transition-property: all;\n transition-duration: 500ms;\n transform: translateY(50%);\n width: var(--expand-button-width, 200px);\n }\n}\n\n.x-ai-overview-toggle-btn-icon {\n transform: rotate(0deg);\n height: 1rem;\n aspect-ratio: 1 / 1;\n transition-property: all;\n transition-duration: 300ms;\n}\n\n.x-ai-overview-toggle-btn-icon-expanded {\n transform: rotate(180deg);\n}\n\n.x-ai-overview-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}\n\n.x-ai-overview-suggestion-query-btn-icon {\n height: 1rem;\n aspect-ratio: 1 / 1;\n}\n\n.x-ai-overview-suggestions {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n padding-bottom: 1rem;\n}\n\n.x-ai-overview-suggestions-loading {\n width: 2.5rem;\n height: 2.5rem;\n margin: auto;\n animation: x-spin 1s linear infinite;\n}\n\n.x-ai-overview-suggestion {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n}\n\n.x-ai-overview-suggestion-results {\n display: flex;\n gap: 1rem;\n padding-left: 1rem;\n padding-right: 1rem;\n}\n\n@keyframes x-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n@keyframes pulse {\n 50% {\n opacity: 0.5;\n }\n}\n</style>\n"],"names":["_createElementVNode","_createBlock","_openBlock","_createElementBlock","_createVNode","_renderSlot","_createTextVNode","_toDisplayString","_withCtx","_createCommentVNode","_normalizeStyle","_withDirectives","_Fragment","_renderList","_normalizeClass","_vShow","_withModifiers"],"mappings":";;;;;;AAAA,EAAA,GAAA,EAAA,CAAA;AAAA,EAIM,GAAI,EAAA,eAAA;AAAA,EACJ,KAAM,EAAA,eAAA;AAAA,EACN,WAAU,EAAA,qBAAA;;AAEL,MAAA,UAAA,GAAA,EAAA,KAAA,EAAM,oBAAoB,EAAA,CAAA;;AARrC,EAAA,GAAA,EAAA,CAAA;AAAA,EAYY,KAAM,EAAA,6BAAA;AAAA,EACN,WAAU,EAAA,2BAAA;;AAEV,MAAA,UAAA,mBAAAA,kBAAA;AAAA,EAAsD,MAAA;AAAA,EAAA,EAAhD,OAAM,uCAAuC,EAAA;AAAA,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AAA,CAAA,CAAA;;;AArK5E,eAAA,CAAA,IAAAL,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA;AAAA,aAAA,CAAA;AAAA,YAAA,CAAA,EAAA,CAAA;AAAA;AAAA,WAAA,CAAA;;;;AAAA,OAAA,IAAAA,kBAAA,CAAA,MAAA,EAAA,IAAA,CAAA;AAAA,KAAA,CAAA;AAAA,IAAA,CAAA,EAAA,CAAA;AAAA;AAAA,GAAA,CAAA,CAAA;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-overview.vue2.js","sources":["../../../../../src/x-modules/ai/components/ai-overview.vue"],"sourcesContent":["<template>\n <CollapseHeight>\n <div\n v-if=\"!isNoResults\"\n ref=\"aiOverviewRef\"\n class=\"x-ai-overview\"\n data-test=\"ai-overview-wrapper\"\n >\n <div class=\"x-ai-overview-main\">\n <Fade mode=\"out-in\">\n <span\n v-if=\"suggestionsLoading\"\n class=\"x-ai-overview-title-loading\"\n data-test=\"ai-overview-title-loading\"\n >\n <span class=\"x-ai-overview-title-loading-indicator\" />\n <span\n class=\"x-ai-overview-title-loading-text\"\n data-test=\"ai-overview-title-loading-text\"\n >\n <slot name=\"title-loading\">\n {{ titleLoading }}\n </slot>\n </span>\n </span>\n <DisplayEmitter\n v-else\n :payload=\"tagging?.toolingDisplay ?? emptyTaggingRequest\"\n :event-metadata=\"{\n feature: 'overview',\n displayOriginalQuery: query || 'overview-without-query',\n replaceable: false,\n }\"\n data-test=\"ai-overview-display-emitter\"\n >\n <span class=\"x-ai-overview-title\" data-test=\"ai-overview-title\">\n <AIStarIcon class=\"x-ai-overview-title-icon\" />{{ !!title ? title : suggestionText }}\n </span>\n </DisplayEmitter>\n </Fade>\n <ChangeHeight>\n <div class=\"x-ai-overview-content\" data-test=\"ai-overview-content\">\n <span v-if=\"title\">{{ suggestionText }}</span>\n <p>{{ responseText }}</p>\n </div>\n </ChangeHeight>\n </div>\n <CollapseHeight\n :style=\"{\n '--x-collapse-height-transition-duration': `${300 * suggestionsSearch.length}ms`,\n }\"\n data-test=\"ai-overview-collapse-height-suggestions\"\n >\n <div v-show=\"expanded\">\n <SpinnerIcon\n v-if=\"!suggestionsSearch.length\"\n class=\"x-ai-overview-suggestions-loading\"\n data-test=\"ai-overview-suggestions-loading\"\n />\n <div\n v-else\n class=\"x-ai-overview-suggestions\"\n data-test=\"ai-overview-suggestions-container\"\n >\n <DisplayEmitter\n v-for=\"(\n { query: suggestionQuery, results: queriesResults, tagging: suggestionTagging },\n suggestionIndex\n ) in suggestionsSearch\"\n :key=\"suggestionQuery\"\n :payload=\"\n tagging?.searchQueries[suggestionQuery].toolingDisplay ?? emptyTaggingRequest\n \"\n :event-metadata=\"{\n feature: 'overview',\n displayOriginalQuery: query || 'overview-without-query',\n replaceable: false,\n }\"\n data-test=\"ai-overview-query-display-emitter\"\n >\n <div\n class=\"x-ai-overview-suggestion\"\n data-test=\"ai-overview-suggestion\"\n :class=\"{\n 'x-ai-overview-result-animation': shouldAnimateSuggestion,\n }\"\n :style=\"{ animationDelay: `${suggestionIndex * 300}ms` }\"\n >\n <BaseEventButton\n class=\"x-ai-overview-suggestion-query-btn\"\n :events=\"{ UserAcceptedAQuery: suggestionQuery }\"\n >\n {{ suggestionQuery }}\n <ArrowRightIcon class=\"x-ai-overview-suggestion-query-btn-icon\" />\n </BaseEventButton>\n\n <DisplayClickProvider\n :query-tagging=\"suggestionTagging.query\"\n :tooling-display-tagging=\"\n tagging?.searchQueries[suggestionQuery].toolingDisplayClick\n \"\n :tooling-add2-cart-tagging=\"\n tagging?.searchQueries[suggestionQuery].toolingDisplayAdd2Cart\n \"\n result-feature=\"overview\"\n >\n <slot name=\"sliding-panel\" :results=\"queriesResults\">\n <SlidingPanel\n :class=\"slidingPanelsClasses\"\n :scroll-container-class=\"slidingPanelContainersClasses\"\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-overview-suggestion-results\">\n <li\n v-for=\"(result, resultIndex) in queriesResults\"\n :key=\"result.id\"\n data-test=\"ai-overview-suggestion-result\"\n :class=\"{\n 'x-ai-overview-result-animation': shouldAnimateSuggestion,\n }\"\n :style=\"{\n animationDelay: `${suggestionIndex * 300 + resultIndex * 300}ms`,\n }\"\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 </div>\n </div>\n </CollapseHeight>\n\n <Fade>\n <div\n v-if=\"queries.length\"\n class=\"x-cursor-pointer\"\n data-test=\"ai-overview-toggle-button-wrapper\"\n @click=\"onExpandButtonClick(!expanded)\"\n >\n <div v-show=\"!expanded\" class=\"x-ai-overview-gradient\" data-test=\"ai-overview-gradient\" />\n <div class=\"x-ai-overview-toggle-wrapper\">\n <button\n class=\"x-ai-overview-toggle-btn\"\n data-test=\"ai-overview-toggle-button\"\n @click.stop=\"onExpandButtonClick(!expanded)\"\n >\n {{ buttonText }}\n <ChevronDownIcon\n class=\"x-ai-overview-toggle-btn-icon\"\n :class=\"{ 'x-ai-overview-toggle-btn-icon-expanded': expanded }\"\n />\n </button>\n </div>\n </div>\n </Fade>\n </div>\n </CollapseHeight>\n</template>\n\n<script lang=\"ts\">\nimport type { TaggingRequest } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport { computed, defineComponent, onMounted, ref, watch } from 'vue'\nimport {\n AIStarIcon,\n ArrowRightIcon,\n BaseEventButton,\n ChangeHeight,\n ChevronDownIcon,\n CollapseHeight,\n DisplayClickProvider,\n Fade,\n SlidingPanel,\n SpinnerIcon,\n} from '../../../components'\nimport DisplayEmitter from '../../../components/display-emitter.vue'\nimport { use$x, useGetter, useState } from '../../../composables'\nimport { typing } from '../../../directives'\nimport { aiXModule } from '../x-module'\n\nexport default defineComponent({\n directives: {\n typing,\n },\n xModule: aiXModule.name,\n components: {\n AIStarIcon,\n ArrowRightIcon,\n BaseEventButton,\n ChevronDownIcon,\n CollapseHeight,\n ChangeHeight,\n Fade,\n SlidingPanel,\n SpinnerIcon,\n DisplayEmitter,\n DisplayClickProvider,\n },\n props: {\n /**\n * The text displayed when the question ended loading\n *\n * @public\n */\n title: {\n type: String as PropType<string>,\n },\n /**\n * The text displayed when the question is loading.\n *\n * @public\n */\n titleLoading: {\n type: String as PropType<string>,\n default: 'Generating with Empathy AI',\n },\n /**\n * The text displayed on the toggle button when collapsed.\n *\n * @public\n */\n expandText: {\n type: String as PropType<string>,\n default: 'Show more',\n },\n /**\n * The text displayed on the toggle button when expanded.\n *\n * @public\n */\n collapseText: {\n type: String as PropType<string>,\n default: 'Show less',\n },\n\n /**\n * The classes added to each sliding panel for each query.\n *\n * @public\n */\n slidingPanelsClasses: {\n type: String as PropType<string>,\n },\n /**\n * The classes added to each sliding panel container of each query.\n *\n * @public\n */\n slidingPanelContainersClasses: {\n type: String as PropType<string>,\n },\n /**\n * The classes added to each sliding panel buttons of each query.\n *\n * @public\n */\n slidingPanelButtonsClasses: {\n type: String as PropType<string>,\n },\n },\n setup(props) {\n const $x = use$x()\n const { query } = useGetter('ai')\n const {\n suggestionText,\n responseText,\n suggestionsSearch,\n suggestionsLoading,\n tagging,\n isNoResults,\n queries,\n } = useState('ai')\n\n const emptyTaggingRequest: TaggingRequest = { url: '', params: {} }\n\n const aiOverviewRef = ref<HTMLDivElement | null>(null)\n const expanded = ref(false)\n const shouldAnimateSuggestion = ref(true)\n\n const buttonText = computed(() => (expanded.value ? props.collapseText : props.expandText))\n\n function onExpandButtonClick(newValue: boolean) {\n $x.emit('UserClickedAiOverviewExpandButton', expanded.value, {\n suggestionText: suggestionText.value,\n toolingDisplayClick: tagging.value?.toolingDisplayClick,\n })\n setExpanded(newValue)\n }\n\n function setExpanded(newValue: boolean) {\n expanded.value = newValue\n if (!expanded.value) {\n aiOverviewRef.value?.scrollIntoView({ behavior: 'smooth' })\n shouldAnimateSuggestion.value = false\n }\n }\n\n watch(query, () => {\n expanded.value = false\n shouldAnimateSuggestion.value = true\n })\n\n onMounted(() => {\n $x.emit('AiOverviewMounted', undefined, { feature: 'overview' })\n })\n\n return {\n aiOverviewRef,\n buttonText,\n emptyTaggingRequest,\n expanded,\n responseText,\n suggestionsLoading,\n suggestionsSearch,\n suggestionText,\n setExpanded,\n onExpandButtonClick,\n shouldAnimateSuggestion,\n query,\n tagging,\n isNoResults,\n queries,\n }\n },\n})\n</script>\n\n<style lang=\"css\">\n.x-ai-overview {\n --color: var(--x-ai-overview-color, #bbc9cf);\n --color-lighter: var(--x-ai-overview-color-lighter, color-mix(in srgb, var(--color) 25%, white));\n\n position: relative;\n border-radius: 1.5rem;\n background-color: var(--color-lighter);\n}\n\n.x-ai-overview-main {\n padding: 1rem;\n}\n\n.x-ai-overview-title {\n display: flex;\n font-size: 0.875rem;\n font-weight: 700;\n gap: 0.25rem;\n align-items: center;\n margin-bottom: 0.5rem;\n}\n\n.x-ai-overview-title-loading {\n display: flex;\n align-items: center;\n gap: 0.375rem;\n margin-bottom: 0.5rem;\n}\n\n.x-ai-overview-title-loading-indicator {\n width: 0.75rem;\n height: 0.75rem;\n animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n border-radius: 9999px;\n background-color: var(--color);\n}\n\n.x-ai-overview-title-loading-text {\n animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n font-size: 0.75rem;\n}\n\n.x-ai-overview-title-icon {\n height: 1rem;\n aspect-ratio: 1 / 1;\n color: var(--color);\n flex-shrink: 0;\n}\n\n.x-ai-overview-content {\n display: flex;\n flex-direction: column;\n text-align: left;\n line-height: 1.25rem;\n gap: 0.5rem;\n}\n\n.x-ai-overview-content span {\n font-weight: 500;\n}\n\n.x-ai-overview-gradient {\n border-radius: 1.5rem;\n cursor: pointer;\n content: none;\n position: absolute;\n width: 100%;\n height: 100%;\n bottom: 0;\n background-image: linear-gradient(to bottom, transparent 0%, var(--color-lighter) 100%);\n}\n\n.x-ai-overview-toggle-wrapper {\n display: flex;\n position: relative;\n}\n\n.x-ai-overview-toggle-btn {\n border-color: var(--button-color-50, #283034);\n background-color: #ffffff;\n color: var(--button-color-50, #283034);\n border-radius: 9999px;\n width: 100%;\n margin: auto;\n padding-right: 1rem;\n padding-left: 1rem;\n display: flex;\n justify-content: center;\n align-items: center;\n border-style: solid;\n border-width: 1px;\n font-weight: 700;\n min-height: 2.5rem;\n gap: 0.5rem;\n font-size: 0.875rem;\n}\n\n.x-ai-overview-toggle-btn:hover {\n border-color: var(--button-color-50, #283034);\n background-color: var(--button-color-50, #283034);\n color: #ffffff;\n}\n\n@media (min-width: 640px) {\n .x-ai-overview-toggle-btn {\n transition-property: all;\n transition-duration: 500ms;\n transform: translateY(50%);\n width: var(--expand-button-width, 200px);\n }\n}\n\n.x-ai-overview-toggle-btn-icon {\n transform: rotate(0deg);\n height: 1rem;\n aspect-ratio: 1 / 1;\n transition-property: all;\n transition-duration: 300ms;\n}\n\n.x-ai-overview-toggle-btn-icon-expanded {\n transform: rotate(180deg);\n}\n\n.x-ai-overview-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}\n\n.x-ai-overview-suggestion-query-btn-icon {\n height: 1rem;\n aspect-ratio: 1 / 1;\n}\n\n.x-ai-overview-suggestions {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n padding-bottom: 1rem;\n}\n\n.x-ai-overview-suggestions-loading {\n width: 2.5rem;\n height: 2.5rem;\n margin: auto;\n animation: x-spin 1s linear infinite;\n}\n\n.x-ai-overview-suggestion {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n}\n\n.x-ai-overview-suggestion-results {\n display: flex;\n gap: 1rem;\n padding-left: 1rem;\n padding-right: 1rem;\n}\n\n@keyframes x-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n@keyframes pulse {\n 50% {\n opacity: 0.5;\n }\n}\n</style>\n"],"names":["DisplayEmitter","DisplayClickProvider"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmMA,gBAAe,eAAe,CAAC;AAC7B,IAAA,UAAU,EAAE;QACV,MAAM;AACP,KAAA;IACD,OAAO,EAAE,SAAS,CAAC,IAAI;AACvB,IAAA,UAAU,EAAE;QACV,UAAU;QACV,cAAc;QACd,eAAe;QACf,eAAe;QACf,cAAc;QACd,YAAY;QACZ,IAAI;QACJ,YAAY;QACZ,WAAW;wBACXA,WAAc;8BACdC,WAAoB;AACrB,KAAA;AACD,IAAA,KAAK,EAAE;AACL;;;;AAIE;AACF,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,MAA0B;AACjC,SAAA;AACD;;;;AAIE;AACF,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,OAAO,EAAE,4BAA4B;AACtC,SAAA;AACD;;;;AAIE;AACF,QAAA,UAAU,EAAE;AACV,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,OAAO,EAAE,WAAW;AACrB,SAAA;AACD;;;;AAIE;AACF,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,OAAO,EAAE,WAAW;AACrB,SAAA;AAED;;;;AAIE;AACF,QAAA,oBAAoB,EAAE;AACpB,YAAA,IAAI,EAAE,MAA0B;AACjC,SAAA;AACD;;;;AAIE;AACF,QAAA,6BAA6B,EAAE;AAC7B,YAAA,IAAI,EAAE,MAA0B;AACjC,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cAAc,CAAC,EAAE,QAAQ,EAAE,QAAO,EAAG,CAAA,CAAA;AAC1D,gBAAA,uBAAuB,CAAC,KAAM,GAAE,KAAI,CAAA;aACtC;SACF;AAEA,QAAA,KAAK,CAAC,KAAK,EAAE,MAAM;AACjB,YAAA,QAAQ,CAAC,KAAI,GAAI,KAAI,CAAA;AACrB,YAAA,uBAAuB,CAAC,KAAI,GAAI,IAAG,CAAA;AACrC,SAAC,CAAA,CAAA;QAED,SAAS,CAAC,MAAM;AACd,YAAA,EAAE,CAAC,IAAI,CAAC,mBAAmB,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,UAAS,EAAG,CAAA,CAAA;AACjE,SAAC,CAAA,CAAA;QAED,OAAO;YACL,aAAa;YACb,UAAU;YACV,mBAAmB;YACnB,QAAQ;YACR,YAAY;YACZ,kBAAkB;YAClB,iBAAiB;YACjB,cAAc;YACd,WAAW;YACX,mBAAmB;YACnB,uBAAuB;YACvB,KAAK;YACL,OAAO;YACP,WAAW;YACX,OAAO;SACT,CAAA;KACD;AACF,CAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"ai-overview.vue2.js","sources":["../../../../../src/x-modules/ai/components/ai-overview.vue"],"sourcesContent":["<template>\n <CollapseHeight>\n <div\n v-if=\"!isNoResults\"\n ref=\"aiOverviewRef\"\n class=\"x-ai-overview\"\n data-test=\"ai-overview-wrapper\"\n >\n <div class=\"x-ai-overview-main\">\n <Fade mode=\"out-in\">\n <span\n v-if=\"suggestionsLoading\"\n class=\"x-ai-overview-title-loading\"\n data-test=\"ai-overview-title-loading\"\n >\n <span class=\"x-ai-overview-title-loading-indicator\" />\n <span\n class=\"x-ai-overview-title-loading-text\"\n data-test=\"ai-overview-title-loading-text\"\n >\n <slot name=\"title-loading\">\n {{ titleLoading }}\n </slot>\n </span>\n </span>\n <DisplayEmitter\n v-else\n :payload=\"tagging?.toolingDisplay ?? emptyTaggingRequest\"\n :event-metadata=\"{\n feature: 'overview',\n displayOriginalQuery: query || 'overview-without-query',\n replaceable: false,\n }\"\n data-test=\"ai-overview-display-emitter\"\n >\n <span class=\"x-ai-overview-title\" data-test=\"ai-overview-title\">\n <AIStarIcon class=\"x-ai-overview-title-icon\" />{{ !!title ? title : suggestionText }}\n </span>\n </DisplayEmitter>\n </Fade>\n <ChangeHeight>\n <div class=\"x-ai-overview-content\" data-test=\"ai-overview-content\">\n <span v-if=\"title\">{{ suggestionText }}</span>\n <p>{{ responseText }}</p>\n </div>\n </ChangeHeight>\n </div>\n <CollapseHeight\n :style=\"{\n '--x-collapse-height-transition-duration': `${300 * suggestionsSearch.length}ms`,\n }\"\n data-test=\"ai-overview-collapse-height-suggestions\"\n >\n <div v-show=\"expanded\">\n <SpinnerIcon\n v-if=\"!suggestionsSearch.length\"\n class=\"x-ai-overview-suggestions-loading\"\n data-test=\"ai-overview-suggestions-loading\"\n />\n <div\n v-else\n class=\"x-ai-overview-suggestions\"\n data-test=\"ai-overview-suggestions-container\"\n >\n <DisplayEmitter\n v-for=\"(\n { query: suggestionQuery, results: queriesResults, tagging: suggestionTagging },\n suggestionIndex\n ) in suggestionsSearch\"\n :key=\"suggestionQuery\"\n :payload=\"\n tagging?.searchQueries[suggestionQuery].toolingDisplay ?? emptyTaggingRequest\n \"\n :event-metadata=\"{\n feature: 'overview',\n displayOriginalQuery: query || 'overview-without-query',\n replaceable: false,\n }\"\n data-test=\"ai-overview-query-display-emitter\"\n >\n <div\n class=\"x-ai-overview-suggestion\"\n data-test=\"ai-overview-suggestion\"\n :class=\"{\n 'x-ai-overview-result-animation': shouldAnimateSuggestion,\n }\"\n :style=\"{ animationDelay: `${suggestionIndex * 300}ms` }\"\n >\n <BaseEventButton\n class=\"x-ai-overview-suggestion-query-btn\"\n :events=\"{ UserAcceptedAQuery: suggestionQuery }\"\n >\n {{ suggestionQuery }}\n <ArrowRightIcon class=\"x-ai-overview-suggestion-query-btn-icon\" />\n </BaseEventButton>\n\n <DisplayClickProvider\n :query-tagging=\"suggestionTagging.query\"\n :tooling-display-tagging=\"\n tagging?.searchQueries[suggestionQuery].toolingDisplayClick\n \"\n :tooling-add2-cart-tagging=\"\n tagging?.searchQueries[suggestionQuery].toolingDisplayAdd2Cart\n \"\n result-feature=\"overview\"\n >\n <slot name=\"sliding-panel\" :results=\"queriesResults\">\n <SlidingPanel\n :class=\"slidingPanelsClasses\"\n :scroll-container-class=\"slidingPanelContainersClasses\"\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-overview-suggestion-results\">\n <li\n v-for=\"(result, resultIndex) in queriesResults\"\n :key=\"result.id\"\n data-test=\"ai-overview-suggestion-result\"\n :class=\"{\n 'x-ai-overview-result-animation': shouldAnimateSuggestion,\n }\"\n :style=\"{\n animationDelay: `${suggestionIndex * 300 + resultIndex * 300}ms`,\n }\"\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 </div>\n </CollapseHeight>\n\n <Fade>\n <div\n v-if=\"queries.length\"\n class=\"x-cursor-pointer\"\n data-test=\"ai-overview-toggle-button-wrapper\"\n @click=\"onExpandButtonClick(!expanded)\"\n >\n <div v-show=\"!expanded\" class=\"x-ai-overview-gradient\" data-test=\"ai-overview-gradient\" />\n <div class=\"x-ai-overview-toggle-wrapper\">\n <button\n class=\"x-ai-overview-toggle-btn\"\n data-test=\"ai-overview-toggle-button\"\n @click.stop=\"onExpandButtonClick(!expanded)\"\n >\n {{ buttonText }}\n <ChevronDownIcon\n class=\"x-ai-overview-toggle-btn-icon\"\n :class=\"{ 'x-ai-overview-toggle-btn-icon-expanded': expanded }\"\n />\n </button>\n </div>\n </div>\n </Fade>\n </div>\n </CollapseHeight>\n</template>\n\n<script lang=\"ts\">\nimport type { TaggingRequest } from '@empathyco/x-types'\nimport type { PropType } from 'vue'\nimport { computed, defineComponent, onMounted, ref, watch } from 'vue'\nimport {\n AIStarIcon,\n ArrowRightIcon,\n BaseEventButton,\n ChangeHeight,\n ChevronDownIcon,\n CollapseHeight,\n DisplayClickProvider,\n Fade,\n SlidingPanel,\n SpinnerIcon,\n} from '../../../components'\nimport DisplayEmitter from '../../../components/display-emitter.vue'\nimport { use$x, useGetter, useState } from '../../../composables'\nimport { typing } from '../../../directives'\nimport { aiXModule } from '../x-module'\n\nexport default defineComponent({\n directives: {\n typing,\n },\n xModule: aiXModule.name,\n components: {\n AIStarIcon,\n ArrowRightIcon,\n BaseEventButton,\n ChevronDownIcon,\n CollapseHeight,\n ChangeHeight,\n Fade,\n SlidingPanel,\n SpinnerIcon,\n DisplayEmitter,\n DisplayClickProvider,\n },\n props: {\n /**\n * The text displayed when the question ended loading\n *\n * @public\n */\n title: {\n type: String as PropType<string>,\n },\n /**\n * The text displayed when the question is loading.\n *\n * @public\n */\n titleLoading: {\n type: String as PropType<string>,\n default: 'Generating with Empathy AI',\n },\n /**\n * The text displayed on the toggle button when collapsed.\n *\n * @public\n */\n expandText: {\n type: String as PropType<string>,\n default: 'Show more',\n },\n /**\n * The text displayed on the toggle button when expanded.\n *\n * @public\n */\n collapseText: {\n type: String as PropType<string>,\n default: 'Show less',\n },\n\n /**\n * The classes added to each sliding panel for each query.\n *\n * @public\n */\n slidingPanelsClasses: {\n type: String as PropType<string>,\n },\n /**\n * The classes added to each sliding panel container of each query.\n *\n * @public\n */\n slidingPanelContainersClasses: {\n type: String as PropType<string>,\n },\n /**\n * The classes added to each sliding panel buttons of each query.\n *\n * @public\n */\n slidingPanelButtonsClasses: {\n type: String as PropType<string>,\n },\n },\n setup(props) {\n const $x = use$x()\n const { query } = useGetter('ai')\n const {\n suggestionText,\n responseText,\n suggestionsSearch,\n suggestionsLoading,\n tagging,\n isNoResults,\n queries,\n } = useState('ai')\n\n const emptyTaggingRequest: TaggingRequest = { url: '', params: {} }\n\n const aiOverviewRef = ref<HTMLDivElement | null>(null)\n const expanded = ref(false)\n const shouldAnimateSuggestion = ref(true)\n\n const buttonText = computed(() => (expanded.value ? props.collapseText : props.expandText))\n\n function onExpandButtonClick(newValue: boolean) {\n $x.emit('UserClickedAiOverviewExpandButton', expanded.value, {\n suggestionText: suggestionText.value,\n toolingDisplayClick: tagging.value?.toolingDisplayClick,\n })\n setExpanded(newValue)\n }\n\n function setExpanded(newValue: boolean) {\n expanded.value = newValue\n if (!expanded.value) {\n aiOverviewRef.value?.scrollIntoView({ behavior: 'smooth' })\n shouldAnimateSuggestion.value = false\n }\n }\n\n watch(query, () => {\n expanded.value = false\n shouldAnimateSuggestion.value = true\n })\n\n onMounted(() => {\n $x.emit('AiOverviewMounted', undefined, { feature: 'overview' })\n })\n\n return {\n aiOverviewRef,\n buttonText,\n emptyTaggingRequest,\n expanded,\n responseText,\n suggestionsLoading,\n suggestionsSearch,\n suggestionText,\n setExpanded,\n onExpandButtonClick,\n shouldAnimateSuggestion,\n query,\n tagging,\n isNoResults,\n queries,\n }\n },\n})\n</script>\n\n<style lang=\"css\">\n.x-ai-overview {\n --color: var(--x-ai-overview-color, #bbc9cf);\n --color-lighter: var(--x-ai-overview-color-lighter, color-mix(in srgb, var(--color) 25%, white));\n\n position: relative;\n border-radius: 1.5rem;\n background-color: var(--color-lighter);\n}\n\n.x-ai-overview-main {\n padding: 1rem;\n}\n\n.x-ai-overview-title {\n display: flex;\n font-size: 0.875rem;\n font-weight: 700;\n gap: 0.25rem;\n align-items: center;\n margin-bottom: 0.5rem;\n}\n\n.x-ai-overview-title-loading {\n display: flex;\n align-items: center;\n gap: 0.375rem;\n margin-bottom: 0.5rem;\n}\n\n.x-ai-overview-title-loading-indicator {\n width: 0.75rem;\n height: 0.75rem;\n animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n border-radius: 9999px;\n background-color: var(--color);\n}\n\n.x-ai-overview-title-loading-text {\n animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n font-size: 0.75rem;\n}\n\n.x-ai-overview-title-icon {\n height: 1rem;\n aspect-ratio: 1 / 1;\n color: var(--color);\n flex-shrink: 0;\n}\n\n.x-ai-overview-content {\n display: flex;\n flex-direction: column;\n text-align: left;\n line-height: 1.25rem;\n gap: 0.5rem;\n}\n\n.x-ai-overview-content span {\n font-weight: 500;\n}\n\n.x-ai-overview-gradient {\n border-radius: 1.5rem;\n cursor: pointer;\n content: none;\n position: absolute;\n width: 100%;\n height: 100%;\n bottom: 0;\n background-image: linear-gradient(to bottom, transparent 0%, var(--color-lighter) 100%);\n}\n\n.x-ai-overview-toggle-wrapper {\n display: flex;\n position: relative;\n}\n\n.x-ai-overview-toggle-btn {\n border-color: var(--button-color-50, #283034);\n background-color: #ffffff;\n color: var(--button-color-50, #283034);\n border-radius: 9999px;\n width: 100%;\n margin: auto;\n padding-right: 1rem;\n padding-left: 1rem;\n display: flex;\n justify-content: center;\n align-items: center;\n border-style: solid;\n border-width: 1px;\n font-weight: 700;\n min-height: 2.5rem;\n gap: 0.5rem;\n font-size: 0.875rem;\n}\n\n.x-ai-overview-toggle-btn:hover {\n border-color: var(--button-color-50, #283034);\n background-color: var(--button-color-50, #283034);\n color: #ffffff;\n}\n\n@media (min-width: 640px) {\n .x-ai-overview-toggle-btn {\n transition-property: all;\n transition-duration: 500ms;\n transform: translateY(50%);\n width: var(--expand-button-width, 200px);\n }\n}\n\n.x-ai-overview-toggle-btn-icon {\n transform: rotate(0deg);\n height: 1rem;\n aspect-ratio: 1 / 1;\n transition-property: all;\n transition-duration: 300ms;\n}\n\n.x-ai-overview-toggle-btn-icon-expanded {\n transform: rotate(180deg);\n}\n\n.x-ai-overview-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}\n\n.x-ai-overview-suggestion-query-btn-icon {\n height: 1rem;\n aspect-ratio: 1 / 1;\n}\n\n.x-ai-overview-suggestions {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n padding-bottom: 1rem;\n}\n\n.x-ai-overview-suggestions-loading {\n width: 2.5rem;\n height: 2.5rem;\n margin: auto;\n animation: x-spin 1s linear infinite;\n}\n\n.x-ai-overview-suggestion {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n}\n\n.x-ai-overview-suggestion-results {\n display: flex;\n gap: 1rem;\n padding-left: 1rem;\n padding-right: 1rem;\n}\n\n@keyframes x-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n@keyframes pulse {\n 50% {\n opacity: 0.5;\n }\n}\n</style>\n"],"names":["DisplayEmitter","DisplayClickProvider"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoMA,gBAAe,eAAe,CAAC;AAC7B,IAAA,UAAU,EAAE;QACV,MAAM;AACP,KAAA;IACD,OAAO,EAAE,SAAS,CAAC,IAAI;AACvB,IAAA,UAAU,EAAE;QACV,UAAU;QACV,cAAc;QACd,eAAe;QACf,eAAe;QACf,cAAc;QACd,YAAY;QACZ,IAAI;QACJ,YAAY;QACZ,WAAW;wBACXA,WAAc;8BACdC,WAAoB;AACrB,KAAA;AACD,IAAA,KAAK,EAAE;AACL;;;;AAIE;AACF,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,MAA0B;AACjC,SAAA;AACD;;;;AAIE;AACF,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,OAAO,EAAE,4BAA4B;AACtC,SAAA;AACD;;;;AAI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AAmC,EAAE,QAAQ,CAAC,KAAK,EAAE;gBAC3D,cAAc,EAAE,cAAc,CAAC,KAAK;AACpC,gBAAA,mBAAmB,EAAE,OAAO,CAAC,KAAK,EAAE,mBAAmB;AACxD,aAAA,CAAA,CAAA;YACD,WAAW,CAAC,QAAQ,CAAA,CAAA;SACtB;QAEA,SAAS,WAAW,CAAC,QAAiB,EAAA;AACpC,YAAA,QAAQ,CAAC,KAAI,GAAI,QAAO,CAAA;AACxB,YAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE;gBACnB,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,EAAE,QAAQ,EAAE,QAAO,EAAG,CAAA,CAAA;AAC1D,gBAAA,uBAAuB,CAAC,KAAM,GAAE,KAAI,CAAA;aACtC;SACF;AAEA,QAAA,KAAK,CAAC,KAAK,EAAE,MAAM;AACjB,YAAA,QAAQ,CAAC,KAAI,GAAI,KAAI,CAAA;AACrB,YAAA,uBAAuB,CAAC,KAAI,GAAI,IAAG,CAAA;AACrC,SAAC,CAAA,CAAA;QAED,SAAS,CAAC,MAAM;AACd,YAAA,EAAE,CAAC,IAAI,CAAC,mBAAmB,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,UAAS,EAAG,CAAA,CAAA;AACjE,SAAC,CAAA,CAAA;QAED,OAAO;YACL,aAAa;YACb,UAAU;YACV,mBAAmB;YACnB,QAAQ;YACR,YAAY;YACZ,kBAAkB;YAClB,iBAAiB;YACjB,cAAc;YACd,WAAW;YACX,mBAAmB;YACnB,uBAAuB;YACvB,KAAK;YACL,OAAO;YACP,WAAW;YACX,OAAO;SACT,CAAA;KACD;AACF,CAAA,CAAA;;;;"}
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
*
|
|
10
10
|
* @public
|
|
11
11
|
*/
|
|
12
|
-
const suggestionsRequest = ({ params, origin }, { query }) => {
|
|
13
|
-
return { query, extraParams
|
|
12
|
+
const suggestionsRequest = ({ params: extraParams, selectedFilters: filters, origin }, { query }) => {
|
|
13
|
+
return { query, extraParams, filters, ...(origin && { origin }) };
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export { suggestionsRequest };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestions-request.getter.js","sources":["../../../../../../src/x-modules/ai/store/getters/suggestions-request.getter.ts"],"sourcesContent":["import type { AiXStoreModule } from '../types'\n\n/**\n * Default implementation for the {@link AiGetters.suggestionsRequest} getter.\n *\n * @param state - Current {@link https://vuex.vuejs.org/guide/state.html | state} of the ai\n * module.\n * @param getters - Current {@link https://vuex.vuejs.org/guide/getters.html | getters} of the\n * ai module.\n * @returns The ai request to fetch data from the API.\n *\n * @public\n */\nexport const suggestionsRequest: AiXStoreModule['getters']['suggestionsRequest'] = (\n { params, origin },\n { query },\n) => {\n return { query, extraParams
|
|
1
|
+
{"version":3,"file":"suggestions-request.getter.js","sources":["../../../../../../src/x-modules/ai/store/getters/suggestions-request.getter.ts"],"sourcesContent":["import type { AiXStoreModule } from '../types'\n\n/**\n * Default implementation for the {@link AiGetters.suggestionsRequest} getter.\n *\n * @param state - Current {@link https://vuex.vuejs.org/guide/state.html | state} of the ai\n * module.\n * @param getters - Current {@link https://vuex.vuejs.org/guide/getters.html | getters} of the\n * ai module.\n * @returns The ai request to fetch data from the API.\n *\n * @public\n */\nexport const suggestionsRequest: AiXStoreModule['getters']['suggestionsRequest'] = (\n { params: extraParams, selectedFilters: filters, origin },\n { query },\n) => {\n return { query, extraParams, filters, ...(origin && { origin }) }\n}\n"],"names":[],"mappings":"AAEA;;;;;;;;;;AAUG;MACU,kBAAkB,GAAoD,CACjF,EAAE,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,EACzD,EAAE,KAAK,EAAE,KACP;AACF,IAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,MAAM,IAAI,EAAE,MAAM,EAAE,GAAG,CAAA;AACnE;;;;"}
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @public
|
|
10
10
|
*/
|
|
11
|
-
const suggestionsSearchRequest = ({ params,
|
|
12
|
-
return queries.length ? { queries, extraParams
|
|
11
|
+
const suggestionsSearchRequest = ({ queries, params: extraParams, selectedFilters: filters, origin, }) => {
|
|
12
|
+
return queries.length ? { queries, extraParams, filters, ...(origin && { origin }) } : null;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
export { suggestionsSearchRequest };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestions-search-request.getter.js","sources":["../../../../../../src/x-modules/ai/store/getters/suggestions-search-request.getter.ts"],"sourcesContent":["import type { AiXStoreModule } from '../types'\n\n/**\n * Default implementation for the {@link AiGetters.suggestionsSearchRequest} getter.\n *\n * @param state - Current {@link https://vuex.vuejs.org/guide/state.html | state} of the ai\n * module.\n *\n * @returns The ai request to fetch data from the API.\n *\n * @public\n */\nexport const suggestionsSearchRequest: AiXStoreModule['getters']['suggestionsSearchRequest'] = ({\n params,\n
|
|
1
|
+
{"version":3,"file":"suggestions-search-request.getter.js","sources":["../../../../../../src/x-modules/ai/store/getters/suggestions-search-request.getter.ts"],"sourcesContent":["import type { AiXStoreModule } from '../types'\n\n/**\n * Default implementation for the {@link AiGetters.suggestionsSearchRequest} getter.\n *\n * @param state - Current {@link https://vuex.vuejs.org/guide/state.html | state} of the ai\n * module.\n *\n * @returns The ai request to fetch data from the API.\n *\n * @public\n */\nexport const suggestionsSearchRequest: AiXStoreModule['getters']['suggestionsSearchRequest'] = ({\n queries,\n params: extraParams,\n selectedFilters: filters,\n origin,\n}) => {\n return queries.length ? { queries, extraParams, filters, ...(origin && { origin }) } : null\n}\n"],"names":[],"mappings":"AAEA;;;;;;;;;AASG;AACU,MAAA,wBAAwB,GAA0D,CAAC,EAC9F,OAAO,EACP,MAAM,EAAE,WAAW,EACnB,eAAe,EAAE,OAAO,EACxB,MAAM,GACP,KAAI;IACH,OAAO,OAAO,CAAC,MAAM,GAAG,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,MAAM,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,IAAI,CAAA;AAC7F;;;;"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { isFacetFilter } from '@empathyco/x-types';
|
|
1
2
|
import { setConfig, mergeConfig } from '../../../store/utils/config-store.utils.js';
|
|
3
|
+
import { groupItemsBy } from '../../../utils/array.js';
|
|
4
|
+
import { UNKNOWN_FACET_KEY } from '../../facets/store/constants.js';
|
|
2
5
|
import { fetchAndSaveAiSuggestionsSearch } from './actions/fetch-and-save-ai-suggestions-search.action.js';
|
|
3
6
|
import { fetchAndSaveAiSuggestions } from './actions/fetch-and-save-ai-suggestions.action.js';
|
|
4
7
|
import { saveOrigin } from './actions/save-origin.action.js';
|
|
@@ -15,6 +18,7 @@ import { suggestionsSearchRequest } from './getters/suggestions-search-request.g
|
|
|
15
18
|
const aiXStoreModule = {
|
|
16
19
|
state: () => ({
|
|
17
20
|
...resettableAiState(),
|
|
21
|
+
selectedFilters: {},
|
|
18
22
|
query: '',
|
|
19
23
|
config: {},
|
|
20
24
|
params: {},
|
|
@@ -50,8 +54,6 @@ const aiXStoreModule = {
|
|
|
50
54
|
setSuggestionsSearchLoading: (state, value) => {
|
|
51
55
|
state.suggestionsSearchLoading = value;
|
|
52
56
|
},
|
|
53
|
-
setConfig,
|
|
54
|
-
mergeConfig,
|
|
55
57
|
setQuery: (state, query) => {
|
|
56
58
|
state.query = query;
|
|
57
59
|
},
|
|
@@ -70,6 +72,11 @@ const aiXStoreModule = {
|
|
|
70
72
|
setIsNoResults(state, isNoResults) {
|
|
71
73
|
state.isNoResults = isNoResults;
|
|
72
74
|
},
|
|
75
|
+
setSelectedFilters(state, selectedFilters) {
|
|
76
|
+
state.selectedFilters = groupItemsBy(selectedFilters, filter => isFacetFilter(filter) ? filter.facetId : UNKNOWN_FACET_KEY);
|
|
77
|
+
},
|
|
78
|
+
setConfig,
|
|
79
|
+
mergeConfig,
|
|
73
80
|
},
|
|
74
81
|
actions: {
|
|
75
82
|
fetchAndSaveAiSuggestions,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sources":["../../../../../src/x-modules/ai/store/module.ts"],"sourcesContent":["import type { AiSuggestionQuery, AiSuggestionSearch } from '@empathyco/x-types'\nimport type { QueryState } from '../../../store'\nimport type { AiXStoreModule } from './types'\nimport { mergeConfig, setConfig } from '../../../store/utils/config-store.utils'\nimport { fetchAndSaveAiSuggestionsSearch } from './actions/fetch-and-save-ai-suggestions-search.action'\nimport { fetchAndSaveAiSuggestions } from './actions/fetch-and-save-ai-suggestions.action'\nimport { saveOrigin } from './actions/save-origin.action'\nimport { setUrlParams } from './actions/set-url-params.action'\nimport {\n aiQuery as query,\n aiSuggestionsRequest as suggestionsRequest,\n aiSuggestionsSearchRequest as suggestionsSearchRequest,\n} from './getters'\n/**\n * {@link XStoreModule} For the ai module.\n *\n * @internal\n */\nexport const aiXStoreModule: AiXStoreModule = {\n state: () => ({\n ...resettableAiState(),\n query: '',\n config: {},\n params: {},\n origin: null,\n relatedTags: [],\n }),\n getters: {\n suggestionsRequest,\n suggestionsSearchRequest,\n query,\n },\n mutations: {\n /* Streamed fields */\n setResponseText: (state, responseText: string) => {\n state.responseText = responseText\n },\n setSuggestionText: (state, suggestionText: string) => {\n state.suggestionText = suggestionText\n },\n setQueries: (state, queries: AiSuggestionQuery[]) => {\n state.queries = queries\n },\n setTagging: (state, tagging) => {\n state.tagging = tagging\n },\n /* END Streamed fields */\n setSuggestionsSearch: (state, suggestionsSearch: AiSuggestionSearch[]) => {\n state.suggestionsSearch = suggestionsSearch\n },\n setSuggestionsLoading: (state, value) => {\n state.suggestionsLoading = value\n },\n setSuggestionsSearchLoading: (state, value) => {\n state.suggestionsSearchLoading = value\n },\n
|
|
1
|
+
{"version":3,"file":"module.js","sources":["../../../../../src/x-modules/ai/store/module.ts"],"sourcesContent":["import type { AiSuggestionQuery, AiSuggestionSearch } from '@empathyco/x-types'\nimport type { QueryState } from '../../../store'\nimport type { AiXStoreModule } from './types'\nimport { isFacetFilter } from '@empathyco/x-types'\nimport { mergeConfig, setConfig } from '../../../store/utils/config-store.utils'\nimport { groupItemsBy } from '../../../utils/array'\nimport { UNKNOWN_FACET_KEY } from '../../facets/store/constants'\nimport { fetchAndSaveAiSuggestionsSearch } from './actions/fetch-and-save-ai-suggestions-search.action'\nimport { fetchAndSaveAiSuggestions } from './actions/fetch-and-save-ai-suggestions.action'\nimport { saveOrigin } from './actions/save-origin.action'\nimport { setUrlParams } from './actions/set-url-params.action'\nimport {\n aiQuery as query,\n aiSuggestionsRequest as suggestionsRequest,\n aiSuggestionsSearchRequest as suggestionsSearchRequest,\n} from './getters'\n\n/**\n * {@link XStoreModule} For the ai module.\n *\n * @internal\n */\nexport const aiXStoreModule: AiXStoreModule = {\n state: () => ({\n ...resettableAiState(),\n selectedFilters: {},\n query: '',\n config: {},\n params: {},\n origin: null,\n relatedTags: [],\n }),\n getters: {\n suggestionsRequest,\n suggestionsSearchRequest,\n query,\n },\n mutations: {\n /* Streamed fields */\n setResponseText: (state, responseText: string) => {\n state.responseText = responseText\n },\n setSuggestionText: (state, suggestionText: string) => {\n state.suggestionText = suggestionText\n },\n setQueries: (state, queries: AiSuggestionQuery[]) => {\n state.queries = queries\n },\n setTagging: (state, tagging) => {\n state.tagging = tagging\n },\n /* END Streamed fields */\n setSuggestionsSearch: (state, suggestionsSearch: AiSuggestionSearch[]) => {\n state.suggestionsSearch = suggestionsSearch\n },\n setSuggestionsLoading: (state, value) => {\n state.suggestionsLoading = value\n },\n setSuggestionsSearchLoading: (state, value) => {\n state.suggestionsSearchLoading = value\n },\n setQuery: (state: QueryState, query: string) => {\n state.query = query\n },\n setParams(state, params) {\n state.params = params\n },\n setOrigin(state, origin = null) {\n state.origin = origin\n },\n resetAiState(state) {\n Object.assign(state, resettableAiState())\n },\n setAiRelatedTags(state, relatedTags) {\n state.relatedTags = relatedTags\n },\n setIsNoResults(state, isNoResults: boolean) {\n state.isNoResults = isNoResults\n },\n setSelectedFilters(state, selectedFilters) {\n state.selectedFilters = groupItemsBy(selectedFilters, filter =>\n isFacetFilter(filter) ? filter.facetId : UNKNOWN_FACET_KEY,\n )\n },\n setConfig,\n mergeConfig,\n },\n actions: {\n fetchAndSaveAiSuggestions,\n fetchAndSaveAiSuggestionsSearch,\n setUrlParams,\n saveOrigin,\n },\n}\n\n/**\n * Function to return the \"resettable\" part of the state. This will be used in the `resetState`\n * mutation to reset to the initial state.\n *\n * @returns The \"resettable\" part of the {@link AiState}.\n *\n * @internal\n */\nfunction resettableAiState() {\n return {\n responseText: '',\n suggestionText: '',\n queries: [],\n tagging: undefined,\n suggestionsSearch: [],\n suggestionsLoading: false,\n suggestionsSearchLoading: false,\n isNoResults: true,\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAiBA;;;;AAIG;AACU,MAAA,cAAc,GAAmB;AAC5C,IAAA,KAAK,EAAE,OAAO;AACZ,QAAA,GAAG,iBAAiB,EAAE;AACtB,QAAA,eAAe,EAAE,EAAE;AACnB,QAAA,KAAK,EAAE,EAAE;AACT,QAAA,MAAM,EAAE,EAAE;AACV,QAAA,MAAM,EAAE,EAAE;AACV,QAAA,MAAM,EAAE,IAAI;AACZ,QAAA,WAAW,EAAE,EAAE;KAChB,CAAC;AACF,IAAA,OAAO,EAAE;QACP,kBAAkB;QAClB,wBAAwB;QACxB,KAAK;AACN,KAAA;AACD,IAAA,SAAS,EAAE;;AAET,QAAA,eAAe,EAAE,CAAC,KAAK,EAAE,YAAoB,KAAI;AAC/C,YAAA,KAAK,CAAC,YAAY,GAAG,YAAY,CAAA;SAClC;AACD,QAAA,iBAAiB,EAAE,CAAC,KAAK,EAAE,cAAsB,KAAI;AACnD,YAAA,KAAK,CAAC,cAAc,GAAG,cAAc,CAAA;SACtC;AACD,QAAA,UAAU,EAAE,CAAC,KAAK,EAAE,OAA4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AAE,MAAM,IAC1D,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,OAAO,GAAG,iBAAiB,CAC3D,CAAA;SACF;QACD,SAAS;QACT,WAAW;AACZ,KAAA;AACD,IAAA,OAAO,EAAE;QACP,yBAAyB;QACzB,+BAA+B;QAC/B,YAAY;QACZ,UAAU;AACX,KAAA;EACF;AAED;;;;;;;AAOG;AACH,SAAS,iBAAiB,GAAA;IACxB,OAAO;AACL,QAAA,YAAY,EAAE,EAAE;AAChB,QAAA,cAAc,EAAE,EAAE;AAClB,QAAA,OAAO,EAAE,EAAE;AACX,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,iBAAiB,EAAE,EAAE;AACrB,QAAA,kBAAkB,EAAE,KAAK;AACzB,QAAA,wBAAwB,EAAE,KAAK;AAC/B,QAAA,WAAW,EAAE,IAAI;KAClB,CAAA;AACH;;;;"}
|
|
@@ -3,7 +3,7 @@ import 'rxjs/operators';
|
|
|
3
3
|
import 'rxjs';
|
|
4
4
|
import { createWiring } from '../../wiring/wiring.utils.js';
|
|
5
5
|
|
|
6
|
-
/**
|
|
6
|
+
/** AI XModule name. */
|
|
7
7
|
const moduleName = 'ai';
|
|
8
8
|
/** WireCommit for AiXModule. */
|
|
9
9
|
const wireCommit = namespacedWireCommit(moduleName);
|
|
@@ -11,22 +11,24 @@ const wireCommit = namespacedWireCommit(moduleName);
|
|
|
11
11
|
const wireCommitWithoutPayload = namespacedWireCommitWithoutPayload(moduleName);
|
|
12
12
|
/** WireDispatch for AiXModule.*/
|
|
13
13
|
const wireDispatch = namespacedWireDispatch(moduleName);
|
|
14
|
-
/** Sets the
|
|
15
|
-
const
|
|
16
|
-
/** Sets the
|
|
17
|
-
const
|
|
18
|
-
/** Sets the
|
|
19
|
-
const
|
|
14
|
+
/** Sets the AI state from URL data. */
|
|
15
|
+
const setUrlParamsWire = wireDispatch('setUrlParams');
|
|
16
|
+
/** Sets the AI state `params`. */
|
|
17
|
+
const setExtraParamsWire = wireCommit('setParams');
|
|
18
|
+
/** Sets the AI state `query`. */
|
|
19
|
+
const setAiQueryWire = wireCommit('setQuery');
|
|
20
20
|
/** Fetches the AI suggestions streaming response. */
|
|
21
|
-
const
|
|
22
|
-
/** Fetches and save the
|
|
23
|
-
const
|
|
24
|
-
/** Sets the
|
|
25
|
-
const
|
|
21
|
+
const fetchAndSaveAiSuggestionsWire = wireDispatch('fetchAndSaveAiSuggestions');
|
|
22
|
+
/** Fetches and save the AI suggestions search response. */
|
|
23
|
+
const fetchAndSaveAiSuggestionsSearchWire = wireDispatch('fetchAndSaveAiSuggestionsSearch');
|
|
24
|
+
/** Sets the AI state `relatedTags`.*/
|
|
25
|
+
const setAiRelatedTagsWire = wireCommit('setAiRelatedTags');
|
|
26
26
|
/** Resets the related prompts state. */
|
|
27
|
-
const
|
|
27
|
+
const resetAiStateWire = wireCommitWithoutPayload('resetAiState');
|
|
28
28
|
/** Sets the origin for the AI requests. */
|
|
29
29
|
const saveAiOriginWire = wireDispatch('saveOrigin', ({ metadata }) => metadata);
|
|
30
|
+
/** Sets the AI state `selectedFilters`. */
|
|
31
|
+
const setSelectedFiltersWire = wireCommit('setSelectedFilters');
|
|
30
32
|
/**
|
|
31
33
|
* Wiring configuration for the {@link AiXModule | AI module}.
|
|
32
34
|
*
|
|
@@ -34,26 +36,29 @@ const saveAiOriginWire = wireDispatch('saveOrigin', ({ metadata }) => metadata);
|
|
|
34
36
|
*/
|
|
35
37
|
const aiWiring = createWiring({
|
|
36
38
|
ParamsLoadedFromUrl: {
|
|
37
|
-
|
|
39
|
+
setUrlParamsWire,
|
|
38
40
|
},
|
|
39
41
|
ExtraParamsChanged: {
|
|
40
|
-
|
|
42
|
+
setExtraParamsWire,
|
|
41
43
|
},
|
|
42
44
|
UserAcceptedAQuery: {
|
|
43
|
-
|
|
45
|
+
setAiQueryWire,
|
|
44
46
|
},
|
|
45
47
|
UserClearedQuery: {
|
|
46
|
-
|
|
48
|
+
setAiQueryWire,
|
|
47
49
|
},
|
|
48
50
|
AiSuggestionsRequestUpdated: {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
resetAiStateWire,
|
|
52
|
+
fetchAndSaveAiSuggestionsWire,
|
|
51
53
|
},
|
|
52
54
|
AiSuggestionsSearchRequestUpdated: {
|
|
53
|
-
|
|
55
|
+
fetchAndSaveAiSuggestionsSearchWire,
|
|
54
56
|
},
|
|
55
57
|
SelectedRelatedTagsChanged: {
|
|
56
|
-
|
|
58
|
+
setAiRelatedTagsWire,
|
|
59
|
+
},
|
|
60
|
+
SelectedFiltersForRequestChanged: {
|
|
61
|
+
setSelectedFiltersWire,
|
|
57
62
|
},
|
|
58
63
|
AiOverviewMounted: {
|
|
59
64
|
saveAiOriginWire,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/ai/wiring.ts"],"sourcesContent":["import {\n createWiring,\n namespacedWireCommit,\n namespacedWireCommitWithoutPayload,\n namespacedWireDispatch,\n} from '../../wiring'\n\n/**
|
|
1
|
+
{"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/ai/wiring.ts"],"sourcesContent":["import {\n createWiring,\n namespacedWireCommit,\n namespacedWireCommitWithoutPayload,\n namespacedWireDispatch,\n} from '../../wiring'\n\n/** AI XModule name. */\nconst moduleName = 'ai'\n/** WireCommit for AiXModule. */\nconst wireCommit = namespacedWireCommit(moduleName)\n/** WireCommitWithoutPayload for AiXModule. */\nconst wireCommitWithoutPayload = namespacedWireCommitWithoutPayload(moduleName)\n/** WireDispatch for AiXModule.*/\nconst wireDispatch = namespacedWireDispatch(moduleName)\n\n/** Sets the AI state from URL data. */\nconst setUrlParamsWire = wireDispatch('setUrlParams')\n/** Sets the AI state `params`. */\nconst setExtraParamsWire = wireCommit('setParams')\n\n/** Sets the AI state `query`. */\nconst setAiQueryWire = wireCommit('setQuery')\n\n/** Fetches the AI suggestions streaming response. */\nconst fetchAndSaveAiSuggestionsWire = wireDispatch('fetchAndSaveAiSuggestions')\n\n/** Fetches and save the AI suggestions search response. */\nconst fetchAndSaveAiSuggestionsSearchWire = wireDispatch('fetchAndSaveAiSuggestionsSearch')\n\n/** Sets the AI state `relatedTags`.*/\nconst setAiRelatedTagsWire = wireCommit('setAiRelatedTags')\n\n/** Resets the related prompts state. */\nconst resetAiStateWire = wireCommitWithoutPayload('resetAiState')\n\n/** Sets the origin for the AI requests. */\nconst saveAiOriginWire = wireDispatch('saveOrigin', ({ metadata }) => metadata)\n\n/** Sets the AI state `selectedFilters`. */\nconst setSelectedFiltersWire = wireCommit('setSelectedFilters')\n\n/**\n * Wiring configuration for the {@link AiXModule | AI module}.\n *\n * @internal\n */\nexport const aiWiring = createWiring({\n ParamsLoadedFromUrl: {\n setUrlParamsWire,\n },\n ExtraParamsChanged: {\n setExtraParamsWire,\n },\n UserAcceptedAQuery: {\n setAiQueryWire,\n },\n UserClearedQuery: {\n setAiQueryWire,\n },\n AiSuggestionsRequestUpdated: {\n resetAiStateWire,\n fetchAndSaveAiSuggestionsWire,\n },\n AiSuggestionsSearchRequestUpdated: {\n fetchAndSaveAiSuggestionsSearchWire,\n },\n SelectedRelatedTagsChanged: {\n setAiRelatedTagsWire,\n },\n SelectedFiltersForRequestChanged: {\n setSelectedFiltersWire,\n },\n AiOverviewMounted: {\n saveAiOriginWire,\n },\n})\n"],"names":[],"mappings":";;;;;AAOA;AACA,MAAM,UAAU,GAAG,IAAI,CAAA;AACvB;AACA,MAAM,UAAU,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAA;AACnD;AACA,MAAM,wBAAwB,GAAG,kCAAkC,CAAC,UAAU,CAAC,CAAA;AAC/E;AACA,MAAM,YAAY,GAAG,sBAAsB,CAAC,UAAU,CAAC,CAAA;AAEvD;AACA,MAAM,gBAAgB,GAAG,YAAY,CAAC,cAAc,CAAC,CAAA;AACrD;AACA,MAAM,kBAAkB,GAAG,UAAU,CAAC,WAAW,CAAC,CAAA;AAElD;AACA,MAAM,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC,CAAA;AAE7C;AACA,MAAM,6BAA6B,GAAG,YAAY,CAAC,2BAA2B,CAAC,CAAA;AAE/E;AACA,MAAM,mCAAmC,GAAG,YAAY,CAAC,iCAAiC,CAAC,CAAA;AAE3F;AACA,MAAM,oBAAoB,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAA;AAE3D;AACA,MAAM,gBAAgB,GAAG,wBAAwB,CAAC,cAAc,CAAC,CAAA;AAEjE;AACA,MAAM,gBAAgB,GAAG,YAAY,CAAC,YAAY,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,QAAQ,CAAC,CAAA;AAE/E;AACA,MAAM,sBAAsB,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAA;AAE/D;;;;AAIG;AACI,MAAM,QAAQ,GAAG,YAAY,CAAC;AACnC,IAAA,mBAAmB,EAAE;QACnB,gBAAgB;AACjB,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,kBAAkB;AACnB,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,cAAc;AACf,KAAA;AACD,IAAA,gBAAgB,EAAE;QAChB,cAAc;AACf,KAAA;AACD,IAAA,2BAA2B,EAAE;QAC3B,gBAAgB;QAChB,6BAA6B;AAC9B,KAAA;AACD,IAAA,iCAAiC,EAAE;QACjC,mCAAmC;AACpC,KAAA;AACD,IAAA,0BAA0B,EAAE;QAC1B,oBAAoB;AACrB,KAAA;AACD,IAAA,gCAAgC,EAAE;QAChC,sBAAsB;AACvB,KAAA;AACD,IAAA,iBAAiB,EAAE;QACjB,gBAAgB;AACjB,KAAA;AACF,CAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empathyco/x-components",
|
|
3
|
-
"version": "6.0.0-alpha.
|
|
3
|
+
"version": "6.0.0-alpha.163",
|
|
4
4
|
"description": "Empathy X Components",
|
|
5
5
|
"author": "Empathy Systems Corporation S.L.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -79,10 +79,10 @@
|
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@empathyco/x-adapter": "^8.1.0-alpha.9",
|
|
82
|
-
"@empathyco/x-adapter-platform": "^1.1.0-alpha.
|
|
82
|
+
"@empathyco/x-adapter-platform": "^1.1.0-alpha.37",
|
|
83
83
|
"@empathyco/x-deep-merge": "^2.0.3-alpha.9",
|
|
84
84
|
"@empathyco/x-storage-service": "^2.0.3-alpha.7",
|
|
85
|
-
"@empathyco/x-types": "^10.1.0-alpha.
|
|
85
|
+
"@empathyco/x-types": "^10.1.0-alpha.30",
|
|
86
86
|
"@empathyco/x-utils": "^1.0.3-alpha.8",
|
|
87
87
|
"@vue/devtools-api": "~6.5.0",
|
|
88
88
|
"@vueuse/core": "~10.11.0",
|
|
@@ -142,5 +142,5 @@
|
|
|
142
142
|
"access": "public",
|
|
143
143
|
"directory": "dist"
|
|
144
144
|
},
|
|
145
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "896de9ef1a7fd0d2e7368fb8b15c0dd7792bda4c"
|
|
146
146
|
}
|
|
@@ -2166,6 +2166,65 @@
|
|
|
2166
2166
|
"endIndex": 8
|
|
2167
2167
|
}
|
|
2168
2168
|
},
|
|
2169
|
+
{
|
|
2170
|
+
"kind": "Function",
|
|
2171
|
+
"canonicalReference": "@empathyco/x-adapter-platform!mapFilters:function(1)",
|
|
2172
|
+
"docComment": "/**\n * Converts the filters to the shape the Platform's API is expecting.\n *\n * @param filters - The filters from our internal request.\n *\n * @returns The filters ready to be consumed for the API.\n *\n * @example\n * ```ts\n * const filters = {\n * offer: [\n * {\n * facetId: 'offer',\n * modelName: 'SimpleFilter',\n * id: 'price:[0 TO 10]',\n * selected: true,\n * label: 'In Offer'\n * } as SimpleFilter\n * ],\n * categoryPaths: [\n * {\n * facetId: 'categoryPaths',\n * id: 'categoryIds:ffc61e1e9__be257cb26',\n * label: 'Fragrance',\n * modelName: 'HierarchicalFilter',\n * parentId: 'categoryIds:ffc61e1e9',\n * selected: true,\n * totalResults: 1\n * },\n * {\n * facetId: 'categoryPaths',\n * id: 'categoryIds:ffc61e1e9__fa5ef54f2',\n * label: 'Fragrance',\n * modelName: 'HierarchicalFilter',\n * parentId: 'categoryIds:ffc61e1e9',\n * selected: true,\n * totalResults: 1\n * },\n * {\n * children: ['categoryIds:ffc61e1e9__be257cb26', 'categoryIds:ffc61e1e9__fa5ef54f2'],\n * facetId: 'categoryPaths',\n * id: 'categoryIds:ffc61e1e9',\n * label: 'Personal Care',\n * modelName: 'HierarchicalFilter',\n * parentId: null,\n * selected: true,\n * totalResults: 1\n * }\n * ]\n * };\n *\n * const mappedFilters = mapFilters({ filters });\n * mappedFilters is [\n * 'price:[0 TO 10]',\n * 'categoryIds:ffc61e1e9__be257cb26',\n * 'categoryIds:ffc61e1e9__fa5ef54f2'\n * ];\n * ```\n *\n */\n",
|
|
2173
|
+
"excerptTokens": [
|
|
2174
|
+
{
|
|
2175
|
+
"kind": "Content",
|
|
2176
|
+
"text": "export declare function mapFilters(filters?: "
|
|
2177
|
+
},
|
|
2178
|
+
{
|
|
2179
|
+
"kind": "Reference",
|
|
2180
|
+
"text": "Record",
|
|
2181
|
+
"canonicalReference": "!Record:type"
|
|
2182
|
+
},
|
|
2183
|
+
{
|
|
2184
|
+
"kind": "Content",
|
|
2185
|
+
"text": "<string, "
|
|
2186
|
+
},
|
|
2187
|
+
{
|
|
2188
|
+
"kind": "Reference",
|
|
2189
|
+
"text": "Filter",
|
|
2190
|
+
"canonicalReference": "@empathyco/x-adapter-platform!Filter:interface"
|
|
2191
|
+
},
|
|
2192
|
+
{
|
|
2193
|
+
"kind": "Content",
|
|
2194
|
+
"text": "[]>"
|
|
2195
|
+
},
|
|
2196
|
+
{
|
|
2197
|
+
"kind": "Content",
|
|
2198
|
+
"text": "): "
|
|
2199
|
+
},
|
|
2200
|
+
{
|
|
2201
|
+
"kind": "Content",
|
|
2202
|
+
"text": "string[]"
|
|
2203
|
+
},
|
|
2204
|
+
{
|
|
2205
|
+
"kind": "Content",
|
|
2206
|
+
"text": ";"
|
|
2207
|
+
}
|
|
2208
|
+
],
|
|
2209
|
+
"fileUrlPath": "dist/types/mappers/filter.utils.d.ts",
|
|
2210
|
+
"returnTypeTokenRange": {
|
|
2211
|
+
"startIndex": 6,
|
|
2212
|
+
"endIndex": 7
|
|
2213
|
+
},
|
|
2214
|
+
"releaseTag": "Public",
|
|
2215
|
+
"overloadIndex": 1,
|
|
2216
|
+
"parameters": [
|
|
2217
|
+
{
|
|
2218
|
+
"parameterName": "filters",
|
|
2219
|
+
"parameterTypeTokenRange": {
|
|
2220
|
+
"startIndex": 1,
|
|
2221
|
+
"endIndex": 5
|
|
2222
|
+
},
|
|
2223
|
+
"isOptional": true
|
|
2224
|
+
}
|
|
2225
|
+
],
|
|
2226
|
+
"name": "mapFilters"
|
|
2227
|
+
},
|
|
2169
2228
|
{
|
|
2170
2229
|
"kind": "Variable",
|
|
2171
2230
|
"canonicalReference": "@empathyco/x-adapter-platform!nextQueriesEndpointAdapter:var",
|
|
@@ -1397,6 +1397,42 @@
|
|
|
1397
1397
|
"endIndex": 2
|
|
1398
1398
|
}
|
|
1399
1399
|
},
|
|
1400
|
+
{
|
|
1401
|
+
"kind": "PropertySignature",
|
|
1402
|
+
"canonicalReference": "@empathyco/x-components!AiMutations#setSelectedFilters:member",
|
|
1403
|
+
"docComment": "/**\n * Sets the selected filters of the module.\n *\n * @param selectedFilters - The new selected filters to save to the state.\n */\n",
|
|
1404
|
+
"excerptTokens": [
|
|
1405
|
+
{
|
|
1406
|
+
"kind": "Content",
|
|
1407
|
+
"text": "setSelectedFilters: "
|
|
1408
|
+
},
|
|
1409
|
+
{
|
|
1410
|
+
"kind": "Content",
|
|
1411
|
+
"text": "(selectedFilters: "
|
|
1412
|
+
},
|
|
1413
|
+
{
|
|
1414
|
+
"kind": "Reference",
|
|
1415
|
+
"text": "Filter",
|
|
1416
|
+
"canonicalReference": "@empathyco/x-components!Filter:interface"
|
|
1417
|
+
},
|
|
1418
|
+
{
|
|
1419
|
+
"kind": "Content",
|
|
1420
|
+
"text": "[]) => void"
|
|
1421
|
+
},
|
|
1422
|
+
{
|
|
1423
|
+
"kind": "Content",
|
|
1424
|
+
"text": ";"
|
|
1425
|
+
}
|
|
1426
|
+
],
|
|
1427
|
+
"isReadonly": false,
|
|
1428
|
+
"isOptional": false,
|
|
1429
|
+
"releaseTag": "Public",
|
|
1430
|
+
"name": "setSelectedFilters",
|
|
1431
|
+
"propertyTypeTokenRange": {
|
|
1432
|
+
"startIndex": 1,
|
|
1433
|
+
"endIndex": 4
|
|
1434
|
+
}
|
|
1435
|
+
},
|
|
1400
1436
|
{
|
|
1401
1437
|
"kind": "PropertySignature",
|
|
1402
1438
|
"canonicalReference": "@empathyco/x-components!AiMutations#setSuggestionsLoading:member",
|
|
@@ -2152,6 +2188,47 @@
|
|
|
2152
2188
|
"endIndex": 2
|
|
2153
2189
|
}
|
|
2154
2190
|
},
|
|
2191
|
+
{
|
|
2192
|
+
"kind": "PropertySignature",
|
|
2193
|
+
"canonicalReference": "@empathyco/x-components!AiState#selectedFilters:member",
|
|
2194
|
+
"docComment": "/**\n * The dictionary of selected filters, used to perform the AI requests. The key is the facet ID, and the value the list of filters for that facet.\n */\n",
|
|
2195
|
+
"excerptTokens": [
|
|
2196
|
+
{
|
|
2197
|
+
"kind": "Content",
|
|
2198
|
+
"text": "selectedFilters: "
|
|
2199
|
+
},
|
|
2200
|
+
{
|
|
2201
|
+
"kind": "Reference",
|
|
2202
|
+
"text": "Dictionary",
|
|
2203
|
+
"canonicalReference": "@empathyco/x-utils!Dictionary:type"
|
|
2204
|
+
},
|
|
2205
|
+
{
|
|
2206
|
+
"kind": "Content",
|
|
2207
|
+
"text": "<"
|
|
2208
|
+
},
|
|
2209
|
+
{
|
|
2210
|
+
"kind": "Reference",
|
|
2211
|
+
"text": "Filter",
|
|
2212
|
+
"canonicalReference": "@empathyco/x-components!Filter:interface"
|
|
2213
|
+
},
|
|
2214
|
+
{
|
|
2215
|
+
"kind": "Content",
|
|
2216
|
+
"text": "[]>"
|
|
2217
|
+
},
|
|
2218
|
+
{
|
|
2219
|
+
"kind": "Content",
|
|
2220
|
+
"text": ";"
|
|
2221
|
+
}
|
|
2222
|
+
],
|
|
2223
|
+
"isReadonly": false,
|
|
2224
|
+
"isOptional": false,
|
|
2225
|
+
"releaseTag": "Public",
|
|
2226
|
+
"name": "selectedFilters",
|
|
2227
|
+
"propertyTypeTokenRange": {
|
|
2228
|
+
"startIndex": 1,
|
|
2229
|
+
"endIndex": 5
|
|
2230
|
+
}
|
|
2231
|
+
},
|
|
2155
2232
|
{
|
|
2156
2233
|
"kind": "PropertySignature",
|
|
2157
2234
|
"canonicalReference": "@empathyco/x-components!AiState#suggestionsLoading:member",
|
|
@@ -211,6 +211,8 @@ export interface AiMutations extends ConfigMutations<AiState>, QueryMutations {
|
|
|
211
211
|
// Warning: (ae-forgotten-export) The symbol "AiSuggestionQuery" needs to be exported by the entry point index.d.ts
|
|
212
212
|
setQueries: (queries: AiSuggestionQuery[]) => void;
|
|
213
213
|
setResponseText: (responseText: string) => void;
|
|
214
|
+
// Warning: (ae-forgotten-export) The symbol "Filter" needs to be exported by the entry point index.d.ts
|
|
215
|
+
setSelectedFilters: (selectedFilters: Filter[]) => void;
|
|
214
216
|
setSuggestionsLoading: (value: boolean) => void;
|
|
215
217
|
// Warning: (ae-forgotten-export) The symbol "AiSuggestionSearch" needs to be exported by the entry point index.d.ts
|
|
216
218
|
setSuggestionsSearch: (suggestionsSearch: AiSuggestionSearch[]) => void;
|
|
@@ -306,6 +308,7 @@ export interface AiState extends QueryState {
|
|
|
306
308
|
queries: AiSuggestionQuery[];
|
|
307
309
|
relatedTags: RelatedTag_2[];
|
|
308
310
|
responseText: string;
|
|
311
|
+
selectedFilters: Dictionary<Filter[]>;
|
|
309
312
|
suggestionsLoading: boolean;
|
|
310
313
|
suggestionsSearch: AiSuggestionSearch[];
|
|
311
314
|
suggestionsSearchLoading: boolean;
|
|
@@ -318,26 +321,29 @@ export interface AiState extends QueryState {
|
|
|
318
321
|
// @internal
|
|
319
322
|
export const aiWiring: {
|
|
320
323
|
ParamsLoadedFromUrl: {
|
|
321
|
-
|
|
324
|
+
setUrlParamsWire: Wire<UrlParams>;
|
|
322
325
|
};
|
|
323
326
|
ExtraParamsChanged: {
|
|
324
|
-
|
|
327
|
+
setExtraParamsWire: Wire<Dictionary<unknown>>;
|
|
325
328
|
};
|
|
326
329
|
UserAcceptedAQuery: {
|
|
327
|
-
|
|
330
|
+
setAiQueryWire: Wire<string>;
|
|
328
331
|
};
|
|
329
332
|
UserClearedQuery: {
|
|
330
|
-
|
|
333
|
+
setAiQueryWire: Wire<string>;
|
|
331
334
|
};
|
|
332
335
|
AiSuggestionsRequestUpdated: {
|
|
333
|
-
|
|
334
|
-
|
|
336
|
+
resetAiStateWire: AnyWire;
|
|
337
|
+
fetchAndSaveAiSuggestionsWire: Wire<AiSuggestionsRequest | null>;
|
|
335
338
|
};
|
|
336
339
|
AiSuggestionsSearchRequestUpdated: {
|
|
337
|
-
|
|
340
|
+
fetchAndSaveAiSuggestionsSearchWire: Wire<AiSuggestionsSearchRequest | null>;
|
|
338
341
|
};
|
|
339
342
|
SelectedRelatedTagsChanged: {
|
|
340
|
-
|
|
343
|
+
setAiRelatedTagsWire: Wire<RelatedTag_2[]>;
|
|
344
|
+
};
|
|
345
|
+
SelectedFiltersForRequestChanged: {
|
|
346
|
+
setSelectedFiltersWire: Wire<Filter[]>;
|
|
341
347
|
};
|
|
342
348
|
AiOverviewMounted: {
|
|
343
349
|
saveAiOriginWire: AnyWire;
|
|
@@ -438,8 +444,6 @@ export type AnyXStoreModule = XStoreModule<any, any, any, any>;
|
|
|
438
444
|
// @public
|
|
439
445
|
export type AnyXStoreModuleOption = XStoreModuleOptions<AnyXStoreModule>;
|
|
440
446
|
|
|
441
|
-
// Warning: (ae-forgotten-export) The symbol "Filter" needs to be exported by the entry point index.d.ts
|
|
442
|
-
//
|
|
443
447
|
// @public
|
|
444
448
|
export function areFiltersDifferent(someFilters: Filter[], anotherFilters: Filter[]): boolean;
|
|
445
449
|
|
package/report/x-types.api.json
CHANGED
|
@@ -885,6 +885,15 @@
|
|
|
885
885
|
"text": "TrackableRequest",
|
|
886
886
|
"canonicalReference": "@empathyco/x-types!TrackableRequest:interface"
|
|
887
887
|
},
|
|
888
|
+
{
|
|
889
|
+
"kind": "Content",
|
|
890
|
+
"text": ", "
|
|
891
|
+
},
|
|
892
|
+
{
|
|
893
|
+
"kind": "Reference",
|
|
894
|
+
"text": "FilterableRequest",
|
|
895
|
+
"canonicalReference": "@empathyco/x-types!FilterableRequest:interface"
|
|
896
|
+
},
|
|
888
897
|
{
|
|
889
898
|
"kind": "Content",
|
|
890
899
|
"text": " "
|
|
@@ -931,6 +940,10 @@
|
|
|
931
940
|
{
|
|
932
941
|
"startIndex": 3,
|
|
933
942
|
"endIndex": 4
|
|
943
|
+
},
|
|
944
|
+
{
|
|
945
|
+
"startIndex": 5,
|
|
946
|
+
"endIndex": 6
|
|
934
947
|
}
|
|
935
948
|
]
|
|
936
949
|
},
|
|
@@ -957,6 +970,15 @@
|
|
|
957
970
|
"text": "TrackableRequest",
|
|
958
971
|
"canonicalReference": "@empathyco/x-types!TrackableRequest:interface"
|
|
959
972
|
},
|
|
973
|
+
{
|
|
974
|
+
"kind": "Content",
|
|
975
|
+
"text": ", "
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
"kind": "Reference",
|
|
979
|
+
"text": "FilterableRequest",
|
|
980
|
+
"canonicalReference": "@empathyco/x-types!FilterableRequest:interface"
|
|
981
|
+
},
|
|
960
982
|
{
|
|
961
983
|
"kind": "Content",
|
|
962
984
|
"text": " "
|
|
@@ -1003,6 +1025,10 @@
|
|
|
1003
1025
|
{
|
|
1004
1026
|
"startIndex": 3,
|
|
1005
1027
|
"endIndex": 4
|
|
1028
|
+
},
|
|
1029
|
+
{
|
|
1030
|
+
"startIndex": 5,
|
|
1031
|
+
"endIndex": 6
|
|
1006
1032
|
}
|
|
1007
1033
|
]
|
|
1008
1034
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestions-search-request.getter.d.ts","sourceRoot":"","sources":["../../../../../../src/x-modules/ai/store/getters/suggestions-search-request.getter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC,0BAA0B,
|
|
1
|
+
{"version":3,"file":"suggestions-search-request.getter.d.ts","sourceRoot":"","sources":["../../../../../../src/x-modules/ai/store/getters/suggestions-search-request.getter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC,0BAA0B,CAO1F,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/ai/store/module.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/ai/store/module.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAe7C;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,cAuE5B,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AiSuggestionQuery, AiSuggestionSearch, AiSuggestionsRequest, AiSuggestionsSearchRequest, AiSuggestionTagging, RelatedTag } from '@empathyco/x-types';
|
|
1
|
+
import type { AiSuggestionQuery, AiSuggestionSearch, AiSuggestionsRequest, AiSuggestionsSearchRequest, AiSuggestionTagging, Filter, RelatedTag } from '@empathyco/x-types';
|
|
2
2
|
import type { Dictionary } from '@empathyco/x-utils';
|
|
3
3
|
import type { ConfigMutations, QueryMutations, QueryState, XActionContext, XStoreModule } from '../../../store';
|
|
4
4
|
import type { QueryOrigin, QueryOriginInit, UrlParams } from '../../../types';
|
|
@@ -29,6 +29,11 @@ export interface AiState extends QueryState {
|
|
|
29
29
|
isNoResults: boolean;
|
|
30
30
|
/** The origin property of the request. */
|
|
31
31
|
origin: QueryOrigin | null;
|
|
32
|
+
/**
|
|
33
|
+
* The dictionary of selected filters, used to perform the AI requests.
|
|
34
|
+
* The key is the facet ID, and the value the list of filters for that facet.
|
|
35
|
+
*/
|
|
36
|
+
selectedFilters: Dictionary<Filter[]>;
|
|
32
37
|
}
|
|
33
38
|
/**
|
|
34
39
|
* Ai module getters.
|
|
@@ -124,6 +129,12 @@ export interface AiMutations extends ConfigMutations<AiState>, QueryMutations {
|
|
|
124
129
|
* @param origin - The new origin.
|
|
125
130
|
*/
|
|
126
131
|
setOrigin: (origin: QueryOrigin | undefined | null) => void;
|
|
132
|
+
/**
|
|
133
|
+
* Sets the selected filters of the module.
|
|
134
|
+
*
|
|
135
|
+
* @param selectedFilters - The new selected filters to save to the state.
|
|
136
|
+
*/
|
|
137
|
+
setSelectedFilters: (selectedFilters: Filter[]) => void;
|
|
127
138
|
}
|
|
128
139
|
/**
|
|
129
140
|
* Ai module actions.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/ai/store/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,mBAAmB,EACnB,UAAU,EACX,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EACV,eAAe,EACf,cAAc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wire<import("../..").UrlParams>;
|
|
9
9
|
};
|
|
10
10
|
ExtraParamsChanged: {
|
|
11
|
-
|
|
11
|
+
setExtraParamsWire: import("../../wiring").Wire<import("@empathyco/x-utils").Dictionary<unknown>>;
|
|
12
12
|
};
|
|
13
13
|
UserAcceptedAQuery: {
|
|
14
|
-
|
|
14
|
+
setAiQueryWire: import("../../wiring").Wire<string>;
|
|
15
15
|
};
|
|
16
16
|
UserClearedQuery: {
|
|
17
|
-
|
|
17
|
+
setAiQueryWire: import("../../wiring").Wire<string>;
|
|
18
18
|
};
|
|
19
19
|
AiSuggestionsRequestUpdated: {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
resetAiStateWire: import("../../wiring").AnyWire;
|
|
21
|
+
fetchAndSaveAiSuggestionsWire: import("../../wiring").Wire<import("@empathyco/x-types").AiSuggestionsRequest | null>;
|
|
22
22
|
};
|
|
23
23
|
AiSuggestionsSearchRequestUpdated: {
|
|
24
|
-
|
|
24
|
+
fetchAndSaveAiSuggestionsSearchWire: import("../../wiring").Wire<import("@empathyco/x-types").AiSuggestionsSearchRequest | null>;
|
|
25
25
|
};
|
|
26
26
|
SelectedRelatedTagsChanged: {
|
|
27
|
-
|
|
27
|
+
setAiRelatedTagsWire: import("../../wiring").Wire<import("@empathyco/x-types").RelatedTag[]>;
|
|
28
|
+
};
|
|
29
|
+
SelectedFiltersForRequestChanged: {
|
|
30
|
+
setSelectedFiltersWire: import("../../wiring").Wire<import("@empathyco/x-types").Filter[]>;
|
|
28
31
|
};
|
|
29
32
|
AiOverviewMounted: {
|
|
30
33
|
saveAiOriginWire: import("../../wiring").AnyWire;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring.d.ts","sourceRoot":"","sources":["../../../../src/x-modules/ai/wiring.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wiring.d.ts","sourceRoot":"","sources":["../../../../src/x-modules/ai/wiring.ts"],"names":[],"mappings":"AA0CA;;;;GAIG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BnB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"related-prompts-tag-list.vue?vue&type=script&lang.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/related-prompts/components/related-prompts-tag-list.vue?vue&type=script&lang.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AAQnC;;;;;;;GAOG;;IAMC;;;;OAIG;;IAEH;;;;OAIG;;;;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;;OAKG;eACiB,QAAQ,CAAC,MAAM,EAAE,CAAC;IACtC;;;;OAIG;;;;;;8BAoE8B,MAAM,KAAG,IAAI;wBAiEnB,OAAO;kBAeb,OAAO,QAAQ,MAAM,IAAI;kBAkBzB,OAAO,QAAQ,MAAM,IAAI;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"related-prompts-tag-list.vue?vue&type=script&lang.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/related-prompts/components/related-prompts-tag-list.vue?vue&type=script&lang.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AAQnC;;;;;;;GAOG;;IAMC;;;;OAIG;;IAEH;;;;OAIG;;;;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;;OAKG;eACiB,QAAQ,CAAC,MAAM,EAAE,CAAC;IACtC;;;;OAIG;;;;;;8BAoE8B,MAAM,KAAG,IAAI;wBAiEnB,OAAO;kBAeb,OAAO,QAAQ,MAAM,IAAI;kBAkBzB,OAAO,QAAQ,MAAM,IAAI;;;;;;;;;;;iCAoCq0Z,CAAC;sCAAqD,CAAC;8BAA6C,CAAC;;;;;;;;;;;;;IA7Ox9Z;;;;OAIG;;IAEH;;;;OAIG;;;;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;;OAKG;eACiB,QAAQ,CAAC,MAAM,EAAE,CAAC;IACtC;;;;OAIG;;;;;;;;;AAxCP,wBAiPE"}
|