@empathyco/x-components 6.0.0-alpha.137 → 6.0.0-alpha.139
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 +18 -0
- package/docs/API-reference/api/x-adapter-platform.platformaisuggestionsearch.md +1 -0
- package/docs/API-reference/api/x-adapter-platform.platformaisuggestionsearch.numfound.md +11 -0
- package/docs/API-reference/api/x-adapter-platform.platformaisuggestionssearchresponse.items.md +1 -0
- package/docs/API-reference/api/x-adapter-platform.platformaisuggestionssearchresponse.md +1 -1
- package/docs/API-reference/api/x-components.aioverview.md +4 -1
- package/docs/API-reference/api/x-types.aisuggestionsearch.md +1 -0
- package/docs/API-reference/api/x-types.aisuggestionsearch.numfound.md +11 -0
- package/docs/API-reference/api/x-types.aisuggestionssearchresponse.md +1 -1
- package/docs/API-reference/api/x-types.aisuggestionssearchresponse.suggestions.md +1 -4
- package/js/x-modules/ai/components/ai-overview.vue.js +12 -31
- package/js/x-modules/ai/components/ai-overview.vue.js.map +1 -1
- package/js/x-modules/ai/components/ai-overview.vue2.js +2 -2
- package/js/x-modules/ai/components/ai-overview.vue2.js.map +1 -1
- package/js/x-modules/ai/components/ai-overview.vue3.js +1 -1
- package/js/x-modules/ai/store/module.js +3 -3
- package/js/x-modules/ai/store/module.js.map +1 -1
- package/package.json +4 -4
- package/report/x-adapter-platform.api.json +28 -1
- package/report/x-components.api.json +4 -4
- package/report/x-components.api.md +5 -2
- package/report/x-types.api.json +31 -8
- package/types/x-modules/ai/components/ai-overview.vue.d.ts +4 -1
- package/types/x-modules/ai/components/ai-overview.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,24 @@
|
|
|
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.139 (2025-09-09)
|
|
7
|
+
|
|
8
|
+
* chore: pr review ([d30c56f](https://github.com/empathyco/x/commit/d30c56f))
|
|
9
|
+
* style(AiOverview): minor adjustment ([7728c9f](https://github.com/empathyco/x/commit/7728c9f))
|
|
10
|
+
* feat(AiOverview): remove the skeleton to display the incremental content from the store ([1d41ee5](https://github.com/empathyco/x/commit/1d41ee5))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## 6.0.0-alpha.138 (2025-09-09)
|
|
17
|
+
|
|
18
|
+
* feat(ai): add numFound property to the response of suggestionSearch ([d0118ae](https://github.com/empathyco/x/commit/d0118ae))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
## 6.0.0-alpha.137 (2025-09-08)
|
|
7
25
|
|
|
8
26
|
* feat(AiOverview): minor component adjustments (#1867) ([554cd79](https://github.com/empathyco/x/commit/554cd79)), closes [#1867](https://github.com/empathyco/x/issues/1867)
|
|
@@ -16,6 +16,7 @@ export interface PlatformAiSuggestionSearch
|
|
|
16
16
|
|
|
17
17
|
| Property | Modifiers | Type | Description |
|
|
18
18
|
| --- | --- | --- | --- |
|
|
19
|
+
| [numFound](./x-adapter-platform.platformaisuggestionsearch.numfound.md) | | number | |
|
|
19
20
|
| [query](./x-adapter-platform.platformaisuggestionsearch.query.md) | | string | |
|
|
20
21
|
| [results](./x-adapter-platform.platformaisuggestionsearch.results.md) | | [PlatformResult](./x-adapter-platform.platformresult.md)<!-- -->\[\] | |
|
|
21
22
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-adapter-platform](./x-adapter-platform.md) > [PlatformAiSuggestionSearch](./x-adapter-platform.platformaisuggestionsearch.md) > [numFound](./x-adapter-platform.platformaisuggestionsearch.numfound.md)
|
|
4
|
+
|
|
5
|
+
## PlatformAiSuggestionSearch.numFound property
|
|
6
|
+
|
|
7
|
+
**Signature:**
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
numFound: number;
|
|
11
|
+
```
|
|
@@ -16,5 +16,5 @@ export interface PlatformAiSuggestionsSearchResponse
|
|
|
16
16
|
|
|
17
17
|
| Property | Modifiers | Type | Description |
|
|
18
18
|
| --- | --- | --- | --- |
|
|
19
|
-
| [items](./x-adapter-platform.platformaisuggestionssearchresponse.items.md) | | { query: string; results: [PlatformResult](./x-adapter-platform.platformresult.md)<!-- -->\[\]; }\[\] | |
|
|
19
|
+
| [items](./x-adapter-platform.platformaisuggestionssearchresponse.items.md) | | { query: string; results: [PlatformResult](./x-adapter-platform.platformresult.md)<!-- -->\[\]; numFound: number; }\[\] | |
|
|
20
20
|
|
|
@@ -30,7 +30,10 @@ _default: import("vue").DefineComponent<{
|
|
|
30
30
|
queries: import("vue").ComputedRef<import("@empathyco/x-types").AiSuggestionQuery[]>;
|
|
31
31
|
responseText: import("vue").ComputedRef<string>;
|
|
32
32
|
suggestionsLoading: import("vue").ComputedRef<boolean>;
|
|
33
|
-
queriesResults: import("vue").ComputedRef<Record<string,
|
|
33
|
+
queriesResults: import("vue").ComputedRef<Record<string, {
|
|
34
|
+
results: AiSuggestionSearch["results"];
|
|
35
|
+
numFound: number;
|
|
36
|
+
}>>;
|
|
34
37
|
suggestionsSearch: import("vue").ComputedRef<AiSuggestionSearch[]>;
|
|
35
38
|
suggestionText: import("vue").ComputedRef<string>;
|
|
36
39
|
toggleVisibility: () => void;
|
|
@@ -16,6 +16,7 @@ export interface AiSuggestionSearch
|
|
|
16
16
|
|
|
17
17
|
| Property | Modifiers | Type | Description |
|
|
18
18
|
| --- | --- | --- | --- |
|
|
19
|
+
| [numFound](./x-types.aisuggestionsearch.numfound.md) | | number | |
|
|
19
20
|
| [query](./x-types.aisuggestionsearch.query.md) | | string | |
|
|
20
21
|
| [results](./x-types.aisuggestionsearch.results.md) | | [Result](./x-types.result.md)<!-- -->\[\] | |
|
|
21
22
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@empathyco/x-types](./x-types.md) > [AiSuggestionSearch](./x-types.aisuggestionsearch.md) > [numFound](./x-types.aisuggestionsearch.numfound.md)
|
|
4
|
+
|
|
5
|
+
## AiSuggestionSearch.numFound property
|
|
6
|
+
|
|
7
|
+
**Signature:**
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
numFound: number;
|
|
11
|
+
```
|
|
@@ -16,5 +16,5 @@ export interface AiSuggestionsSearchResponse
|
|
|
16
16
|
|
|
17
17
|
| Property | Modifiers | Type | Description |
|
|
18
18
|
| --- | --- | --- | --- |
|
|
19
|
-
| [suggestions](./x-types.aisuggestionssearchresponse.suggestions.md) | |
|
|
19
|
+
| [suggestions](./x-types.aisuggestionssearchresponse.suggestions.md) | | [AiSuggestionSearch](./x-types.aisuggestionsearch.md)<!-- -->\[\] | |
|
|
20
20
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _sfc_main from './ai-overview.vue2.js';
|
|
2
|
-
import { resolveComponent, resolveDirective, openBlock, createElementBlock, createElementVNode, createVNode, withCtx, withDirectives, createTextVNode, toDisplayString,
|
|
2
|
+
import { resolveComponent, resolveDirective, openBlock, createElementBlock, createElementVNode, createVNode, withCtx, withDirectives, createTextVNode, toDisplayString, createBlock, normalizeStyle, renderSlot, Fragment, renderList, createCommentVNode, vShow, normalizeProps, guardReactiveProps, normalizeClass } from 'vue';
|
|
3
3
|
import './ai-overview.vue3.js';
|
|
4
4
|
import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.js';
|
|
5
5
|
|
|
@@ -27,19 +27,13 @@ const _hoisted_6 = {
|
|
|
27
27
|
"data-test": "ai-overview-title"
|
|
28
28
|
};
|
|
29
29
|
const _hoisted_7 = {
|
|
30
|
-
key: 0,
|
|
31
|
-
class: "x-ai-overview-loading-content",
|
|
32
|
-
"data-test": "ai-overview-loading-content"
|
|
33
|
-
};
|
|
34
|
-
const _hoisted_8 = {
|
|
35
|
-
key: 1,
|
|
36
30
|
class: "x-ai-overview-content",
|
|
37
31
|
"data-test": "ai-overview-content"
|
|
38
32
|
};
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const
|
|
33
|
+
const _hoisted_8 = { "data-test": "ai-overview-suggestions-container" };
|
|
34
|
+
const _hoisted_9 = { class: "x-ai-overview-suggestions" };
|
|
35
|
+
const _hoisted_10 = { class: "x-ai-overview-suggestion-results" };
|
|
36
|
+
const _hoisted_11 = { class: "x-ai-overview-toggle-wrapper" };
|
|
43
37
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
44
38
|
const _component_AIStarIcon = resolveComponent("AIStarIcon");
|
|
45
39
|
const _component_Fade = resolveComponent("Fade");
|
|
@@ -79,20 +73,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
79
73
|
}),
|
|
80
74
|
createVNode(_component_ChangeHeight, null, {
|
|
81
75
|
default: withCtx(() => [
|
|
82
|
-
|
|
83
|
-
(openBlock(), createElementBlock(
|
|
84
|
-
Fragment,
|
|
85
|
-
null,
|
|
86
|
-
renderList(4, (i) => {
|
|
87
|
-
return createElementVNode("span", {
|
|
88
|
-
key: i,
|
|
89
|
-
"data-test": "ai-overview-loading-item"
|
|
90
|
-
});
|
|
91
|
-
}),
|
|
92
|
-
64
|
|
93
|
-
/* STABLE_FRAGMENT */
|
|
94
|
-
))
|
|
95
|
-
])) : (openBlock(), createElementBlock("div", _hoisted_8, [
|
|
76
|
+
createElementVNode("div", _hoisted_7, [
|
|
96
77
|
createElementVNode(
|
|
97
78
|
"span",
|
|
98
79
|
null,
|
|
@@ -107,7 +88,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
107
88
|
1
|
|
108
89
|
/* TEXT */
|
|
109
90
|
)
|
|
110
|
-
])
|
|
91
|
+
])
|
|
111
92
|
]),
|
|
112
93
|
_: 1
|
|
113
94
|
/* STABLE */
|
|
@@ -123,13 +104,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
123
104
|
default: withCtx(() => [
|
|
124
105
|
withDirectives(createElementVNode(
|
|
125
106
|
"div",
|
|
126
|
-
|
|
107
|
+
_hoisted_8,
|
|
127
108
|
[
|
|
128
109
|
renderSlot(_ctx.$slots, "default", {
|
|
129
110
|
suggestionsSearch: _ctx.suggestionsSearch,
|
|
130
111
|
queries: _ctx.queries
|
|
131
112
|
}, () => [
|
|
132
|
-
createElementVNode("div",
|
|
113
|
+
createElementVNode("div", _hoisted_9, [
|
|
133
114
|
(openBlock(true), createElementBlock(
|
|
134
115
|
Fragment,
|
|
135
116
|
null,
|
|
@@ -164,11 +145,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
164
145
|
},
|
|
165
146
|
{
|
|
166
147
|
default: withCtx(() => [
|
|
167
|
-
createElementVNode("ul",
|
|
148
|
+
createElementVNode("ul", _hoisted_10, [
|
|
168
149
|
(openBlock(true), createElementBlock(
|
|
169
150
|
Fragment,
|
|
170
151
|
null,
|
|
171
|
-
renderList(_ctx.queriesResults[query], (result) => {
|
|
152
|
+
renderList(_ctx.queriesResults[query].results, (result) => {
|
|
172
153
|
return openBlock(), createElementBlock("li", {
|
|
173
154
|
key: result.id,
|
|
174
155
|
"data-test": "ai-overview-suggestion-result"
|
|
@@ -222,7 +203,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
222
203
|
), [
|
|
223
204
|
[vShow, !_ctx.expanded]
|
|
224
205
|
]),
|
|
225
|
-
createElementVNode("div",
|
|
206
|
+
createElementVNode("div", _hoisted_11, [
|
|
226
207
|
renderSlot(_ctx.$slots, "toggle-button", normalizeProps(guardReactiveProps({ expanded: _ctx.expanded, toggleVisibility: _ctx.toggleVisibility, buttonText: _ctx.buttonText })), () => [
|
|
227
208
|
createElementVNode("button", {
|
|
228
209
|
class: "x-ai-overview-toggle-btn",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-overview.vue.js","sources":["../../../../../src/x-modules/ai/components/ai-overview.vue"],"sourcesContent":["<template>\n <div class=\"x-ai-overview\">\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 v-typing=\"{ text: titleLoading, speed: 50 }\"\n class=\"x-ai-overview-title-loading-text\"\n data-test=\"ai-overview-title-loading-text\"\n />\n </span>\n <span v-else class=\"x-ai-overview-title\" data-test=\"ai-overview-title\">\n <AIStarIcon class=\"x-ai-overview-title-icon\" />{{ title }}\n </span>\n </Fade>\n <ChangeHeight>\n <div\n v-if=\"suggestionsLoading\"\n class=\"x-ai-overview-loading-content\"\n data-test=\"ai-overview-loading-content\"\n >\n <span v-for=\"i in 4\" :key=\"i\" data-test=\"ai-overview-loading-item\" />\n </div>\n <div v-else class=\"x-ai-overview-content\" data-test=\"ai-overview-content\">\n <span>{{ suggestionText }}</span>\n <p>{{ responseText }}</p>\n </div>\n </ChangeHeight>\n </div>\n <CollapseHeight\n v-if=\"queries.length\"\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\" data-test=\"ai-overview-suggestions-container\">\n <!-- @slot suggestions-search content -->\n <slot :suggestions-search=\"suggestionsSearch\" :queries=\"queries\">\n <div class=\"x-ai-overview-suggestions\">\n <div v-for=\"{ query } in queries\" :key=\"query\" class=\"x-ai-overview-suggestion\">\n <BaseEventButton\n class=\"x-ai-overview-suggestion-query-btn\"\n :events=\"{ UserAcceptedAQuery: query }\"\n >\n {{ query }}<ArrowRightIcon class=\"x-ai-overview-suggestion-query-btn-icon\" />\n </BaseEventButton>\n <!-- @slot suggestion query result list -->\n <slot name=\"query-results\" :query-results=\"queriesResults[query]\">\n <SlidingPanel v-if=\"queriesResults[query]\" :reset-on-content-change=\"false\">\n <ul class=\"x-ai-overview-suggestion-results\">\n <li\n v-for=\"result in queriesResults[query]\"\n :key=\"result.id\"\n data-test=\"ai-overview-suggestion-result\"\n >\n <!-- @slot (required) result card -->\n <slot name=\"result\" :result=\"result\" />\n </li>\n </ul>\n </SlidingPanel>\n </slot>\n </div>\n </div>\n </slot>\n </div>\n </CollapseHeight>\n <div v-show=\"queries.length\">\n <div\n v-show=\"!expanded\"\n class=\"x-ai-overview-gradient\"\n data-test=\"ai-overview-gradient\"\n @click=\"toggleVisibility\"\n />\n <div class=\"x-ai-overview-toggle-wrapper\">\n <!-- @slot toggle button -->\n <slot name=\"toggle-button\" v-bind=\"{ expanded, toggleVisibility, buttonText }\">\n <button\n class=\"x-ai-overview-toggle-btn\"\n data-test=\"ai-overview-toggle-button\"\n @click=\"toggleVisibility\"\n >\n {{ buttonText }}\n <ChevronDownIcon\n class=\"x-ai-overview-toggle-btn-icon\"\n :class=\"\n expanded\n ? 'x-ai-overview-toggle-btn-icon-expanded'\n : 'x-ai-overview-toggle-btn-icon-collapsed'\n \"\n />\n </button>\n </slot>\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { AiSuggestionSearch } 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 Fade,\n SlidingPanel,\n} from '../../../components'\nimport { 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 },\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 default: 'Empathy AI Overview',\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 setup(props) {\n const { query } = useGetter('ai')\n const { suggestionText, responseText, queries, suggestionsSearch, suggestionsLoading } =\n useState('ai')\n\n const expanded = ref(false)\n\n const queriesResults = computed(() => {\n return suggestionsSearch.value.reduce(\n (acc: Record<string, AiSuggestionSearch['results']>, { query, results }) => {\n acc[query] = results\n return acc\n },\n {},\n )\n })\n\n const buttonText = computed(() => (expanded.value ? props.collapseText : props.expandText))\n\n function toggleVisibility() {\n expanded.value = !expanded.value\n }\n\n watch(query, () => (expanded.value = false))\n\n return {\n buttonText,\n expanded,\n queries,\n responseText,\n suggestionsLoading,\n queriesResults,\n suggestionsSearch,\n suggestionText,\n toggleVisibility,\n }\n },\n})\n</script>\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 --color-lightest: var(\n --x-ai-overview-color-lightest,\n color-mix(in srgb, var(--color) 75%, white)\n );\n\n @apply x-relative x-rounded-3xl x-bg-[var(--color-lighter)];\n}\n\n.x-ai-overview-main {\n @apply x-p-16 x-rounded-lg;\n}\n\n.x-ai-overview-title-loading {\n @apply x-flex x-items-center x-gap-1.5 x-mb-8;\n}\n.x-ai-overview-title-loading-indicator {\n @apply x-size-3 x-animate-pulse x-rounded-full x-bg-[var(--color)];\n}\n.x-ai-overview-title-loading-text {\n @apply x-animate-pulse x-text-xs;\n}\n\n.x-ai-overview-title {\n @apply x-flex x-text-sm x-font-bold x-gap-4 x-items-center x-mb-8;\n}\n.x-ai-overview-title-icon {\n @apply x-icon x-text-[var(--color)];\n}\n\n.x-ai-overview-loading-content {\n @apply x-flex x-w-full x-flex-col x-gap-4 x-animate-pulse;\n}\n.x-ai-overview-loading-content > span:first-child {\n @apply x-h-16 x-w-full x-rounded-full x-bg-gradient-to-r x-from-0% x-from-[var(--color)] x-to-100% x-to-[var(--color-lightest)];\n}\n.x-ai-overview-loading-content > span:nth-child(2) {\n @apply x-h-16 x-w-3/4 x-rounded-full x-bg-gradient-to-r x-from-0% x-from-[var(--color-lightest)] x-to-100% x-to-[var(--color)] x-opacity-50;\n}\n.x-ai-overview-loading-content > span:nth-child(3) {\n @apply x-h-16 x-w-11/12 x-rounded-full x-bg-gradient-to-r x-from-0% x-from-[var(--color)] x-to-100% x-to-[var(--color-lightest)];\n}\n.x-ai-overview-loading-content > span:nth-child(4) {\n @apply x-h-16 x-w-1/2 x-rounded-full x-bg-gradient-to-r x-from-0% x-from-[var(--color)] x-to-100% x-to-[var(--color-lightest)] x-opacity-75;\n}\n\n.x-ai-overview-content {\n @apply x-flex x-flex-col x-text-left x-leading-5 x-gap-2;\n}\n.x-ai-overview-content span {\n @apply x-font-medium;\n}\n\n.x-ai-overview-gradient {\n @apply x-cursor-pointer x-content-none x-absolute x-w-full x-h-80 x-bottom-5 x-bg-gradient-to-b x-from-0% x-from-transparent x-to-100% x-to-[var(--color-lighter)];\n}\n\n.x-ai-overview-toggle-wrapper {\n @apply x-flex x-relative x-z-[1];\n}\n.x-ai-overview-toggle-btn {\n @apply x-button x-button-outlined x-rounded-full x-w-full;\n}\n.x-ai-overview-toggle-btn-icon {\n @apply x-icon x-transition-all x-duration-300;\n}\n.x-ai-overview-toggle-btn-icon-expanded {\n @apply x-rotate-0;\n}\n.x-ai-overview-toggle-btn-icon-collapsed {\n @apply x-rotate-180;\n}\n.x-ai-overview-suggestion-query-btn {\n @apply x-button-tight x-mx-16 x-font-bold x-text-gray-900 x-w-fit x-min-h-fit x-flex x-gap-16 x-items-center;\n}\n.x-ai-overview-suggestion-query-btn-icon {\n @apply x-icon-md;\n}\n.x-ai-overview-suggestions {\n @apply x-flex x-flex-col x-gap-16 x-pb-16;\n}\n.x-ai-overview-suggestion {\n @apply x-flex x-flex-col x-gap-8;\n}\n.x-ai-overview-suggestion-results {\n @apply x-flex x-gap-16 x-px-16;\n}\n</style>\n"],"names":["_createElementVNode","_openBlock","_createElementBlock","_createVNode","_withDirectives","_createTextVNode","_toDisplayString","_Fragment","_renderList","_createBlock","_normalizeStyle","_withCtx","_renderSlot","_createCommentVNode","_normalizeProps","_guardReactiveProps","_normalizeClass","_vShow"],"mappings":";;;;;AACO,MAAA,UAAA,GAAA,EAAA,KAAA,EAAM,eAAe,EAAA,CAAA;AACnB,MAAA,UAAA,GAAA,EAAA,KAAA,EAAM,oBAAoB,EAAA,CAAA;;AAFnC,EAAA,GAAA,EAAA,CAAA;AAAA,EAMU,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;;EAGjD,KAAM,EAAA,kCAAA;AAAA,EACN,WAAU,EAAA,gCAAA;;;AAbtB,EAAA,GAAA,EAAA,CAAA;AAAA,EAgBqB,KAAM,EAAA,qBAAA;AAAA,EAAsB,WAAU,EAAA,mBAAA;;;AAhB3D,EAAA,GAAA,EAAA,CAAA;AAAA,EAuBU,KAAM,EAAA,+BAAA;AAAA,EACN,WAAU,EAAA,6BAAA;;;AAxBpB,EAAA,GAAA,EAAA,CAAA;AAAA,EA4BoB,KAAM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ources":["../../../../../src/x-modules/ai/components/ai-overview.vue"],"sourcesContent":["<template>\n <div class=\"x-ai-overview\">\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 v-typing=\"{ text: titleLoading, speed: 50 }\"\n class=\"x-ai-overview-title-loading-text\"\n data-test=\"ai-overview-title-loading-text\"\n />\n </span>\n <span v-else class=\"x-ai-overview-title\" data-test=\"ai-overview-title\">\n <AIStarIcon class=\"x-ai-overview-title-icon\" />{{ title }}\n </span>\n </Fade>\n <ChangeHeight>\n <div class=\"x-ai-overview-content\" data-test=\"ai-overview-content\">\n <span>{{ suggestionText }}</span>\n <p>{{ responseText }}</p>\n </div>\n </ChangeHeight>\n </div>\n <CollapseHeight\n v-if=\"queries.length\"\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\" data-test=\"ai-overview-suggestions-container\">\n <!-- @slot suggestions-search content -->\n <slot :suggestions-search=\"suggestionsSearch\" :queries=\"queries\">\n <div class=\"x-ai-overview-suggestions\">\n <div v-for=\"{ query } in queries\" :key=\"query\" class=\"x-ai-overview-suggestion\">\n <BaseEventButton\n class=\"x-ai-overview-suggestion-query-btn\"\n :events=\"{ UserAcceptedAQuery: query }\"\n >\n {{ query }}<ArrowRightIcon class=\"x-ai-overview-suggestion-query-btn-icon\" />\n </BaseEventButton>\n <!-- @slot suggestion query result list -->\n <slot name=\"query-results\" :query-results=\"queriesResults[query]\">\n <SlidingPanel v-if=\"queriesResults[query]\" :reset-on-content-change=\"false\">\n <ul class=\"x-ai-overview-suggestion-results\">\n <li\n v-for=\"result in queriesResults[query].results\"\n :key=\"result.id\"\n data-test=\"ai-overview-suggestion-result\"\n >\n <!-- @slot (required) result card -->\n <slot name=\"result\" :result=\"result\" />\n </li>\n </ul>\n </SlidingPanel>\n </slot>\n </div>\n </div>\n </slot>\n </div>\n </CollapseHeight>\n <div v-show=\"queries.length\">\n <div\n v-show=\"!expanded\"\n class=\"x-ai-overview-gradient\"\n data-test=\"ai-overview-gradient\"\n @click=\"toggleVisibility\"\n />\n <div class=\"x-ai-overview-toggle-wrapper\">\n <!-- @slot toggle button -->\n <slot name=\"toggle-button\" v-bind=\"{ expanded, toggleVisibility, buttonText }\">\n <button\n class=\"x-ai-overview-toggle-btn\"\n data-test=\"ai-overview-toggle-button\"\n @click=\"toggleVisibility\"\n >\n {{ buttonText }}\n <ChevronDownIcon\n class=\"x-ai-overview-toggle-btn-icon\"\n :class=\"\n expanded\n ? 'x-ai-overview-toggle-btn-icon-expanded'\n : 'x-ai-overview-toggle-btn-icon-collapsed'\n \"\n />\n </button>\n </slot>\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { AiSuggestionSearch } 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 Fade,\n SlidingPanel,\n} from '../../../components'\nimport { 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 },\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 default: 'Empathy AI Overview',\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 setup(props) {\n const { query } = useGetter('ai')\n const { suggestionText, responseText, queries, suggestionsSearch, suggestionsLoading } =\n useState('ai')\n\n const expanded = ref(false)\n\n const queriesResults = computed(() => {\n return suggestionsSearch.value.reduce(\n (\n acc: Record<string, { results: AiSuggestionSearch['results']; numFound: number }>,\n { query, results, numFound },\n ) => {\n acc[query] = { results, numFound }\n return acc\n },\n {},\n )\n })\n\n const buttonText = computed(() => (expanded.value ? props.collapseText : props.expandText))\n\n function toggleVisibility() {\n expanded.value = !expanded.value\n }\n\n watch(query, () => (expanded.value = false))\n\n return {\n buttonText,\n expanded,\n queries,\n responseText,\n suggestionsLoading,\n queriesResults,\n suggestionsSearch,\n suggestionText,\n toggleVisibility,\n }\n },\n})\n</script>\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 @apply x-relative x-rounded-3xl x-bg-[var(--color-lighter)];\n}\n\n.x-ai-overview-main {\n @apply x-p-16 x-rounded-lg;\n}\n\n.x-ai-overview-title-loading {\n @apply x-flex x-items-center x-gap-1.5 x-mb-8;\n}\n.x-ai-overview-title-loading-indicator {\n @apply x-size-3 x-animate-pulse x-rounded-full x-bg-[var(--color)];\n}\n.x-ai-overview-title-loading-text {\n @apply x-animate-pulse x-text-xs;\n}\n\n.x-ai-overview-title {\n @apply x-flex x-text-sm x-font-bold x-gap-4 x-items-center x-mb-8;\n}\n.x-ai-overview-title-icon {\n @apply x-icon x-text-[var(--color)];\n}\n\n.x-ai-overview-content {\n @apply x-flex x-flex-col x-text-left x-leading-5 x-gap-2;\n}\n.x-ai-overview-content span {\n @apply x-font-medium;\n}\n\n.x-ai-overview-gradient {\n @apply x-cursor-pointer x-content-none x-absolute x-w-full x-h-80 x-bottom-5 x-bg-gradient-to-b x-from-0% x-from-transparent x-to-100% x-to-[var(--color-lighter)];\n}\n\n.x-ai-overview-toggle-wrapper {\n @apply x-flex x-relative x-z-[1];\n}\n.x-ai-overview-toggle-btn {\n @apply x-button x-button-outlined x-rounded-full x-w-full;\n}\n.x-ai-overview-toggle-btn-icon {\n @apply x-icon x-transition-all x-duration-300;\n}\n.x-ai-overview-toggle-btn-icon-expanded {\n @apply x-rotate-180;\n}\n.x-ai-overview-toggle-btn-icon-collapsed {\n @apply x-rotate-0;\n}\n.x-ai-overview-suggestion-query-btn {\n @apply x-button-tight x-mx-16 x-font-bold x-text-gray-900 x-w-fit x-min-h-fit x-flex x-gap-16 x-items-center;\n}\n.x-ai-overview-suggestion-query-btn-icon {\n @apply x-icon-md;\n}\n.x-ai-overview-suggestions {\n @apply x-flex x-flex-col x-gap-16 x-pb-16;\n}\n.x-ai-overview-suggestion {\n @apply x-flex x-flex-col x-gap-8;\n}\n.x-ai-overview-suggestion-results {\n @apply x-flex x-gap-16 x-px-16;\n}\n</style>\n"],"names":["_createElementVNode","_openBlock","_createElementBlock","_createVNode","_withDirectives","_createTextVNode","_toDisplayString","_createBlock","_normalizeStyle","_withCtx","_renderSlot","_Fragment","_renderList","_createCommentVNode","_normalizeProps","_guardReactiveProps","_normalizeClass","_vShow"],"mappings":";;;;;AACO,MAAA,UAAA,GAAA,EAAA,KAAA,EAAM,eAAe,EAAA,CAAA;AACnB,MAAA,UAAA,GAAA,EAAA,KAAA,EAAM,oBAAoB,EAAA,CAAA;;AAFnC,EAAA,GAAA,EAAA,CAAA;AAAA,EAMU,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;;E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AAQ,CAAA,QAAA,CAAA;AAAA,SAAA,CAAA;AAKnB,QAAAA,kBAAA,CAmBM,OAnBN,WAmBM,EAAA;AAAA,UAjBJU,UAAA,CAgBO,8BA1FfI,cA0E6C,CAAAC,kBAAA,CAAA,EAAA,QAAA,EAAA,IAAA,CAAA,QAAA,EAAQ,kBAAE,IAAgB,CAAA,gBAAA,EAAA,UAAA,EAAE,IAAU,CAAA,UAAA,EAAA,CAAA,CAAA,EAA3E,MAgBO;AAAA,YAfLf,kBAcS,CAAA,QAAA,EAAA;AAAA,cAbP,KAAM,EAAA,0BAAA;AAAA,cACN,WAAU,EAAA,2BAAA;AAAA,cACT,SAAK,MAAE,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,GAAA,IAAA,KAAA,IAAA,CAAA,gBAAA,IAAA,IAAA,CAAA,gBAAA,CAAA,GAAA,IAAA,CAAA,CAAA;AAAA,aAAA,EAAA;AA9EpB,cAAAK,eAAA;AAAA,gBAAAC,eAAA,CAgFe,eAAU,CAAG,GAAA,GAAA;AAAA,gBAChB,CAAA;AAAA;AAAA,eAAA;AAAA,cAOEH,WAAA,CAAA,0BAAA,EAAA;AAAA,gBANA,KAlFd,EAAAa,cAAA,CAAA;AAAA,kBAkFoB,+BAAA;AAAA,kBACmB,IAAA,CAAA,QAAA,GAAA,wCAAA,GAAA,yCAAA;;;;;;;;;;AAlBtB,MAAA,CAAAC,KAAA,EAAA,IAAA,CAAA,OAAA,CAAQ,MAAM,CAAA;AAAA,KAAA,CAAA;;;;;;;"}
|
|
@@ -167,8 +167,8 @@ var _sfc_main = defineComponent({
|
|
|
167
167
|
const { suggestionText, responseText, queries, suggestionsSearch, suggestionsLoading } = useState('ai');
|
|
168
168
|
const expanded = ref(false);
|
|
169
169
|
const queriesResults = computed(() => {
|
|
170
|
-
return suggestionsSearch.value.reduce((acc, { query, results }) => {
|
|
171
|
-
acc[query] = results;
|
|
170
|
+
return suggestionsSearch.value.reduce((acc, { query, results, numFound }) => {
|
|
171
|
+
acc[query] = { results, numFound };
|
|
172
172
|
return acc;
|
|
173
173
|
}, {});
|
|
174
174
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-overview.vue2.js","sources":["../../../../../src/x-modules/ai/components/ai-overview.vue"],"sourcesContent":["<template>\n <div class=\"x-ai-overview\">\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 v-typing=\"{ text: titleLoading, speed: 50 }\"\n class=\"x-ai-overview-title-loading-text\"\n data-test=\"ai-overview-title-loading-text\"\n />\n </span>\n <span v-else class=\"x-ai-overview-title\" data-test=\"ai-overview-title\">\n <AIStarIcon class=\"x-ai-overview-title-icon\" />{{ title }}\n </span>\n </Fade>\n <ChangeHeight>\n <div\n v-if=\"suggestionsLoading\"\n class=\"x-ai-overview-loading-content\"\n data-test=\"ai-overview-loading-content\"\n >\n <span v-for=\"i in 4\" :key=\"i\" data-test=\"ai-overview-loading-item\" />\n </div>\n <div v-else class=\"x-ai-overview-content\" data-test=\"ai-overview-content\">\n <span>{{ suggestionText }}</span>\n <p>{{ responseText }}</p>\n </div>\n </ChangeHeight>\n </div>\n <CollapseHeight\n v-if=\"queries.length\"\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\" data-test=\"ai-overview-suggestions-container\">\n <!-- @slot suggestions-search content -->\n <slot :suggestions-search=\"suggestionsSearch\" :queries=\"queries\">\n <div class=\"x-ai-overview-suggestions\">\n <div v-for=\"{ query } in queries\" :key=\"query\" class=\"x-ai-overview-suggestion\">\n <BaseEventButton\n class=\"x-ai-overview-suggestion-query-btn\"\n :events=\"{ UserAcceptedAQuery: query }\"\n >\n {{ query }}<ArrowRightIcon class=\"x-ai-overview-suggestion-query-btn-icon\" />\n </BaseEventButton>\n <!-- @slot suggestion query result list -->\n <slot name=\"query-results\" :query-results=\"queriesResults[query]\">\n <SlidingPanel v-if=\"queriesResults[query]\" :reset-on-content-change=\"false\">\n <ul class=\"x-ai-overview-suggestion-results\">\n <li\n v-for=\"result in queriesResults[query]\"\n :key=\"result.id\"\n data-test=\"ai-overview-suggestion-result\"\n >\n <!-- @slot (required) result card -->\n <slot name=\"result\" :result=\"result\" />\n </li>\n </ul>\n </SlidingPanel>\n </slot>\n </div>\n </div>\n </slot>\n </div>\n </CollapseHeight>\n <div v-show=\"queries.length\">\n <div\n v-show=\"!expanded\"\n class=\"x-ai-overview-gradient\"\n data-test=\"ai-overview-gradient\"\n @click=\"toggleVisibility\"\n />\n <div class=\"x-ai-overview-toggle-wrapper\">\n <!-- @slot toggle button -->\n <slot name=\"toggle-button\" v-bind=\"{ expanded, toggleVisibility, buttonText }\">\n <button\n class=\"x-ai-overview-toggle-btn\"\n data-test=\"ai-overview-toggle-button\"\n @click=\"toggleVisibility\"\n >\n {{ buttonText }}\n <ChevronDownIcon\n class=\"x-ai-overview-toggle-btn-icon\"\n :class=\"\n expanded\n ? 'x-ai-overview-toggle-btn-icon-expanded'\n : 'x-ai-overview-toggle-btn-icon-collapsed'\n \"\n />\n </button>\n </slot>\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { AiSuggestionSearch } 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 Fade,\n SlidingPanel,\n} from '../../../components'\nimport { 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 },\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 default: 'Empathy AI Overview',\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 setup(props) {\n const { query } = useGetter('ai')\n const { suggestionText, responseText, queries, suggestionsSearch, suggestionsLoading } =\n useState('ai')\n\n const expanded = ref(false)\n\n const queriesResults = computed(() => {\n return suggestionsSearch.value.reduce(\n (acc: Record<string, AiSuggestionSearch['results']>, { query, results }) => {\n acc[query] = results\n return acc\n },\n {},\n )\n })\n\n const buttonText = computed(() => (expanded.value ? props.collapseText : props.expandText))\n\n function toggleVisibility() {\n expanded.value = !expanded.value\n }\n\n watch(query, () => (expanded.value = false))\n\n return {\n buttonText,\n expanded,\n queries,\n responseText,\n suggestionsLoading,\n queriesResults,\n suggestionsSearch,\n suggestionText,\n toggleVisibility,\n }\n },\n})\n</script>\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 --color-lightest: var(\n --x-ai-overview-color-lightest,\n color-mix(in srgb, var(--color) 75%, white)\n );\n\n @apply x-relative x-rounded-3xl x-bg-[var(--color-lighter)];\n}\n\n.x-ai-overview-main {\n @apply x-p-16 x-rounded-lg;\n}\n\n.x-ai-overview-title-loading {\n @apply x-flex x-items-center x-gap-1.5 x-mb-8;\n}\n.x-ai-overview-title-loading-indicator {\n @apply x-size-3 x-animate-pulse x-rounded-full x-bg-[var(--color)];\n}\n.x-ai-overview-title-loading-text {\n @apply x-animate-pulse x-text-xs;\n}\n\n.x-ai-overview-title {\n @apply x-flex x-text-sm x-font-bold x-gap-4 x-items-center x-mb-8;\n}\n.x-ai-overview-title-icon {\n @apply x-icon x-text-[var(--color)];\n}\n\n.x-ai-overview-loading-content {\n @apply x-flex x-w-full x-flex-col x-gap-4 x-animate-pulse;\n}\n.x-ai-overview-loading-content > span:first-child {\n @apply x-h-16 x-w-full x-rounded-full x-bg-gradient-to-r x-from-0% x-from-[var(--color)] x-to-100% x-to-[var(--color-lightest)];\n}\n.x-ai-overview-loading-content > span:nth-child(2) {\n @apply x-h-16 x-w-3/4 x-rounded-full x-bg-gradient-to-r x-from-0% x-from-[var(--color-lightest)] x-to-100% x-to-[var(--color)] x-opacity-50;\n}\n.x-ai-overview-loading-content > span:nth-child(3) {\n @apply x-h-16 x-w-11/12 x-rounded-full x-bg-gradient-to-r x-from-0% x-from-[var(--color)] x-to-100% x-to-[var(--color-lightest)];\n}\n.x-ai-overview-loading-content > span:nth-child(4) {\n @apply x-h-16 x-w-1/2 x-rounded-full x-bg-gradient-to-r x-from-0% x-from-[var(--color)] x-to-100% x-to-[var(--color-lightest)] x-opacity-75;\n}\n\n.x-ai-overview-content {\n @apply x-flex x-flex-col x-text-left x-leading-5 x-gap-2;\n}\n.x-ai-overview-content span {\n @apply x-font-medium;\n}\n\n.x-ai-overview-gradient {\n @apply x-cursor-pointer x-content-none x-absolute x-w-full x-h-80 x-bottom-5 x-bg-gradient-to-b x-from-0% x-from-transparent x-to-100% x-to-[var(--color-lighter)];\n}\n\n.x-ai-overview-toggle-wrapper {\n @apply x-flex x-relative x-z-[1];\n}\n.x-ai-overview-toggle-btn {\n @apply x-button x-button-outlined x-rounded-full x-w-full;\n}\n.x-ai-overview-toggle-btn-icon {\n @apply x-icon x-transition-all x-duration-300;\n}\n.x-ai-overview-toggle-btn-icon-expanded {\n @apply x-rotate-0;\n}\n.x-ai-overview-toggle-btn-icon-collapsed {\n @apply x-rotate-180;\n}\n.x-ai-overview-suggestion-query-btn {\n @apply x-button-tight x-mx-16 x-font-bold x-text-gray-900 x-w-fit x-min-h-fit x-flex x-gap-16 x-items-center;\n}\n.x-ai-overview-suggestion-query-btn-icon {\n @apply x-icon-md;\n}\n.x-ai-overview-suggestions {\n @apply x-flex x-flex-col x-gap-16 x-pb-16;\n}\n.x-ai-overview-suggestion {\n @apply x-flex x-flex-col x-gap-8;\n}\n.x-ai-overview-suggestion-results {\n @apply x-flex x-gap-16 x-px-16;\n}\n</style>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyHA,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;AACb,KAAA;AACD,IAAA,KAAK,EAAE;AACL;;;;AAIE;AACF,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,OAAO,EAAE,qBAAqB;AAC/B,SAAA;AACD;;;;AAIE;AACF,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,OAAO,EAAE,4BAA4B;AACtC,SAAA;AACD;;;;AAIE;AACF,QAAA,UAAU,EAAE;AACV,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,OAAO,EAAE,WAAW;AACrB,SAAA;AACD;;;;AAIE;AACF,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,OAAO,EAAE,WAAW;AACrB,SAAA;AACF,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAA;QACT,MAAM,EAAE,KAAI,EAAI,GAAE,SAAS,CAAC,IAAI,CAAA,CAAA;AAChC,QAAA,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,OAAO,EAAE,iBAAiB,EAAE,oBAAqB,GACrF,QAAQ,CAAC,IAAI,CAAA,CAAA;AAEf,QAAA,MAAM,QAAS,GAAE,GAAG,CAAC,KAAK,CAAA,CAAA;AAE1B,QAAA,MAAM,cAAe,GAAE,QAAQ,CAAC,MAAM;AACpC,YAAA,OAAO,iBAAiB,CAAC,KAAK,CAAC,MAAM,CACnC,CAAC,GAAkD,EAAE,EAAE,KAAK,EAAE,OAAM,EAAG,KAAK;AAC1E,gBAAA,GAAG,CAAC,KAAK,CAAA,GAAI,OAAM,CAAA;AACnB,gBAAA,OAAO,GAAE,CAAA;aACV,EACD,EAAE,CACJ,CAAA;AACF,SAAC,CAAA,CAAA;QAED,MAAM,UAAW,GAAE,QAAQ,CAAC,OAAO,QAAQ,CAAC,KAAM,GAAE,KAAK,CAAC,YAAW,GAAI,KAAK,CAAC,UAAU,CAAC,CAAA,CAAA;AAE1F,QAAA,SAAS,gBAAgB,GAAA;AACvB,YAAA,QAAQ,CAAC,KAAI,GAAI,CAAC,QAAQ,CAAC,KAAI,CAAA;SACjC;AAEA,QAAA,KAAK,CAAC,KAAK,EAAE,OAAO,QAAQ,CAAC,KAAI,GAAI,KAAK,CAAC,CAAA,CAAA;QAE3C,OAAO;YACL,UAAU;YACV,QAAQ;YACR,OAAO;YACP,YAAY;YACZ,kBAAkB;YAClB,cAAc;YACd,iBAAiB;YACjB,cAAc;YACd,gBAAgB;SAClB,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 <div class=\"x-ai-overview\">\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 v-typing=\"{ text: titleLoading, speed: 50 }\"\n class=\"x-ai-overview-title-loading-text\"\n data-test=\"ai-overview-title-loading-text\"\n />\n </span>\n <span v-else class=\"x-ai-overview-title\" data-test=\"ai-overview-title\">\n <AIStarIcon class=\"x-ai-overview-title-icon\" />{{ title }}\n </span>\n </Fade>\n <ChangeHeight>\n <div class=\"x-ai-overview-content\" data-test=\"ai-overview-content\">\n <span>{{ suggestionText }}</span>\n <p>{{ responseText }}</p>\n </div>\n </ChangeHeight>\n </div>\n <CollapseHeight\n v-if=\"queries.length\"\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\" data-test=\"ai-overview-suggestions-container\">\n <!-- @slot suggestions-search content -->\n <slot :suggestions-search=\"suggestionsSearch\" :queries=\"queries\">\n <div class=\"x-ai-overview-suggestions\">\n <div v-for=\"{ query } in queries\" :key=\"query\" class=\"x-ai-overview-suggestion\">\n <BaseEventButton\n class=\"x-ai-overview-suggestion-query-btn\"\n :events=\"{ UserAcceptedAQuery: query }\"\n >\n {{ query }}<ArrowRightIcon class=\"x-ai-overview-suggestion-query-btn-icon\" />\n </BaseEventButton>\n <!-- @slot suggestion query result list -->\n <slot name=\"query-results\" :query-results=\"queriesResults[query]\">\n <SlidingPanel v-if=\"queriesResults[query]\" :reset-on-content-change=\"false\">\n <ul class=\"x-ai-overview-suggestion-results\">\n <li\n v-for=\"result in queriesResults[query].results\"\n :key=\"result.id\"\n data-test=\"ai-overview-suggestion-result\"\n >\n <!-- @slot (required) result card -->\n <slot name=\"result\" :result=\"result\" />\n </li>\n </ul>\n </SlidingPanel>\n </slot>\n </div>\n </div>\n </slot>\n </div>\n </CollapseHeight>\n <div v-show=\"queries.length\">\n <div\n v-show=\"!expanded\"\n class=\"x-ai-overview-gradient\"\n data-test=\"ai-overview-gradient\"\n @click=\"toggleVisibility\"\n />\n <div class=\"x-ai-overview-toggle-wrapper\">\n <!-- @slot toggle button -->\n <slot name=\"toggle-button\" v-bind=\"{ expanded, toggleVisibility, buttonText }\">\n <button\n class=\"x-ai-overview-toggle-btn\"\n data-test=\"ai-overview-toggle-button\"\n @click=\"toggleVisibility\"\n >\n {{ buttonText }}\n <ChevronDownIcon\n class=\"x-ai-overview-toggle-btn-icon\"\n :class=\"\n expanded\n ? 'x-ai-overview-toggle-btn-icon-expanded'\n : 'x-ai-overview-toggle-btn-icon-collapsed'\n \"\n />\n </button>\n </slot>\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport type { AiSuggestionSearch } 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 Fade,\n SlidingPanel,\n} from '../../../components'\nimport { 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 },\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 default: 'Empathy AI Overview',\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 setup(props) {\n const { query } = useGetter('ai')\n const { suggestionText, responseText, queries, suggestionsSearch, suggestionsLoading } =\n useState('ai')\n\n const expanded = ref(false)\n\n const queriesResults = computed(() => {\n return suggestionsSearch.value.reduce(\n (\n acc: Record<string, { results: AiSuggestionSearch['results']; numFound: number }>,\n { query, results, numFound },\n ) => {\n acc[query] = { results, numFound }\n return acc\n },\n {},\n )\n })\n\n const buttonText = computed(() => (expanded.value ? props.collapseText : props.expandText))\n\n function toggleVisibility() {\n expanded.value = !expanded.value\n }\n\n watch(query, () => (expanded.value = false))\n\n return {\n buttonText,\n expanded,\n queries,\n responseText,\n suggestionsLoading,\n queriesResults,\n suggestionsSearch,\n suggestionText,\n toggleVisibility,\n }\n },\n})\n</script>\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 @apply x-relative x-rounded-3xl x-bg-[var(--color-lighter)];\n}\n\n.x-ai-overview-main {\n @apply x-p-16 x-rounded-lg;\n}\n\n.x-ai-overview-title-loading {\n @apply x-flex x-items-center x-gap-1.5 x-mb-8;\n}\n.x-ai-overview-title-loading-indicator {\n @apply x-size-3 x-animate-pulse x-rounded-full x-bg-[var(--color)];\n}\n.x-ai-overview-title-loading-text {\n @apply x-animate-pulse x-text-xs;\n}\n\n.x-ai-overview-title {\n @apply x-flex x-text-sm x-font-bold x-gap-4 x-items-center x-mb-8;\n}\n.x-ai-overview-title-icon {\n @apply x-icon x-text-[var(--color)];\n}\n\n.x-ai-overview-content {\n @apply x-flex x-flex-col x-text-left x-leading-5 x-gap-2;\n}\n.x-ai-overview-content span {\n @apply x-font-medium;\n}\n\n.x-ai-overview-gradient {\n @apply x-cursor-pointer x-content-none x-absolute x-w-full x-h-80 x-bottom-5 x-bg-gradient-to-b x-from-0% x-from-transparent x-to-100% x-to-[var(--color-lighter)];\n}\n\n.x-ai-overview-toggle-wrapper {\n @apply x-flex x-relative x-z-[1];\n}\n.x-ai-overview-toggle-btn {\n @apply x-button x-button-outlined x-rounded-full x-w-full;\n}\n.x-ai-overview-toggle-btn-icon {\n @apply x-icon x-transition-all x-duration-300;\n}\n.x-ai-overview-toggle-btn-icon-expanded {\n @apply x-rotate-180;\n}\n.x-ai-overview-toggle-btn-icon-collapsed {\n @apply x-rotate-0;\n}\n.x-ai-overview-suggestion-query-btn {\n @apply x-button-tight x-mx-16 x-font-bold x-text-gray-900 x-w-fit x-min-h-fit x-flex x-gap-16 x-items-center;\n}\n.x-ai-overview-suggestion-query-btn-icon {\n @apply x-icon-md;\n}\n.x-ai-overview-suggestions {\n @apply x-flex x-flex-col x-gap-16 x-pb-16;\n}\n.x-ai-overview-suggestion {\n @apply x-flex x-flex-col x-gap-8;\n}\n.x-ai-overview-suggestion-results {\n @apply x-flex x-gap-16 x-px-16;\n}\n</style>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkHA,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;AACb,KAAA;AACD,IAAA,KAAK,EAAE;AACL;;;;AAIE;AACF,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,OAAO,EAAE,qBAAqB;AAC/B,SAAA;AACD;;;;AAIE;AACF,QAAA,YAAY,EAAE;AACZ,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,OAAO,EAAE,4BAA4B;AACtC,SAAA;AACD;;;;AAIE;AACF,QAAA,UAAU,EAAE;AACV,YAAA,IAAI,EAAE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ClB,CAAA;KACD;AACF,CAAA,CAAA;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import injectCss from '../../../../tools/inject-css.js';
|
|
2
2
|
|
|
3
|
-
var css = ".x-ai-overview{--color:var(--x-ai-overview-color,#bbc9cf);--color-lighter:var(--x-ai-overview-color-lighter,color-mix(in srgb,var(--color) 25%,#fff))
|
|
3
|
+
var css = ".x-ai-overview{--color:var(--x-ai-overview-color,#bbc9cf);--color-lighter:var(--x-ai-overview-color-lighter,color-mix(in srgb,var(--color) 25%,#fff));background-color:var(--color-lighter);border-radius:1.5rem;position:relative}.x-ai-overview-main{border-radius:.5rem;padding:16px}.x-ai-overview-title-loading{align-items:center;display:flex;gap:.375rem;margin-bottom:8px}.x-ai-overview-title-loading-indicator{animation:x-pulse 2s cubic-bezier(.4,0,.6,1) infinite;background-color:var(--color);border-radius:9999px;height:.75rem;width:.75rem}@keyframes x-pulse{50%{opacity:.5}}.x-ai-overview-title-loading-text{animation:x-pulse 2s cubic-bezier(.4,0,.6,1) infinite;font-size:12px}.x-ai-overview-title{align-items:center;display:flex;font-size:14px;font-weight:700;gap:4px;margin-bottom:8px}.x-ai-overview-title-icon{vector-effect:non-scaling-stroke;--enableIconOffset:var(--OFF);--fontSize:14px;align-items:center;aspect-ratio:1/1;color:var(--color);display:flex;flex:0 0 auto;font-family:font-awesome;font-size:var(--enableIconOffset) var(--fontSize);height:16px;justify-content:center;margin-top:var(--enableIconOffset,calc(var(--iconVerticalOffset)*-1));transform:var(--enableIconOffset,translateY(var(--iconVerticalOffset,0)));width:auto}.x-ai-overview-content{display:flex;flex-direction:column;gap:2px;line-height:1.25rem;text-align:left}.x-ai-overview-content span{font-weight:500}.x-ai-overview-gradient{--tw-gradient-from:transparent var(--tw-gradient-from-position);--tw-gradient-to:transparent var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to);--tw-gradient-from-position:0%;--tw-gradient-to:var(--color-lighter) var(--tw-gradient-to-position);--tw-gradient-to-position:100%;--tw-content:none;background-image:linear-gradient(to bottom,var(--tw-gradient-stops));bottom:1.25rem;content:var(--tw-content);cursor:pointer;height:80px;position:absolute;width:100%}.x-ai-overview-toggle-wrapper{display:flex;position:relative;z-index:1}.x-ai-overview-toggle-btn{align-content:center;align-items:center;background-color:var(--button-color-50,#283034);border-style:solid;border-width:1px;box-sizing:border-box;color:#fff;cursor:pointer;display:flex;flex-flow:row nowrap;font-family:Inter,sans-serif;font-weight:700;justify-content:center;letter-spacing:0;line-height:1.4}.x-ai-overview-toggle-btn:active,.x-ai-overview-toggle-btn:hover{background-color:var(--button-color-75,#000);border-color:var(--button-color-75,#000)}[dir=ltr] .x-ai-overview-toggle-btn{padding-left:16px}[dir=ltr] .x-ai-overview-toggle-btn,[dir=rtl] .x-ai-overview-toggle-btn{padding-right:16px}[dir=rtl] .x-ai-overview-toggle-btn{padding-left:16px}.x-ai-overview-toggle-btn{font-size:14px;gap:8px;min-height:40px}.x-ai-overview-toggle-btn.x-selected{background-color:var(--button-color-75,#000);border-color:var(--button-color-75,#000)}.x-ai-overview-toggle-btn.x-selected:active,.x-ai-overview-toggle-btn.x-selected:hover{background-color:var(--button-color-50,#283034);border-color:var(--button-color-50,#283034)}.x-ai-overview-toggle-btn{--button-disabled-border-color:#dbe2e5;background-color:#fff;border-color:var(--button-color-50,#283034);color:var(--button-color-50,#283034)}.x-ai-overview-toggle-btn.x-selected,.x-ai-overview-toggle-btn:active,.x-ai-overview-toggle-btn:hover{background-color:var(--button-color-50,#283034);border-color:var(--button-color-50,#283034);color:#fff}.x-ai-overview-toggle-btn.x-selected:active,.x-ai-overview-toggle-btn.x-selected:hover{background-color:#fff;color:var(--button-color-50,#283034)}.x-ai-overview-toggle-btn:disabled{cursor:not-allowed}.x-ai-overview-toggle-btn:disabled,.x-ai-overview-toggle-btn:disabled.x-selected{background-color:var(--button-disabled-background-color,#eef1f2);border-color:var(--button-disabled-border-color,#eef1f2);color:#dbe2e5}.x-button-group:not([class*=gap])>.x-ai-overview-toggle-btn+.x-button{border-left:unset}.x-ai-overview-toggle-btn{border-radius:9999px;width:100%}.x-ai-overview-toggle-btn-icon{vector-effect:non-scaling-stroke;--enableIconOffset:var(--OFF);--fontSize:14px;align-items:center;aspect-ratio:1/1;display:flex;flex:0 0 auto;font-family:font-awesome;font-size:var(--enableIconOffset) var(--fontSize);height:16px;justify-content:center;margin-top:var(--enableIconOffset,calc(var(--iconVerticalOffset)*-1));transform:var(--enableIconOffset,translateY(var(--iconVerticalOffset,0)));transition-duration:.3s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);width:auto}.x-ai-overview-toggle-btn-icon-expanded{--tw-rotate:180deg}.x-ai-overview-toggle-btn-icon-collapsed,.x-ai-overview-toggle-btn-icon-expanded{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.x-ai-overview-toggle-btn-icon-collapsed{--tw-rotate:0deg}.x-ai-overview-suggestion-query-btn{--button-disabled-border-color:transparent;--button-disabled-background-color:transparent;background-color:transparent;border-color:transparent;color:var(--button-color-50,#283034)}.x-ai-overview-suggestion-query-btn:active,.x-ai-overview-suggestion-query-btn:hover{background-color:transparent;border-color:transparent;color:var(--button-color-75,#000)}[dir=ltr] .x-ai-overview-suggestion-query-btn{padding-left:0}[dir=ltr] .x-ai-overview-suggestion-query-btn,[dir=rtl] .x-ai-overview-suggestion-query-btn{padding-right:0}[dir=rtl] .x-ai-overview-suggestion-query-btn{padding-left:0}.x-ai-overview-suggestion-query-btn.x-selected{background-color:transparent;border-color:transparent;color:var(--button-color-75,#000)}.x-ai-overview-suggestion-query-btn.x-selected:active,.x-ai-overview-suggestion-query-btn.x-selected:hover{background-color:transparent;border-color:transparent;color:var(--button-color-50,#283034)}.x-ai-overview-suggestion-query-btn{--tw-text-opacity:1;align-items:center;color:rgb(17 24 39/var(--tw-text-opacity));display:flex;font-weight:700;gap:16px;margin-left:16px;margin-right:16px;min-height:fit-content;width:fit-content}.x-ai-overview-suggestion-query-btn-icon{--fontSize:14px;height:16px}.x-ai-overview-suggestions{display:flex;flex-direction:column;gap:16px;padding-bottom:16px}.x-ai-overview-suggestion{display:flex;flex-direction:column;gap:8px}.x-ai-overview-suggestion-results{display:flex;gap:16px;padding-left:16px;padding-right:16px}";
|
|
4
4
|
injectCss(css);
|
|
5
5
|
|
|
6
6
|
export { css, css as default };
|
|
@@ -27,13 +27,13 @@ const aiXStoreModule = {
|
|
|
27
27
|
mutations: {
|
|
28
28
|
/* Streamed fields */
|
|
29
29
|
setResponseText: (state, responseText) => {
|
|
30
|
-
state.responseText =
|
|
30
|
+
state.responseText = responseText;
|
|
31
31
|
},
|
|
32
32
|
setSuggestionText: (state, suggestionText) => {
|
|
33
|
-
state.suggestionText =
|
|
33
|
+
state.suggestionText = suggestionText;
|
|
34
34
|
},
|
|
35
35
|
setQueries: (state, queries) => {
|
|
36
|
-
state.queries =
|
|
36
|
+
state.queries = queries;
|
|
37
37
|
},
|
|
38
38
|
setTaggings: (state, taggings) => {
|
|
39
39
|
state.taggings = taggings;
|
|
@@ -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 =
|
|
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 setTaggings: (state, taggings) => {\n state.taggings = taggings\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 },\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 taggings: [],\n suggestionsSearch: [],\n suggestionsLoading: false,\n suggestionsSearchLoading: false,\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAYA;;;;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,WAAW,EAAE,EAAE;KAChB,CAAC;AACF,IAAA,OAAO,EAAE;QACP,kBAAkB;QAClB,wBAAwB;QACxB,KAAK;AACN,KAAA;AACD,IAAA,SAAS,EAAE;;AAET,QAAA,eAAe,EAAE,CAAC,KAAK,EAAE,YAAoB,KAAI;AAC/C,YAAA,KAAK,CAAC,YAAY,GAAG,YAAY,CAAA;SAClC;AACD,QAAA,iBAAiB,EAAE,CAAC,KAAK,EAAE,cAAsB,KAAI;AACnD,YAAA,KAAK,CAAC,cAAc,GAAG,cAAc,CAAA;SACtC;AACD,QAAA,UAAU,EAAE,CAAC,KAAK,EAAE,OAA4B,KAAI;AAClD,YAAA,KAAK,CAAC,OAAO,GAAG,OAAO,CAAA;SACxB;AACD,QAAA,WAAW,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAI;AAC/B,YAAA,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAA;S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2
2
|
"name": "@empathyco/x-components",
|
|
3
|
-
"version": "6.0.0-alpha.
|
|
3
|
+
"version": "6.0.0-alpha.139",
|
|
4
4
|
"description": "Empathy X Components",
|
|
5
5
|
"author": "Empathy Systems Corporation S.L.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -79,10 +79,10 @@
|
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@empathyco/x-adapter": "^8.1.0-alpha.9",
|
|
82
|
-
"@empathyco/x-adapter-platform": "^1.1.0-alpha.
|
|
82
|
+
"@empathyco/x-adapter-platform": "^1.1.0-alpha.32",
|
|
83
83
|
"@empathyco/x-deep-merge": "^2.0.3-alpha.9",
|
|
84
84
|
"@empathyco/x-storage-service": "^2.0.3-alpha.7",
|
|
85
|
-
"@empathyco/x-types": "^10.1.0-alpha.
|
|
85
|
+
"@empathyco/x-types": "^10.1.0-alpha.25",
|
|
86
86
|
"@empathyco/x-utils": "^1.0.3-alpha.8",
|
|
87
87
|
"@vue/devtools-api": "~6.5.0",
|
|
88
88
|
"@vueuse/core": "~10.11.0",
|
|
@@ -142,5 +142,5 @@
|
|
|
142
142
|
"access": "public",
|
|
143
143
|
"directory": "dist"
|
|
144
144
|
},
|
|
145
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "af18afcf0737a9f3492a250e726ec6269d3d4cb7"
|
|
146
146
|
}
|
|
@@ -3504,6 +3504,33 @@
|
|
|
3504
3504
|
"name": "PlatformAiSuggestionSearch",
|
|
3505
3505
|
"preserveMemberOrder": false,
|
|
3506
3506
|
"members": [
|
|
3507
|
+
{
|
|
3508
|
+
"kind": "PropertySignature",
|
|
3509
|
+
"canonicalReference": "@empathyco/x-adapter-platform!PlatformAiSuggestionSearch#numFound:member",
|
|
3510
|
+
"docComment": "",
|
|
3511
|
+
"excerptTokens": [
|
|
3512
|
+
{
|
|
3513
|
+
"kind": "Content",
|
|
3514
|
+
"text": "numFound: "
|
|
3515
|
+
},
|
|
3516
|
+
{
|
|
3517
|
+
"kind": "Content",
|
|
3518
|
+
"text": "number"
|
|
3519
|
+
},
|
|
3520
|
+
{
|
|
3521
|
+
"kind": "Content",
|
|
3522
|
+
"text": ";"
|
|
3523
|
+
}
|
|
3524
|
+
],
|
|
3525
|
+
"isReadonly": false,
|
|
3526
|
+
"isOptional": false,
|
|
3527
|
+
"releaseTag": "Public",
|
|
3528
|
+
"name": "numFound",
|
|
3529
|
+
"propertyTypeTokenRange": {
|
|
3530
|
+
"startIndex": 1,
|
|
3531
|
+
"endIndex": 2
|
|
3532
|
+
}
|
|
3533
|
+
},
|
|
3507
3534
|
{
|
|
3508
3535
|
"kind": "PropertySignature",
|
|
3509
3536
|
"canonicalReference": "@empathyco/x-adapter-platform!PlatformAiSuggestionSearch#query:member",
|
|
@@ -3736,7 +3763,7 @@
|
|
|
3736
3763
|
},
|
|
3737
3764
|
{
|
|
3738
3765
|
"kind": "Content",
|
|
3739
|
-
"text": "[];\n }[]"
|
|
3766
|
+
"text": "[];\n numFound: number;\n }[]"
|
|
3740
3767
|
},
|
|
3741
3768
|
{
|
|
3742
3769
|
"kind": "Content",
|
|
@@ -1595,16 +1595,16 @@
|
|
|
1595
1595
|
},
|
|
1596
1596
|
{
|
|
1597
1597
|
"kind": "Content",
|
|
1598
|
-
"text": "<string,
|
|
1598
|
+
"text": "<string, {\n results: "
|
|
1599
1599
|
},
|
|
1600
1600
|
{
|
|
1601
1601
|
"kind": "Reference",
|
|
1602
|
-
"text": "
|
|
1603
|
-
"canonicalReference": "@empathyco/x-components!
|
|
1602
|
+
"text": "AiSuggestionSearch",
|
|
1603
|
+
"canonicalReference": "@empathyco/x-components!AiSuggestionSearch:interface"
|
|
1604
1604
|
},
|
|
1605
1605
|
{
|
|
1606
1606
|
"kind": "Content",
|
|
1607
|
-
"text": "[]>>;\n suggestionsSearch: import(\"vue\")."
|
|
1607
|
+
"text": "[\"results\"];\n numFound: number;\n }>>;\n suggestionsSearch: import(\"vue\")."
|
|
1608
1608
|
},
|
|
1609
1609
|
{
|
|
1610
1610
|
"kind": "Reference",
|
|
@@ -239,7 +239,10 @@ expanded: Ref<boolean>;
|
|
|
239
239
|
queries: ComputedRef<AiSuggestionQuery[]>;
|
|
240
240
|
responseText: ComputedRef<string>;
|
|
241
241
|
suggestionsLoading: ComputedRef<boolean>;
|
|
242
|
-
queriesResults: ComputedRef<Record<string,
|
|
242
|
+
queriesResults: ComputedRef<Record<string, {
|
|
243
|
+
results: AiSuggestionSearch["results"];
|
|
244
|
+
numFound: number;
|
|
245
|
+
}>>;
|
|
243
246
|
suggestionsSearch: ComputedRef<AiSuggestionSearch[]>;
|
|
244
247
|
suggestionText: ComputedRef<string>;
|
|
245
248
|
toggleVisibility: () => void;
|
|
@@ -9188,8 +9191,8 @@ export type XStoreModuleOptions<StoreModule extends AnyXStoreModule> = StoreModu
|
|
|
9188
9191
|
// dist/types/components/filters/labels/base-price-filter-label.vue.d.ts:13:13 - (ae-forgotten-export) The symbol "RangeValue" needs to be exported by the entry point index.d.ts
|
|
9189
9192
|
// dist/types/components/filters/labels/base-rating-filter-label.vue.d.ts:16:9 - (ae-forgotten-export) The symbol "BooleanFilter" needs to be exported by the entry point index.d.ts
|
|
9190
9193
|
// dist/types/components/page-selector.vue.d.ts:65:5 - (ae-forgotten-export) The symbol "PageItem" needs to be exported by the entry point index.d.ts
|
|
9194
|
+
// dist/types/components/result/base-result-add-to-cart.vue.d.ts:18:9 - (ae-forgotten-export) The symbol "Result" needs to be exported by the entry point index.d.ts
|
|
9191
9195
|
// dist/types/components/suggestions/base-suggestion.vue.d.ts:31:9 - (ae-forgotten-export) The symbol "Suggestion" needs to be exported by the entry point index.d.ts
|
|
9192
|
-
// dist/types/x-modules/ai/components/ai-overview.vue.d.ts:46:5 - (ae-forgotten-export) The symbol "Result" needs to be exported by the entry point index.d.ts
|
|
9193
9196
|
// dist/types/x-modules/device/components/device-detector.vue.d.ts:21:9 - (ae-forgotten-export) The symbol "Device" needs to be exported by the entry point index.d.ts
|
|
9194
9197
|
// dist/types/x-modules/device/components/device-detector.vue.d.ts:21:9 - (ae-forgotten-export) The symbol "MaxWidth" needs to be exported by the entry point index.d.ts
|
|
9195
9198
|
// dist/types/x-modules/facets/components/facets/facets.vue.d.ts:56:5 - (ae-forgotten-export) The symbol "RenderFacet" needs to be exported by the entry point index.d.ts
|
package/report/x-types.api.json
CHANGED
|
@@ -737,6 +737,33 @@
|
|
|
737
737
|
"name": "AiSuggestionSearch",
|
|
738
738
|
"preserveMemberOrder": false,
|
|
739
739
|
"members": [
|
|
740
|
+
{
|
|
741
|
+
"kind": "PropertySignature",
|
|
742
|
+
"canonicalReference": "@empathyco/x-types!AiSuggestionSearch#numFound:member",
|
|
743
|
+
"docComment": "",
|
|
744
|
+
"excerptTokens": [
|
|
745
|
+
{
|
|
746
|
+
"kind": "Content",
|
|
747
|
+
"text": "numFound: "
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
"kind": "Content",
|
|
751
|
+
"text": "number"
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
"kind": "Content",
|
|
755
|
+
"text": ";"
|
|
756
|
+
}
|
|
757
|
+
],
|
|
758
|
+
"isReadonly": false,
|
|
759
|
+
"isOptional": false,
|
|
760
|
+
"releaseTag": "Public",
|
|
761
|
+
"name": "numFound",
|
|
762
|
+
"propertyTypeTokenRange": {
|
|
763
|
+
"startIndex": 1,
|
|
764
|
+
"endIndex": 2
|
|
765
|
+
}
|
|
766
|
+
},
|
|
740
767
|
{
|
|
741
768
|
"kind": "PropertySignature",
|
|
742
769
|
"canonicalReference": "@empathyco/x-types!AiSuggestionSearch#query:member",
|
|
@@ -941,18 +968,14 @@
|
|
|
941
968
|
"kind": "Content",
|
|
942
969
|
"text": "suggestions: "
|
|
943
970
|
},
|
|
944
|
-
{
|
|
945
|
-
"kind": "Content",
|
|
946
|
-
"text": "{\n query: string;\n results: "
|
|
947
|
-
},
|
|
948
971
|
{
|
|
949
972
|
"kind": "Reference",
|
|
950
|
-
"text": "
|
|
951
|
-
"canonicalReference": "@empathyco/x-types!
|
|
973
|
+
"text": "AiSuggestionSearch",
|
|
974
|
+
"canonicalReference": "@empathyco/x-types!AiSuggestionSearch:interface"
|
|
952
975
|
},
|
|
953
976
|
{
|
|
954
977
|
"kind": "Content",
|
|
955
|
-
"text": "[]
|
|
978
|
+
"text": "[]"
|
|
956
979
|
},
|
|
957
980
|
{
|
|
958
981
|
"kind": "Content",
|
|
@@ -965,7 +988,7 @@
|
|
|
965
988
|
"name": "suggestions",
|
|
966
989
|
"propertyTypeTokenRange": {
|
|
967
990
|
"startIndex": 1,
|
|
968
|
-
"endIndex":
|
|
991
|
+
"endIndex": 3
|
|
969
992
|
}
|
|
970
993
|
}
|
|
971
994
|
],
|
|
@@ -43,7 +43,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
43
43
|
queries: import("vue").ComputedRef<import("@empathyco/x-types").AiSuggestionQuery[]>;
|
|
44
44
|
responseText: import("vue").ComputedRef<string>;
|
|
45
45
|
suggestionsLoading: import("vue").ComputedRef<boolean>;
|
|
46
|
-
queriesResults: import("vue").ComputedRef<Record<string,
|
|
46
|
+
queriesResults: import("vue").ComputedRef<Record<string, {
|
|
47
|
+
results: AiSuggestionSearch["results"];
|
|
48
|
+
numFound: number;
|
|
49
|
+
}>>;
|
|
47
50
|
suggestionsSearch: import("vue").ComputedRef<AiSuggestionSearch[]>;
|
|
48
51
|
suggestionText: import("vue").ComputedRef<string>;
|
|
49
52
|
toggleVisibility: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-overview.vue?vue&type=script&lang.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/ai/components/ai-overview.vue?vue&type=script&lang.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;;IAgC/B;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;;IAGlC;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;;IAGlC;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;;IAGlC;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC
|
|
1
|
+
{"version":3,"file":"ai-overview.vue?vue&type=script&lang.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/ai/components/ai-overview.vue?vue&type=script&lang.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;;IAgC/B;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;;IAGlC;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;;IAGlC;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;;IAGlC;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;;;;;;;;;iBAcG,kBAAkB,CAAC,SAAS,CAAC;kBAAY,MAAM;;;;;;IA/CpF;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;;IAGlC;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;;IAGlC;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;;IAGlC;;;;OAIG;;cAEe,QAAQ,CAAC,MAAM,CAAC;;;;;;;;;AAjDtC,wBA6FE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"related-prompts-tag-list.vue?vue&type=script&lang.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/related-prompts/components/related-prompts-tag-list.vue?vue&type=script&lang.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AAQnC;;;;;;;GAOG;;IAMC;;;;OAIG;;IAEH;;;;OAIG;;;;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;;OAKG;eACiB,QAAQ,CAAC,MAAM,EAAE,CAAC;IACtC;;;;OAIG;;;;;;8BAoE8B,MAAM,KAAG,IAAI;wBAiEnB,OAAO;kBAeb,OAAO,QAAQ,MAAM,IAAI;kBAkBzB,OAAO,QAAQ,MAAM,IAAI;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"related-prompts-tag-list.vue?vue&type=script&lang.d.ts","sourceRoot":"","sources":["../../../../../src/x-modules/related-prompts/components/related-prompts-tag-list.vue?vue&type=script&lang.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AAQnC;;;;;;;GAOG;;IAMC;;;;OAIG;;IAEH;;;;OAIG;;;;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;;OAKG;eACiB,QAAQ,CAAC,MAAM,EAAE,CAAC;IACtC;;;;OAIG;;;;;;8BAoE8B,MAAM,KAAG,IAAI;wBAiEnB,OAAO;kBAeb,OAAO,QAAQ,MAAM,IAAI;kBAkBzB,OAAO,QAAQ,MAAM,IAAI;;;;;;;;;;;iCAoCg0Y,CAAC;sCAAqD,CAAC;8BAA6C,CAAC;;;;;;;;;;;;;IA7On9Y;;;;OAIG;;IAEH;;;;OAIG;;;;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;;OAKG;eACiB,QAAQ,CAAC,MAAM,EAAE,CAAC;IACtC;;;;OAIG;;;;;;;;;AAxCP,wBAiPE"}
|