@empathyco/x-components 6.0.0-alpha.26 → 6.0.0-alpha.28
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/core/index.js.map +1 -1
- package/design-system/deprecated-full-theme.css +2052 -2051
- package/docs/API-reference/api/x-components.md +2 -1
- package/docs/API-reference/api/x-components.relatedprompt.md +27 -11
- package/docs/API-reference/api/x-components.relatedpromptsmutations.md +1 -0
- package/docs/API-reference/api/x-components.relatedpromptsmutations.resetselectedprompt.md +17 -0
- package/docs/API-reference/api/x-components.relatedpromptsmutations.setrelatedpromptsproducts.md +1 -1
- package/docs/API-reference/api/x-components.relatedpromptstaglist.md +22 -0
- package/docs/API-reference/components/related-prompts/x-components.related-prompt.md +11 -14
- package/docs/API-reference/components/related-prompts/x-components.related-prompts-tag-list.md +23 -0
- package/js/components/modals/base-modal.vue.js.map +1 -1
- package/js/components/modals/base-modal.vue2.js +13 -6
- package/js/components/modals/base-modal.vue2.js.map +1 -1
- package/js/index.js +1 -0
- package/js/index.js.map +1 -1
- package/js/x-modules/related-prompts/components/related-prompt.vue.js +43 -81
- package/js/x-modules/related-prompts/components/related-prompt.vue.js.map +1 -1
- package/js/x-modules/related-prompts/components/related-prompt.vue2.js +34 -26
- package/js/x-modules/related-prompts/components/related-prompt.vue2.js.map +1 -1
- package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue.js +80 -0
- package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue.js.map +1 -0
- package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue2.js +55 -0
- package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue2.js.map +1 -0
- package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue3.js +7 -0
- package/js/x-modules/related-prompts/components/related-prompts-tag-list.vue3.js.map +1 -0
- package/js/x-modules/related-prompts/store/module.js +9 -1
- package/js/x-modules/related-prompts/store/module.js.map +1 -1
- package/js/x-modules/related-prompts/wiring.js +10 -0
- package/js/x-modules/related-prompts/wiring.js.map +1 -1
- package/package.json +2 -2
- package/related-prompts/index.js +1 -0
- package/report/x-components.api.json +209 -14
- package/report/x-components.api.md +47 -10
- package/types/components/modals/base-modal.vue.d.ts.map +1 -1
- package/types/x-modules/related-prompts/components/index.d.ts +1 -0
- package/types/x-modules/related-prompts/components/index.d.ts.map +1 -1
- package/types/x-modules/related-prompts/components/related-prompt.vue.d.ts +27 -13
- package/types/x-modules/related-prompts/components/related-prompt.vue.d.ts.map +1 -1
- package/types/x-modules/related-prompts/components/related-prompts-tag-list.vue.d.ts +14 -0
- package/types/x-modules/related-prompts/components/related-prompts-tag-list.vue.d.ts.map +1 -0
- package/types/x-modules/related-prompts/store/module.d.ts.map +1 -1
- package/types/x-modules/related-prompts/store/types.d.ts +5 -1
- package/types/x-modules/related-prompts/store/types.d.ts.map +1 -1
- package/types/x-modules/related-prompts/wiring.d.ts +6 -0
- package/types/x-modules/related-prompts/wiring.d.ts.map +1 -1
- package/js/x-modules/related-prompts/components/related-prompt.vue3.js +0 -7
- package/js/x-modules/related-prompts/components/related-prompt.vue3.js.map +0 -1
|
@@ -1,22 +1,30 @@
|
|
|
1
|
-
import { defineComponent
|
|
1
|
+
import { defineComponent } from 'vue';
|
|
2
2
|
import { relatedPromptsXModule } from '../x-module.js';
|
|
3
3
|
import CrossTinyIcon from '../../../components/icons/cross-tiny.vue.js';
|
|
4
4
|
import PlusIcon from '../../../components/icons/plus.vue.js';
|
|
5
|
-
import
|
|
5
|
+
import '../../../composables/create-use-device.js';
|
|
6
|
+
import { use$x } from '../../../composables/use-_x.js';
|
|
7
|
+
import '@vue/devtools-api';
|
|
8
|
+
import '../../../plugins/devtools/timeline.devtools.js';
|
|
9
|
+
import '@empathyco/x-utils';
|
|
10
|
+
import 'rxjs/operators';
|
|
11
|
+
import 'rxjs';
|
|
12
|
+
import '../../../plugins/devtools/colors.utils.js';
|
|
13
|
+
import '../../../plugins/x-bus.js';
|
|
14
|
+
import '../../../plugins/x-plugin.js';
|
|
15
|
+
import 'vuex';
|
|
16
|
+
import '@vueuse/core';
|
|
6
17
|
|
|
7
18
|
/**
|
|
8
|
-
* This component shows a suggested related prompt
|
|
9
|
-
* It allows to select one of the next query and show it.
|
|
19
|
+
* This component shows a suggested related prompt.
|
|
10
20
|
*
|
|
11
|
-
* It
|
|
12
|
-
* the individual next query inside the list and the selected query.
|
|
21
|
+
* It provides a slot to customize the related prompt button information.
|
|
13
22
|
*
|
|
14
23
|
* @public
|
|
15
24
|
*/
|
|
16
25
|
var _sfc_main = defineComponent({
|
|
17
26
|
name: 'RelatedPrompt',
|
|
18
27
|
components: {
|
|
19
|
-
SlidingPanel,
|
|
20
28
|
CrossTinyIcon,
|
|
21
29
|
PlusIcon
|
|
22
30
|
},
|
|
@@ -26,27 +34,27 @@ var _sfc_main = defineComponent({
|
|
|
26
34
|
type: Object,
|
|
27
35
|
required: true
|
|
28
36
|
},
|
|
29
|
-
|
|
30
|
-
type:
|
|
31
|
-
default:
|
|
37
|
+
isPromptVisible: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: false
|
|
40
|
+
},
|
|
41
|
+
isSelected: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false
|
|
44
|
+
},
|
|
45
|
+
index: {
|
|
46
|
+
type: Number,
|
|
47
|
+
required: true
|
|
32
48
|
}
|
|
33
49
|
},
|
|
34
|
-
setup(
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (selectedNextQuery.value === nextQuery) {
|
|
43
|
-
selectedNextQuery.value = '';
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
selectedNextQuery.value = nextQuery;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return { selectedNextQuery, onClick };
|
|
50
|
+
setup() {
|
|
51
|
+
const x = use$x();
|
|
52
|
+
const toggleSuggestion = (index) => {
|
|
53
|
+
x.emit('UserSelectedARelatedPrompt', index);
|
|
54
|
+
};
|
|
55
|
+
return {
|
|
56
|
+
toggleSuggestion
|
|
57
|
+
};
|
|
50
58
|
}
|
|
51
59
|
});
|
|
52
60
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"related-prompt.vue2.js","sources":["../../../../../src/x-modules/related-prompts/components/related-prompt.vue"],"sourcesContent":["<template>\n <div
|
|
1
|
+
{"version":3,"file":"related-prompt.vue2.js","sources":["../../../../../src/x-modules/related-prompts/components/related-prompt.vue"],"sourcesContent":["<template>\n <div\n @click=\"toggleSuggestion(index)\"\n @keydown=\"toggleSuggestion(index)\"\n class=\"x-related-prompt__button\"\n :class=\"[{ 'x-related-prompt-selected__button': isSelected }]\"\n role=\"button\"\n aria-pressed=\"true\"\n tabindex=\"0\"\n >\n <slot name=\"related-prompt-button-info\">\n <div class=\"x-related-prompt__button-info\">\n <span\n class=\"x-typewritter-initial\"\n :class=\"[{ 'x-typewritter-animation': isPromptVisible }]\"\n :style=\"{\n animationDelay: `${index * 0.4 + 0.05}s`,\n '--suggestion-text-length': relatedPrompt.suggestionText.length\n }\"\n >\n {{ relatedPrompt.suggestionText }}\n </span>\n </div>\n <CrossTinyIcon v-if=\"isSelected\" class=\"x-icon-lg\" />\n <PlusIcon v-else class=\"x-icon-lg\" />\n </slot>\n </div>\n</template>\n<script lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import { RelatedPrompt } from '@empathyco/x-types';\n import { relatedPromptsXModule } from '../x-module';\n import CrossTinyIcon from '../../../components/icons/cross-tiny.vue';\n import PlusIcon from '../../../components/icons/plus.vue';\n import { use$x } from '../../../composables/index';\n\n /**\n * This component shows a suggested related prompt.\n *\n * It provides a slot to customize the related prompt button information.\n *\n * @public\n */\n export default defineComponent({\n name: 'RelatedPrompt',\n components: {\n CrossTinyIcon,\n PlusIcon\n },\n xModule: relatedPromptsXModule.name,\n props: {\n relatedPrompt: {\n type: Object as PropType<RelatedPrompt>,\n required: true\n },\n isPromptVisible: {\n type: Boolean,\n default: false\n },\n isSelected: {\n type: Boolean,\n default: false\n },\n index: {\n type: Number,\n required: true\n }\n },\n setup() {\n const x = use$x();\n\n const toggleSuggestion = (index: number): void => {\n x.emit('UserSelectedARelatedPrompt', index);\n };\n\n return {\n toggleSuggestion\n };\n }\n });\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAoCE;;;;;;AAME;AACF,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,eAAe;AACrB,IAAA,UAAU,EAAE;QACV,aAAa;QACb,QAAO;AACR,KAAA;IACD,OAAO,EAAE,qBAAqB,CAAC,IAAI;AACnC,IAAA,KAAK,EAAE;AACL,QAAA,aAAa,EAAE;AACb,YAAA,IAAI,EAAE,MAAiC;AACvC,YAAA,QAAQ,EAAE,IAAG;AACd,SAAA;AACD,QAAA,eAAe,EAAE;AACf,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,KAAI;AACd,SAAA;AACD,QAAA,UAAU,EAAE;AACV,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,KAAI;AACd,SAAA;AACD,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,QAAQ,EAAE,IAAG;AACf,SAAA;AACD,KAAA;IACD,KAAK,GAAA;AACH,QAAA,MAAM,CAAE,GAAE,KAAK,EAAE,CAAA;AAEjB,QAAA,MAAM,gBAAe,GAAI,CAAC,KAAa,KAAW;AAChD,YAAA,CAAC,CAAC,IAAI,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAA;AAC7C,SAAC,CAAA;QAED,OAAO;YACL,gBAAe;SAChB,CAAA;KACH;AACD,CAAA,CAAC;;;;"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import _sfc_main from './related-prompts-tag-list.vue2.js';
|
|
2
|
+
import { resolveComponent, openBlock, createElementBlock, renderSlot, createCommentVNode, createVNode, withCtx, createElementVNode, normalizeClass, Fragment, renderList, normalizeStyle, mergeProps } from 'vue';
|
|
3
|
+
import './related-prompts-tag-list.vue3.js';
|
|
4
|
+
import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.js';
|
|
5
|
+
|
|
6
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
7
|
+
const _component_RelatedPrompt = resolveComponent("RelatedPrompt");
|
|
8
|
+
const _component_SlidingPanel = resolveComponent("SlidingPanel");
|
|
9
|
+
return openBlock(), createElementBlock("div", null, [
|
|
10
|
+
_ctx.$slots.header ? renderSlot(_ctx.$slots, "header", { key: 0 }) : createCommentVNode("v-if", true),
|
|
11
|
+
createVNode(_component_SlidingPanel, {
|
|
12
|
+
"reset-on-content-change": true,
|
|
13
|
+
"button-class": _ctx.buttonClass,
|
|
14
|
+
"scroll-container-class": _ctx.selectedPrompt === -1 ? "desktop:x-sliding-panel-fade desktop:x-sliding-panel-fade-sm" : ""
|
|
15
|
+
}, {
|
|
16
|
+
"sliding-panel-left-button": withCtx(() => [
|
|
17
|
+
renderSlot(_ctx.$slots, "sliding-panel-left-button")
|
|
18
|
+
]),
|
|
19
|
+
"sliding-panel-right-button": withCtx(() => [
|
|
20
|
+
renderSlot(_ctx.$slots, "sliding-panel-right-button")
|
|
21
|
+
]),
|
|
22
|
+
default: withCtx(() => [
|
|
23
|
+
renderSlot(_ctx.$slots, "sliding-panel-content", {}, () => [
|
|
24
|
+
createElementVNode(
|
|
25
|
+
"div",
|
|
26
|
+
{
|
|
27
|
+
ref: "slidingPanelContent",
|
|
28
|
+
class: normalizeClass(["x-related-prompt__sliding-panel-content", { "x-w-[calc(100%)]": _ctx.selectedPrompt !== -1 }])
|
|
29
|
+
},
|
|
30
|
+
[
|
|
31
|
+
(openBlock(true), createElementBlock(
|
|
32
|
+
Fragment,
|
|
33
|
+
null,
|
|
34
|
+
renderList(_ctx.relatedPrompts, (suggestion, index) => {
|
|
35
|
+
return openBlock(), createElementBlock(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
key: index,
|
|
39
|
+
style: normalizeStyle({
|
|
40
|
+
animationDelay: `${index * 0.4 + 0.05}s`
|
|
41
|
+
}),
|
|
42
|
+
class: normalizeClass(["x-related-prompt x-staggered-initial", [
|
|
43
|
+
{ "x-staggered-animation": _ctx.arePromptsVisible },
|
|
44
|
+
{ "x-hidden": _ctx.hidePrompt(index) },
|
|
45
|
+
{ "x-related-prompt-selected": _ctx.isSelected(index) }
|
|
46
|
+
]]),
|
|
47
|
+
"data-test": "related-prompt-item"
|
|
48
|
+
},
|
|
49
|
+
[
|
|
50
|
+
renderSlot(_ctx.$slots, "related-prompt-button", mergeProps({ ref_for: true }, { suggestion, index, arePromptsVisible: _ctx.arePromptsVisible, isSelected: _ctx.isSelected }), () => [
|
|
51
|
+
createVNode(_component_RelatedPrompt, {
|
|
52
|
+
"related-prompt": suggestion,
|
|
53
|
+
index,
|
|
54
|
+
"is-prompt-visible": _ctx.arePromptsVisible,
|
|
55
|
+
"is-selected": _ctx.isSelected(index)
|
|
56
|
+
}, null, 8, ["related-prompt", "index", "is-prompt-visible", "is-selected"])
|
|
57
|
+
])
|
|
58
|
+
],
|
|
59
|
+
6
|
|
60
|
+
/* CLASS, STYLE */
|
|
61
|
+
);
|
|
62
|
+
}),
|
|
63
|
+
128
|
|
64
|
+
/* KEYED_FRAGMENT */
|
|
65
|
+
))
|
|
66
|
+
],
|
|
67
|
+
2
|
|
68
|
+
/* CLASS */
|
|
69
|
+
)
|
|
70
|
+
])
|
|
71
|
+
]),
|
|
72
|
+
_: 3
|
|
73
|
+
/* FORWARDED */
|
|
74
|
+
}, 8, ["button-class", "scroll-container-class"])
|
|
75
|
+
]);
|
|
76
|
+
}
|
|
77
|
+
var relatedPromptsTagList = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
78
|
+
|
|
79
|
+
export { relatedPromptsTagList as default };
|
|
80
|
+
//# sourceMappingURL=related-prompts-tag-list.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"related-prompts-tag-list.vue.js","sources":["../../../../../src/x-modules/related-prompts/components/related-prompts-tag-list.vue"],"sourcesContent":["<template>\n <div>\n <template v-if=\"$slots.header\">\n <slot name=\"header\" />\n </template>\n <SlidingPanel\n :reset-on-content-change=\"true\"\n :button-class=\"buttonClass\"\n :scroll-container-class=\"\n selectedPrompt === -1 ? 'desktop:x-sliding-panel-fade desktop:x-sliding-panel-fade-sm' : ''\n \"\n >\n <template #sliding-panel-left-button>\n <slot name=\"sliding-panel-left-button\" />\n </template>\n\n <slot name=\"sliding-panel-content\">\n <div\n ref=\"slidingPanelContent\"\n class=\"x-related-prompt__sliding-panel-content\"\n :class=\"{ 'x-w-[calc(100%)]': selectedPrompt !== -1 }\"\n >\n <div\n v-for=\"(suggestion, index) in relatedPrompts\"\n :key=\"index\"\n :style=\"{\n animationDelay: `${index * 0.4 + 0.05}s`\n }\"\n class=\"x-related-prompt x-staggered-initial\"\n :class=\"[\n { 'x-staggered-animation': arePromptsVisible },\n { 'x-hidden': hidePrompt(index) },\n { 'x-related-prompt-selected': isSelected(index) }\n ]\"\n data-test=\"related-prompt-item\"\n >\n <slot\n name=\"related-prompt-button\"\n v-bind=\"{ suggestion, index, arePromptsVisible, isSelected }\"\n >\n <RelatedPrompt\n :related-prompt=\"suggestion\"\n :index=\"index\"\n :is-prompt-visible=\"arePromptsVisible\"\n :is-selected=\"isSelected(index)\"\n />\n </slot>\n </div>\n </div>\n </slot>\n\n <template #sliding-panel-right-button>\n <slot name=\"sliding-panel-right-button\" />\n </template>\n </SlidingPanel>\n </div>\n</template>\n<script lang=\"ts\">\n import { defineComponent, onMounted, onUnmounted, ref } from 'vue';\n import SlidingPanel from '../../../components/sliding-panel.vue';\n import { relatedPromptsXModule } from '../x-module';\n import { useState } from '../../../composables/index';\n import RelatedPrompt from './related-prompt.vue';\n\n export default defineComponent({\n name: 'RelatedPromptsTagList',\n xModule: relatedPromptsXModule.name,\n components: { RelatedPrompt, SlidingPanel },\n props: {\n buttonClass: String\n },\n setup() {\n const { relatedPrompts, selectedPrompt } = useState('relatedPrompts', [\n 'relatedPrompts',\n 'selectedPrompt'\n ]);\n\n const slidingPanelContent = ref<Element>();\n const arePromptsVisible = ref(false);\n\n const observer = new IntersectionObserver(([entry]) => {\n arePromptsVisible.value = entry.isIntersecting;\n });\n\n onMounted(() => {\n observer.observe(slidingPanelContent.value as Element);\n });\n\n onUnmounted(() => {\n observer.disconnect();\n });\n\n const isSelected = (index: number): boolean => selectedPrompt.value === index;\n\n const hidePrompt = (index: number): boolean =>\n selectedPrompt.value !== -1 && selectedPrompt.value !== index;\n\n return {\n arePromptsVisible,\n hidePrompt,\n isSelected,\n relatedPrompts,\n selectedPrompt,\n slidingPanelContent\n };\n }\n });\n</script>\n\n<style lang=\"css\">\n .x-related-prompt__sliding-panel-content {\n display: flex;\n gap: 8px;\n }\n\n .x-related-prompt {\n display: flex;\n flex-direction: column;\n border-radius: 12px;\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 500ms;\n min-height: 112px;\n height: 100%;\n width: 303px;\n }\n\n .x-related-prompt-selected {\n width: 100% !important;\n min-height: 0;\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n\n &__button {\n width: 100% !important;\n }\n }\n\n .x-related-prompt__button {\n display: flex;\n flex-direction: row;\n gap: 12px;\n justify-content: space-between;\n align-items: start;\n text-align: start;\n padding: 16px;\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 500ms;\n flex-grow: 1;\n width: 303px;\n }\n\n .x-related-prompt__button-info {\n display: flex;\n min-height: 32px;\n }\n\n @media (max-width: 743px) {\n .x-related-prompt {\n width: 204px;\n &__button {\n width: 204px;\n }\n }\n }\n\n .x-no-scrollbar::-webkit-scrollbar {\n display: none;\n }\n\n .x-no-scrollbar {\n -ms-overflow-style: none; /* IE and Edge */\n scrollbar-width: none; /* Firefox */\n }\n\n .x-typewritter-initial {\n color: #0000;\n background: linear-gradient(-90deg, transparent 5px, #0000 0) 10px 0,\n linear-gradient(#575757 0 0) 0 0;\n background-size: 0 200%;\n -webkit-background-clip: padding-box, text;\n background-clip: padding-box, text;\n background-repeat: no-repeat;\n }\n\n .x-typewritter-animation {\n animation: typewritter calc(var(--suggestion-text-length) * 0.05s)\n steps(var(--suggestion-text-length)) forwards;\n }\n\n @keyframes typewritter {\n from {\n background-size: 0 200%;\n }\n to {\n background-size: calc(var(--suggestion-text-length) * 1ch) 200%;\n }\n }\n\n .x-staggered-initial {\n opacity: 0;\n transform: translateY(20px);\n }\n\n .x-staggered-animation {\n animation: fadeInUp 0.6s forwards;\n }\n\n @keyframes fadeInUp {\n from {\n opacity: 0;\n transform: translateY(20px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n</style>\n"],"names":["_resolveComponent","_openBlock","_createElementBlock","_renderSlot","_createCommentVNode","_createVNode","selectedPrompt","_withCtx","_createElementVNode","relatedPrompts","_Fragment","_renderList","hidePrompt","isSelected","_mergeProps"],"mappings":";;;;;;;kCACEA,gBAsDM,CAAA,cAAA,CAAA,CAAA;AApDF,EAAA,OAAAC,SAAA,EAHN,EAAAC,kBAAA,CAAA,KAAA,EAAA,IAAA,EAAA;AAAA,IAKI,IAAA,CAAA,MAAA,CAAA,MAAA,GAAAC,UAAA,CAiDe,IAhDZ,CAAA,MAAA,EAAA,QAAA,EAAA,EAAA,GAAA,EAAA,CAAA,EAAA,CAAA,GAAAC,kBAAA,CAAA,MAAA,EAAyB,IAAI,CAAA;AAAA,IAAAC,WAAA,CAC7B,uBAAyB,EAAA;AAAA,MACzB,yBAAsB,EAAA,IAAA;AAAA,MAAA,cAAA,EAAWC,IAAc,CAAA,WAAA;AAAA,MAAA,wBAAA,EAAA,IAAA,CAAA,cAAA,KAAA,CAAA,CAAA,GAAA,8DAAA,GAAA,EAAA;;;QA2CrCH,UACiC,CAAA,IAAA,CAAA,MAAA,EAAA,2BAAA,CAAA;AAAA,OAAA,CAAA;;QApDlDA,UAiDa,CAAA,IAAA,CAAA,MAAA,EAAA,4BAAA,CAAA;AAAA,OAAA,CAAA;eAhCLI,OA+BM,CAAA,MAAA;AAAA,QAAAJ,UAAA,CA9BA,IAAqB,CAAA,MAAA,EAAA,uBAAA,EAAA,EAAA,EAAA,MAAA;AAAA,UAAAK,kBAAA;AAlBnC,YAAA,KAAA;AAAA,YAmBgB;AAAA,cAAA,GAAA,EAAA,qBAAA;oCAGN,CAtBV,yCAAA,EAAA,EAuB0CC,kBAvB1C,EAAA,IAAA,CAuBoB,cAAiB,KAAA,CAAA,CAAA,EAAA,CAAA,CAAA;AAAA,aAAA;;yBACnB,IAAK,CAAA,EAAAP,kBAAA;AAAA,gBAAAQ,QAAA;AAAA,gBAAA,IAAA;AAAA,gBAAAC,UAAA,CAAA,IAAA,CAAA,cAAA,EAAA,CAAA,UAAA,EAAA,KAAA,KAAA;yBACLV,SAzBlB,EAAA,EAAAC,kBAAA;AAAA,oBAAA,KAAA;AAAA,oBAAA;AAAA,sBAAA,GAAA,EAAA,KAAA;;wCAAA,CA4BkB,EAAA,KAAA,GAAA,GAAA,GAAA,IAAA,CAAA,CAAA,CAAA;AAAA,uBAAA,CAAA;4CAC8FU,CAAgB,sCAAA,EAAA;AAAA,wBAAA,EAAA,uBAAA,EAAA,IAAA,CAAkDC,iBAAW,EAAA;AAAA,wBAAA,EAAA,UAAA,EAAA,IAAA,CAAA,UAAA,CAAA,KAAA,CAAA,EAAA;AAKjL,wBAAA,EAAA,2BAAA,EAAU,IAAqB,CAAA,UAAA,CAAA,KAAA,CAAA,EAAA;AAAA,uBAAA,CAAA,CAAA;sBAE/B,WAUO,EAAA,qBAAA;AAAA,qBAAA;;AALF,sBAAAV,UAAA,CAAA,IAAA,CAAA,MAAA,EAAgB,uBAAU,EAAAW,UAAA,CAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,CAAA,iBAAA,EAAA,UAAA,EAAA,IAAA,CAAA,UAAA,EAAA,CAAA,EAAA,MAAA;AAAA,wBAAAT,WAAA,CACnB,wBAAK,EAAA;AAAA,0BACZ,gBAAA,EAAA,UAAA;AAAA,0BACA,KAAA;AAAA,0BAAA,mBAAA,EAAA,IAAA,CAAA,iBAAA;;;;;;;;;;;;;;;;AA5CjB,SAAA,CAAA;AAAA,OAAA,CAAA;;;;;;;;;;"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { defineComponent, ref, onMounted, onUnmounted } from 'vue';
|
|
2
|
+
import SlidingPanel from '../../../components/sliding-panel.vue.js';
|
|
3
|
+
import { relatedPromptsXModule } from '../x-module.js';
|
|
4
|
+
import '../../../composables/create-use-device.js';
|
|
5
|
+
import '@vue/devtools-api';
|
|
6
|
+
import '../../../plugins/devtools/timeline.devtools.js';
|
|
7
|
+
import '@empathyco/x-utils';
|
|
8
|
+
import 'rxjs/operators';
|
|
9
|
+
import 'rxjs';
|
|
10
|
+
import '../../../plugins/devtools/colors.utils.js';
|
|
11
|
+
import '../../../plugins/x-bus.js';
|
|
12
|
+
import '../../../plugins/x-plugin.js';
|
|
13
|
+
import 'vuex';
|
|
14
|
+
import '@vueuse/core';
|
|
15
|
+
import { useState } from '../../../composables/use-state.js';
|
|
16
|
+
import RelatedPrompt from './related-prompt.vue.js';
|
|
17
|
+
|
|
18
|
+
var _sfc_main = defineComponent({
|
|
19
|
+
name: 'RelatedPromptsTagList',
|
|
20
|
+
xModule: relatedPromptsXModule.name,
|
|
21
|
+
components: { RelatedPrompt, SlidingPanel },
|
|
22
|
+
props: {
|
|
23
|
+
buttonClass: String
|
|
24
|
+
},
|
|
25
|
+
setup() {
|
|
26
|
+
const { relatedPrompts, selectedPrompt } = useState('relatedPrompts', [
|
|
27
|
+
'relatedPrompts',
|
|
28
|
+
'selectedPrompt'
|
|
29
|
+
]);
|
|
30
|
+
const slidingPanelContent = ref();
|
|
31
|
+
const arePromptsVisible = ref(false);
|
|
32
|
+
const observer = new IntersectionObserver(([entry]) => {
|
|
33
|
+
arePromptsVisible.value = entry.isIntersecting;
|
|
34
|
+
});
|
|
35
|
+
onMounted(() => {
|
|
36
|
+
observer.observe(slidingPanelContent.value);
|
|
37
|
+
});
|
|
38
|
+
onUnmounted(() => {
|
|
39
|
+
observer.disconnect();
|
|
40
|
+
});
|
|
41
|
+
const isSelected = (index) => selectedPrompt.value === index;
|
|
42
|
+
const hidePrompt = (index) => selectedPrompt.value !== -1 && selectedPrompt.value !== index;
|
|
43
|
+
return {
|
|
44
|
+
arePromptsVisible,
|
|
45
|
+
hidePrompt,
|
|
46
|
+
isSelected,
|
|
47
|
+
relatedPrompts,
|
|
48
|
+
selectedPrompt,
|
|
49
|
+
slidingPanelContent
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
export { _sfc_main as default };
|
|
55
|
+
//# sourceMappingURL=related-prompts-tag-list.vue2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"related-prompts-tag-list.vue2.js","sources":["../../../../../src/x-modules/related-prompts/components/related-prompts-tag-list.vue"],"sourcesContent":["<template>\n <div>\n <template v-if=\"$slots.header\">\n <slot name=\"header\" />\n </template>\n <SlidingPanel\n :reset-on-content-change=\"true\"\n :button-class=\"buttonClass\"\n :scroll-container-class=\"\n selectedPrompt === -1 ? 'desktop:x-sliding-panel-fade desktop:x-sliding-panel-fade-sm' : ''\n \"\n >\n <template #sliding-panel-left-button>\n <slot name=\"sliding-panel-left-button\" />\n </template>\n\n <slot name=\"sliding-panel-content\">\n <div\n ref=\"slidingPanelContent\"\n class=\"x-related-prompt__sliding-panel-content\"\n :class=\"{ 'x-w-[calc(100%)]': selectedPrompt !== -1 }\"\n >\n <div\n v-for=\"(suggestion, index) in relatedPrompts\"\n :key=\"index\"\n :style=\"{\n animationDelay: `${index * 0.4 + 0.05}s`\n }\"\n class=\"x-related-prompt x-staggered-initial\"\n :class=\"[\n { 'x-staggered-animation': arePromptsVisible },\n { 'x-hidden': hidePrompt(index) },\n { 'x-related-prompt-selected': isSelected(index) }\n ]\"\n data-test=\"related-prompt-item\"\n >\n <slot\n name=\"related-prompt-button\"\n v-bind=\"{ suggestion, index, arePromptsVisible, isSelected }\"\n >\n <RelatedPrompt\n :related-prompt=\"suggestion\"\n :index=\"index\"\n :is-prompt-visible=\"arePromptsVisible\"\n :is-selected=\"isSelected(index)\"\n />\n </slot>\n </div>\n </div>\n </slot>\n\n <template #sliding-panel-right-button>\n <slot name=\"sliding-panel-right-button\" />\n </template>\n </SlidingPanel>\n </div>\n</template>\n<script lang=\"ts\">\n import { defineComponent, onMounted, onUnmounted, ref } from 'vue';\n import SlidingPanel from '../../../components/sliding-panel.vue';\n import { relatedPromptsXModule } from '../x-module';\n import { useState } from '../../../composables/index';\n import RelatedPrompt from './related-prompt.vue';\n\n export default defineComponent({\n name: 'RelatedPromptsTagList',\n xModule: relatedPromptsXModule.name,\n components: { RelatedPrompt, SlidingPanel },\n props: {\n buttonClass: String\n },\n setup() {\n const { relatedPrompts, selectedPrompt } = useState('relatedPrompts', [\n 'relatedPrompts',\n 'selectedPrompt'\n ]);\n\n const slidingPanelContent = ref<Element>();\n const arePromptsVisible = ref(false);\n\n const observer = new IntersectionObserver(([entry]) => {\n arePromptsVisible.value = entry.isIntersecting;\n });\n\n onMounted(() => {\n observer.observe(slidingPanelContent.value as Element);\n });\n\n onUnmounted(() => {\n observer.disconnect();\n });\n\n const isSelected = (index: number): boolean => selectedPrompt.value === index;\n\n const hidePrompt = (index: number): boolean =>\n selectedPrompt.value !== -1 && selectedPrompt.value !== index;\n\n return {\n arePromptsVisible,\n hidePrompt,\n isSelected,\n relatedPrompts,\n selectedPrompt,\n slidingPanelContent\n };\n }\n });\n</script>\n\n<style lang=\"css\">\n .x-related-prompt__sliding-panel-content {\n display: flex;\n gap: 8px;\n }\n\n .x-related-prompt {\n display: flex;\n flex-direction: column;\n border-radius: 12px;\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 500ms;\n min-height: 112px;\n height: 100%;\n width: 303px;\n }\n\n .x-related-prompt-selected {\n width: 100% !important;\n min-height: 0;\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n\n &__button {\n width: 100% !important;\n }\n }\n\n .x-related-prompt__button {\n display: flex;\n flex-direction: row;\n gap: 12px;\n justify-content: space-between;\n align-items: start;\n text-align: start;\n padding: 16px;\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 500ms;\n flex-grow: 1;\n width: 303px;\n }\n\n .x-related-prompt__button-info {\n display: flex;\n min-height: 32px;\n }\n\n @media (max-width: 743px) {\n .x-related-prompt {\n width: 204px;\n &__button {\n width: 204px;\n }\n }\n }\n\n .x-no-scrollbar::-webkit-scrollbar {\n display: none;\n }\n\n .x-no-scrollbar {\n -ms-overflow-style: none; /* IE and Edge */\n scrollbar-width: none; /* Firefox */\n }\n\n .x-typewritter-initial {\n color: #0000;\n background: linear-gradient(-90deg, transparent 5px, #0000 0) 10px 0,\n linear-gradient(#575757 0 0) 0 0;\n background-size: 0 200%;\n -webkit-background-clip: padding-box, text;\n background-clip: padding-box, text;\n background-repeat: no-repeat;\n }\n\n .x-typewritter-animation {\n animation: typewritter calc(var(--suggestion-text-length) * 0.05s)\n steps(var(--suggestion-text-length)) forwards;\n }\n\n @keyframes typewritter {\n from {\n background-size: 0 200%;\n }\n to {\n background-size: calc(var(--suggestion-text-length) * 1ch) 200%;\n }\n }\n\n .x-staggered-initial {\n opacity: 0;\n transform: translateY(20px);\n }\n\n .x-staggered-animation {\n animation: fadeInUp 0.6s forwards;\n }\n\n @keyframes fadeInUp {\n from {\n opacity: 0;\n transform: translateY(20px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n</style>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAgEE,gBAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,uBAAuB;IAC7B,OAAO,EAAE,qBAAqB,CAAC,IAAI;AACnC,IAAA,UAAU,EAAE,EAAE,aAAa,EAAE,cAAc;AAC3C,IAAA,KAAK,EAAE;AACL,QAAA,WAAW,EAAE,MAAK;AACnB,KAAA;IACD,KAAK,GAAA;QACH,MAAM,EAAE,cAAc,EAAE,cAAa,EAAI,GAAE,QAAQ,CAAC,gBAAgB,EAAE;YACpE,gBAAgB;YAChB,gBAAe;AAChB,SAAA,CAAC,CAAA;AAEF,QAAA,MAAM,mBAAkB,GAAI,GAAG,EAAW,CAAA;AAC1C,QAAA,MAAM,iBAAgB,GAAI,GAAG,CAAC,KAAK,CAAC,CAAA;QAEpC,MAAM,QAAS,GAAE,IAAI,oBAAoB,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK;AACrD,YAAA,iBAAiB,CAAC,KAAM,GAAE,KAAK,CAAC,cAAc,CAAA;AAChD,SAAC,CAAC,CAAA;QAEF,SAAS,CAAC,MAAM;AACd,YAAA,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC,KAAgB,CAAC,CAAA;AACxD,SAAC,CAAC,CAAA;QAEF,WAAW,CAAC,MAAM;YAChB,QAAQ,CAAC,UAAU,EAAE,CAAA;AACvB,SAAC,CAAC,CAAA;AAEF,QAAA,MAAM,UAAW,GAAE,CAAC,KAAa,KAAc,cAAc,CAAC,KAAI,KAAM,KAAK,CAAA;AAE7E,QAAA,MAAM,UAAW,GAAE,CAAC,KAAa,KAC/B,cAAc,CAAC,KAAI,KAAM,CAAC,CAAA,IAAK,cAAc,CAAC,KAAM,KAAI,KAAK,CAAA;QAE/D,OAAO;YACL,iBAAiB;YACjB,UAAU;YACV,UAAU;YACV,cAAc;YACd,cAAc;YACd,mBAAkB;SACnB,CAAA;KACH;AACD,CAAA,CAAC;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import injectCss from '../../../../tools/inject-css.js';
|
|
2
|
+
|
|
3
|
+
var css = ".x-related-prompt__sliding-panel-content{display:flex;gap:8px}.x-related-prompt{border-radius:12px;display:flex;flex-direction:column;height:100%;min-height:112px;transition-duration:.5s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);width:303px}.x-related-prompt-selected{border-bottom-left-radius:0;border-bottom-right-radius:0;min-height:0;width:100%!important}.x-related-prompt-selected__button{width:100%!important}[dir=ltr] .x-related-prompt__button{text-align:left}[dir=rtl] .x-related-prompt__button{text-align:right}.x-related-prompt__button{align-items:start;display:flex;flex-direction:row;flex-grow:1;gap:12px;justify-content:space-between;padding:16px;transition-duration:.5s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);width:303px}.x-related-prompt__button-info{display:flex;min-height:32px}@media (max-width:743px){.x-related-prompt,.x-related-prompt__button{width:204px}}.x-no-scrollbar::-webkit-scrollbar{display:none}.x-no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}.x-typewritter-initial{background:linear-gradient(-90deg,transparent 5px,#0000 0) 10px 0,linear-gradient(#575757 0 0) 0 0;background-clip:padding-box,text;background-repeat:no-repeat;background-size:0 200%;color:#0000}.x-typewritter-animation{animation:typewritter calc(var(--suggestion-text-length)*.05s) steps(var(--suggestion-text-length)) forwards}@keyframes typewritter{0%{background-size:0 200%}to{background-size:calc(var(--suggestion-text-length)*1ch) 200%}}.x-staggered-initial{opacity:0;transform:translateY(20px)}.x-staggered-animation{animation:fadeInUp .6s forwards}@keyframes fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}";
|
|
4
|
+
injectCss(css);
|
|
5
|
+
|
|
6
|
+
export { css, css as default };
|
|
7
|
+
//# sourceMappingURL=related-prompts-tag-list.vue3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"related-prompts-tag-list.vue3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -31,7 +31,12 @@ const relatedPromptsXStoreModule = {
|
|
|
31
31
|
state.relatedPrompts = products;
|
|
32
32
|
},
|
|
33
33
|
setSelectedPrompt(state, selectedPrompt) {
|
|
34
|
-
state.selectedPrompt
|
|
34
|
+
if (state.selectedPrompt === selectedPrompt) {
|
|
35
|
+
state.selectedPrompt = -1;
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
state.selectedPrompt = selectedPrompt;
|
|
39
|
+
}
|
|
35
40
|
},
|
|
36
41
|
setSelectedQuery(state, selectedQuery) {
|
|
37
42
|
state.selectedQuery = selectedQuery;
|
|
@@ -40,6 +45,9 @@ const relatedPromptsXStoreModule = {
|
|
|
40
45
|
state.selectedQuery = -1;
|
|
41
46
|
state.selectedPrompt = -1;
|
|
42
47
|
state.relatedPrompts = [];
|
|
48
|
+
},
|
|
49
|
+
resetSelectedPrompt(state) {
|
|
50
|
+
state.selectedPrompt = -1;
|
|
43
51
|
}
|
|
44
52
|
},
|
|
45
53
|
actions: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sources":["../../../../../src/x-modules/related-prompts/store/module.ts"],"sourcesContent":["import { setStatus } from '../../../store/utils/status-store.utils';\nimport { setQuery } from '../../../store/utils/query.utils';\nimport { RelatedPromptsXStoreModule } from './types';\nimport {\n cancelFetchAndSaveRelatedPrompts,\n fetchAndSaveRelatedPrompts\n} from './actions/fetch-and-save-related-prompts.action';\nimport { fetchRelatedPrompts } from './actions/fetch-related-prompts.action';\nimport { request } from './getters/request.getter';\n\n/**\n * {@link XStoreModule} For the related prompt module.\n *\n * @internal\n */\nexport const relatedPromptsXStoreModule: RelatedPromptsXStoreModule = {\n state: () => ({\n query: '',\n relatedPrompts: [],\n selectedPrompt: -1,\n selectedQuery: -1,\n status: 'initial',\n params: {}\n }),\n getters: {\n request\n },\n mutations: {\n setStatus,\n setQuery,\n setParams(state, params) {\n state.params = params;\n },\n setRelatedPromptsProducts(state, products) {\n state.relatedPrompts = products;\n },\n setSelectedPrompt(state, selectedPrompt) {\n state.selectedPrompt = selectedPrompt;\n },\n setSelectedQuery(state, selectedQuery) {\n state.selectedQuery = selectedQuery;\n },\n resetRelatedPromptsState(state) {\n state.selectedQuery = -1;\n state.selectedPrompt = -1;\n state.relatedPrompts = [];\n }\n },\n actions: {\n fetchRelatedPrompts,\n fetchAndSaveRelatedPrompts,\n cancelFetchAndSaveRelatedPrompts\n }\n};\n"],"names":[],"mappings":";;;;;;AAUA;;;;AAIG;AACU,MAAA,0BAA0B,GAA+B;AACpE,IAAA,KAAK,EAAE,OAAO;AACZ,QAAA,KAAK,EAAE,EAAE;AACT,QAAA,cAAc,EAAE,EAAE;QAClB,cAAc,EAAE,CAAC,CAAC;QAClB,aAAa,EAAE,CAAC,CAAC;AACjB,QAAA,MAAM,EAAE,SAAS;AACjB,QAAA,MAAM,EAAE,EAAE;KACX,CAAC;AACF,IAAA,OAAO,EAAE;QACP,OAAO;AACR,KAAA;AACD,IAAA,SAAS,EAAE;QACT,SAAS;QACT,QAAQ;QACR,SAAS,CAAC,KAAK,EAAE,MAAM,EAAA;AACrB,YAAA,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;SACvB;QACD,yBAAyB,CAAC,KAAK,EAAE,QAAQ,EAAA;AACvC,YAAA,KAAK,CAAC,cAAc,GAAG,QAAQ,CAAC;SACjC;QACD,iBAAiB,CAAC,KAAK,EAAE,cAAc,EAAA;AACrC,YAAA,KAAK,CAAC,cAAc,GAAG,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"module.js","sources":["../../../../../src/x-modules/related-prompts/store/module.ts"],"sourcesContent":["import { setStatus } from '../../../store/utils/status-store.utils';\nimport { setQuery } from '../../../store/utils/query.utils';\nimport { RelatedPromptsXStoreModule } from './types';\nimport {\n cancelFetchAndSaveRelatedPrompts,\n fetchAndSaveRelatedPrompts\n} from './actions/fetch-and-save-related-prompts.action';\nimport { fetchRelatedPrompts } from './actions/fetch-related-prompts.action';\nimport { request } from './getters/request.getter';\n\n/**\n * {@link XStoreModule} For the related prompt module.\n *\n * @internal\n */\nexport const relatedPromptsXStoreModule: RelatedPromptsXStoreModule = {\n state: () => ({\n query: '',\n relatedPrompts: [],\n selectedPrompt: -1,\n selectedQuery: -1,\n status: 'initial',\n params: {}\n }),\n getters: {\n request\n },\n mutations: {\n setStatus,\n setQuery,\n setParams(state, params) {\n state.params = params;\n },\n setRelatedPromptsProducts(state, products) {\n state.relatedPrompts = products;\n },\n setSelectedPrompt(state, selectedPrompt) {\n if (state.selectedPrompt === selectedPrompt) {\n state.selectedPrompt = -1;\n } else {\n state.selectedPrompt = selectedPrompt;\n }\n },\n setSelectedQuery(state, selectedQuery) {\n state.selectedQuery = selectedQuery;\n },\n resetRelatedPromptsState(state) {\n state.selectedQuery = -1;\n state.selectedPrompt = -1;\n state.relatedPrompts = [];\n },\n resetSelectedPrompt(state) {\n state.selectedPrompt = -1;\n }\n },\n actions: {\n fetchRelatedPrompts,\n fetchAndSaveRelatedPrompts,\n cancelFetchAndSaveRelatedPrompts\n }\n};\n"],"names":[],"mappings":";;;;;;AAUA;;;;AAIG;AACU,MAAA,0BAA0B,GAA+B;AACpE,IAAA,KAAK,EAAE,OAAO;AACZ,QAAA,KAAK,EAAE,EAAE;AACT,QAAA,cAAc,EAAE,EAAE;QAClB,cAAc,EAAE,CAAC,CAAC;QAClB,aAAa,EAAE,CAAC,CAAC;AACjB,QAAA,MAAM,EAAE,SAAS;AACjB,QAAA,MAAM,EAAE,EAAE;KACX,CAAC;AACF,IAAA,OAAO,EAAE;QACP,OAAO;AACR,KAAA;AACD,IAAA,SAAS,EAAE;QACT,SAAS;QACT,QAAQ;QACR,SAAS,CAAC,KAAK,EAAE,MAAM,EAAA;AACrB,YAAA,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;SACvB;QACD,yBAAyB,CAAC,KAAK,EAAE,QAAQ,EAAA;AACvC,YAAA,KAAK,CAAC,cAAc,GAAG,QAAQ,CAAC;SACjC;QACD,iBAAiB,CAAC,KAAK,EAAE,cAAc,EAAA;AACrC,YAAA,IAAI,KAAK,CAAC,cAAc,KAAK,cAAc,EAAE;AAC3C,gBAAA,KAAK,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC;AAC3B,aAAA;AAAM,iBAAA;AACL,gBAAA,KAAK,CAAC,cAAc,GAAG,cAAc,CAAC;AACvC,aAAA;SACF;QACD,gBAAgB,CAAC,KAAK,EAAE,aAAa,EAAA;AACnC,YAAA,KAAK,CAAC,aAAa,GAAG,aAAa,CAAC;SACrC;AACD,QAAA,wBAAwB,CAAC,KAAK,EAAA;AAC5B,YAAA,KAAK,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;AACzB,YAAA,KAAK,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC;AAC1B,YAAA,KAAK,CAAC,cAAc,GAAG,EAAE,CAAC;SAC3B;AACD,QAAA,mBAAmB,CAAC,KAAK,EAAA;AACvB,YAAA,KAAK,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC;SAC3B;AACF,KAAA;AACD,IAAA,OAAO,EAAE;QACP,mBAAmB;QACnB,0BAA0B;QAC1B,gCAAgC;AACjC,KAAA;;;;;"}
|
|
@@ -45,6 +45,10 @@ const setRelatedPromptsExtraParams = wireCommit('setParams');
|
|
|
45
45
|
* Resets the related prompts state.
|
|
46
46
|
*/
|
|
47
47
|
const resetRelatedPromptsStateWire = wireCommitWithoutPayload('resetRelatedPromptsState');
|
|
48
|
+
/**
|
|
49
|
+
* Resets the selected related prompt number.
|
|
50
|
+
*/
|
|
51
|
+
const resetSelectedPromptWire = wireCommitWithoutPayload('resetSelectedPrompt');
|
|
48
52
|
/**
|
|
49
53
|
* Fetches and saves the related prompts response.
|
|
50
54
|
*/
|
|
@@ -81,6 +85,12 @@ const relatedPromptsWiring = createWiring({
|
|
|
81
85
|
},
|
|
82
86
|
UserSelectedARelatedPromptQuery: {
|
|
83
87
|
setSelectedQueryWire
|
|
88
|
+
},
|
|
89
|
+
UserAcceptedAQueryPreview: {
|
|
90
|
+
resetSelectedPromptWire
|
|
91
|
+
},
|
|
92
|
+
SearchRequestChanged: {
|
|
93
|
+
resetSelectedPromptWire
|
|
84
94
|
}
|
|
85
95
|
});
|
|
86
96
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/related-prompts/wiring.ts"],"sourcesContent":["import {\n namespacedWireCommit,\n namespacedWireCommitWithoutPayload,\n namespacedWireDispatch,\n namespacedWireDispatchWithoutPayload\n} from '../../wiring/namespaced-wires.factory';\nimport {\n NamespacedWireCommit,\n NamespacedWireCommitWithoutPayload\n} from '../../wiring/namespaced-wiring.types';\nimport { createWiring } from '../../wiring/wiring.utils';\n\n/**\n * `relatedPrompts` {@link XModuleName | XModule name}.\n */\nconst moduleName = 'relatedPrompts';\n\n/**\n * WireCommit for {@link RelatedPromptsXModule}.\n */\nconst wireCommit: NamespacedWireCommit<typeof moduleName> = namespacedWireCommit(moduleName);\n\n/**\n * WireCommitWithoutPayload for {@link RelatedPromptsXModule}.\n */\nconst wireCommitWithoutPayload: NamespacedWireCommitWithoutPayload<typeof moduleName> =\n namespacedWireCommitWithoutPayload(moduleName);\n\n/**\n * WireDispatch for {@link RelatedPromptsXModule}.\n */\nconst wireDispatch = namespacedWireDispatch(moduleName);\n\n/**\n * WireDispatchWithoutPayload for {@link RelatedPromptsXModule}.\n */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName);\n\n/**\n * Sets the related prompts state `query`.\n */\nconst setRelatedPromptsQuery = wireCommit('setQuery');\n\n/**\n * Sets the related prompts state `selectedPrompt`.\n */\nconst setSelectedPromptWire = wireCommit('setSelectedPrompt');\n\n/**\n * Sets the related prompts state `selectedQuery`.\n */\nconst setSelectedQueryWire = wireCommit('setSelectedQuery');\n\n/**\n * Sets the related prompts state `query` from url params.\n */\nconst setRelatedPromptsQueryFromUrl = wireCommit(\n 'setQuery',\n ({ eventPayload: { query } }) => query\n);\n\n/**\n * Sets the related prompts state `params`.\n */\nconst setRelatedPromptsExtraParams = wireCommit('setParams');\n\n/**\n * Resets the related prompts state.\n */\nconst resetRelatedPromptsStateWire = wireCommitWithoutPayload('resetRelatedPromptsState');\n\n/**\n * Fetches and saves the related prompts response.\n */\nconst fetchAndSaveRelatedPromptsResponseWire = wireDispatch('fetchAndSaveRelatedPrompts');\n\n/**\n * Cancels the fetch and save related prompts response.\n */\nconst cancelFetchAndSaveSearchResponseWire = wireDispatchWithoutPayload(\n 'cancelFetchAndSaveRelatedPrompts'\n);\n\n/**\n * Wiring configuration for the {@link RelatedPromptsXModule | related prompts module}.\n *\n * @internal\n */\nexport const relatedPromptsWiring = createWiring({\n ParamsLoadedFromUrl: {\n setRelatedPromptsQueryFromUrl\n },\n UserAcceptedAQuery: {\n setRelatedPromptsQuery\n },\n UserClearedQuery: {\n cancelFetchAndSaveSearchResponseWire,\n resetRelatedPromptsStateWire,\n setRelatedPromptsQuery\n },\n RelatedPromptsRequestUpdated: {\n fetchAndSaveRelatedPromptsResponseWire\n },\n ExtraParamsChanged: {\n setRelatedPromptsExtraParams\n },\n UserSelectedARelatedPrompt: {\n setSelectedPromptWire\n },\n UserSelectedARelatedPromptQuery: {\n setSelectedQueryWire\n }\n});\n"],"names":[],"mappings":";;;AAYA;;AAEG;AACH,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAEpC;;AAEG;AACH,MAAM,UAAU,GAA4C,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAE7F;;AAEG;AACH,MAAM,wBAAwB,GAC5B,kCAAkC,CAAC,UAAU,CAAC,CAAC;AAEjD;;AAEG;AACH,MAAM,YAAY,GAAG,sBAAsB,CAAC,UAAU,CAAC,CAAC;AAExD;;AAEG;AACH,MAAM,0BAA0B,GAAG,oCAAoC,CAAC,UAAU,CAAC,CAAC;AAEpF;;AAEG;AACH,MAAM,sBAAsB,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;AAEtD;;AAEG;AACH,MAAM,qBAAqB,GAAG,UAAU,CAAC,mBAAmB,CAAC,CAAC;AAE9D;;AAEG;AACH,MAAM,oBAAoB,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAC;AAE5D;;AAEG;AACH,MAAM,6BAA6B,GAAG,UAAU,CAC9C,UAAU,EACV,CAAC,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,KAAK,CACvC,CAAC;AAEF;;AAEG;AACH,MAAM,4BAA4B,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;AAE7D;;AAEG;AACH,MAAM,4BAA4B,GAAG,wBAAwB,CAAC,0BAA0B,CAAC,CAAC;AAE1F;;AAEG;AACH,MAAM,sCAAsC,GAAG,YAAY,CAAC,4BAA4B,CAAC,CAAC;AAE1F;;AAEG;AACH,MAAM,oCAAoC,GAAG,0BAA0B,CACrE,kCAAkC,CACnC,CAAC;AAEF;;;;AAIG;AACI,MAAM,oBAAoB,GAAG,YAAY,CAAC;AAC/C,IAAA,mBAAmB,EAAE;QACnB,6BAA6B;AAC9B,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,sBAAsB;AACvB,KAAA;AACD,IAAA,gBAAgB,EAAE;QAChB,oCAAoC;QACpC,4BAA4B;QAC5B,sBAAsB;AACvB,KAAA;AACD,IAAA,4BAA4B,EAAE;QAC5B,sCAAsC;AACvC,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,4BAA4B;AAC7B,KAAA;AACD,IAAA,0BAA0B,EAAE;QAC1B,qBAAqB;AACtB,KAAA;AACD,IAAA,+BAA+B,EAAE;QAC/B,oBAAoB;AACrB,KAAA;AACF,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"wiring.js","sources":["../../../../src/x-modules/related-prompts/wiring.ts"],"sourcesContent":["import {\n namespacedWireCommit,\n namespacedWireCommitWithoutPayload,\n namespacedWireDispatch,\n namespacedWireDispatchWithoutPayload\n} from '../../wiring/namespaced-wires.factory';\nimport {\n NamespacedWireCommit,\n NamespacedWireCommitWithoutPayload\n} from '../../wiring/namespaced-wiring.types';\nimport { createWiring } from '../../wiring/wiring.utils';\n\n/**\n * `relatedPrompts` {@link XModuleName | XModule name}.\n */\nconst moduleName = 'relatedPrompts';\n\n/**\n * WireCommit for {@link RelatedPromptsXModule}.\n */\nconst wireCommit: NamespacedWireCommit<typeof moduleName> = namespacedWireCommit(moduleName);\n\n/**\n * WireCommitWithoutPayload for {@link RelatedPromptsXModule}.\n */\nconst wireCommitWithoutPayload: NamespacedWireCommitWithoutPayload<typeof moduleName> =\n namespacedWireCommitWithoutPayload(moduleName);\n\n/**\n * WireDispatch for {@link RelatedPromptsXModule}.\n */\nconst wireDispatch = namespacedWireDispatch(moduleName);\n\n/**\n * WireDispatchWithoutPayload for {@link RelatedPromptsXModule}.\n */\nconst wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload(moduleName);\n\n/**\n * Sets the related prompts state `query`.\n */\nconst setRelatedPromptsQuery = wireCommit('setQuery');\n\n/**\n * Sets the related prompts state `selectedPrompt`.\n */\nconst setSelectedPromptWire = wireCommit('setSelectedPrompt');\n\n/**\n * Sets the related prompts state `selectedQuery`.\n */\nconst setSelectedQueryWire = wireCommit('setSelectedQuery');\n\n/**\n * Sets the related prompts state `query` from url params.\n */\nconst setRelatedPromptsQueryFromUrl = wireCommit(\n 'setQuery',\n ({ eventPayload: { query } }) => query\n);\n\n/**\n * Sets the related prompts state `params`.\n */\nconst setRelatedPromptsExtraParams = wireCommit('setParams');\n\n/**\n * Resets the related prompts state.\n */\nconst resetRelatedPromptsStateWire = wireCommitWithoutPayload('resetRelatedPromptsState');\n\n/**\n * Resets the selected related prompt number.\n */\nconst resetSelectedPromptWire = wireCommitWithoutPayload('resetSelectedPrompt');\n\n/**\n * Fetches and saves the related prompts response.\n */\nconst fetchAndSaveRelatedPromptsResponseWire = wireDispatch('fetchAndSaveRelatedPrompts');\n\n/**\n * Cancels the fetch and save related prompts response.\n */\nconst cancelFetchAndSaveSearchResponseWire = wireDispatchWithoutPayload(\n 'cancelFetchAndSaveRelatedPrompts'\n);\n\n/**\n * Wiring configuration for the {@link RelatedPromptsXModule | related prompts module}.\n *\n * @internal\n */\nexport const relatedPromptsWiring = createWiring({\n ParamsLoadedFromUrl: {\n setRelatedPromptsQueryFromUrl\n },\n UserAcceptedAQuery: {\n setRelatedPromptsQuery\n },\n UserClearedQuery: {\n cancelFetchAndSaveSearchResponseWire,\n resetRelatedPromptsStateWire,\n setRelatedPromptsQuery\n },\n RelatedPromptsRequestUpdated: {\n fetchAndSaveRelatedPromptsResponseWire\n },\n ExtraParamsChanged: {\n setRelatedPromptsExtraParams\n },\n UserSelectedARelatedPrompt: {\n setSelectedPromptWire\n },\n UserSelectedARelatedPromptQuery: {\n setSelectedQueryWire\n },\n UserAcceptedAQueryPreview: {\n resetSelectedPromptWire\n },\n SearchRequestChanged: {\n resetSelectedPromptWire\n }\n});\n"],"names":[],"mappings":";;;AAYA;;AAEG;AACH,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAEpC;;AAEG;AACH,MAAM,UAAU,GAA4C,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAE7F;;AAEG;AACH,MAAM,wBAAwB,GAC5B,kCAAkC,CAAC,UAAU,CAAC,CAAC;AAEjD;;AAEG;AACH,MAAM,YAAY,GAAG,sBAAsB,CAAC,UAAU,CAAC,CAAC;AAExD;;AAEG;AACH,MAAM,0BAA0B,GAAG,oCAAoC,CAAC,UAAU,CAAC,CAAC;AAEpF;;AAEG;AACH,MAAM,sBAAsB,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;AAEtD;;AAEG;AACH,MAAM,qBAAqB,GAAG,UAAU,CAAC,mBAAmB,CAAC,CAAC;AAE9D;;AAEG;AACH,MAAM,oBAAoB,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAC;AAE5D;;AAEG;AACH,MAAM,6BAA6B,GAAG,UAAU,CAC9C,UAAU,EACV,CAAC,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,KAAK,CACvC,CAAC;AAEF;;AAEG;AACH,MAAM,4BAA4B,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;AAE7D;;AAEG;AACH,MAAM,4BAA4B,GAAG,wBAAwB,CAAC,0BAA0B,CAAC,CAAC;AAE1F;;AAEG;AACH,MAAM,uBAAuB,GAAG,wBAAwB,CAAC,qBAAqB,CAAC,CAAC;AAEhF;;AAEG;AACH,MAAM,sCAAsC,GAAG,YAAY,CAAC,4BAA4B,CAAC,CAAC;AAE1F;;AAEG;AACH,MAAM,oCAAoC,GAAG,0BAA0B,CACrE,kCAAkC,CACnC,CAAC;AAEF;;;;AAIG;AACI,MAAM,oBAAoB,GAAG,YAAY,CAAC;AAC/C,IAAA,mBAAmB,EAAE;QACnB,6BAA6B;AAC9B,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,sBAAsB;AACvB,KAAA;AACD,IAAA,gBAAgB,EAAE;QAChB,oCAAoC;QACpC,4BAA4B;QAC5B,sBAAsB;AACvB,KAAA;AACD,IAAA,4BAA4B,EAAE;QAC5B,sCAAsC;AACvC,KAAA;AACD,IAAA,kBAAkB,EAAE;QAClB,4BAA4B;AAC7B,KAAA;AACD,IAAA,0BAA0B,EAAE;QAC1B,qBAAqB;AACtB,KAAA;AACD,IAAA,+BAA+B,EAAE;QAC/B,oBAAoB;AACrB,KAAA;AACD,IAAA,yBAAyB,EAAE;QACzB,uBAAuB;AACxB,KAAA;AACD,IAAA,oBAAoB,EAAE;QACpB,uBAAuB;AACxB,KAAA;AACF,CAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empathyco/x-components",
|
|
3
|
-
"version": "6.0.0-alpha.
|
|
3
|
+
"version": "6.0.0-alpha.28",
|
|
4
4
|
"description": "Empathy X Components",
|
|
5
5
|
"author": "Empathy Systems Corporation S.L.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -138,5 +138,5 @@
|
|
|
138
138
|
"access": "public",
|
|
139
139
|
"directory": "dist"
|
|
140
140
|
},
|
|
141
|
-
"gitHead": "
|
|
141
|
+
"gitHead": "66f60255a67fe290db89301b390ef6b4d65d0baf"
|
|
142
142
|
}
|
package/related-prompts/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as RelatedPrompt } from '../js/x-modules/related-prompts/components/related-prompt.vue.js';
|
|
2
2
|
export { default as RelatedPromptsList } from '../js/x-modules/related-prompts/components/related-prompts-list.vue.js';
|
|
3
|
+
export { default as RelatedPromptsTagList } from '../js/x-modules/related-prompts/components/related-prompts-tag-list.vue.js';
|
|
3
4
|
export { cancelFetchAndSaveRelatedPrompts, fetchAndSaveRelatedPrompts } from '../js/x-modules/related-prompts/store/actions/fetch-and-save-related-prompts.action.js';
|
|
4
5
|
export { fetchRelatedPrompts } from '../js/x-modules/related-prompts/store/actions/fetch-related-prompts.action.js';
|
|
5
6
|
export { request as relatedPromptRequest } from '../js/x-modules/related-prompts/store/getters/request.getter.js';
|