@useinsider/guido 3.19.0-beta.4b9be3a → 3.19.0-beta.6f88fb4
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/Guido.vue.js +3 -3
- package/dist/composables/useCortexBlueprintBridge.js +44 -42
- package/dist/composables/useEmailTemplateApplier.js +71 -60
- package/dist/guido.css +1 -1
- package/dist/src/composables/useCortexBlueprintBridge.d.ts +1 -3
- package/dist/src/composables/useEmailTemplateApplier.d.ts +3 -11
- package/dist/src/stores/guido-email-editor.d.ts +4 -16
- package/package.json +1 -1
|
@@ -5,55 +5,57 @@ import { ToasterTypeOptions as Z } from "../enums/toaster.js";
|
|
|
5
5
|
import { useGuidoEmailEditorStore as W } from "../stores/guido-email-editor.js";
|
|
6
6
|
import { getActivePinia as k } from "pinia";
|
|
7
7
|
import { onUnmounted as tt, watch as et } from "vue";
|
|
8
|
-
const rt = "email_template", nt = "chat",
|
|
9
|
-
let
|
|
8
|
+
const rt = "email_template", nt = "chat", ot = "guido:debug:ai", it = 2, lt = 500, ct = (b, p) => `${b}:${p ?? 1}`;
|
|
9
|
+
let S = null;
|
|
10
10
|
const at = () => {
|
|
11
11
|
if (typeof window > "u")
|
|
12
12
|
return !1;
|
|
13
13
|
try {
|
|
14
|
-
return window.localStorage.getItem(
|
|
14
|
+
return window.localStorage.getItem(ot) === "1";
|
|
15
15
|
} catch {
|
|
16
16
|
return !1;
|
|
17
17
|
}
|
|
18
|
-
},
|
|
19
|
-
const
|
|
20
|
-
if (!
|
|
18
|
+
}, bt = () => {
|
|
19
|
+
const b = k();
|
|
20
|
+
if (!b)
|
|
21
21
|
return;
|
|
22
|
-
const
|
|
23
|
-
|
|
22
|
+
const p = W(), M = Symbol("cortexBlueprintBridge");
|
|
23
|
+
S = M, p.$patch((t) => {
|
|
24
24
|
t.bridgeActive = !0;
|
|
25
25
|
});
|
|
26
|
-
const { markPending: F, applyTemplate: H, applyTemplateDebounced: O } = z(), { showToaster: C } = Q(), G = V(),
|
|
26
|
+
const { markPending: F, applyTemplate: H, applyTemplateDebounced: O } = z(), { showToaster: C } = Q(), G = V(), E = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
|
|
27
27
|
let s = null;
|
|
28
|
-
const d = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Set(),
|
|
28
|
+
const d = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Set(), B = at();
|
|
29
29
|
let w = null, m = null, A;
|
|
30
30
|
const K = (t, r) => {
|
|
31
|
-
|
|
32
|
-
}, U = () => new Set((A == null ? void 0 : A.appliedBlueprintKeys) ?? []), Y = (t) => t instanceof Error ? t.message : String(t),
|
|
33
|
-
if (
|
|
31
|
+
B && console.debug(`[guido:cortex] msg=${t ?? "?"} type=${(r == null ? void 0 : r.type) ?? "?"}`, r);
|
|
32
|
+
}, U = () => new Set((A == null ? void 0 : A.appliedBlueprintKeys) ?? []), Y = (t) => t instanceof Error ? t.message : String(t), D = (t, r, n, e) => {
|
|
33
|
+
if (S !== M)
|
|
34
34
|
return;
|
|
35
|
-
const
|
|
36
|
-
e !== void 0 && (a.error = Y(e)),
|
|
37
|
-
|
|
35
|
+
const o = p.applyAcks[t], c = Math.max(Date.now(), ((o == null ? void 0 : o.ackAt) ?? 0) + 1), a = { status: r, requestedAt: n, ackAt: c };
|
|
36
|
+
e !== void 0 && (a.error = Y(e)), p.$patch((l) => {
|
|
37
|
+
l.applyAcks = { ...l.applyAcks, [t]: a };
|
|
38
38
|
});
|
|
39
39
|
}, I = (t) => (d.get(t) ?? 0) > 0, P = (t) => (s == null ? void 0 : s.key) === t, v = async (t, r, n) => {
|
|
40
|
-
var a,
|
|
41
|
-
const e = ((a = r.blueprintData) == null ? void 0 : a.html) ?? "",
|
|
40
|
+
var a, l, h;
|
|
41
|
+
const e = ((a = r.blueprintData) == null ? void 0 : a.html) ?? "", o = ((l = r.blueprintData) == null ? void 0 : l.css) ?? "", c = r.applyRequestedAt ?? 0;
|
|
42
42
|
d.set(t, (d.get(t) ?? 0) + 1);
|
|
43
43
|
try {
|
|
44
|
-
const
|
|
45
|
-
if (
|
|
44
|
+
const i = n === "debounced" ? await O(t, { html: e, css: o }) : await H(t, { html: e, css: o });
|
|
45
|
+
if (i.status === "superseded")
|
|
46
46
|
return;
|
|
47
|
-
if (
|
|
48
|
-
|
|
47
|
+
if (i.status === "applied") {
|
|
48
|
+
E.set(t, e), u.delete(t), D(t, "applied", c);
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
const
|
|
52
|
-
|
|
51
|
+
const y = u.get(t), j = (y == null ? void 0 : y.html) === e ? y.count + 1 : 1;
|
|
52
|
+
u.set(t, { html: e, count: j }), D(t, "failed", c, i.error);
|
|
53
|
+
} catch (i) {
|
|
54
|
+
console.error("[guido:apply] apply threw before it could settle", i), D(t, "failed", c, i);
|
|
53
55
|
} finally {
|
|
54
56
|
d.set(t, (d.get(t) ?? 1) - 1);
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
+
const i = T.get(t);
|
|
58
|
+
i && !I(t) && (T.delete(t), P(t) && (((h = i.blueprintData) == null ? void 0 : h.html) ?? "") !== e && v(t, i, n));
|
|
57
59
|
}
|
|
58
60
|
}, N = (t) => {
|
|
59
61
|
var h;
|
|
@@ -67,21 +69,21 @@ const at = () => {
|
|
|
67
69
|
F(e);
|
|
68
70
|
return;
|
|
69
71
|
}
|
|
70
|
-
const
|
|
71
|
-
if (c === void 0 ||
|
|
72
|
-
const
|
|
73
|
-
if (_.set(e,
|
|
74
|
-
|
|
72
|
+
const o = t.applyRequestedAt ?? 0, c = _.get(e);
|
|
73
|
+
if (c === void 0 || o > c) {
|
|
74
|
+
const i = c === void 0;
|
|
75
|
+
if (_.set(e, o), u.delete(e), (!s || o >= s.requestedAt) && (s = { key: e, requestedAt: o }), i && U().has(e)) {
|
|
76
|
+
E.set(e, n);
|
|
75
77
|
return;
|
|
76
78
|
}
|
|
77
79
|
v(e, t, "immediate");
|
|
78
80
|
return;
|
|
79
81
|
}
|
|
80
|
-
const a =
|
|
82
|
+
const a = E.get(e);
|
|
81
83
|
if (a === n || !P(e))
|
|
82
84
|
return;
|
|
83
|
-
const
|
|
84
|
-
if (!((
|
|
85
|
+
const l = u.get(e);
|
|
86
|
+
if (!((l == null ? void 0 : l.html) === n && l.count >= it)) {
|
|
85
87
|
if (a === void 0) {
|
|
86
88
|
if (I(e)) {
|
|
87
89
|
T.set(e, t);
|
|
@@ -100,13 +102,13 @@ const at = () => {
|
|
|
100
102
|
}), !0), X = (t) => {
|
|
101
103
|
Array.isArray(t) && t.forEach((r) => {
|
|
102
104
|
const n = r == null ? void 0 : r.id;
|
|
103
|
-
(r == null ? void 0 : r.isError) === !0 && R(n) &&
|
|
105
|
+
(r == null ? void 0 : r.isError) === !0 && R(n) && B && console.debug(`[guido:cortex] message-level error id=${n}`, r);
|
|
104
106
|
const e = r == null ? void 0 : r.segments;
|
|
105
|
-
Array.isArray(e) && e.forEach((
|
|
106
|
-
if (
|
|
107
|
-
switch (K(n,
|
|
107
|
+
Array.isArray(e) && e.forEach((o) => {
|
|
108
|
+
if (o)
|
|
109
|
+
switch (K(n, o), o.type) {
|
|
108
110
|
case "blueprint":
|
|
109
|
-
N(
|
|
111
|
+
N(o);
|
|
110
112
|
break;
|
|
111
113
|
case "error":
|
|
112
114
|
R(n);
|
|
@@ -118,7 +120,7 @@ const at = () => {
|
|
|
118
120
|
w !== null && (clearInterval(w), w = null);
|
|
119
121
|
}, q = () => {
|
|
120
122
|
var t;
|
|
121
|
-
return (t =
|
|
123
|
+
return (t = b._s) == null ? void 0 : t.get(nt);
|
|
122
124
|
}, L = (t) => {
|
|
123
125
|
A = t, m = et(() => t.messages, X, { deep: !0, immediate: !0 });
|
|
124
126
|
}, x = q();
|
|
@@ -126,11 +128,11 @@ const at = () => {
|
|
|
126
128
|
const t = q();
|
|
127
129
|
t && ($(), L(t));
|
|
128
130
|
}, lt), tt(() => {
|
|
129
|
-
$(), m == null || m(), A = void 0,
|
|
131
|
+
$(), m == null || m(), A = void 0, E.clear(), f.clear(), _.clear(), u.clear(), s = null, d.clear(), T.clear(), g.clear(), S === M && (S = null, p.$patch((t) => {
|
|
130
132
|
t.bridgeActive = !1, t.applyAcks = {};
|
|
131
133
|
}), J());
|
|
132
134
|
});
|
|
133
135
|
};
|
|
134
136
|
export {
|
|
135
|
-
|
|
137
|
+
bt as useCortexBlueprintBridge
|
|
136
138
|
};
|
|
@@ -1,104 +1,115 @@
|
|
|
1
1
|
import { useActionsApi as x } from "./useActionsApi.js";
|
|
2
2
|
import { useConfig as z } from "./useConfig.js";
|
|
3
|
-
import { useEditorLock as
|
|
4
|
-
import { useToaster as
|
|
5
|
-
import { useTranslations as
|
|
6
|
-
import { ToasterTypeOptions as
|
|
7
|
-
import { useDynamicContentStore as
|
|
8
|
-
import { useEditorStore as
|
|
9
|
-
import { flattenDynamicContentList as
|
|
10
|
-
import { extractUsedDynamicContent as
|
|
11
|
-
import { ref as
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
import { useEditorLock as N } from "./useEditorLock.js";
|
|
4
|
+
import { useToaster as K } from "./useToaster.js";
|
|
5
|
+
import { useTranslations as R } from "./useTranslations.js";
|
|
6
|
+
import { ToasterTypeOptions as U } from "../enums/toaster.js";
|
|
7
|
+
import { useDynamicContentStore as F } from "../stores/dynamic-content.js";
|
|
8
|
+
import { useEditorStore as G } from "../stores/editor.js";
|
|
9
|
+
import { flattenDynamicContentList as $ } from "../utils/genericUtil.js";
|
|
10
|
+
import { extractUsedDynamicContent as j } from "../utils/registerUsedDynamicContent.js";
|
|
11
|
+
import { ref as J, watch as V } from "vue";
|
|
12
|
+
const W = 250, M = 12e4, X = 1e3, p = { status: "superseded" }, A = { status: "failed", error: new Error("Blueprint has no html to apply") }, a = J({}), O = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
|
|
13
|
+
let d = null;
|
|
14
|
+
const E = () => {
|
|
15
|
+
d && (clearInterval(d), d = null);
|
|
16
|
+
}, ue = () => {
|
|
17
|
+
const { updateHtmlAndCss: i } = x(), { runExclusive: P } = N(), { showToaster: T } = K(), w = R(), { template: _ } = z(), b = F(), g = G(), y = (e, t) => {
|
|
18
|
+
m.get(e) !== t && (m.set(e, t), T({
|
|
19
|
+
type: U.Error,
|
|
20
|
+
message: w("newsletter.ai-template-failed-apply")
|
|
17
21
|
}));
|
|
18
|
-
},
|
|
22
|
+
}, C = () => {
|
|
19
23
|
var e, t;
|
|
20
|
-
return
|
|
21
|
-
},
|
|
24
|
+
return g.isStripoInitialized && typeof ((t = (e = window.StripoEditorApi) == null ? void 0 : e.actionsApi) == null ? void 0 : t.updateHtmlAndCss) == "function";
|
|
25
|
+
}, L = (e) => {
|
|
22
26
|
a.value[e] === void 0 && (a.value = { ...a.value, [e]: "pending" });
|
|
23
27
|
}, l = (e, t) => {
|
|
24
28
|
a.value = { ...a.value, [e]: t };
|
|
25
|
-
},
|
|
29
|
+
}, Q = (e) => {
|
|
26
30
|
var t;
|
|
27
31
|
try {
|
|
28
|
-
const r =
|
|
29
|
-
n.length > 0 &&
|
|
32
|
+
const r = $((t = _.value) == null ? void 0 : t.dynamicContentList), n = j(e, r);
|
|
33
|
+
n.length > 0 && b.registerDynamicContent(n);
|
|
30
34
|
} catch {
|
|
31
35
|
}
|
|
32
|
-
},
|
|
33
|
-
m.delete(e),
|
|
34
|
-
type:
|
|
35
|
-
message:
|
|
36
|
+
}, H = (e, t) => {
|
|
37
|
+
m.delete(e), O.get(e) !== t && (O.set(e, t), T({
|
|
38
|
+
type: U.Success,
|
|
39
|
+
message: w("newsletter.ai-template-applied")
|
|
36
40
|
}));
|
|
37
|
-
},
|
|
41
|
+
}, D = async (e, t, r) => {
|
|
38
42
|
const n = (u.get(e) ?? 0) + 1;
|
|
39
43
|
u.set(e, n), l(e, "applying");
|
|
40
44
|
try {
|
|
41
|
-
await
|
|
45
|
+
await P(() => i(t, r));
|
|
42
46
|
} catch (o) {
|
|
43
|
-
return u.get(e) !== n ? p : (console.error("[guido:apply] editor did not acknowledge the template apply", o), l(e, "failed"),
|
|
47
|
+
return u.get(e) !== n ? p : (console.error("[guido:apply] editor did not acknowledge the template apply", o), l(e, "failed"), y(e, t), { status: "failed", error: o });
|
|
44
48
|
}
|
|
45
|
-
return u.get(e) !== n ? p : (l(e, "applied"),
|
|
46
|
-
},
|
|
49
|
+
return u.get(e) !== n ? p : (l(e, "applied"), Q(t), H(e, t), { status: "applied" });
|
|
50
|
+
}, I = (e) => {
|
|
47
51
|
const t = s.get(e);
|
|
48
52
|
t && (clearTimeout(t.timer), s.delete(e), t.settle(p));
|
|
49
|
-
},
|
|
53
|
+
}, S = (e) => {
|
|
50
54
|
const t = c.get(e);
|
|
51
55
|
t && (clearTimeout(t.timer), c.delete(e), t.settle(p));
|
|
52
56
|
}, B = () => {
|
|
53
|
-
[...c.keys()].forEach(
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
});
|
|
61
|
-
}, h);
|
|
62
|
-
s.set(e, { html: t, css: r, timer: o, settle: n }), l(e, "applying");
|
|
63
|
-
}), C = (e, t, r) => O() ? g(e, t, r) : L(e, t, r), Q = async () => {
|
|
64
|
-
if (s.size === 0)
|
|
57
|
+
[...c.keys()].forEach(S);
|
|
58
|
+
}, h = async () => {
|
|
59
|
+
if (s.size === 0) {
|
|
60
|
+
E();
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (!C())
|
|
65
64
|
return;
|
|
65
|
+
E();
|
|
66
66
|
const e = [...s.entries()];
|
|
67
67
|
s.clear(), e.forEach(([, o]) => clearTimeout(o.timer));
|
|
68
68
|
const t = e.pop();
|
|
69
|
-
if (e.forEach(([o,
|
|
70
|
-
l(o, "failed"),
|
|
69
|
+
if (e.forEach(([o, f]) => {
|
|
70
|
+
l(o, "failed"), f.settle({ status: "failed", error: new Error("Displaced by a newer apply") });
|
|
71
71
|
}), !t)
|
|
72
72
|
return;
|
|
73
73
|
const [r, n] = t;
|
|
74
|
-
n.settle(await
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
n.settle(await D(r, n.html, n.css));
|
|
75
|
+
}, q = (e, t, r) => new Promise((n) => {
|
|
76
|
+
I(e);
|
|
77
|
+
const o = setTimeout(() => {
|
|
78
|
+
s.delete(e), l(e, "failed"), y(e, t), n({
|
|
79
|
+
status: "failed",
|
|
80
|
+
error: new Error(`Editor did not become ready within ${M}ms`)
|
|
81
|
+
});
|
|
82
|
+
}, M);
|
|
83
|
+
s.set(e, { html: t, css: r, timer: o, settle: n }), l(e, "applying"), d ?? (d = setInterval(() => {
|
|
84
|
+
h();
|
|
85
|
+
}, X));
|
|
86
|
+
}), v = (e, t, r) => C() ? D(e, t, r) : q(e, t, r);
|
|
87
|
+
return V(() => g.isStripoInitialized, (e) => {
|
|
88
|
+
e && h();
|
|
89
|
+
}, { immediate: !0 }), { applyStatus: a, markPending: L, applyTemplate: (e, t) => {
|
|
79
90
|
const { html: r } = t;
|
|
80
|
-
return r ? (B(),
|
|
91
|
+
return r ? (B(), v(e, r, t.css ?? "")) : Promise.resolve(A);
|
|
81
92
|
}, applyTemplateDebounced: (e, t) => {
|
|
82
93
|
const { html: r } = t;
|
|
83
94
|
if (!r)
|
|
84
|
-
return Promise.resolve(
|
|
95
|
+
return Promise.resolve(A);
|
|
85
96
|
const n = t.css ?? "";
|
|
86
97
|
return new Promise((o) => {
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
c.delete(e),
|
|
90
|
-
},
|
|
91
|
-
c.set(e, { timer:
|
|
98
|
+
S(e);
|
|
99
|
+
const f = setTimeout(() => {
|
|
100
|
+
c.delete(e), v(e, r, n).then(o);
|
|
101
|
+
}, W);
|
|
102
|
+
c.set(e, { timer: f, settle: o });
|
|
92
103
|
});
|
|
93
104
|
} };
|
|
94
|
-
},
|
|
105
|
+
}, me = () => {
|
|
95
106
|
c.forEach((i) => {
|
|
96
107
|
clearTimeout(i.timer), i.settle(p);
|
|
97
108
|
}), c.clear(), s.forEach((i) => {
|
|
98
109
|
clearTimeout(i.timer), i.settle(p);
|
|
99
|
-
}), s.clear(),
|
|
110
|
+
}), s.clear(), E(), m.clear(), a.value = {};
|
|
100
111
|
};
|
|
101
112
|
export {
|
|
102
|
-
|
|
103
|
-
|
|
113
|
+
me as resetEmailTemplateApplier,
|
|
114
|
+
ue as useEmailTemplateApplier
|
|
104
115
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.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-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__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-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__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-1ca6baf0]{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-
|
|
1
|
+
@charset "UTF-8";.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-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__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-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__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-1ca6baf0]{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-bb2a5f2c]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-bb2a5f2c]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-bb2a5f2c]{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}.assign-strategy-drawer-content .assign-strategy-select[data-v-2580a7d9]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-2580a7d9] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}
|
|
@@ -17,9 +17,7 @@
|
|
|
17
17
|
* - `error` segments (and message-level `isError` / `isCancelled`) trigger
|
|
18
18
|
* a localized toaster.
|
|
19
19
|
*
|
|
20
|
-
* Every apply settles into a terminal `applyAcks` entry on the
|
|
21
|
-
* cortex can move its Apply button on the truth of the editor write rather than
|
|
22
|
-
* on the click.
|
|
20
|
+
* Every apply settles into a terminal `applyAcks` entry, so cortex moves its button on the write, not the click.
|
|
23
21
|
*
|
|
24
22
|
* In dev (`import.meta.env.DEV`) every observed segment + message-level flag
|
|
25
23
|
* change is also `console.debug`-logged with the prefix `[guido:cortex]` so a
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
type ApplyStatus = 'pending' | 'applying' | 'applied' | 'failed';
|
|
2
2
|
/**
|
|
3
|
-
* Terminal outcome of an apply
|
|
4
|
-
*
|
|
5
|
-
* never-settling promise would strand cortex's Apply button forever.
|
|
6
|
-
*
|
|
7
|
-
* Every map here is keyed by the caller's apply key (`blueprintId:version`), so
|
|
8
|
-
* `superseded` always means a newer payload for the SAME key replaced this one:
|
|
9
|
-
* not a success, not a failure, and never acked — that newer payload owns the ack.
|
|
3
|
+
* Terminal outcome of an apply; every promise here settles with one, since the bridge acks on it.
|
|
4
|
+
* `superseded`: a newer payload for the same key replaced this one and owns the ack.
|
|
10
5
|
*/
|
|
11
6
|
export type ApplyOutcome = {
|
|
12
7
|
status: 'applied';
|
|
@@ -26,10 +21,7 @@ export type ApplyOutcome = {
|
|
|
26
21
|
* - manual Apply click (first apply): immediate.
|
|
27
22
|
* - blueprint_update after the user has applied once: debounced 250 ms trailing
|
|
28
23
|
* so rapid mid-stream updates don't thrash updateHtmlAndCss.
|
|
29
|
-
*
|
|
30
|
-
* A click that lands before Stripo finished initializing is queued rather than
|
|
31
|
-
* dropped, and flushed when `isStripoInitialized` flips — the user does not
|
|
32
|
-
* have to click again.
|
|
24
|
+
* - a click before Stripo is ready is queued and flushed when `isStripoInitialized` flips.
|
|
33
25
|
*/
|
|
34
26
|
export declare const useEmailTemplateApplier: () => {
|
|
35
27
|
applyStatus: import("vue").Ref<Record<string, ApplyStatus>>;
|
|
@@ -32,23 +32,11 @@ export interface GuidoEmailEditorState {
|
|
|
32
32
|
* Published as `@useinsider/guido/editor-state` and from the root barrel, so a
|
|
33
33
|
* consumer imports this store instead of re-declaring one under the same id.
|
|
34
34
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* view of it. cortex-fe reads it through that public path; adding an action or
|
|
38
|
-
* a getter that cortex needs would silently break that read. Keep it
|
|
39
|
-
* state-only. (`hasSnapshot` stays — cortex does not read it.)
|
|
35
|
+
* State-only by contract: cortex-fe reads `pinia.state.value['guidoEmailEditor']`, which misses
|
|
36
|
+
* actions and getters. Intended writers: `useGuidoStateBridge` and `useCortexBlueprintBridge`.
|
|
40
37
|
*
|
|
41
|
-
* `
|
|
42
|
-
*
|
|
43
|
-
* convention rather than something the store enforces: publishing the
|
|
44
|
-
* definition hands a consumer `$patch` as well, exactly as the runtime
|
|
45
|
-
* `pinia._s` probe always did.
|
|
46
|
-
*
|
|
47
|
-
* Store id `guidoEmailEditor` is cross-MFE: cortex-fe reads it at runtime rather
|
|
48
|
-
* than importing it, so the id stays part of the contract. The internal Guido
|
|
49
|
-
* editor store keeps id `guidoEditor` — these are intentionally separate. The
|
|
50
|
-
* internal store carries UI state a consumer should not see; this public store
|
|
51
|
-
* carries the contract Guido is willing to share.
|
|
38
|
+
* The id `guidoEmailEditor` is part of the cross-MFE contract; the internal
|
|
39
|
+
* store `guidoEditor` is intentionally separate.
|
|
52
40
|
*/
|
|
53
41
|
export declare const useGuidoEmailEditorStore: import("pinia").StoreDefinition<"guidoEmailEditor", GuidoEmailEditorState, {
|
|
54
42
|
/** True once the bridge has published at least one snapshot. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.19.0-beta.
|
|
3
|
+
"version": "3.19.0-beta.6f88fb4",
|
|
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",
|