@useinsider/guido 3.2.0-beta.803b92e → 3.2.0-beta.8220f9d
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/README.md +1 -25
- package/dist/@types/config/schemas.js +2 -2
- package/dist/components/Guido.vue.js +5 -5
- package/dist/components/Guido.vue2.js +88 -78
- package/dist/components/organisms/chat/blueprint/BlueprintCard.vue.js +20 -0
- package/dist/components/organisms/chat/blueprint/BlueprintCard.vue2.js +20 -0
- package/dist/components/organisms/chat/blueprint/EmailTemplateBlueprintCard.vue.js +23 -0
- package/dist/components/organisms/chat/blueprint/EmailTemplateBlueprintCard.vue2.js +18 -0
- package/dist/components/organisms/chat/chatbox/ChatboxContainer.vue.js +18 -0
- package/dist/components/organisms/chat/chatbox/ChatboxContainer.vue2.js +16 -0
- package/dist/components/organisms/chat/chatbox/ChatboxPanel.vue.js +20 -0
- package/dist/components/organisms/chat/chatbox/ChatboxPanel.vue2.js +19 -0
- package/dist/components/organisms/chat/conversation/ChatConversation.vue.js +28 -0
- package/dist/components/organisms/chat/conversation/ChatConversation.vue2.js +20 -0
- package/dist/components/organisms/chat/conversation/ChatWelcome.vue.js +18 -0
- package/dist/components/organisms/chat/conversation/ChatWelcome.vue2.js +11 -0
- package/dist/components/organisms/chat/conversation/QuickActionChips.vue.js +22 -0
- package/dist/components/organisms/chat/conversation/QuickActionChips.vue2.js +42 -0
- package/dist/components/organisms/chat/input/ChatInput.vue.js +29 -0
- package/dist/components/organisms/chat/input/ChatInput.vue2.js +39 -0
- package/dist/components/organisms/chat/input/GuidoAgentSelector.vue.js +22 -0
- package/dist/components/organisms/chat/input/GuidoAgentSelector.vue2.js +29 -0
- package/dist/components/organisms/chat/messages/AiMessage.vue.js +26 -0
- package/dist/components/organisms/chat/messages/AiMessage.vue2.js +41 -0
- package/dist/components/organisms/chat/messages/AiMessageActions.vue.js +18 -0
- package/dist/components/organisms/chat/messages/AiMessageActions.vue2.js +27 -0
- package/dist/components/organisms/chat/messages/ChatLoading.vue.js +18 -0
- package/dist/components/organisms/chat/messages/ChatLoading.vue2.js +30 -0
- package/dist/components/organisms/chat/messages/ChatMessages.vue.js +26 -0
- package/dist/components/organisms/chat/messages/ChatMessages.vue2.js +67 -0
- package/dist/components/organisms/chat/messages/UserMessage.vue.js +18 -0
- package/dist/components/organisms/chat/messages/UserMessage.vue2.js +26 -0
- package/dist/components/organisms/header/RightSlot.vue.js +8 -8
- package/dist/components/organisms/header/RightSlot.vue2.js +8 -9
- package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +51 -31
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +1 -1
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +23 -22
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +1 -1
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +37 -39
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +3 -3
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +30 -41
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +15 -14
- package/dist/composables/useChatState.js +130 -0
- package/dist/composables/useChatStreaming.js +191 -0
- package/dist/composables/useConversationEvents.js +37 -0
- package/dist/composables/useEmailTemplateApplier.js +41 -0
- package/dist/composables/useRibbonOffset.js +21 -0
- package/dist/composables/useSave.js +15 -15
- package/dist/config/compiler/unsubscribeCompilerRules.js +40 -37
- package/dist/enums/onboarding.js +7 -2
- package/dist/enums/unsubscribe.js +34 -27
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +258 -235
- package/dist/node_modules/@vueuse/core/index.js +127 -0
- package/dist/node_modules/@vueuse/shared/index.js +68 -27
- package/dist/node_modules/dompurify/dist/purify.es.js +595 -0
- package/dist/node_modules/marked/lib/marked.esm.js +1152 -0
- package/dist/package.json.js +1 -1
- package/dist/services/chatService.js +163 -0
- package/dist/services/templateLibraryApi.js +5 -4
- package/dist/src/@types/chat.d.ts +138 -0
- package/dist/src/@types/config/schemas.d.ts +4 -4
- package/dist/src/components/Guido.vue.d.ts +5 -1
- package/dist/src/components/organisms/chat/blueprint/BlueprintCard.vue.d.ts +38 -0
- package/dist/src/components/organisms/chat/blueprint/EmailTemplateBlueprintCard.vue.d.ts +35 -0
- package/dist/src/components/organisms/chat/chatbox/ChatboxContainer.vue.d.ts +4 -0
- package/dist/src/components/organisms/chat/chatbox/ChatboxPanel.vue.d.ts +4 -0
- package/dist/src/components/organisms/chat/conversation/ChatConversation.vue.d.ts +31 -0
- package/dist/src/components/organisms/chat/conversation/QuickActionChips.vue.d.ts +30 -0
- package/dist/src/components/organisms/chat/input/ChatInput.vue.d.ts +37 -0
- package/dist/src/components/organisms/chat/messages/AiMessage.vue.d.ts +33 -0
- package/dist/src/components/organisms/chat/messages/AiMessageActions.vue.d.ts +18 -0
- package/dist/src/components/organisms/chat/messages/ChatLoading.vue.d.ts +32 -0
- package/dist/src/components/organisms/chat/messages/ChatMessages.vue.d.ts +37 -0
- package/dist/src/components/organisms/chat/messages/UserMessage.vue.d.ts +35 -0
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
- package/dist/src/composables/useChatState.d.ts +26 -0
- package/dist/src/composables/useChatStreaming.d.ts +26 -0
- package/dist/src/composables/useConfig.d.ts +2 -2
- package/dist/src/composables/useConversationEvents.d.ts +19 -0
- package/dist/src/composables/useEmailTemplateApplier.d.ts +21 -0
- package/dist/src/composables/useRibbonOffset.d.ts +4 -0
- package/dist/src/composables/useSave.d.ts +1 -1
- package/dist/src/enums/onboarding.d.ts +6 -0
- package/dist/src/enums/unsubscribe.d.ts +5 -0
- package/dist/src/services/chatService.d.ts +16 -0
- package/dist/src/stores/chat.d.ts +323 -0
- package/dist/src/stores/config.d.ts +18 -18
- package/dist/src/stores/editor.d.ts +23 -0
- package/dist/src/stores/onboarding.d.ts +4 -0
- package/dist/src/utils/generateId.d.ts +1 -0
- package/dist/src/utils/markdown.d.ts +1 -0
- package/dist/stores/chat.js +26 -0
- package/dist/stores/editor.js +1 -0
- package/dist/stores/onboarding.js +4 -0
- package/dist/utils/generateId.js +7 -0
- package/dist/utils/markdown.js +21 -0
- package/dist/utils/pairProductVariables.js +89 -88
- package/package.json +6 -3
- package/dist/components/organisms/AutoSaveController.vue.js +0 -17
- package/dist/components/organisms/AutoSaveController.vue2.js +0 -13
- package/dist/components/organisms/header/AutoSaveToggle.vue.js +0 -22
- package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
- package/dist/composables/useAutoSave.js +0 -68
- package/dist/src/composables/useAutoSave.d.ts +0 -3
- package/dist/src/stores/autosave.d.ts +0 -6
- package/dist/src/utils/timeUtil.d.ts +0 -8
- package/dist/stores/autosave.js +0 -11
- package/dist/utils/timeUtil.js +0 -19
- /package/dist/src/components/organisms/{AutoSaveController.vue.d.ts → chat/conversation/ChatWelcome.vue.d.ts} +0 -0
- /package/dist/src/components/organisms/{header/AutoSaveToggle.vue.d.ts → chat/input/GuidoAgentSelector.vue.d.ts} +0 -0
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { defineComponent as l, computed as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { defineComponent as l, computed as r, watch as m } from "vue";
|
|
2
|
+
import { useRibbonOffset as x } from "../../../composables/useRibbonOffset.js";
|
|
3
|
+
import { useTranslations as f } from "../../../composables/useTranslations.js";
|
|
4
|
+
import { SERVICE_HOVER_SELECTORS as k } from "../../../enums/onboarding.js";
|
|
5
|
+
import { useOnboardingStore as B } from "../../../stores/onboarding.js";
|
|
6
|
+
import { InOnboard as C } from "@useinsider/design-system-vue";
|
|
7
|
+
const y = /* @__PURE__ */ l({
|
|
7
8
|
__name: "GenericOnboarding",
|
|
8
|
-
setup(
|
|
9
|
-
const e =
|
|
9
|
+
setup(T) {
|
|
10
|
+
const e = f(), o = B(), { getTopPosition: i } = x(), s = r(() => `${window.innerWidth / 2 - 146}px`), c = () => {
|
|
10
11
|
const t = document.querySelector("ui-editor");
|
|
11
|
-
t != null && t.shadowRoot &&
|
|
12
|
-
var
|
|
13
|
-
const
|
|
14
|
-
|
|
12
|
+
t != null && t.shadowRoot && k.forEach((n) => {
|
|
13
|
+
var g;
|
|
14
|
+
const d = (g = t.shadowRoot) == null ? void 0 : g.querySelector(n);
|
|
15
|
+
d && d.classList.add("hover");
|
|
15
16
|
});
|
|
16
|
-
},
|
|
17
|
+
}, a = r(() => [
|
|
17
18
|
{
|
|
18
19
|
classes: "guido-onboarding-blocks",
|
|
19
20
|
left: "90px",
|
|
20
|
-
top:
|
|
21
|
+
top: i(90),
|
|
21
22
|
position: "Left Top",
|
|
22
23
|
title: e("email-editor.onboarding-blocks-title"),
|
|
23
24
|
description: e("email-editor.onboarding-blocks-description"),
|
|
@@ -51,8 +52,8 @@ const S = /* @__PURE__ */ l({
|
|
|
51
52
|
},
|
|
52
53
|
{
|
|
53
54
|
classes: "guido-onboarding-preview",
|
|
54
|
-
left:
|
|
55
|
-
top:
|
|
55
|
+
left: s.value,
|
|
56
|
+
top: i(68),
|
|
56
57
|
position: "Top Center",
|
|
57
58
|
title: e("email-editor.onboarding-preview-title"),
|
|
58
59
|
description: e("email-editor.onboarding-preview-description"),
|
|
@@ -66,18 +67,18 @@ const S = /* @__PURE__ */ l({
|
|
|
66
67
|
o.close("genericOnboarding");
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
|
-
]),
|
|
70
|
+
]), p = r(() => o.onboardings.genericOnboarding.config.length > 0 && o.onboardings.genericOnboarding.isActive), u = () => {
|
|
70
71
|
var t, n;
|
|
71
72
|
(n = (t = o.getGenericCurrentCard) == null ? void 0 : t.nextButtonClick) == null || n.call(t);
|
|
72
|
-
},
|
|
73
|
+
}, b = () => {
|
|
73
74
|
var t, n;
|
|
74
75
|
(n = (t = o.getGenericCurrentCard) == null ? void 0 : t.backButtonClick) == null || n.call(t);
|
|
75
76
|
};
|
|
76
|
-
return
|
|
77
|
-
t && o.setConfig("genericOnboarding",
|
|
78
|
-
}, { immediate: !0 }), { __sfc: !0, trans: e, onboardingStore: o, centerLeft:
|
|
77
|
+
return m(() => o.onboardings.genericOnboarding.isActive, (t) => {
|
|
78
|
+
t && o.setConfig("genericOnboarding", a.value);
|
|
79
|
+
}, { immediate: !0 }), { __sfc: !0, trans: e, onboardingStore: o, getTopPosition: i, centerLeft: s, addHoverToServiceElements: c, onboardingCardsConfig: a, isVisible: p, handleNext: u, handleBack: b, InOnboard: C };
|
|
79
80
|
}
|
|
80
81
|
});
|
|
81
82
|
export {
|
|
82
|
-
|
|
83
|
+
y as default
|
|
83
84
|
};
|
|
@@ -1,33 +1,31 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as b, computed as d, watch as m } from "vue";
|
|
2
|
+
import { useRibbonOffset as l } from "../../../composables/useRibbonOffset.js";
|
|
2
3
|
import { useTranslations as x } from "../../../composables/useTranslations.js";
|
|
3
|
-
import {
|
|
4
|
-
import { useOnboardingStore as
|
|
5
|
-
import { InOnboard as
|
|
6
|
-
const E = /* @__PURE__ */
|
|
4
|
+
import { UI_EDITOR_SELECTOR as T, CARD_COMPOSITION_TAB_SELECTOR as O, SETTINGS_TAB_SELECTOR as f } from "../../../enums/onboarding.js";
|
|
5
|
+
import { useOnboardingStore as k } from "../../../stores/onboarding.js";
|
|
6
|
+
import { InOnboard as B } from "@useinsider/design-system-vue";
|
|
7
|
+
const E = /* @__PURE__ */ b({
|
|
7
8
|
__name: "ItemsOnboarding",
|
|
8
|
-
setup(
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
}), n = (t) => `${t + c.value}px`, r = (t) => {
|
|
13
|
-
const i = document.querySelector(O);
|
|
14
|
-
if (!(i != null && i.shadowRoot))
|
|
9
|
+
setup(C) {
|
|
10
|
+
const i = x(), o = k(), { getTopPosition: n } = l(), r = (t) => {
|
|
11
|
+
const e = document.querySelector(T);
|
|
12
|
+
if (!(e != null && e.shadowRoot))
|
|
15
13
|
return;
|
|
16
|
-
const { shadowRoot: s } =
|
|
17
|
-
|
|
18
|
-
},
|
|
14
|
+
const { shadowRoot: s } = e, c = s.querySelector(t);
|
|
15
|
+
c && c.click();
|
|
16
|
+
}, a = d(() => [
|
|
19
17
|
{
|
|
20
18
|
classes: "guido-items-onboarding-card-1",
|
|
21
19
|
right: "426px",
|
|
22
20
|
top: n(90),
|
|
23
21
|
position: "Right Top",
|
|
24
|
-
title:
|
|
25
|
-
description:
|
|
22
|
+
title: i("email-editor.onboarding-items-title"),
|
|
23
|
+
description: i("email-editor.onboarding-items-description"),
|
|
26
24
|
imageSource: "",
|
|
27
25
|
backButtonClick: () => {
|
|
28
26
|
},
|
|
29
27
|
nextButtonType: "text",
|
|
30
|
-
nextButtonText:
|
|
28
|
+
nextButtonText: i("products.next"),
|
|
31
29
|
nextButtonClick: () => {
|
|
32
30
|
o.next("itemsOnboarding");
|
|
33
31
|
}
|
|
@@ -37,16 +35,16 @@ const E = /* @__PURE__ */ l({
|
|
|
37
35
|
right: "426px",
|
|
38
36
|
top: n(218),
|
|
39
37
|
position: "Right Top",
|
|
40
|
-
title:
|
|
41
|
-
description:
|
|
38
|
+
title: i("email-editor.onboarding-items-item-type-title"),
|
|
39
|
+
description: i("email-editor.onboarding-items-item-type-description"),
|
|
42
40
|
imageSource: "",
|
|
43
41
|
backButtonType: "text",
|
|
44
|
-
backButtonText:
|
|
42
|
+
backButtonText: i("ds-steps.back"),
|
|
45
43
|
backButtonClick: () => {
|
|
46
44
|
o.previous("itemsOnboarding");
|
|
47
45
|
},
|
|
48
46
|
nextButtonType: "text",
|
|
49
|
-
nextButtonText:
|
|
47
|
+
nextButtonText: i("products.next"),
|
|
50
48
|
nextButtonClick: () => {
|
|
51
49
|
o.next("itemsOnboarding");
|
|
52
50
|
}
|
|
@@ -56,42 +54,42 @@ const E = /* @__PURE__ */ l({
|
|
|
56
54
|
right: "426px",
|
|
57
55
|
top: n(140),
|
|
58
56
|
position: "Right Top",
|
|
59
|
-
title:
|
|
60
|
-
description:
|
|
57
|
+
title: i("email-editor.onboarding-items-composition-title"),
|
|
58
|
+
description: i("email-editor.onboarding-items-composition-description"),
|
|
61
59
|
imageSource: "",
|
|
62
60
|
backButtonType: "text",
|
|
63
|
-
backButtonText:
|
|
61
|
+
backButtonText: i("ds-steps.back"),
|
|
64
62
|
backButtonClick: () => {
|
|
65
63
|
o.previous("itemsOnboarding");
|
|
66
64
|
},
|
|
67
65
|
nextButtonType: "text",
|
|
68
|
-
nextButtonText:
|
|
66
|
+
nextButtonText: i("action-builder.ok"),
|
|
69
67
|
nextButtonClick: () => {
|
|
70
68
|
o.close("itemsOnboarding");
|
|
71
69
|
}
|
|
72
70
|
}
|
|
73
|
-
]), g =
|
|
74
|
-
var t,
|
|
75
|
-
(
|
|
76
|
-
},
|
|
77
|
-
var t,
|
|
78
|
-
(
|
|
71
|
+
]), g = d(() => o.onboardings.itemsOnboarding.config.length > 0 && o.onboardings.itemsOnboarding.isActive), p = () => {
|
|
72
|
+
var t, e;
|
|
73
|
+
(e = (t = o.getItemsCurrentCard) == null ? void 0 : t.nextButtonClick) == null || e.call(t);
|
|
74
|
+
}, u = () => {
|
|
75
|
+
var t, e;
|
|
76
|
+
(e = (t = o.getItemsCurrentCard) == null ? void 0 : t.backButtonClick) == null || e.call(t);
|
|
79
77
|
};
|
|
80
|
-
return
|
|
78
|
+
return m(
|
|
81
79
|
() => o.isActive("itemsOnboarding"),
|
|
82
80
|
(t) => {
|
|
83
|
-
t && o.setConfig("itemsOnboarding",
|
|
81
|
+
t && o.setConfig("itemsOnboarding", a.value);
|
|
84
82
|
},
|
|
85
83
|
{ immediate: !0 }
|
|
86
|
-
),
|
|
84
|
+
), m(
|
|
87
85
|
() => o.onboardings.itemsOnboarding.cardIndex,
|
|
88
|
-
(t,
|
|
86
|
+
(t, e) => {
|
|
89
87
|
if (!o.isActive("itemsOnboarding"))
|
|
90
88
|
return;
|
|
91
|
-
const s = `${
|
|
92
|
-
s === "1-2" && r(
|
|
89
|
+
const s = `${e}-${t}`;
|
|
90
|
+
s === "1-2" && r(O), s === "2-1" && r(f);
|
|
93
91
|
}
|
|
94
|
-
), { __sfc: !0, trans:
|
|
92
|
+
), { __sfc: !0, trans: i, onboardingStore: o, getTopPosition: n, switchTab: r, onboardingCardsConfig: a, isVisible: g, handleNext: p, handleBack: u, InOnboard: B };
|
|
95
93
|
}
|
|
96
94
|
});
|
|
97
95
|
export {
|
|
@@ -1,74 +1,63 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { defineComponent as l, computed as c, watch as g } from "vue";
|
|
2
|
+
import { useRibbonOffset as b } from "../../../composables/useRibbonOffset.js";
|
|
3
|
+
import { useTranslations as x } from "../../../composables/useTranslations.js";
|
|
4
|
+
import { useOnboardingStore as u } from "../../../stores/onboarding.js";
|
|
5
|
+
import { InOnboard as p } from "@useinsider/design-system-vue";
|
|
6
|
+
const O = /* @__PURE__ */ l({
|
|
6
7
|
__name: "TextBlockOnboarding",
|
|
7
|
-
setup(
|
|
8
|
-
const
|
|
9
|
-
const n = window.innerHeight - 128, r = Math.max(90, n * 0.15), s = Math.max(490, n * 0.71), d = 200, g = 40;
|
|
10
|
-
return {
|
|
11
|
-
settings: {
|
|
12
|
-
top: `${r}px`,
|
|
13
|
-
position: r + d + g > n ? "Right Bottom" : "Right Top"
|
|
14
|
-
},
|
|
15
|
-
dynamic: {
|
|
16
|
-
top: `${s}px`,
|
|
17
|
-
position: s + d + g > n ? "Right Bottom" : "Right Top"
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
}), c = a(() => [
|
|
8
|
+
setup(k) {
|
|
9
|
+
const n = x(), o = u(), { getTopPosition: i } = b(), r = c(() => [
|
|
21
10
|
{
|
|
22
11
|
classes: "guido-text-block-onboarding-settings",
|
|
23
12
|
right: "426px",
|
|
24
|
-
top:
|
|
25
|
-
position:
|
|
26
|
-
title:
|
|
27
|
-
description:
|
|
13
|
+
top: i(90),
|
|
14
|
+
position: "Right Top",
|
|
15
|
+
title: n("email-editor.onboarding-text-block-title"),
|
|
16
|
+
description: n("email-editor.onboarding-text-block-description"),
|
|
28
17
|
imageSource: "",
|
|
29
18
|
backButtonClick: () => {
|
|
30
19
|
},
|
|
31
20
|
nextButtonType: "text",
|
|
32
|
-
nextButtonText:
|
|
21
|
+
nextButtonText: n("products.next"),
|
|
33
22
|
nextButtonClick: () => {
|
|
34
23
|
o.next("textBlockOnboarding");
|
|
35
24
|
}
|
|
36
25
|
},
|
|
37
26
|
{
|
|
38
27
|
classes: "guido-text-block-onboarding-dynamic",
|
|
39
|
-
right: "
|
|
40
|
-
top:
|
|
41
|
-
position:
|
|
42
|
-
title:
|
|
43
|
-
description:
|
|
28
|
+
right: "409px",
|
|
29
|
+
top: i(607),
|
|
30
|
+
position: "Right Top",
|
|
31
|
+
title: n("email-editor.onboarding-dynamic-content-title"),
|
|
32
|
+
description: n("email-editor.onboarding-dynamic-content-description"),
|
|
44
33
|
imageSource: "",
|
|
45
34
|
backButtonType: "text",
|
|
46
|
-
backButtonText:
|
|
35
|
+
backButtonText: n("ds-steps.back"),
|
|
47
36
|
backButtonClick: () => {
|
|
48
37
|
o.previous("textBlockOnboarding");
|
|
49
38
|
},
|
|
50
39
|
nextButtonType: "text",
|
|
51
|
-
nextButtonText:
|
|
40
|
+
nextButtonText: n("action-builder.ok"),
|
|
52
41
|
nextButtonClick: () => {
|
|
53
42
|
o.close("textBlockOnboarding");
|
|
54
43
|
}
|
|
55
44
|
}
|
|
56
|
-
]),
|
|
57
|
-
var t,
|
|
58
|
-
(
|
|
59
|
-
},
|
|
60
|
-
var t,
|
|
61
|
-
(
|
|
45
|
+
]), a = c(() => o.onboardings.textBlockOnboarding.config.length > 0 && o.onboardings.textBlockOnboarding.isActive), s = () => {
|
|
46
|
+
var t, e;
|
|
47
|
+
(e = (t = o.getTextBlockCurrentCard) == null ? void 0 : t.nextButtonClick) == null || e.call(t);
|
|
48
|
+
}, d = () => {
|
|
49
|
+
var t, e;
|
|
50
|
+
(e = (t = o.getTextBlockCurrentCard) == null ? void 0 : t.backButtonClick) == null || e.call(t);
|
|
62
51
|
};
|
|
63
|
-
return
|
|
52
|
+
return g(
|
|
64
53
|
() => o.isActive("textBlockOnboarding"),
|
|
65
54
|
(t) => {
|
|
66
|
-
t && o.setConfig("textBlockOnboarding",
|
|
55
|
+
t && o.setConfig("textBlockOnboarding", r.value);
|
|
67
56
|
},
|
|
68
57
|
{ immediate: !0 }
|
|
69
|
-
), { __sfc: !0, trans:
|
|
58
|
+
), { __sfc: !0, trans: n, onboardingStore: o, getTopPosition: i, onboardingCardsConfig: r, isVisible: a, handleNext: s, handleBack: d, InOnboard: p };
|
|
70
59
|
}
|
|
71
60
|
});
|
|
72
61
|
export {
|
|
73
|
-
|
|
62
|
+
O as default
|
|
74
63
|
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { defineComponent as g, computed as s, watch as b } from "vue";
|
|
2
|
+
import { useRibbonOffset as u } from "../../../composables/useRibbonOffset.js";
|
|
3
|
+
import { useTranslations as l } from "../../../composables/useTranslations.js";
|
|
4
|
+
import { useOnboardingStore as m } from "../../../stores/onboarding.js";
|
|
5
|
+
import { InOnboard as p } from "@useinsider/design-system-vue";
|
|
6
|
+
const k = /* @__PURE__ */ g({
|
|
6
7
|
__name: "VersionHistoryOnboarding",
|
|
7
|
-
setup(
|
|
8
|
-
const t =
|
|
8
|
+
setup(f) {
|
|
9
|
+
const t = l(), n = m(), { getTopPosition: r } = u(), e = s(() => [
|
|
9
10
|
{
|
|
10
11
|
classes: "guido-version-history-onboarding",
|
|
11
12
|
left: "409px",
|
|
12
|
-
top:
|
|
13
|
+
top: r(192),
|
|
13
14
|
position: "Left Top",
|
|
14
15
|
title: t("email-editor.onboarding-version-history-title"),
|
|
15
16
|
description: t("email-editor.onboarding-version-history-description"),
|
|
@@ -20,18 +21,18 @@ const C = /* @__PURE__ */ c({
|
|
|
20
21
|
nextButtonText: t("action-builder.ok"),
|
|
21
22
|
nextButtonClick: () => void n.close("versionHistoryOnboarding")
|
|
22
23
|
}
|
|
23
|
-
]),
|
|
24
|
+
]), a = s(() => n.onboardings.versionHistoryOnboarding.config.length > 0 && n.onboardings.versionHistoryOnboarding.isActive), d = () => {
|
|
24
25
|
var o, i;
|
|
25
26
|
(i = (o = n.getVersionHistoryCurrentCard) == null ? void 0 : o.nextButtonClick) == null || i.call(o);
|
|
26
|
-
},
|
|
27
|
+
}, c = () => {
|
|
27
28
|
var o, i;
|
|
28
29
|
(i = (o = n.getVersionHistoryCurrentCard) == null ? void 0 : o.backButtonClick) == null || i.call(o);
|
|
29
30
|
};
|
|
30
|
-
return
|
|
31
|
-
o && n.setConfig("versionHistoryOnboarding",
|
|
32
|
-
}, { immediate: !0 }), { __sfc: !0, trans: t, onboardingStore: n,
|
|
31
|
+
return b(() => n.onboardings.versionHistoryOnboarding.isActive, (o) => {
|
|
32
|
+
o && n.setConfig("versionHistoryOnboarding", e.value);
|
|
33
|
+
}, { immediate: !0 }), { __sfc: !0, trans: t, onboardingStore: n, getTopPosition: r, onboardingCardsConfig: e, isVisible: a, handleNext: d, handleBack: c, InOnboard: p };
|
|
33
34
|
}
|
|
34
35
|
});
|
|
35
36
|
export {
|
|
36
|
-
|
|
37
|
+
k as default
|
|
37
38
|
};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { useActionsApi as _ } from "./useActionsApi.js";
|
|
2
|
+
import { createStreamHandler as F } from "./useChatStreaming.js";
|
|
3
|
+
import { useEmailTemplateApplier as N, resetEmailTemplateApplier as R } from "./useEmailTemplateApplier.js";
|
|
4
|
+
import { chatService as o } from "../services/chatService.js";
|
|
5
|
+
import { useChatStore as V } from "../stores/chat.js";
|
|
6
|
+
import { useEditorStore as Y } from "../stores/editor.js";
|
|
7
|
+
import { generateId as I } from "../utils/generateId.js";
|
|
8
|
+
import { ref as u, computed as M } from "vue";
|
|
9
|
+
const j = "email_template", a = u([]), r = u(null), l = u(!1), p = u(""), n = u([]);
|
|
10
|
+
let c = null;
|
|
11
|
+
const g = /* @__PURE__ */ new Set(), ee = () => {
|
|
12
|
+
const v = V(), f = Y(), { applyTemplate: T, applyTemplateDebounced: P } = N(), d = () => {
|
|
13
|
+
v.messages = a.value, v.isLoading = l.value, v.activeConversationId = r.value;
|
|
14
|
+
}, x = M(() => a.value.length > 0), L = M(() => a.value[a.value.length - 1] ?? null), U = M(() => n.value[n.value.length - 1] ?? null), A = (e) => {
|
|
15
|
+
const t = n.value.findIndex((C) => C.id === e.id), s = t >= 0 ? n.value[t] : void 0, i = {
|
|
16
|
+
...e,
|
|
17
|
+
lastSavedAt: e.lastSavedAt ?? (s == null ? void 0 : s.lastSavedAt)
|
|
18
|
+
}, S = t >= 0 ? n.value.filter((C) => C.id !== e.id) : n.value;
|
|
19
|
+
if (n.value = [...S, i], e.type !== j)
|
|
20
|
+
return;
|
|
21
|
+
const h = e.data;
|
|
22
|
+
!g.has(e.id) ? (g.add(e.id), T(e.id, h)) : P(e.id, h);
|
|
23
|
+
}, w = (e) => {
|
|
24
|
+
const t = {
|
|
25
|
+
id: I("msg"),
|
|
26
|
+
role: "assistant",
|
|
27
|
+
content: "",
|
|
28
|
+
timestamp: Date.now(),
|
|
29
|
+
isStreaming: !0,
|
|
30
|
+
segments: [],
|
|
31
|
+
agentName: e
|
|
32
|
+
};
|
|
33
|
+
return a.value.push(t), t;
|
|
34
|
+
}, k = async () => {
|
|
35
|
+
var t;
|
|
36
|
+
const { getTemplateData: e } = _();
|
|
37
|
+
try {
|
|
38
|
+
const s = await e();
|
|
39
|
+
return (t = s == null ? void 0 : s.html) != null && t.trim() ? {
|
|
40
|
+
template: {
|
|
41
|
+
html: s.html,
|
|
42
|
+
css: s.css ?? ""
|
|
43
|
+
}
|
|
44
|
+
} : void 0;
|
|
45
|
+
} catch {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
}, E = async (e, t, s, i) => {
|
|
49
|
+
c = F({
|
|
50
|
+
messages: a,
|
|
51
|
+
conversationId: r,
|
|
52
|
+
isLoading: l,
|
|
53
|
+
assistantMsgId: e,
|
|
54
|
+
addOrUpdateBlueprint: A
|
|
55
|
+
});
|
|
56
|
+
const S = await k();
|
|
57
|
+
await o.sendMessageStream(
|
|
58
|
+
o.activeAgent,
|
|
59
|
+
t,
|
|
60
|
+
{
|
|
61
|
+
conversationId: s,
|
|
62
|
+
gate: i,
|
|
63
|
+
clientState: S,
|
|
64
|
+
onEvent: (h) => {
|
|
65
|
+
c == null || c.handleEvent(h), d();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}, B = async (e) => {
|
|
70
|
+
if (!e.trim() || l.value)
|
|
71
|
+
return;
|
|
72
|
+
const t = {
|
|
73
|
+
id: I("msg"),
|
|
74
|
+
role: "user",
|
|
75
|
+
content: e.trim(),
|
|
76
|
+
timestamp: Date.now()
|
|
77
|
+
};
|
|
78
|
+
a.value.push(t);
|
|
79
|
+
const s = w(o.activeAgent);
|
|
80
|
+
l.value = !0, p.value = "", d(), await E(s.id, e.trim(), r.value);
|
|
81
|
+
}, y = () => {
|
|
82
|
+
o.cancelStream();
|
|
83
|
+
}, D = async () => {
|
|
84
|
+
const e = [...a.value].reverse().find((i) => i.role === "user");
|
|
85
|
+
if (!e)
|
|
86
|
+
return;
|
|
87
|
+
const t = a.value.findIndex((i) => i.id === e.id);
|
|
88
|
+
t < a.value.length - 1 && a.value.splice(t + 1);
|
|
89
|
+
const s = w(o.activeAgent);
|
|
90
|
+
l.value = !0, d(), await E(s.id, e.content, r.value);
|
|
91
|
+
}, O = () => {
|
|
92
|
+
y(), o.newConversation(), a.value = [], r.value = null, l.value = !1, p.value = "", n.value = [], g.clear(), d();
|
|
93
|
+
}, m = (e) => {
|
|
94
|
+
v.viewMode = e;
|
|
95
|
+
};
|
|
96
|
+
return {
|
|
97
|
+
// state
|
|
98
|
+
messages: a,
|
|
99
|
+
conversationId: r,
|
|
100
|
+
isLoading: l,
|
|
101
|
+
draft: p,
|
|
102
|
+
blueprints: n,
|
|
103
|
+
// getters
|
|
104
|
+
hasMessages: x,
|
|
105
|
+
lastMessage: L,
|
|
106
|
+
activeBlueprint: U,
|
|
107
|
+
// actions
|
|
108
|
+
addOrUpdateBlueprint: A,
|
|
109
|
+
sendMessage: B,
|
|
110
|
+
cancelStream: y,
|
|
111
|
+
retryLastUserMessage: D,
|
|
112
|
+
clearConversation: O,
|
|
113
|
+
setViewMode: m,
|
|
114
|
+
openChat: () => {
|
|
115
|
+
f.isChatPanelOpen = !0, m("shrink");
|
|
116
|
+
},
|
|
117
|
+
shrinkChat: () => {
|
|
118
|
+
f.isChatPanelOpen = !0, m("shrink");
|
|
119
|
+
},
|
|
120
|
+
closeChat: () => {
|
|
121
|
+
f.isChatPanelOpen = !1, m("closed");
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
}, te = () => {
|
|
125
|
+
o.cancelStream(), o.newConversation(), o.clearSelectedAgent(), a.value = [], r.value = null, l.value = !1, p.value = "", n.value = [], g.clear(), c = null, R();
|
|
126
|
+
};
|
|
127
|
+
export {
|
|
128
|
+
te as resetChatModuleState,
|
|
129
|
+
ee as useChatState
|
|
130
|
+
};
|