@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
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import n from "./ChatInput.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import i from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var r = function() {
|
|
5
|
+
var s = this, a = s._self._c, e = s._self._setupProxy;
|
|
6
|
+
return a("div", { staticClass: "chat-input" }, [a("div", { staticClass: "chat-input__container", class: { "chat-input__container--focused": e.isFocused } }, [a("div", { staticClass: "chat-input__text-area" }, [a("textarea", { directives: [{ name: "model", rawName: "v-model", value: e.message, expression: "message" }], ref: "textareaRef", staticClass: "chat-input__textarea", attrs: { rows: "1", disabled: s.disabled, placeholder: e.trans("newsletter.ai-input-placeholder") }, domProps: { value: e.message }, on: { blur: function(t) {
|
|
7
|
+
e.isFocused = !1;
|
|
8
|
+
}, focus: function(t) {
|
|
9
|
+
e.isFocused = !0;
|
|
10
|
+
}, input: [function(t) {
|
|
11
|
+
t.target.composing || (e.message = t.target.value);
|
|
12
|
+
}, e.handleInput], keydown: [function(t) {
|
|
13
|
+
return !t.type.indexOf("key") && s._k(t.keyCode, "enter", 13, t.key, "Enter") || t.ctrlKey || t.shiftKey || t.altKey || t.metaKey ? null : (t.preventDefault(), e.handleSend.apply(null, arguments));
|
|
14
|
+
}, function(t) {
|
|
15
|
+
if (!t.type.indexOf("key") && s._k(t.keyCode, "enter", 13, t.key, "Enter") || !t.shiftKey) return null;
|
|
16
|
+
t.stopPropagation();
|
|
17
|
+
}] } })]), a("div", { staticClass: "chat-input__toolbar" }, [a("div", { staticClass: "chat-input__toolbar-left" }, [a(e.GuidoAgentSelector)], 1), a("div", { staticClass: "chat-input__actions" }, [a("button", { staticClass: "chat-input__send-btn", attrs: { type: "button", disabled: !e.canSend && !s.isLoading }, on: { click: e.handleButtonClick } }, [s.isLoading ? a(e.InIcons, { attrs: { name: "line-stop", size: "24" } }) : a(e.InIcons, { attrs: { name: "line-send", size: "24" } })], 1)])])])]);
|
|
18
|
+
}, o = [], l = /* @__PURE__ */ i(
|
|
19
|
+
n,
|
|
20
|
+
r,
|
|
21
|
+
o,
|
|
22
|
+
!1,
|
|
23
|
+
null,
|
|
24
|
+
"dd031314"
|
|
25
|
+
);
|
|
26
|
+
const _ = l.exports;
|
|
27
|
+
export {
|
|
28
|
+
_ as default
|
|
29
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { defineComponent as g, ref as l, computed as v, nextTick as x } from "vue";
|
|
2
|
+
import { useTranslations as _ } from "../../../../composables/useTranslations.js";
|
|
3
|
+
import y from "./GuidoAgentSelector.vue.js";
|
|
4
|
+
import { InIcons as I } from "@useinsider/design-system-vue";
|
|
5
|
+
const S = /* @__PURE__ */ g({
|
|
6
|
+
__name: "ChatInput",
|
|
7
|
+
props: {
|
|
8
|
+
isLoading: { type: Boolean, default: !1 },
|
|
9
|
+
disabled: { type: Boolean, default: !1 }
|
|
10
|
+
},
|
|
11
|
+
emits: ["send", "stop"],
|
|
12
|
+
setup(c, { expose: d, emit: s }) {
|
|
13
|
+
const t = c, f = _(), n = l(null), o = l(""), p = l(!1), i = v(
|
|
14
|
+
() => o.value.trim().length > 0 && !t.isLoading && !t.disabled
|
|
15
|
+
), a = () => {
|
|
16
|
+
const e = n.value;
|
|
17
|
+
if (!e)
|
|
18
|
+
return;
|
|
19
|
+
e.style.height = "auto";
|
|
20
|
+
const u = 120;
|
|
21
|
+
e.style.height = `${Math.min(e.scrollHeight, u)}px`, e.style.overflowY = e.scrollHeight > u ? "auto" : "hidden";
|
|
22
|
+
}, m = () => {
|
|
23
|
+
a();
|
|
24
|
+
}, r = () => {
|
|
25
|
+
i.value && (s("send", o.value.trim()), o.value = "", x(() => a()));
|
|
26
|
+
}, h = () => {
|
|
27
|
+
t.isLoading ? s("stop") : r();
|
|
28
|
+
};
|
|
29
|
+
return d({
|
|
30
|
+
focus: () => {
|
|
31
|
+
var e;
|
|
32
|
+
return (e = n.value) == null ? void 0 : e.focus();
|
|
33
|
+
}
|
|
34
|
+
}), { __sfc: !0, props: t, emit: s, trans: f, textareaRef: n, message: o, isFocused: p, canSend: i, autoResize: a, handleInput: m, handleSend: r, handleButtonClick: h, GuidoAgentSelector: y, InIcons: I };
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
export {
|
|
38
|
+
S as default
|
|
39
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import s from "./GuidoAgentSelector.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var l = function() {
|
|
5
|
+
var e = this, o = e._self._c, t = e._self._setupProxy;
|
|
6
|
+
return t.visibleAllowed.length > 1 ? o("div", { staticClass: "guido-agent-selector", attrs: { role: "tablist" } }, e._l(t.visibleAllowed, function(n) {
|
|
7
|
+
return o("button", { key: n.name, staticClass: "guido-agent-selector__option", class: { "guido-agent-selector__option--active": n.name === t.selectedAgent }, attrs: { role: "tab", type: "button", "aria-selected": n.name === t.selectedAgent }, on: { click: function(_) {
|
|
8
|
+
return t.handleSelect(n.name);
|
|
9
|
+
} } }, [e._v(" " + e._s(t.trans(n.labelKey)) + " ")]);
|
|
10
|
+
}), 0) : e._e();
|
|
11
|
+
}, a = [], i = /* @__PURE__ */ r(
|
|
12
|
+
s,
|
|
13
|
+
l,
|
|
14
|
+
a,
|
|
15
|
+
!1,
|
|
16
|
+
null,
|
|
17
|
+
"1179a597"
|
|
18
|
+
);
|
|
19
|
+
const f = i.exports;
|
|
20
|
+
export {
|
|
21
|
+
f as default
|
|
22
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineComponent as d, ref as m, computed as f, onMounted as g } from "vue";
|
|
2
|
+
import { useTranslations as p } from "../../../../composables/useTranslations.js";
|
|
3
|
+
import { chatService as n } from "../../../../services/chatService.js";
|
|
4
|
+
const b = /* @__PURE__ */ d({
|
|
5
|
+
__name: "GuidoAgentSelector",
|
|
6
|
+
setup(v) {
|
|
7
|
+
const i = ["email-template-agent", "liquid-agent"], r = p(), s = m([]), a = m(n.activeAgent), c = [
|
|
8
|
+
{ name: "email-template-agent", labelKey: "newsletter.ai-agent-template" },
|
|
9
|
+
{ name: "liquid-agent", labelKey: "newsletter.ai-agent-liquid" }
|
|
10
|
+
], o = f(() => c.filter(
|
|
11
|
+
(e) => s.value.some((l) => l.name === e.name)
|
|
12
|
+
)), u = (e) => {
|
|
13
|
+
a.value = e, n.selectedAgent = e, n.newConversation();
|
|
14
|
+
};
|
|
15
|
+
return g(async () => {
|
|
16
|
+
var l;
|
|
17
|
+
const e = await n.fetchVisibleAgents();
|
|
18
|
+
if (s.value = e.filter(
|
|
19
|
+
(t) => i.includes(t.name)
|
|
20
|
+
), !o.value.some((t) => t.name === a.value)) {
|
|
21
|
+
const t = ((l = o.value[0]) == null ? void 0 : l.name) ?? "email-template-agent";
|
|
22
|
+
a.value = t, n.selectedAgent = t;
|
|
23
|
+
}
|
|
24
|
+
}), { __sfc: !0, ALLOWED_AGENTS: i, trans: r, allAgents: s, selectedAgent: a, allowedConfigs: c, visibleAllowed: o, handleSelect: u };
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
export {
|
|
28
|
+
b as default
|
|
29
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import n from "./AiMessage.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import i from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var r = function() {
|
|
5
|
+
var e = this, s = e._self._c, t = e._self._setupProxy;
|
|
6
|
+
return t.isLoading || t.hasContent ? s("div", { staticClass: "ai-message d-f f-d-c a-i-f-s w-1" }, [t.isLoading && !t.hasContent ? s(t.ChatLoading, { attrs: { cycling: !t.statusText, text: t.statusText } }) : e._e(), t.hasContent || !t.isLoading ? [t.hasSegments ? s("div", { staticClass: "ai-message__segments" }, [e._l(e.message.segments, function(a) {
|
|
7
|
+
return [a.type === "text" && a.content ? s("div", { key: a._id, staticClass: "ai-message__text-segment", domProps: { innerHTML: e._s(t.formatMarkdown(a.content)) } }) : a.type === "error" ? s("div", { key: `err-${a._id}`, staticClass: "ai-message__error d-f a-i-c" }, [s(t.InIcons, { attrs: { name: "line-alert-triangle", size: "16" } }), s("span", { staticClass: "ai-message__error-text" }, [e._v(e._s(a.content))])], 1) : a.type === "blueprint" && a.blueprintType === "email_template" ? s(t.EmailTemplateBlueprintCard, { key: `bp-${a._id}`, attrs: { status: t.applyStatus[a.blueprintId ?? ""] ?? "pending", version: a.version }, on: { apply: function(c) {
|
|
8
|
+
return t.onApplyTemplate(a.blueprintId ?? "", a.blueprintData);
|
|
9
|
+
} } }) : a.type === "blueprint" ? s(t.BlueprintCard, { key: `bp-${a._id}`, attrs: { title: a.title, version: a.version } }) : e._e()];
|
|
10
|
+
}), t.isLoading && t.statusText ? s(t.ChatLoading, { attrs: { cycling: !1, text: t.statusText } }) : t.runningToolsCount > 0 ? s(t.ChatLoading, { attrs: { cycling: !1, text: t.runningToolsLabel } }) : e._e()], 2) : e.message.content ? s("div", { staticClass: "ai-message__content", domProps: { innerHTML: e._s(t.formatMarkdown(e.message.content)) } }) : e._e()] : e._e(), !t.isLoading && e.showFeedback ? s(t.AiMessageActions, { staticClass: "mt-2", attrs: { message: e.message }, on: { copy: function(a) {
|
|
11
|
+
return e.$emit("copy");
|
|
12
|
+
}, retry: function(a) {
|
|
13
|
+
return e.$emit("retry");
|
|
14
|
+
} } }) : e._e()], 2) : e._e();
|
|
15
|
+
}, o = [], l = /* @__PURE__ */ i(
|
|
16
|
+
n,
|
|
17
|
+
r,
|
|
18
|
+
o,
|
|
19
|
+
!1,
|
|
20
|
+
null,
|
|
21
|
+
"b287766f"
|
|
22
|
+
);
|
|
23
|
+
const f = l.exports;
|
|
24
|
+
export {
|
|
25
|
+
f as default
|
|
26
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { defineComponent as f, computed as r } from "vue";
|
|
2
|
+
import { useEmailTemplateApplier as g } from "../../../../composables/useEmailTemplateApplier.js";
|
|
3
|
+
import y from "../blueprint/BlueprintCard.vue.js";
|
|
4
|
+
import d from "../blueprint/EmailTemplateBlueprintCard.vue.js";
|
|
5
|
+
import A from "./AiMessageActions.vue.js";
|
|
6
|
+
import T from "./ChatLoading.vue.js";
|
|
7
|
+
import { formatMarkdown as h } from "../../../../utils/markdown.js";
|
|
8
|
+
import { InIcons as C } from "@useinsider/design-system-vue";
|
|
9
|
+
const E = /* @__PURE__ */ f({
|
|
10
|
+
__name: "AiMessage",
|
|
11
|
+
props: {
|
|
12
|
+
message: null,
|
|
13
|
+
showFeedback: { type: Boolean, default: !0 }
|
|
14
|
+
},
|
|
15
|
+
emits: ["copy", "retry"],
|
|
16
|
+
setup(p) {
|
|
17
|
+
const t = p, { applyStatus: i, applyTemplate: a } = g(), m = r(() => t.message.isStreaming === !0), n = r(
|
|
18
|
+
() => Array.isArray(t.message.segments) && t.message.segments.length > 0
|
|
19
|
+
), s = r(() => n.value ? t.message.segments.filter(
|
|
20
|
+
(e) => e.type === "tool" && e.isRunning && !e.error
|
|
21
|
+
).length : 0), l = r(() => {
|
|
22
|
+
if (s.value === 0)
|
|
23
|
+
return "";
|
|
24
|
+
if (s.value === 1) {
|
|
25
|
+
const e = t.message.segments.find(
|
|
26
|
+
(o) => o.type === "tool" && o.isRunning && !o.error
|
|
27
|
+
);
|
|
28
|
+
return (e == null ? void 0 : e.name) ?? (e == null ? void 0 : e.title) ?? "Working...";
|
|
29
|
+
}
|
|
30
|
+
return `Working on ${s.value} tasks`;
|
|
31
|
+
}), u = r(() => n.value ? t.message.segments.some(
|
|
32
|
+
(e) => e.type === "text" && e.content || e.type === "blueprint"
|
|
33
|
+
) : !!t.message.content), c = r(() => t.message.currentStatus ?? "");
|
|
34
|
+
return { __sfc: !0, props: t, applyStatus: i, applyTemplate: a, isLoading: m, hasSegments: n, runningToolsCount: s, runningToolsLabel: l, hasContent: u, statusText: c, onApplyTemplate: (e, o) => {
|
|
35
|
+
o && a(e, o);
|
|
36
|
+
}, BlueprintCard: y, EmailTemplateBlueprintCard: d, AiMessageActions: A, ChatLoading: T, formatMarkdown: h, InIcons: C };
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
export {
|
|
40
|
+
E as default
|
|
41
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import a from "./AiMessageActions.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import n from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var c = function() {
|
|
5
|
+
var e = this, s = e._self._c, t = e._self._setupProxy;
|
|
6
|
+
return s("div", { staticClass: "ai-message-actions d-f a-i-c" }, [s("button", { staticClass: "ai-message-actions__btn d-i-f a-i-c j-c-c bor-n cur-p bor-r-1", attrs: { type: "button", title: t.trans("newsletter.ai-retry") }, on: { click: t.handleRetry } }, [s(t.InIcons, { attrs: { name: "line-reset", size: "20" } })], 1), s("button", { staticClass: "ai-message-actions__btn d-i-f a-i-c j-c-c bor-n cur-p bor-r-1", class: { "ai-message-actions__btn--success": t.copied }, attrs: { type: "button", title: t.copied ? t.trans("newsletter.ai-copied") : t.trans("newsletter.ai-copy") }, on: { click: t.handleCopy } }, [s(t.InIcons, { attrs: { size: "20", name: t.copied ? "line-success-status" : "line-copy" } })], 1)]);
|
|
7
|
+
}, i = [], r = /* @__PURE__ */ n(
|
|
8
|
+
a,
|
|
9
|
+
c,
|
|
10
|
+
i,
|
|
11
|
+
!1,
|
|
12
|
+
null,
|
|
13
|
+
"4b57f736"
|
|
14
|
+
);
|
|
15
|
+
const m = r.exports;
|
|
16
|
+
export {
|
|
17
|
+
m as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineComponent as m } from "vue";
|
|
2
|
+
import { useChatState as y } from "../../../../composables/useChatState.js";
|
|
3
|
+
import { useTranslations as l } from "../../../../composables/useTranslations.js";
|
|
4
|
+
import { InIcons as d } from "@useinsider/design-system-vue";
|
|
5
|
+
import { useClipboard as f } from "../../../../node_modules/@vueuse/core/index.js";
|
|
6
|
+
const v = /* @__PURE__ */ m({
|
|
7
|
+
__name: "AiMessageActions",
|
|
8
|
+
props: {
|
|
9
|
+
message: null
|
|
10
|
+
},
|
|
11
|
+
emits: ["copy", "retry"],
|
|
12
|
+
setup(p, { emit: e }) {
|
|
13
|
+
const t = p, c = l(), { copy: n, copied: i } = f({ copiedDuring: 2e3 }), { retryLastUserMessage: r } = y(), a = () => {
|
|
14
|
+
const { segments: o } = t.message;
|
|
15
|
+
return Array.isArray(o) && o.length > 0 ? o.filter((s) => s.type === "text").map((s) => s.content ?? "").join(`
|
|
16
|
+
`) : t.message.content;
|
|
17
|
+
};
|
|
18
|
+
return { __sfc: !0, props: t, emit: e, trans: c, copy: n, copied: i, retryLastUserMessage: r, getPlainText: a, handleCopy: () => {
|
|
19
|
+
n(a()), e("copy");
|
|
20
|
+
}, handleRetry: () => {
|
|
21
|
+
r(), e("retry");
|
|
22
|
+
}, InIcons: d };
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
export {
|
|
26
|
+
v as default
|
|
27
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import i from "./ChatLoading.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import n from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var c = function() {
|
|
5
|
+
var a = this, s = a._self._c, t = a._self._setupProxy;
|
|
6
|
+
return s("div", { staticClass: "chat-loading d-f a-i-c" }, [s("span", { staticClass: "chat-loading__icon d-i-f a-i-c j-c-c" }, [s(t.InIcons, { staticClass: "i-c-10", attrs: { name: "line-smart-sirius-ai", size: "20" } })], 1), s("span", { staticClass: "chat-loading__text" }, [a._v(a._s(t.displayText))])]);
|
|
7
|
+
}, e = [], r = /* @__PURE__ */ n(
|
|
8
|
+
i,
|
|
9
|
+
c,
|
|
10
|
+
e,
|
|
11
|
+
!1,
|
|
12
|
+
null,
|
|
13
|
+
"4a52f577"
|
|
14
|
+
);
|
|
15
|
+
const d = r.exports;
|
|
16
|
+
export {
|
|
17
|
+
d as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineComponent as i, ref as c, computed as u, onMounted as p, onUnmounted as d } from "vue";
|
|
2
|
+
import { useTranslations as f } from "../../../../composables/useTranslations.js";
|
|
3
|
+
import { InIcons as g } from "@useinsider/design-system-vue";
|
|
4
|
+
const _ = /* @__PURE__ */ i({
|
|
5
|
+
__name: "ChatLoading",
|
|
6
|
+
props: {
|
|
7
|
+
text: { default: "" },
|
|
8
|
+
cycling: { type: Boolean, default: !0 }
|
|
9
|
+
},
|
|
10
|
+
setup(l) {
|
|
11
|
+
const e = l, o = 2500, s = f(), n = c(0);
|
|
12
|
+
let t = null;
|
|
13
|
+
const a = [
|
|
14
|
+
"newsletter.ai-loading-analyzing",
|
|
15
|
+
"newsletter.ai-loading-processing",
|
|
16
|
+
"newsletter.ai-loading-searching",
|
|
17
|
+
"newsletter.ai-loading-synthesizing"
|
|
18
|
+
], r = u(() => e.text ? e.text : s(a[n.value]));
|
|
19
|
+
return p(() => {
|
|
20
|
+
e.cycling && !e.text && (t = setInterval(() => {
|
|
21
|
+
n.value = (n.value + 1) % a.length;
|
|
22
|
+
}, o));
|
|
23
|
+
}), d(() => {
|
|
24
|
+
t && (clearInterval(t), t = null);
|
|
25
|
+
}), { __sfc: !0, PHASE_INTERVAL: o, props: e, trans: s, phaseIndex: n, intervalId: t, phases: a, displayText: r, InIcons: g };
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
export {
|
|
29
|
+
_ as default
|
|
30
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import i from "./ChatMessages.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var a = function() {
|
|
5
|
+
var e = this, n = e._self._c, r = e._self._setupProxy;
|
|
6
|
+
return n("div", { ref: "containerRef", staticClass: "chat-messages f-g-1", staticStyle: { "min-height": "0" } }, [n("div", { staticClass: "chat-messages__list d-f f-d-c p-4" }, [e._l(e.messages, function(t) {
|
|
7
|
+
return [t.role === "user" ? n(r.UserMessage, { key: t.id, attrs: { content: t.content, "show-actions": t.id === r.lastUserMessageId, timestamp: t.timestamp }, on: { copy: function(s) {
|
|
8
|
+
return e.$emit("copy-message", t.id);
|
|
9
|
+
} } }) : n(r.AiMessage, { key: `ai-${t.id}`, attrs: { message: t }, on: { copy: function(s) {
|
|
10
|
+
return e.$emit("copy-message", t.id);
|
|
11
|
+
}, retry: function(s) {
|
|
12
|
+
return e.$emit("retry", t.id);
|
|
13
|
+
} } })];
|
|
14
|
+
})], 2)]);
|
|
15
|
+
}, c = [], f = /* @__PURE__ */ o(
|
|
16
|
+
i,
|
|
17
|
+
a,
|
|
18
|
+
c,
|
|
19
|
+
!1,
|
|
20
|
+
null,
|
|
21
|
+
"42f0f380"
|
|
22
|
+
);
|
|
23
|
+
const u = f.exports;
|
|
24
|
+
export {
|
|
25
|
+
u as default
|
|
26
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { defineComponent as _, ref as m, inject as H, computed as C, watch as f, onMounted as M, nextTick as g, onUnmounted as T } from "vue";
|
|
2
|
+
import x from "./AiMessage.vue.js";
|
|
3
|
+
import U from "./UserMessage.vue.js";
|
|
4
|
+
const R = /* @__PURE__ */ _({
|
|
5
|
+
__name: "ChatMessages",
|
|
6
|
+
props: {
|
|
7
|
+
messages: null,
|
|
8
|
+
autoScroll: { type: Boolean, default: !0 }
|
|
9
|
+
},
|
|
10
|
+
emits: ["copy-message", "retry", "scroll"],
|
|
11
|
+
setup(S, { emit: d }) {
|
|
12
|
+
const t = S, p = 50, h = m(null), i = H("chatScrollContainer", m(null)), n = m(!1), E = C(() => {
|
|
13
|
+
for (let e = t.messages.length - 1; e >= 0; e--)
|
|
14
|
+
if (t.messages[e].role === "user")
|
|
15
|
+
return t.messages[e].id;
|
|
16
|
+
return null;
|
|
17
|
+
}), r = () => i.value ?? h.value, c = (e = !1) => {
|
|
18
|
+
if (n.value && !e)
|
|
19
|
+
return;
|
|
20
|
+
const o = r();
|
|
21
|
+
o && g(() => {
|
|
22
|
+
o.scrollTo({
|
|
23
|
+
top: o.scrollHeight,
|
|
24
|
+
behavior: "smooth"
|
|
25
|
+
}), e && (n.value = !1);
|
|
26
|
+
});
|
|
27
|
+
}, a = () => {
|
|
28
|
+
const e = r();
|
|
29
|
+
if (!e)
|
|
30
|
+
return;
|
|
31
|
+
const { scrollHeight: o, scrollTop: l, clientHeight: L } = e, v = o - l - L < p;
|
|
32
|
+
n.value = !v, d("scroll", { isAtBottom: v, scrollTop: l });
|
|
33
|
+
};
|
|
34
|
+
f(
|
|
35
|
+
() => t.messages.length,
|
|
36
|
+
() => {
|
|
37
|
+
t.autoScroll && c();
|
|
38
|
+
}
|
|
39
|
+
), f(
|
|
40
|
+
() => {
|
|
41
|
+
var o, l;
|
|
42
|
+
const e = t.messages[t.messages.length - 1];
|
|
43
|
+
return e != null && e.isStreaming ? ((o = e.content) == null ? void 0 : o.length) ?? ((l = e.segments) == null ? void 0 : l.length) ?? 0 : -1;
|
|
44
|
+
},
|
|
45
|
+
() => {
|
|
46
|
+
t.autoScroll && c();
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
let s = null;
|
|
50
|
+
const u = () => {
|
|
51
|
+
const e = r();
|
|
52
|
+
e !== s && (s && s.removeEventListener("scroll", a), e && (e.addEventListener("scroll", a), s = e));
|
|
53
|
+
};
|
|
54
|
+
return M(() => {
|
|
55
|
+
g(() => {
|
|
56
|
+
u(), c(!0);
|
|
57
|
+
});
|
|
58
|
+
}), f(i, () => {
|
|
59
|
+
g(() => u());
|
|
60
|
+
}), T(() => {
|
|
61
|
+
s && (s.removeEventListener("scroll", a), s = null);
|
|
62
|
+
}), { __sfc: !0, SCROLL_THRESHOLD: p, props: t, emit: d, containerRef: h, externalContainer: i, userHasScrolledUp: n, lastUserMessageId: E, getScrollElement: r, scrollToBottom: c, handleScroll: a, boundScrollEl: s, bindScrollListener: u, AiMessage: x, UserMessage: U };
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
export {
|
|
66
|
+
R as default
|
|
67
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import a from "./UserMessage.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var i = function() {
|
|
5
|
+
var s = this, e = s._self._c, t = s._self._setupProxy;
|
|
6
|
+
return e("div", { staticClass: "user-message d-f f-d-c a-i-f-e w-1" }, [e("div", { staticClass: "user-message__view-wrapper" }, [e("div", { staticClass: "user-message__bubble-row d-f a-i-f-s j-c-f-e w-1" }, [s.showActions ? e("div", { staticClass: "user-message__actions d-f a-i-c" }, [e("button", { staticClass: "user-message__action-btn d-i-f a-i-c j-c-c bor-n cur-p bor-r-1", class: { "user-message__action-btn--success": t.copied }, attrs: { type: "button", title: t.copied ? t.trans("newsletter.ai-copied") : t.trans("newsletter.ai-copy") }, on: { click: t.handleCopy } }, [e(t.InIcons, { attrs: { size: "20", name: t.copied ? "line-success-status" : "line-copy" } })], 1)]) : s._e(), e("div", { staticClass: "user-message__bubble" }, [e("span", { staticClass: "user-message__text" }, [s._v(s._s(s.content))])])]), e("span", { staticClass: "user-message__timestamp" }, [s._v(" " + s._s(t.trans("newsletter.ai-you")) + " - " + s._s(t.formattedTime) + " ")])])]);
|
|
7
|
+
}, c = [], n = /* @__PURE__ */ r(
|
|
8
|
+
a,
|
|
9
|
+
i,
|
|
10
|
+
c,
|
|
11
|
+
!1,
|
|
12
|
+
null,
|
|
13
|
+
"bc03b908"
|
|
14
|
+
);
|
|
15
|
+
const u = n.exports;
|
|
16
|
+
export {
|
|
17
|
+
u as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineComponent as i, computed as a } from "vue";
|
|
2
|
+
import { useTranslations as p } from "../../../../composables/useTranslations.js";
|
|
3
|
+
import { InIcons as m } from "@useinsider/design-system-vue";
|
|
4
|
+
import { useClipboard as c } from "../../../../node_modules/@vueuse/core/index.js";
|
|
5
|
+
const h = /* @__PURE__ */ i({
|
|
6
|
+
__name: "UserMessage",
|
|
7
|
+
props: {
|
|
8
|
+
content: null,
|
|
9
|
+
timestamp: { default: () => Date.now() },
|
|
10
|
+
showActions: { type: Boolean, default: !0 }
|
|
11
|
+
},
|
|
12
|
+
emits: ["copy"],
|
|
13
|
+
setup(o) {
|
|
14
|
+
const t = o, n = p(), { copy: e, copied: s } = c({ copiedDuring: 2e3 }), r = a(() => new Date(t.timestamp).toLocaleTimeString("en-US", {
|
|
15
|
+
hour: "2-digit",
|
|
16
|
+
minute: "2-digit",
|
|
17
|
+
hour12: !1
|
|
18
|
+
}));
|
|
19
|
+
return { __sfc: !0, props: t, trans: n, copy: e, copied: s, formattedTime: r, handleCopy: () => {
|
|
20
|
+
e(t.content);
|
|
21
|
+
}, InIcons: m };
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
export {
|
|
25
|
+
h as default
|
|
26
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
return e("div", { staticClass: "d-f a-i-c" }, [t.
|
|
6
|
-
}, a = [], n = /* @__PURE__ */
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import i from "./RightSlot.vue2.js";
|
|
2
|
+
import r from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var o = function() {
|
|
4
|
+
var s = this, e = s._self._c, t = s._self._setupProxy;
|
|
5
|
+
return e("div", { staticClass: "d-f a-i-c" }, [t.isLiquidEnabled && !t.editorStore.isVersionHistoryOpen ? e(t.InChips, { staticClass: "mr-3", attrs: { id: "guido__liquid-tag-chip", styles: "stroke", type: "default", value: "liquid-tags", "close-button": !1, "disabled-status": t.editorStore.loadingStatus, interactive: !1, text: t.trans("email-editor.liquid-tags-enabled") } }) : s._e(), t.editorStore.isVersionHistoryOpen ? e(t.RestoreButton) : e(t.EditorActions, { ref: "editorActionsRef" })], 1);
|
|
6
|
+
}, a = [], n = /* @__PURE__ */ r(
|
|
7
|
+
i,
|
|
8
|
+
o,
|
|
9
9
|
a,
|
|
10
10
|
!1,
|
|
11
11
|
null,
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import { defineComponent as a, ref as f, computed as p } from "vue";
|
|
2
2
|
import { useConfig as u } from "../../../composables/useConfig.js";
|
|
3
3
|
import { useTranslations as d } from "../../../composables/useTranslations.js";
|
|
4
|
-
import { useEditorStore as
|
|
5
|
-
import { InChips as
|
|
6
|
-
import _ from "./
|
|
7
|
-
import S from "./
|
|
8
|
-
|
|
9
|
-
const T = /* @__PURE__ */ a({
|
|
4
|
+
import { useEditorStore as c } from "../../../stores/editor.js";
|
|
5
|
+
import { InChips as l } from "@useinsider/design-system-vue";
|
|
6
|
+
import _ from "./EditorActions.vue.js";
|
|
7
|
+
import S from "./version-history/RestoreButton.vue.js";
|
|
8
|
+
const x = /* @__PURE__ */ a({
|
|
10
9
|
__name: "RightSlot",
|
|
11
10
|
setup(h, { expose: r }) {
|
|
12
|
-
const { isFeatureEnabled: o } = u(),
|
|
11
|
+
const { isFeatureEnabled: o } = u(), n = d(), i = c(), t = f(null), s = p(() => o("liquidSyntax"));
|
|
13
12
|
return r({
|
|
14
13
|
handleSave: (m) => {
|
|
15
14
|
var e;
|
|
16
15
|
return (e = t.value) == null ? void 0 : e.handleSave(m);
|
|
17
16
|
}
|
|
18
|
-
}), { __sfc: !0, isFeatureEnabled: o, trans:
|
|
17
|
+
}), { __sfc: !0, isFeatureEnabled: o, trans: n, editorStore: i, editorActionsRef: t, isLiquidEnabled: s, InChips: l, EditorActions: _, RestoreButton: S };
|
|
19
18
|
}
|
|
20
19
|
});
|
|
21
20
|
export {
|
|
22
|
-
|
|
21
|
+
x as default
|
|
23
22
|
};
|
|
@@ -1,37 +1,57 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTranslations as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { defineComponent as u, computed as d, watch as b, nextTick as f } from "vue";
|
|
2
|
+
import { useTranslations as C } from "../../../composables/useTranslations.js";
|
|
3
|
+
import { HEADER_SELECTOR as O, AMP_TOGGLE_BUTTON_SELECTOR as _, AMP_TOGGLE_WRAPPER_SELECTOR as T, POPOVER_LEFT_OFFSET as g, POPOVER_TOP_GAP as E } from "../../../enums/onboarding.js";
|
|
4
|
+
import { useOnboardingStore as x } from "../../../stores/onboarding.js";
|
|
5
|
+
import { InOnboard as P } from "@useinsider/design-system-vue";
|
|
6
|
+
const G = /* @__PURE__ */ u({
|
|
6
7
|
__name: "AMPOnboarding",
|
|
7
|
-
setup(
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
8
|
+
setup(R) {
|
|
9
|
+
const e = C(), o = x(), r = () => {
|
|
10
|
+
const t = document.querySelector(O), n = document.querySelector(_), c = n == null ? void 0 : n.closest(T);
|
|
11
|
+
if (!c || !t)
|
|
12
|
+
return {
|
|
13
|
+
left: `${((t == null ? void 0 : t.offsetWidth) ?? window.innerWidth) / 2 - g}px`,
|
|
14
|
+
top: "68px"
|
|
15
|
+
};
|
|
16
|
+
const s = t.getBoundingClientRect(), i = c.getBoundingClientRect();
|
|
17
|
+
return {
|
|
18
|
+
left: `${i.left - s.left + i.width / 2 - g}px`,
|
|
19
|
+
top: `${i.bottom - s.top + E}px`
|
|
20
|
+
};
|
|
21
|
+
}, a = d(() => {
|
|
22
|
+
const { left: t, top: n } = r();
|
|
23
|
+
return [
|
|
24
|
+
{
|
|
25
|
+
classes: "guido-amp-onboarding",
|
|
26
|
+
left: t,
|
|
27
|
+
top: n,
|
|
28
|
+
position: "Top Center",
|
|
29
|
+
title: e("email-editor.onboarding-amp-title"),
|
|
30
|
+
description: e("email-editor.onboarding-amp-description"),
|
|
31
|
+
imageSource: "",
|
|
32
|
+
backButtonClick: () => {
|
|
33
|
+
},
|
|
34
|
+
nextButtonType: "text",
|
|
35
|
+
nextButtonText: e("action-builder.ok"),
|
|
36
|
+
nextButtonClick: () => void o.close("ampOnboarding")
|
|
37
|
+
}
|
|
38
|
+
];
|
|
39
|
+
}), l = d(() => o.onboardings.ampOnboarding.config.length > 0 && o.onboardings.ampOnboarding.isActive), p = () => {
|
|
40
|
+
var t, n;
|
|
41
|
+
(n = (t = o.getAmpCurrentCard) == null ? void 0 : t.nextButtonClick) == null || n.call(t);
|
|
42
|
+
}, m = () => {
|
|
43
|
+
var t, n;
|
|
44
|
+
(n = (t = o.getAmpCurrentCard) == null ? void 0 : t.backButtonClick) == null || n.call(t);
|
|
29
45
|
};
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
|
|
46
|
+
return b(
|
|
47
|
+
() => o.onboardings.ampOnboarding.isActive,
|
|
48
|
+
async (t) => {
|
|
49
|
+
t && (await f(), o.setConfig("ampOnboarding", a.value));
|
|
50
|
+
},
|
|
51
|
+
{ immediate: !0 }
|
|
52
|
+
), { __sfc: !0, trans: e, onboardingStore: o, getTogglePosition: r, onboardingCardsConfig: a, isVisible: l, handleNext: p, handleBack: m, InOnboard: P };
|
|
33
53
|
}
|
|
34
54
|
});
|
|
35
55
|
export {
|
|
36
|
-
|
|
56
|
+
G as default
|
|
37
57
|
};
|