@empathyco/x-components 6.0.0-alpha.159 → 6.0.0-alpha.160
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 +8 -0
- package/docs/API-reference/api/x-components.aiactions.md +1 -0
- package/docs/API-reference/api/x-components.aiactions.saveorigin.md +13 -0
- package/docs/API-reference/api/x-components.aimutations.md +1 -0
- package/docs/API-reference/api/x-components.aimutations.setorigin.md +13 -0
- package/docs/API-reference/api/x-components.aistate.md +1 -0
- package/docs/API-reference/api/x-components.aistate.origin.md +13 -0
- package/docs/API-reference/api/x-components.aixevents.aioverviewmounted.md +11 -0
- package/docs/API-reference/api/x-components.aixevents.md +1 -0
- package/docs/API-reference/api/x-components.baseeventsmodalclose.md +1 -1
- package/docs/API-reference/api/x-components.baseeventsmodalopen.md +1 -1
- package/docs/API-reference/api/x-components.hierarchicalfilter.md +1 -0
- package/docs/API-reference/api/x-components.simplefilter.md +1 -0
- package/docs/API-reference/api/x-components.snippetcallbacks.md +1 -0
- package/docs/API-reference/api/x-types.aisuggestionsrequest.md +2 -2
- package/docs/API-reference/api/x-types.aisuggestionssearchrequest.md +2 -2
- package/js/x-modules/ai/components/ai-overview.vue.js.map +1 -1
- package/js/x-modules/ai/components/ai-overview.vue2.js +5 -2
- package/js/x-modules/ai/components/ai-overview.vue2.js.map +1 -1
- package/js/x-modules/ai/store/actions/save-origin.action.js +16 -0
- package/js/x-modules/ai/store/actions/save-origin.action.js.map +1 -0
- 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 +6 -0
- package/js/x-modules/ai/store/module.js.map +1 -1
- package/js/x-modules/ai/wiring.js +5 -0
- package/js/x-modules/ai/wiring.js.map +1 -1
- package/package.json +4 -4
- package/report/x-components.api.json +145 -5
- package/report/x-components.api.md +13 -2
- package/report/x-types.api.json +26 -0
- package/types/components/modals/base-events-modal-close.vue.d.ts +1 -1
- package/types/components/modals/base-events-modal-open.vue.d.ts +1 -1
- package/types/components/snippet-callbacks.vue.d.ts +1 -0
- package/types/components/snippet-callbacks.vue.d.ts.map +1 -1
- package/types/x-modules/ai/components/ai-overview.vue.d.ts.map +1 -1
- package/types/x-modules/ai/events.types.d.ts +1 -0
- package/types/x-modules/ai/events.types.d.ts.map +1 -1
- package/types/x-modules/ai/store/actions/save-origin.action.d.ts +11 -0
- package/types/x-modules/ai/store/actions/save-origin.action.d.ts.map +1 -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 +15 -1
- package/types/x-modules/ai/store/types.d.ts.map +1 -1
- package/types/x-modules/ai/wiring.d.ts +3 -0
- package/types/x-modules/ai/wiring.d.ts.map +1 -1
- package/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts +1 -0
- package/types/x-modules/facets/components/filters/hierarchical-filter.vue.d.ts.map +1 -1
- package/types/x-modules/facets/components/filters/simple-filter.vue.d.ts +1 -0
- package/types/x-modules/facets/components/filters/simple-filter.vue.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,14 @@
|
|
|
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.160 (2025-10-02)
|
|
7
|
+
|
|
8
|
+
* feat(AiOverview): add origin field to the store module (#1893) ([355ace6](https://github.com/empathyco/x/commit/355ace6)), closes [#1893](https://github.com/empathyco/x/issues/1893)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## 6.0.0-alpha.159 (2025-10-01)
|
|
7
15
|
|
|
8
16
|
* chore(deps): pin dependency @empathyco/x-tailwindcss to 2.0.0-alpha.16 (#1834) ([69e6d9b](https://github.com/empathyco/x/commit/69e6d9b)), closes [#1834](https://github.com/empathyco/x/issues/1834)
|
|
@@ -18,5 +18,6 @@ export interface AiActions
|
|
|
18
18
|
| --- | --- | --- | --- |
|
|
19
19
|
| [fetchAndSaveAiSuggestions](./x-components.aiactions.fetchandsaveaisuggestions.md) | | (request: AiSuggestionsRequest \| null) => void | Requests suggestions for the module ai. |
|
|
20
20
|
| [fetchAndSaveAiSuggestionsSearch](./x-components.aiactions.fetchandsaveaisuggestionssearch.md) | | (request: AiSuggestionsSearchRequest \| null) => void | Requests suggestions search for the module ai. |
|
|
21
|
+
| [saveOrigin](./x-components.aiactions.saveorigin.md) | | (originInit: [QueryOriginInit](./x-components.queryorigininit.md)<!-- -->) => void | Creates a [QueryOrigin](./x-components.queryorigin.md) and saves it. |
|
|
21
22
|
| [setUrlParams](./x-components.aiactions.seturlparams.md) | | (urlParams: [UrlParams](./x-components.urlparams.md)<!-- -->) => void | Checks if the URL has params on it and then updates the state with these values. |
|
|
22
23
|
|
|
@@ -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) > [AiActions](./x-components.aiactions.md) > [saveOrigin](./x-components.aiactions.saveorigin.md)
|
|
4
|
+
|
|
5
|
+
## AiActions.saveOrigin property
|
|
6
|
+
|
|
7
|
+
Creates a [QueryOrigin](./x-components.queryorigin.md) and saves it.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
saveOrigin: (originInit: QueryOriginInit) => void;
|
|
13
|
+
```
|
|
@@ -20,6 +20,7 @@ export interface AiMutations extends ConfigMutations<AiState>, QueryMutations
|
|
|
20
20
|
| [resetAiState](./x-components.aimutations.resetaistate.md) | | () => void | Resets the ai state. |
|
|
21
21
|
| [setAiRelatedTags](./x-components.aimutations.setairelatedtags.md) | | (relatedTags: RelatedTag\[\]) => void | Sets the related tags of the module. |
|
|
22
22
|
| [setIsNoResults](./x-components.aimutations.setisnoresults.md) | | (isNoResults: boolean) => void | Sets the no results flag of the module. |
|
|
23
|
+
| [setOrigin](./x-components.aimutations.setorigin.md) | | (origin: [QueryOrigin](./x-components.queryorigin.md) \| undefined \| null) => void | Sets the origin of the module. |
|
|
23
24
|
| [setParams](./x-components.aimutations.setparams.md) | | (params: Dictionary<unknown>) => void | Sets the extra params of the module. |
|
|
24
25
|
| [setQueries](./x-components.aimutations.setqueries.md) | | (queries: AiSuggestionQuery\[\]) => void | Sets the queries from the streamed response. |
|
|
25
26
|
| [setResponseText](./x-components.aimutations.setresponsetext.md) | | (responseText: string) => void | Sets the responseText from the streamed 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) > [setOrigin](./x-components.aimutations.setorigin.md)
|
|
4
|
+
|
|
5
|
+
## AiMutations.setOrigin property
|
|
6
|
+
|
|
7
|
+
Sets the origin of the module.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
setOrigin: (origin: QueryOrigin | undefined | null) => void;
|
|
13
|
+
```
|
|
@@ -19,6 +19,7 @@ export interface AiState extends QueryState
|
|
|
19
19
|
| --- | --- | --- | --- |
|
|
20
20
|
| [config](./x-components.aistate.config.md) | | [AiConfig](./x-components.aiconfig.md) | |
|
|
21
21
|
| [isNoResults](./x-components.aistate.isnoresults.md) | | boolean | Flag to indicate that the AI response has no results |
|
|
22
|
+
| [origin](./x-components.aistate.origin.md) | | [QueryOrigin](./x-components.queryorigin.md) \| null | The origin property of the request. |
|
|
22
23
|
| [params](./x-components.aistate.params.md) | | Dictionary<unknown> | The extra params property of the state. |
|
|
23
24
|
| [queries](./x-components.aistate.queries.md) | | AiSuggestionQuery\[\] | |
|
|
24
25
|
| [relatedTags](./x-components.aistate.relatedtags.md) | | RelatedTag\[\] | The list of the related tags, related to the <code>query</code> property of the state. |
|
|
@@ -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) > [origin](./x-components.aistate.origin.md)
|
|
4
|
+
|
|
5
|
+
## AiState.origin property
|
|
6
|
+
|
|
7
|
+
The origin property of the request.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
origin: QueryOrigin | null;
|
|
13
|
+
```
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [AiXEvents](./x-components.aixevents.md) > [AiOverviewMounted](./x-components.aixevents.aioverviewmounted.md)
|
|
4
|
+
|
|
5
|
+
## AiXEvents.AiOverviewMounted property
|
|
6
|
+
|
|
7
|
+
**Signature:**
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
AiOverviewMounted: void;
|
|
11
|
+
```
|
|
@@ -16,6 +16,7 @@ export interface AiXEvents
|
|
|
16
16
|
|
|
17
17
|
| Property | Modifiers | Type | Description |
|
|
18
18
|
| --- | --- | --- | --- |
|
|
19
|
+
| [AiOverviewMounted](./x-components.aixevents.aioverviewmounted.md) | | void | |
|
|
19
20
|
| [AiSuggestionsRequestUpdated](./x-components.aixevents.aisuggestionsrequestupdated.md) | | AiSuggestionsRequest \| null | |
|
|
20
21
|
| [AiSuggestionsSearchRequestUpdated](./x-components.aixevents.aisuggestionssearchrequestupdated.md) | | AiSuggestionsSearchRequest \| null | |
|
|
21
22
|
| [UserClickedAiOverviewExpandButton](./x-components.aixevents.userclickedaioverviewexpandbutton.md) | | boolean | |
|
|
@@ -22,6 +22,6 @@ _default: import("vue").DefineComponent<{
|
|
|
22
22
|
default: string;
|
|
23
23
|
};
|
|
24
24
|
}>>, {
|
|
25
|
-
closingEvent: "UserClickedCloseEventsModal" | "UserClickedCloseX" | "UserClickedOutOfMainModal" | "UserClickedOpenEventsModal" | "UserClickedOpenX" | "UserClickedOutOfEventsModal" | "UserOpenXProgrammatically" | "UserReachedEmpathizeTop" | "EmpathizeClosed" | "EmpathizeOpened" | "UserClosedEmpathize" | "UserPressedClearHistoryQueries" | "UserClickedEnableHistoryQueries" | "UserClickedDisableHistoryQueries" | "UserClickedConfirmDisableHistoryQueries" | "UserClickedDismissDisableHistoryQueries" | "ScrollRestoreSucceeded" | "ScrollRestoreFailed" | "UserHoveredInSearchBox" | "UserHoveredOutSearchBox" | "UserBlurredSearchBox" | "UserClickedSearchBox" | "UserFocusedSearchBox" | "UserPressedClearSearchBoxButton" | "ReloadSearchRequested" | "UserReachedResultsListEnd" | "UserClickedAbortARedirection" | "RelatedPromptsUnmounted" | "ReloadRelatedPromptsRequested";
|
|
25
|
+
closingEvent: "UserClickedCloseEventsModal" | "UserClickedCloseX" | "UserClickedOutOfMainModal" | "UserClickedOpenEventsModal" | "UserClickedOpenX" | "UserClickedOutOfEventsModal" | "UserOpenXProgrammatically" | "UserReachedEmpathizeTop" | "EmpathizeClosed" | "EmpathizeOpened" | "UserClosedEmpathize" | "UserPressedClearHistoryQueries" | "UserClickedEnableHistoryQueries" | "UserClickedDisableHistoryQueries" | "UserClickedConfirmDisableHistoryQueries" | "UserClickedDismissDisableHistoryQueries" | "ScrollRestoreSucceeded" | "ScrollRestoreFailed" | "UserHoveredInSearchBox" | "UserHoveredOutSearchBox" | "UserBlurredSearchBox" | "UserClickedSearchBox" | "UserFocusedSearchBox" | "UserPressedClearSearchBoxButton" | "ReloadSearchRequested" | "UserReachedResultsListEnd" | "UserClickedAbortARedirection" | "RelatedPromptsUnmounted" | "ReloadRelatedPromptsRequested" | "AiOverviewMounted";
|
|
26
26
|
}, {}>
|
|
27
27
|
```
|
|
@@ -22,6 +22,6 @@ _default: import("vue").DefineComponent<{
|
|
|
22
22
|
default: string;
|
|
23
23
|
};
|
|
24
24
|
}>>, {
|
|
25
|
-
openingEvent: "UserClickedCloseEventsModal" | "UserClickedCloseX" | "UserClickedOutOfMainModal" | "UserClickedOpenEventsModal" | "UserClickedOpenX" | "UserClickedOutOfEventsModal" | "UserOpenXProgrammatically" | "UserReachedEmpathizeTop" | "EmpathizeClosed" | "EmpathizeOpened" | "UserClosedEmpathize" | "UserPressedClearHistoryQueries" | "UserClickedEnableHistoryQueries" | "UserClickedDisableHistoryQueries" | "UserClickedConfirmDisableHistoryQueries" | "UserClickedDismissDisableHistoryQueries" | "ScrollRestoreSucceeded" | "ScrollRestoreFailed" | "UserHoveredInSearchBox" | "UserHoveredOutSearchBox" | "UserBlurredSearchBox" | "UserClickedSearchBox" | "UserFocusedSearchBox" | "UserPressedClearSearchBoxButton" | "ReloadSearchRequested" | "UserReachedResultsListEnd" | "UserClickedAbortARedirection" | "RelatedPromptsUnmounted" | "ReloadRelatedPromptsRequested";
|
|
25
|
+
openingEvent: "UserClickedCloseEventsModal" | "UserClickedCloseX" | "UserClickedOutOfMainModal" | "UserClickedOpenEventsModal" | "UserClickedOpenX" | "UserClickedOutOfEventsModal" | "UserOpenXProgrammatically" | "UserReachedEmpathizeTop" | "EmpathizeClosed" | "EmpathizeOpened" | "UserClosedEmpathize" | "UserPressedClearHistoryQueries" | "UserClickedEnableHistoryQueries" | "UserClickedDisableHistoryQueries" | "UserClickedConfirmDisableHistoryQueries" | "UserClickedDismissDisableHistoryQueries" | "ScrollRestoreSucceeded" | "ScrollRestoreFailed" | "UserHoveredInSearchBox" | "UserHoveredOutSearchBox" | "UserBlurredSearchBox" | "UserClickedSearchBox" | "UserFocusedSearchBox" | "UserPressedClearSearchBoxButton" | "ReloadSearchRequested" | "UserReachedResultsListEnd" | "UserClickedAbortARedirection" | "RelatedPromptsUnmounted" | "ReloadRelatedPromptsRequested" | "AiOverviewMounted";
|
|
26
26
|
}, {}>
|
|
27
27
|
```
|
|
@@ -198,6 +198,7 @@ _default: import("vue").DefineComponent<{
|
|
|
198
198
|
AiSuggestionsSearchRequestUpdated?: import("@empathyco/x-types").AiSuggestionsSearchRequest | null | undefined;
|
|
199
199
|
UserClickedAiOverviewExpandButton?: boolean | undefined;
|
|
200
200
|
UserClickedAnAiOverviewResult?: import("@empathyco/x-types").Result | undefined;
|
|
201
|
+
AiOverviewMounted?: void | undefined;
|
|
201
202
|
}>;
|
|
202
203
|
innerCssClasses: import("vue").ComputedRef<(string | Dictionary<boolean>)[]>;
|
|
203
204
|
renderedChildrenFilters: import("vue").ComputedRef<HierarchicalFilterModel[]>;
|
|
@@ -195,6 +195,7 @@ _default: import("vue").DefineComponent<{
|
|
|
195
195
|
AiSuggestionsSearchRequestUpdated?: import("@empathyco/x-types").AiSuggestionsSearchRequest | null | undefined;
|
|
196
196
|
UserClickedAiOverviewExpandButton?: boolean | undefined;
|
|
197
197
|
UserClickedAnAiOverviewResult?: import("@empathyco/x-types").Result | undefined;
|
|
198
|
+
AiOverviewMounted?: void | undefined;
|
|
198
199
|
}>;
|
|
199
200
|
innerCssClasses: import("vue").ComputedRef<(string | Dictionary<boolean>)[]>;
|
|
200
201
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -185,6 +185,7 @@ _default: import("vue").DefineComponent<{}, {
|
|
|
185
185
|
AiSuggestionsSearchRequestUpdated: (payload: import("@empathyco/x-types").AiSuggestionsSearchRequest | null, metadata: WireMetadata) => unknown;
|
|
186
186
|
UserClickedAiOverviewExpandButton: (payload: boolean, metadata: WireMetadata) => unknown;
|
|
187
187
|
UserClickedAnAiOverviewResult: (payload: import("@empathyco/x-types").Result, metadata: WireMetadata) => unknown;
|
|
188
|
+
AiOverviewMounted: (payload: undefined, metadata: WireMetadata) => unknown;
|
|
188
189
|
}>>;
|
|
189
190
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>
|
|
190
191
|
```
|
|
@@ -9,9 +9,9 @@ Request for the ai suggestions endpoint.
|
|
|
9
9
|
**Signature:**
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
|
-
export interface AiSuggestionsRequest extends ExtraParamsRequest
|
|
12
|
+
export interface AiSuggestionsRequest extends ExtraParamsRequest, TrackableRequest
|
|
13
13
|
```
|
|
14
|
-
**Extends:** [ExtraParamsRequest](./x-types.extraparamsrequest.md)
|
|
14
|
+
**Extends:** [ExtraParamsRequest](./x-types.extraparamsrequest.md)<!-- -->, [TrackableRequest](./x-types.trackablerequest.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
|
|
12
|
+
export interface AiSuggestionsSearchRequest extends ExtraParamsRequest, TrackableRequest
|
|
13
13
|
```
|
|
14
|
-
**Extends:** [ExtraParamsRequest](./x-types.extraparamsrequest.md)
|
|
14
|
+
**Extends:** [ExtraParamsRequest](./x-types.extraparamsrequest.md)<!-- -->, [TrackableRequest](./x-types.trackablerequest.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, 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 const aiOverviewRef = ref<HTMLDivElement | null>(null)\n\n const emptyTaggingRequest: TaggingRequest = { url: '', params: {} }\n\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 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;;A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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 </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,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A;AAAA,kBAAA,CAAAe,KAAA,EAAA,CAA5E,IAAQ,CAAA,QAAA,CAAA;AAAA,iBAAA,CAAA;AACtB,gBAAAf,kBAAA,CAYM,OAZN,WAYM,EAAA;AAAA,kBAXJA,kBAUS,CAAA,QAAA,EAAA;AAAA,oBATP,KAAM,EAAA,0BAAA;AAAA,oBACN,WAAU,EAAA,2BAAA;AAAA,oBACT,OAAK,EAAA,MAAA,CAAA,CAAA,CAAA,KAAA,MAAA,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,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, watch } from 'vue';
|
|
1
|
+
import { defineComponent, ref, computed, watch, onMounted } from 'vue';
|
|
2
2
|
import '../../../components/animations/animate-clip-path/animate-clip-path.style.scss.js';
|
|
3
3
|
import '../../../components/animations/animate-scale/animate-scale.style.scss.js';
|
|
4
4
|
import '../../../components/animations/animate-translate/animate-translate.style.scss.js';
|
|
@@ -194,8 +194,8 @@ var _sfc_main = defineComponent({
|
|
|
194
194
|
const $x = use$x();
|
|
195
195
|
const { query } = useGetter('ai');
|
|
196
196
|
const { suggestionText, responseText, suggestionsSearch, suggestionsLoading, tagging, isNoResults, queries, } = useState('ai');
|
|
197
|
-
const aiOverviewRef = ref(null);
|
|
198
197
|
const emptyTaggingRequest = { url: '', params: {} };
|
|
198
|
+
const aiOverviewRef = ref(null);
|
|
199
199
|
const expanded = ref(false);
|
|
200
200
|
const shouldAnimateSuggestion = ref(true);
|
|
201
201
|
const buttonText = computed(() => (expanded.value ? props.collapseText : props.expandText));
|
|
@@ -217,6 +217,9 @@ var _sfc_main = defineComponent({
|
|
|
217
217
|
expanded.value = false;
|
|
218
218
|
shouldAnimateSuggestion.value = true;
|
|
219
219
|
});
|
|
220
|
+
onMounted(() => {
|
|
221
|
+
$x.emit('AiOverviewMounted', undefined, { feature: 'overview' });
|
|
222
|
+
});
|
|
220
223
|
return {
|
|
221
224
|
aiOverviewRef,
|
|
222
225
|
buttonText,
|
|
@@ -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, 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 const aiOverviewRef = ref<HTMLDivElement | null>(null)\n\n const emptyTaggingRequest: TaggingRequest = { url: '', params: {} }\n\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 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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AAA;YAC5C,EAAE,CAAC,IAAI,CAAC,mCAAmC,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,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 </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,K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ACT,CAAA;KACD;AACF,CAAA,CAAA;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createOrigin } from '../../../../utils/origin.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Default implementation for the {@link AiActions.saveOrigin}.
|
|
5
|
+
*
|
|
6
|
+
* @param context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,
|
|
7
|
+
* provided by Vuex.
|
|
8
|
+
* @param queryOriginInit - The object to create the {@link QueryOrigin} with.
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
const saveOrigin = ({ commit }, queryOriginInit) => {
|
|
12
|
+
commit('setOrigin', createOrigin(queryOriginInit));
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { saveOrigin };
|
|
16
|
+
//# sourceMappingURL=save-origin.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"save-origin.action.js","sources":["../../../../../../src/x-modules/ai/store/actions/save-origin.action.ts"],"sourcesContent":["import type { QueryOrigin } from '../../../../types/origin'\nimport type { AiXStoreModule } from '../types'\nimport { createOrigin } from '../../../../utils/origin'\n\n/**\n * Default implementation for the {@link AiActions.saveOrigin}.\n *\n * @param context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,\n * provided by Vuex.\n * @param queryOriginInit - The object to create the {@link QueryOrigin} with.\n * @public\n */\nexport const saveOrigin: AiXStoreModule['actions']['saveOrigin'] = (\n { commit },\n queryOriginInit,\n) => {\n commit('setOrigin', createOrigin(queryOriginInit) as QueryOrigin)\n}\n"],"names":[],"mappings":";;AAIA;;;;;;;AAOG;AACU,MAAA,UAAU,GAA4C,CACjE,EAAE,MAAM,EAAE,EACV,eAAe,KACb;IACF,MAAM,CAAC,WAAW,EAAE,YAAY,CAAC,eAAe,CAAgB,CAAC,CAAA;AACnE;;;;"}
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
*
|
|
10
10
|
* @public
|
|
11
11
|
*/
|
|
12
|
-
const suggestionsRequest = ({ params }, { query }) => {
|
|
13
|
-
return { query,
|
|
12
|
+
const suggestionsRequest = ({ params, origin }, { query }) => {
|
|
13
|
+
return { query, extraParams: params, ...(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 },\n { query },\n) => {\n return { query,
|
|
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: params, ...(origin && { origin }) }\n}\n"],"names":[],"mappings":"AAEA;;;;;;;;;;AAUG;AACI,MAAM,kBAAkB,GAAoD,CACjF,EAAE,MAAM,EAAE,MAAM,EAAE,EAClB,EAAE,KAAK,EAAE,KACP;AACF,IAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,MAAM,IAAI,EAAE,MAAM,EAAE,GAAG,CAAA;AAClE;;;;"}
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @public
|
|
10
10
|
*/
|
|
11
|
-
const suggestionsSearchRequest = ({ params, queries, }) => {
|
|
12
|
-
return queries.length ? { queries, extraParams: params } : null;
|
|
11
|
+
const suggestionsSearchRequest = ({ params, queries, origin, }) => {
|
|
12
|
+
return queries.length ? { queries, extraParams: params, ...(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 queries,\n}) => {\n return queries.length ? { queries, extraParams: params } : null\n}\n"],"names":[],"mappings":"AAEA;;;;;;;;;AASG;
|
|
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 queries,\n origin,\n}) => {\n return queries.length ? { queries, extraParams: params, ...(origin && { origin }) } : null\n}\n"],"names":[],"mappings":"AAEA;;;;;;;;;AASG;AACI,MAAM,wBAAwB,GAA0D,CAAC,EAC9F,MAAM,EACN,OAAO,EACP,MAAM,GACP,KAAI;IACH,OAAO,OAAO,CAAC,MAAM,GAAG,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,MAAM,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,IAAI,CAAA;AAC5F;;;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { setConfig, mergeConfig } from '../../../store/utils/config-store.utils.js';
|
|
2
2
|
import { fetchAndSaveAiSuggestionsSearch } from './actions/fetch-and-save-ai-suggestions-search.action.js';
|
|
3
3
|
import { fetchAndSaveAiSuggestions } from './actions/fetch-and-save-ai-suggestions.action.js';
|
|
4
|
+
import { saveOrigin } from './actions/save-origin.action.js';
|
|
4
5
|
import { setUrlParams } from './actions/set-url-params.action.js';
|
|
5
6
|
import { query } from './getters/ai-query.getter.js';
|
|
6
7
|
import { suggestionsRequest } from './getters/suggestions-request.getter.js';
|
|
@@ -17,6 +18,7 @@ const aiXStoreModule = {
|
|
|
17
18
|
query: '',
|
|
18
19
|
config: {},
|
|
19
20
|
params: {},
|
|
21
|
+
origin: null,
|
|
20
22
|
relatedTags: [],
|
|
21
23
|
}),
|
|
22
24
|
getters: {
|
|
@@ -56,6 +58,9 @@ const aiXStoreModule = {
|
|
|
56
58
|
setParams(state, params) {
|
|
57
59
|
state.params = params;
|
|
58
60
|
},
|
|
61
|
+
setOrigin(state, origin = null) {
|
|
62
|
+
state.origin = origin;
|
|
63
|
+
},
|
|
59
64
|
resetAiState(state) {
|
|
60
65
|
Object.assign(state, resettableAiState());
|
|
61
66
|
},
|
|
@@ -70,6 +75,7 @@ const aiXStoreModule = {
|
|
|
70
75
|
fetchAndSaveAiSuggestions,
|
|
71
76
|
fetchAndSaveAiSuggestionsSearch,
|
|
72
77
|
setUrlParams,
|
|
78
|
+
saveOrigin,
|
|
73
79
|
},
|
|
74
80
|
};
|
|
75
81
|
/**
|
|
@@ -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 { 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 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 setConfig,\n mergeConfig,\n setQuery: (state: QueryState, query: string) => {\n state.query = query\n },\n setParams(state, params) {\n state.params = params\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 },\n actions: {\n fetchAndSaveAiSuggestions,\n fetchAndSaveAiSuggestionsSearch,\n setUrlParams,\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":"
|
|
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 setConfig,\n mergeConfig,\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 },\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":";;;;;;;;;AAaA;;;;AAIG;AACU,MAAA,cAAc,GAAmB;AAC5C,IAAA,KAAK,EAAE,OAAO;AACZ,QAAA,GAAG,iBAAiB,EAAE;AACtB,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;AAC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W,GAAG,WAAW,CAAA;SAChC;AACF,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;;;;"}
|
|
@@ -25,6 +25,8 @@ const fetchAndSaveAiSuggestionsSearch = wireDispatch('fetchAndSaveAiSuggestionsS
|
|
|
25
25
|
const setAiRelatedTags = wireCommit('setAiRelatedTags');
|
|
26
26
|
/** Resets the related prompts state. */
|
|
27
27
|
const resetAiState = wireCommitWithoutPayload('resetAiState');
|
|
28
|
+
/** Sets the origin for the AI requests. */
|
|
29
|
+
const saveAiOriginWire = wireDispatch('saveOrigin', ({ metadata }) => metadata);
|
|
28
30
|
/**
|
|
29
31
|
* Wiring configuration for the {@link AiXModule | AI module}.
|
|
30
32
|
*
|
|
@@ -53,6 +55,9 @@ const aiWiring = createWiring({
|
|
|
53
55
|
SelectedRelatedTagsChanged: {
|
|
54
56
|
setAiRelatedTags,
|
|
55
57
|
},
|
|
58
|
+
AiOverviewMounted: {
|
|
59
|
+
saveAiOriginWire,
|
|
60
|
+
},
|
|
56
61
|
});
|
|
57
62
|
|
|
58
63
|
export { aiWiring };
|
|
@@ -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/** `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 setUrlParams = wireDispatch('setUrlParams')\n/** Sets the ai state `params`. */\nconst setExtraParams = wireCommit('setParams')\n\n/** Sets the ai state `query`. */\nconst setAiQuery = wireCommit('setQuery')\n\n/** Fetches the AI suggestions streaming response. */\nconst fetchAndSaveAiSuggestions = wireDispatch('fetchAndSaveAiSuggestions')\n\n/** Fetches and save the ai suggestions search response. */\nconst fetchAndSaveAiSuggestionsSearch = wireDispatch('fetchAndSaveAiSuggestionsSearch')\n\n/** Sets the ai state `relatedTags`.*/\nconst setAiRelatedTags = wireCommit('setAiRelatedTags')\n\n/** Resets the related prompts state. */\nconst resetAiState = wireCommitWithoutPayload('resetAiState')\n\n/**\n * Wiring configuration for the {@link AiXModule | AI module}.\n *\n * @internal\n */\nexport const aiWiring = createWiring({\n ParamsLoadedFromUrl: {\n setUrlParams,\n },\n ExtraParamsChanged: {\n setExtraParams,\n },\n UserAcceptedAQuery: {\n setAiQuery,\n },\n UserClearedQuery: {\n setAiQuery,\n },\n AiSuggestionsRequestUpdated: {\n resetAiState,\n fetchAndSaveAiSuggestions,\n },\n AiSuggestionsSearchRequestUpdated: {\n fetchAndSaveAiSuggestionsSearch,\n },\n SelectedRelatedTagsChanged: {\n setAiRelatedTags,\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,YAAY,GAAG,YAAY,CAAC,cAAc,CAAC,CAAA;AACjD;AACA,MAAM,cAAc,GAAG,UAAU,CAAC,WAAW,CAAC,CAAA;AAE9C;AACA,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC,CAAA;AAEzC;AACA,MAAM,yBAAyB,GAAG,YAAY,CAAC,2BAA2B,CAAC,CAAA;AAE3E;AACA,MAAM,+BAA+B,GAAG,YAAY,CAAC,iCAAiC,CAAC,CAAA;AAEvF;AACA,MAAM,gBAAgB,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAA;AAEvD;AACA,MAAM,YAAY,GAAG,wBAAwB,CAAC,cAAc,CAAC,CAAA;AAE7D;;;;AAIG;AACI,MAAM,QAAQ,GAAG,YAAY,CAAC;AACnC,IAAA,mBAAmB,EAAE;QACnB,YAAY;AACb,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,cAAc;AACf,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,UAAU;AACX,KAAA;AACD,IAAA,gBAAgB,EAAE;QAChB,UAAU;AACX,KAAA;AACD,IAAA,2BAA2B,EAAE;QAC3B,YAAY;QACZ,yBAAyB;AAC1B,KAAA;AACD,IAAA,iCAAiC,EAAE;QACjC,+BAA+B;AAChC,KAAA;AACD,IAAA,0BAA0B,EAAE;QAC1B,gBAAgB;AACjB,KAAA;AACF,CAAA;;;;"}
|
|
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 setUrlParams = wireDispatch('setUrlParams')\n/** Sets the ai state `params`. */\nconst setExtraParams = wireCommit('setParams')\n\n/** Sets the ai state `query`. */\nconst setAiQuery = wireCommit('setQuery')\n\n/** Fetches the AI suggestions streaming response. */\nconst fetchAndSaveAiSuggestions = wireDispatch('fetchAndSaveAiSuggestions')\n\n/** Fetches and save the ai suggestions search response. */\nconst fetchAndSaveAiSuggestionsSearch = wireDispatch('fetchAndSaveAiSuggestionsSearch')\n\n/** Sets the ai state `relatedTags`.*/\nconst setAiRelatedTags = wireCommit('setAiRelatedTags')\n\n/** Resets the related prompts state. */\nconst resetAiState = wireCommitWithoutPayload('resetAiState')\n\n/** Sets the origin for the AI requests. */\nconst saveAiOriginWire = wireDispatch('saveOrigin', ({ metadata }) => metadata)\n\n/**\n * Wiring configuration for the {@link AiXModule | AI module}.\n *\n * @internal\n */\nexport const aiWiring = createWiring({\n ParamsLoadedFromUrl: {\n setUrlParams,\n },\n ExtraParamsChanged: {\n setExtraParams,\n },\n UserAcceptedAQuery: {\n setAiQuery,\n },\n UserClearedQuery: {\n setAiQuery,\n },\n AiSuggestionsRequestUpdated: {\n resetAiState,\n fetchAndSaveAiSuggestions,\n },\n AiSuggestionsSearchRequestUpdated: {\n fetchAndSaveAiSuggestionsSearch,\n },\n SelectedRelatedTagsChanged: {\n setAiRelatedTags,\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,YAAY,GAAG,YAAY,CAAC,cAAc,CAAC,CAA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