@useinsider/guido 3.13.0-beta.b66d46a → 3.13.0-beta.ba65053
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/dist/components/organisms/header/AiStatusPill.vue.js +17 -0
- package/dist/components/organisms/header/AiStatusPill.vue2.js +17 -0
- package/dist/components/organisms/header/MiddleSlot.vue.js +1 -1
- package/dist/components/organisms/header/MiddleSlot.vue2.js +8 -7
- package/dist/components/organisms/header/ViewOptions.vue.js +1 -1
- package/dist/components/organisms/header/version-history/ViewOptions.vue.js +1 -1
- package/dist/composables/useAiStatus.js +14 -0
- package/dist/composables/useCortexBlueprintBridge.js +50 -43
- package/dist/guido.css +1 -1
- package/dist/src/components/organisms/header/AiStatusPill.vue.d.ts +2 -0
- package/dist/src/composables/useAiStatus.d.ts +16 -0
- package/dist/src/composables/useCortexBlueprintBridge.d.ts +3 -1
- package/dist/src/stores/ai-status.d.ts +12 -0
- package/dist/stores/ai-status.js +10 -0
- package/package.json +2 -2
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import a from "./AiStatusPill.vue2.js";
|
|
2
|
+
import r from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var n = function() {
|
|
4
|
+
var t = this, e = t._self._c, s = t._self._setupProxy;
|
|
5
|
+
return s.isGenerating ? e(s.InStatusText, { staticClass: "mr-2", attrs: { "data-testid": "guido-ai-status-pill", size: "small", status: "smart", text: s.label } }) : t._e();
|
|
6
|
+
}, l = [], _ = /* @__PURE__ */ r(
|
|
7
|
+
a,
|
|
8
|
+
n,
|
|
9
|
+
l,
|
|
10
|
+
!1,
|
|
11
|
+
null,
|
|
12
|
+
null
|
|
13
|
+
);
|
|
14
|
+
const u = _.exports;
|
|
15
|
+
export {
|
|
16
|
+
u as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineComponent as i, computed as a } from "vue";
|
|
2
|
+
import { useAiStatus as m } from "../../../composables/useAiStatus.js";
|
|
3
|
+
import { useTranslations as u } from "../../../composables/useTranslations.js";
|
|
4
|
+
import { InStatusText as c } from "@useinsider/design-system-vue";
|
|
5
|
+
const L = /* @__PURE__ */ i({
|
|
6
|
+
__name: "AiStatusPill",
|
|
7
|
+
setup(p) {
|
|
8
|
+
const t = "newsletter.ai-generating", e = "AI is generating...", { isGenerating: r } = m(), n = u(), o = a(() => {
|
|
9
|
+
const s = n(t);
|
|
10
|
+
return s === t ? e : s;
|
|
11
|
+
});
|
|
12
|
+
return { __sfc: !0, LABEL_KEY: t, LABEL_FALLBACK: e, isGenerating: r, trans: n, label: o, InStatusText: c };
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export {
|
|
16
|
+
L as default
|
|
17
|
+
};
|
|
@@ -2,7 +2,7 @@ import r from "./MiddleSlot.vue2.js";
|
|
|
2
2
|
import s from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
3
|
var t = function() {
|
|
4
4
|
var o = this, e = o._self._c, i = o._self._setupProxy;
|
|
5
|
-
return e("div", { staticClass: "d-f a-i-c" }, [i.editorStore.isVersionHistoryOpen ? e("div", { staticClass: "d-f" }, [e(i.VersionHistory), e(i.VersionHistoryViewOptions)], 1) : i.editorStore.isPreviewModeOpen ? e("div", { staticClass: "d-f" }, [e(i.EmailSizeIndicator), e(i.AmpToggle)], 1) : o._e(), e(i.EditorToolbar, { directives: [{ name: "show", rawName: "v-show", value: i.editorStore.isEditorToolbarVisible, expression: "editorStore.isEditorToolbarVisible" }] })], 1);
|
|
5
|
+
return e("div", { staticClass: "d-f a-i-c" }, [i.editorStore.isVersionHistoryOpen ? e("div", { staticClass: "d-f" }, [e(i.VersionHistory), e(i.VersionHistoryViewOptions)], 1) : i.editorStore.isPreviewModeOpen ? e("div", { staticClass: "d-f" }, [e(i.EmailSizeIndicator), e(i.AmpToggle)], 1) : o._e(), e(i.EditorToolbar, { directives: [{ name: "show", rawName: "v-show", value: i.editorStore.isEditorToolbarVisible, expression: "editorStore.isEditorToolbarVisible" }] }), e(i.AiStatusPill)], 1);
|
|
6
6
|
}, a = [], n = /* @__PURE__ */ s(
|
|
7
7
|
r,
|
|
8
8
|
t,
|
|
@@ -2,15 +2,16 @@ import { defineComponent as o } from "vue";
|
|
|
2
2
|
import r from "../email-preview/amp/AmpToggle.vue.js";
|
|
3
3
|
import t from "../email-preview/desktop-preview/EmailSizeIndicator.vue.js";
|
|
4
4
|
import { useEditorStore as i } from "../../../stores/editor.js";
|
|
5
|
-
import e from "./
|
|
6
|
-
import m from "./
|
|
7
|
-
import p from "./version-history/
|
|
8
|
-
|
|
5
|
+
import e from "./AiStatusPill.vue.js";
|
|
6
|
+
import m from "./EditorToolbar.vue.js";
|
|
7
|
+
import p from "./version-history/VersionHistory.vue.js";
|
|
8
|
+
import s from "./version-history/ViewOptions.vue.js";
|
|
9
|
+
const V = /* @__PURE__ */ o({
|
|
9
10
|
__name: "MiddleSlot",
|
|
10
|
-
setup(
|
|
11
|
-
return { __sfc: !0, editorStore: i(), AmpToggle: r, EmailSizeIndicator: t,
|
|
11
|
+
setup(f) {
|
|
12
|
+
return { __sfc: !0, editorStore: i(), AmpToggle: r, EmailSizeIndicator: t, AiStatusPill: e, EditorToolbar: m, VersionHistory: p, VersionHistoryViewOptions: s };
|
|
12
13
|
}
|
|
13
14
|
});
|
|
14
15
|
export {
|
|
15
|
-
|
|
16
|
+
V as default
|
|
16
17
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useAiStatusStore as r } from "../stores/ai-status.js";
|
|
2
|
+
import { computed as i } from "vue";
|
|
3
|
+
const s = () => {
|
|
4
|
+
const t = r();
|
|
5
|
+
return {
|
|
6
|
+
isGenerating: i(() => t.isGenerating),
|
|
7
|
+
setGenerating: (e) => {
|
|
8
|
+
t.isGenerating !== e && t.$patch({ isGenerating: e });
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
s as useAiStatus
|
|
14
|
+
};
|
|
@@ -1,70 +1,77 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { useAiStatus as I } from "./useAiStatus.js";
|
|
2
|
+
import { useEmailTemplateApplier as P, resetEmailTemplateApplier as v } from "./useEmailTemplateApplier.js";
|
|
3
|
+
import { useToaster as B } from "./useToaster.js";
|
|
4
|
+
import { useTranslations as D } from "./useTranslations.js";
|
|
5
|
+
import { ToasterTypeOptions as R } from "../enums/toaster.js";
|
|
6
|
+
import { getActivePinia as x } from "pinia";
|
|
7
|
+
import { watch as G, onUnmounted as L } from "vue";
|
|
8
|
+
const M = "email_template", k = "chat", C = "guido:debug:ai", U = () => {
|
|
8
9
|
if (typeof window > "u")
|
|
9
10
|
return !1;
|
|
10
11
|
try {
|
|
11
|
-
return window.localStorage.getItem(
|
|
12
|
+
return window.localStorage.getItem(C) === "1";
|
|
12
13
|
} catch {
|
|
13
14
|
return !1;
|
|
14
15
|
}
|
|
15
|
-
},
|
|
16
|
-
const
|
|
17
|
-
if (!
|
|
16
|
+
}, K = () => {
|
|
17
|
+
const a = x();
|
|
18
|
+
if (!a)
|
|
18
19
|
return;
|
|
19
|
-
const l =
|
|
20
|
-
if (!
|
|
20
|
+
const l = a._s, c = l == null ? void 0 : l.get(k);
|
|
21
|
+
if (!c)
|
|
21
22
|
return;
|
|
22
|
-
const { markPending:
|
|
23
|
-
const
|
|
24
|
-
return
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
if (r.blueprintType !==
|
|
23
|
+
const { markPending: T, applyTemplate: E, applyTemplateDebounced: h } = P(), { showToaster: y } = B(), { setGenerating: p } = I(), A = D(), b = (r, e) => {
|
|
24
|
+
const t = A(r);
|
|
25
|
+
return t === r ? e : t;
|
|
26
|
+
}, n = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Set(), s = U(), m = (r, e) => {
|
|
27
|
+
s && console.debug(`[guido:cortex] msg=${r ?? "?"} type=${(e == null ? void 0 : e.type) ?? "?"}`, e);
|
|
28
|
+
}, w = (r) => {
|
|
29
|
+
if (r.blueprintType !== M)
|
|
29
30
|
return;
|
|
30
|
-
const
|
|
31
|
-
if (!
|
|
31
|
+
const e = r.blueprintId, t = r.blueprintData;
|
|
32
|
+
if (!e || !(t != null && t.html))
|
|
32
33
|
return;
|
|
33
34
|
if (!r.applyRequested) {
|
|
34
|
-
|
|
35
|
+
T(e);
|
|
35
36
|
return;
|
|
36
37
|
}
|
|
37
|
-
const o =
|
|
38
|
-
o === void 0 ? (
|
|
39
|
-
},
|
|
40
|
-
type:
|
|
41
|
-
message:
|
|
42
|
-
}), !0),
|
|
43
|
-
() =>
|
|
38
|
+
const o = n.get(e);
|
|
39
|
+
o === void 0 ? (n.set(e, t.html), E(e, t)) : o !== t.html && (n.set(e, t.html), h(e, t));
|
|
40
|
+
}, S = (r, e) => e.isRunning === !0 && r.isStreaming === !0 && r.isError !== !0 && r.isCancelled !== !0, f = (r) => r === void 0 || u.has(r) ? !1 : (u.add(r), y({
|
|
41
|
+
type: R.Error,
|
|
42
|
+
message: b("newsletter.ai-template-failed", "AI couldn't generate the template. Please try again.")
|
|
43
|
+
}), !0), _ = G(
|
|
44
|
+
() => c.messages,
|
|
44
45
|
(r) => {
|
|
45
|
-
Array.isArray(r)
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
if (!Array.isArray(r))
|
|
47
|
+
return;
|
|
48
|
+
let e = !1;
|
|
49
|
+
r.forEach((t) => {
|
|
50
|
+
const o = t == null ? void 0 : t.id;
|
|
51
|
+
(t == null ? void 0 : t.isError) === !0 && f(o) && s && console.debug(`[guido:cortex] message-level error id=${o}`, t);
|
|
52
|
+
const d = t == null ? void 0 : t.segments;
|
|
53
|
+
Array.isArray(d) && d.forEach((i) => {
|
|
54
|
+
if (i)
|
|
55
|
+
switch (m(o, i), i.type) {
|
|
52
56
|
case "blueprint":
|
|
53
|
-
|
|
57
|
+
w(i);
|
|
58
|
+
break;
|
|
59
|
+
case "tool":
|
|
60
|
+
e = e || S(t, i);
|
|
54
61
|
break;
|
|
55
62
|
case "error":
|
|
56
|
-
|
|
63
|
+
f(o);
|
|
57
64
|
break;
|
|
58
65
|
}
|
|
59
66
|
});
|
|
60
|
-
});
|
|
67
|
+
}), p(e);
|
|
61
68
|
},
|
|
62
69
|
{ deep: !0, immediate: !0 }
|
|
63
70
|
);
|
|
64
|
-
|
|
65
|
-
|
|
71
|
+
L(() => {
|
|
72
|
+
_(), n.clear(), u.clear(), p(!1), v();
|
|
66
73
|
});
|
|
67
74
|
};
|
|
68
75
|
export {
|
|
69
|
-
|
|
76
|
+
K as useCortexBlueprintBridge
|
|
70
77
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-
|
|
1
|
+
.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-6e711fd7]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-5079a1c8]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-5079a1c8]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-5079a1c8]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ComputedRef } from 'vue';
|
|
2
|
+
interface AiStatus {
|
|
3
|
+
/** True while a cortex-fe agent turn is running a tool. */
|
|
4
|
+
isGenerating: ComputedRef<boolean>;
|
|
5
|
+
/** Idempotent writer — the bridge recomputes this on every stream chunk. */
|
|
6
|
+
setGenerating: (isGenerating: boolean) => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Read/write access to the AI status the header pill renders.
|
|
10
|
+
*
|
|
11
|
+
* The setter is deliberately idempotent: the cortex bridge watcher re-derives
|
|
12
|
+
* the status on every streamed chunk, so writing an unchanged value would
|
|
13
|
+
* re-trigger every subscriber several times per second.
|
|
14
|
+
*/
|
|
15
|
+
export declare const useAiStatus: () => AiStatus;
|
|
16
|
+
export {};
|
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
* that also share that pinia — reads the same store at runtime via
|
|
7
7
|
* `getActivePinia()._s.get('chat')`. No build-time dep on cortex-fe.
|
|
8
8
|
*
|
|
9
|
-
* The bridge handles
|
|
9
|
+
* The bridge handles three segment shapes:
|
|
10
10
|
*
|
|
11
|
+
* - `tool` segments drive the header's "AI is generating…" pill while the
|
|
12
|
+
* owning message is still streaming.
|
|
11
13
|
* - `blueprint` segments with `blueprintType === 'email_template'` are
|
|
12
14
|
* applied to the Stripo editor, but ONLY after the user clicks
|
|
13
15
|
* "Apply to editor" in cortex-fe (which sets `applyRequested` on the
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI generation status Guido surfaces in the header while a cortex-fe agent
|
|
3
|
+
* turn is running a tool. Written by `useAiStatus` (via `$patch`) from the
|
|
4
|
+
* inbound cortex bridge; read by the header pill.
|
|
5
|
+
*
|
|
6
|
+
* Store id `guidoAiStatus` is asserted in the local dev smoke checklist
|
|
7
|
+
* (`pinia._s.has('guidoAiStatus')`) — keep it stable.
|
|
8
|
+
*/
|
|
9
|
+
export declare const useAiStatusStore: import("pinia").StoreDefinition<"guidoAiStatus", {
|
|
10
|
+
/** True while a cortex-fe tool segment is running inside a live message. */
|
|
11
|
+
isGenerating: boolean;
|
|
12
|
+
}, {}, {}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.13.0-beta.
|
|
3
|
+
"version": "3.13.0-beta.ba65053",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"license": "ISC",
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@stripoinc/ui-editor-extensions": "3.8.0",
|
|
47
|
-
"@useinsider/design-system-vue": "1.
|
|
47
|
+
"@useinsider/design-system-vue": "1.3.0",
|
|
48
48
|
"@vueuse/core": "11.3.0",
|
|
49
49
|
"lodash-es": "4.17.21",
|
|
50
50
|
"pinia": "2.3.1",
|