@useinsider/guido 3.15.0-beta.3e8c8d2 → 3.15.0-beta.6b05db3
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 +1 -1
- package/dist/components/Guido.vue2.js +12 -12
- package/dist/composables/useCortexBlueprintBridge.js +79 -43
- package/dist/composables/useEmailTemplateApplier.js +84 -44
- package/dist/config/migrator/itemsBlockMigrator.js +1 -1
- package/dist/enums/recommendation.js +17 -17
- package/dist/extensions/Blocks/Items/enums/productEnums.js +45 -45
- package/dist/guido.css +1 -1
- package/dist/src/composables/useCortexBlueprintBridge.d.ts +12 -5
- package/dist/src/composables/useEmailTemplateApplier.d.ts +20 -2
- package/dist/src/stores/guido-email-editor.d.ts +32 -0
- package/dist/stores/guido-email-editor.js +9 -1
- package/package.json +1 -1
|
@@ -37,11 +37,11 @@ const xe = /* @__PURE__ */ q({
|
|
|
37
37
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
38
38
|
), g = U(), l = U(), u = le(), S = fe(), o = me();
|
|
39
39
|
i.ready && o.init(i.config);
|
|
40
|
-
const
|
|
40
|
+
const c = O(), $ = ue(), m = _(() => c.hasChanges), { isTestPartner: G } = X(), h = () => {
|
|
41
41
|
var t;
|
|
42
42
|
return (t = g.value) == null ? void 0 : t.handleSave(!0);
|
|
43
43
|
}, b = (t) => {
|
|
44
|
-
|
|
44
|
+
c.loadingStatus = t;
|
|
45
45
|
};
|
|
46
46
|
j(), Q();
|
|
47
47
|
const p = () => {
|
|
@@ -54,7 +54,7 @@ const xe = /* @__PURE__ */ q({
|
|
|
54
54
|
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || N.SAVED_MODULES,
|
|
55
55
|
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || N.DEFAULT_MODULES
|
|
56
56
|
};
|
|
57
|
-
}, { initPlugin: E, preloadRuntime: w } = Y(), { getDefaultTemplate: C } = de(), { cloneTimersOnSave: D, hasTimerBlocks: T } = Z(),
|
|
57
|
+
}, { initPlugin: E, preloadRuntime: w } = Y(), { getDefaultTemplate: C } = de(), { cloneTimersOnSave: D, hasTimerBlocks: T } = Z(), H = _(() => {
|
|
58
58
|
var t;
|
|
59
59
|
return !((t = o.ui) != null && t.showHeader);
|
|
60
60
|
});
|
|
@@ -82,8 +82,8 @@ const xe = /* @__PURE__ */ q({
|
|
|
82
82
|
n("on-change", m.value);
|
|
83
83
|
});
|
|
84
84
|
const f = (t) => {
|
|
85
|
-
const e = t, { attribute: s, position:
|
|
86
|
-
console.debug("dynamic-content:open", e.detail), n("dynamic-content:open", s,
|
|
85
|
+
const e = t, { attribute: s, position: d } = e.detail;
|
|
86
|
+
console.debug("dynamic-content:open", e.detail), n("dynamic-content:open", s, d);
|
|
87
87
|
};
|
|
88
88
|
let a = null;
|
|
89
89
|
const y = () => {
|
|
@@ -93,13 +93,13 @@ const xe = /* @__PURE__ */ q({
|
|
|
93
93
|
}, v = async () => {
|
|
94
94
|
var t;
|
|
95
95
|
try {
|
|
96
|
-
o.initialized || o.init(i.config),
|
|
97
|
-
const e = o.template, s = (e == null ? void 0 : e.html) || "",
|
|
96
|
+
o.initialized || o.init(i.config), c.templateId = o.templateId;
|
|
97
|
+
const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", k = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
98
98
|
S.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
99
99
|
const F = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {};
|
|
100
100
|
let r = {
|
|
101
101
|
html: s && await I(s, F),
|
|
102
|
-
css:
|
|
102
|
+
css: d
|
|
103
103
|
};
|
|
104
104
|
r.html || (r = await C(), r.html = await I(r.html, F)), T(r.html) && (r.html = await D(r.html));
|
|
105
105
|
const z = {
|
|
@@ -120,8 +120,8 @@ const xe = /* @__PURE__ */ q({
|
|
|
120
120
|
if (t && (a = new ResizeObserver(y), a.observe(t)), w(), i.ready)
|
|
121
121
|
await v();
|
|
122
122
|
else {
|
|
123
|
-
const s = B(() => i.ready, (
|
|
124
|
-
|
|
123
|
+
const s = B(() => i.ready, (d) => {
|
|
124
|
+
d && (s(), v());
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
127
|
document.addEventListener("dynamic-content:open", f);
|
|
@@ -132,7 +132,7 @@ const xe = /* @__PURE__ */ q({
|
|
|
132
132
|
} catch {
|
|
133
133
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
134
134
|
}
|
|
135
|
-
o.reset();
|
|
135
|
+
c.$reset(), o.reset();
|
|
136
136
|
}), A({
|
|
137
137
|
dynamicContent: {
|
|
138
138
|
insert: L,
|
|
@@ -141,7 +141,7 @@ const xe = /* @__PURE__ */ q({
|
|
|
141
141
|
hasChanges: m,
|
|
142
142
|
saveSilent: h,
|
|
143
143
|
setLoading: b
|
|
144
|
-
}), { __sfc: !0, PreviewContainer: W, OnboardingWrapper: x, headerWrapperRef: g, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: S, props: i, configStore: o, editorStore:
|
|
144
|
+
}), { __sfc: !0, PreviewContainer: W, OnboardingWrapper: x, headerWrapperRef: g, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: S, props: i, configStore: o, editorStore: c, previewStore: $, hasChanges: m, isTestPartner: G, saveSilent: h, setLoading: b, emit: n, buildMetadata: p, initPlugin: E, preloadRuntime: w, getDefaultTemplate: C, cloneTimersOnSave: D, hasTimerBlocks: T, noHeader: H, insertDynamicContent: L, closeDynamicContent: R, handleDynamicContentOpen: f, ribbonObserver: a, updateRibbonOffset: y, startEditor: v, AutoSaveController: oe, Toaster: ne, FilterSelectionDrawer: re, HeaderWrapper: se, LoadingWrapper: ie, SaveAsTemplateDrawer: ae, UnsubscribeWrapper: ce };
|
|
145
145
|
}
|
|
146
146
|
});
|
|
147
147
|
export {
|
|
@@ -1,59 +1,95 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useToaster as
|
|
3
|
-
import { useTranslations as
|
|
4
|
-
import { ToasterTypeOptions as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { resetEmailTemplateApplier as R, useEmailTemplateApplier as q } from "./useEmailTemplateApplier.js";
|
|
2
|
+
import { useToaster as x } from "./useToaster.js";
|
|
3
|
+
import { useTranslations as H } from "./useTranslations.js";
|
|
4
|
+
import { ToasterTypeOptions as K } from "../enums/toaster.js";
|
|
5
|
+
import { useGuidoEmailEditorStore as L } from "../stores/guido-email-editor.js";
|
|
6
|
+
import { getActivePinia as g } from "pinia";
|
|
7
|
+
import { onUnmounted as k, watch as G } from "vue";
|
|
8
|
+
const U = "email_template", C = "chat", F = "guido:debug:ai", O = () => {
|
|
8
9
|
if (typeof window > "u")
|
|
9
10
|
return !1;
|
|
10
11
|
try {
|
|
11
|
-
return window.localStorage.getItem(
|
|
12
|
+
return window.localStorage.getItem(F) === "1";
|
|
12
13
|
} catch {
|
|
13
14
|
return !1;
|
|
14
15
|
}
|
|
15
|
-
},
|
|
16
|
-
const
|
|
17
|
-
if (!
|
|
16
|
+
}, X = () => {
|
|
17
|
+
const T = g();
|
|
18
|
+
if (!T)
|
|
18
19
|
return;
|
|
19
|
-
const
|
|
20
|
-
|
|
20
|
+
const s = L();
|
|
21
|
+
s.$patch((e) => {
|
|
22
|
+
e.bridgeActive = !0, e.applyAcks = {};
|
|
23
|
+
}), k(() => {
|
|
24
|
+
s.$patch((e) => {
|
|
25
|
+
e.bridgeActive = !1, e.applyAcks = {};
|
|
26
|
+
}), R();
|
|
27
|
+
});
|
|
28
|
+
const u = T._s, d = u == null ? void 0 : u.get(C);
|
|
29
|
+
if (!d)
|
|
21
30
|
return;
|
|
22
|
-
const { markPending:
|
|
23
|
-
const
|
|
24
|
-
return
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
|
|
31
|
+
const { markPending: v, applyTemplate: _, applyTemplateDebounced: S } = q(), { showToaster: $ } = x(), M = H(), B = (e, t) => {
|
|
32
|
+
const i = M(e);
|
|
33
|
+
return i === e ? t : i;
|
|
34
|
+
}, a = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Set(), b = O(), D = (e, t) => {
|
|
35
|
+
b && console.debug(`[guido:cortex] msg=${e ?? "?"} type=${(t == null ? void 0 : t.type) ?? "?"}`, t);
|
|
36
|
+
}, A = (e, t, i, r) => {
|
|
37
|
+
s.$patch((n) => {
|
|
38
|
+
const o = n.applyAcks[e], l = Math.max(Date.now(), ((o == null ? void 0 : o.ackAt) ?? 0) + 1);
|
|
39
|
+
n.applyAcks = {
|
|
40
|
+
...n.applyAcks,
|
|
41
|
+
[e]: { status: t, ackAt: l, requestedAt: i, ...r !== void 0 ? { error: r } : {} }
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
}, I = (e) => {
|
|
45
|
+
if (e.blueprintType !== U)
|
|
46
|
+
return;
|
|
47
|
+
const t = e.blueprintId, i = e.blueprintData;
|
|
48
|
+
if (!t || !(i != null && i.html))
|
|
29
49
|
return;
|
|
30
|
-
|
|
31
|
-
|
|
50
|
+
if (!e.applyRequested) {
|
|
51
|
+
v(t);
|
|
32
52
|
return;
|
|
33
|
-
|
|
34
|
-
|
|
53
|
+
}
|
|
54
|
+
const r = `${t}:${e.version ?? 1}`, n = e.applyRequestedAt ?? 0, { html: o } = i, l = a.get(t), y = p.get(r);
|
|
55
|
+
if (l === void 0 && y === void 0 && (d.appliedBlueprintKeys ?? []).includes(r)) {
|
|
56
|
+
a.set(t, o), p.set(r, n), c.set(r, o);
|
|
35
57
|
return;
|
|
36
58
|
}
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
59
|
+
const h = (m) => {
|
|
60
|
+
if (c.set(r, o), l === o) {
|
|
61
|
+
A(r, "applied", n);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
(m ? _(t, i) : S(t, i)).then((E) => {
|
|
65
|
+
if (E.status !== "superseded") {
|
|
66
|
+
if (E.status === "applied") {
|
|
67
|
+
a.set(t, o), A(r, "applied", n);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
A(r, "failed", n, E.error);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
y === void 0 || n > y ? (p.set(r, n), h(!0)) : l !== o && c.get(r) !== o && h(!1);
|
|
75
|
+
}, w = (e) => e === void 0 || f.has(e) ? !1 : (f.add(e), $({
|
|
76
|
+
type: K.Error,
|
|
77
|
+
message: B("newsletter.ai-template-failed", "AI couldn't generate the template. Please try again.")
|
|
78
|
+
}), !0), P = G(
|
|
79
|
+
() => d.messages,
|
|
80
|
+
(e) => {
|
|
81
|
+
Array.isArray(e) && e.forEach((t) => {
|
|
82
|
+
const i = t == null ? void 0 : t.id;
|
|
83
|
+
(t == null ? void 0 : t.isError) === !0 && w(i) && b && console.debug(`[guido:cortex] message-level error id=${i}`, t);
|
|
84
|
+
const r = t == null ? void 0 : t.segments;
|
|
85
|
+
Array.isArray(r) && r.forEach((n) => {
|
|
50
86
|
if (n)
|
|
51
|
-
switch (
|
|
87
|
+
switch (D(i, n), n.type) {
|
|
52
88
|
case "blueprint":
|
|
53
|
-
|
|
89
|
+
I(n);
|
|
54
90
|
break;
|
|
55
91
|
case "error":
|
|
56
|
-
|
|
92
|
+
w(i);
|
|
57
93
|
break;
|
|
58
94
|
}
|
|
59
95
|
});
|
|
@@ -61,10 +97,10 @@ const x = "email_template", L = "chat", M = "guido:debug:ai", R = () => {
|
|
|
61
97
|
},
|
|
62
98
|
{ deep: !0, immediate: !0 }
|
|
63
99
|
);
|
|
64
|
-
|
|
65
|
-
|
|
100
|
+
k(() => {
|
|
101
|
+
P(), a.clear(), p.clear(), c.clear(), f.clear();
|
|
66
102
|
});
|
|
67
103
|
};
|
|
68
104
|
export {
|
|
69
|
-
|
|
105
|
+
X as useCortexBlueprintBridge
|
|
70
106
|
};
|
|
@@ -1,57 +1,97 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useConfig as
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { useTranslations as
|
|
5
|
-
import { ToasterTypeOptions as
|
|
6
|
-
import { useDynamicContentStore as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { useActionsApi as P } from "./useActionsApi.js";
|
|
2
|
+
import { useConfig as U } from "./useConfig.js";
|
|
3
|
+
import { useToaster as O } from "./useToaster.js";
|
|
4
|
+
import { useTranslations as M } from "./useTranslations.js";
|
|
5
|
+
import { ToasterTypeOptions as p } from "../enums/toaster.js";
|
|
6
|
+
import { useDynamicContentStore as Q } from "../stores/dynamic-content.js";
|
|
7
|
+
import { useEditorStore as _ } from "../stores/editor.js";
|
|
8
|
+
import { flattenDynamicContentList as k } from "../utils/genericUtil.js";
|
|
9
|
+
import { extractUsedDynamicContent as z } from "../utils/registerUsedDynamicContent.js";
|
|
10
|
+
import { ref as H, watch as N } from "vue";
|
|
11
|
+
const j = 250, x = 12e4, o = H({}), m = {}, n = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), B = () => {
|
|
12
|
+
var r, l;
|
|
13
|
+
return typeof ((l = (r = window.StripoEditorApi) == null ? void 0 : r.actionsApi) == null ? void 0 : l.updateHtmlAndCss) == "function";
|
|
14
|
+
}, b = () => {
|
|
15
|
+
const { updateHtmlAndCss: r } = P(), { showToaster: l } = O(), h = M(), { template: C } = U(), w = Q(), u = _(), f = (e, t) => {
|
|
16
|
+
const s = h(e);
|
|
17
|
+
return s === e ? t : s;
|
|
18
|
+
}, A = (e) => {
|
|
15
19
|
o.value[e] === void 0 && (o.value = { ...o.value, [e]: "pending" });
|
|
16
|
-
},
|
|
17
|
-
var
|
|
20
|
+
}, d = (e, t, s) => {
|
|
21
|
+
var c;
|
|
18
22
|
o.value = { ...o.value, [e]: "applying" };
|
|
19
23
|
try {
|
|
20
|
-
|
|
24
|
+
r(t, s), o.value = { ...o.value, [e]: "applied" };
|
|
21
25
|
try {
|
|
22
|
-
const
|
|
23
|
-
|
|
26
|
+
const a = k((c = C.value) == null ? void 0 : c.dynamicContentList), i = z(t, a);
|
|
27
|
+
i.length > 0 && w.registerDynamicContent(i);
|
|
24
28
|
} catch {
|
|
25
29
|
}
|
|
26
|
-
|
|
27
|
-
type:
|
|
28
|
-
message:
|
|
29
|
-
}));
|
|
30
|
-
} catch (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
return g.get(e) !== t && (g.set(e, t), l({
|
|
31
|
+
type: p.Success,
|
|
32
|
+
message: f("newsletter.ai-template-applied", "Template applied to the editor")
|
|
33
|
+
})), { status: "applied" };
|
|
34
|
+
} catch (a) {
|
|
35
|
+
const i = a instanceof Error ? a.message : "Failed to apply template";
|
|
36
|
+
return o.value = { ...o.value, [e]: "failed" }, l({
|
|
37
|
+
type: p.Error,
|
|
38
|
+
message: i
|
|
39
|
+
}), { status: "failed", error: i };
|
|
35
40
|
}
|
|
36
|
-
},
|
|
37
|
-
const t =
|
|
38
|
-
t && (clearTimeout(t),
|
|
41
|
+
}, y = (e) => {
|
|
42
|
+
const t = n.get(e);
|
|
43
|
+
t && (n.delete(e), clearTimeout(t.timeoutTimer), t.resolve({ status: "superseded" }));
|
|
44
|
+
}, S = (e, t, s) => (y(e), new Promise((c) => {
|
|
45
|
+
const a = setTimeout(() => {
|
|
46
|
+
n.delete(e), o.value = { ...o.value, [e]: "failed" };
|
|
47
|
+
const i = f(
|
|
48
|
+
"newsletter.ai-template-apply-timeout",
|
|
49
|
+
"The editor took too long to load. Please try applying again."
|
|
50
|
+
);
|
|
51
|
+
l({ type: p.Error, message: i }), c({ status: "failed", error: i });
|
|
52
|
+
}, x);
|
|
53
|
+
n.set(e, { html: t, css: s, resolve: c, timeoutTimer: a });
|
|
54
|
+
})), T = () => u.isStripoInitialized && B(), D = () => {
|
|
55
|
+
if (!T() || n.size === 0)
|
|
56
|
+
return;
|
|
57
|
+
const e = [...n.entries()];
|
|
58
|
+
n.clear(), e.forEach(([t, s]) => {
|
|
59
|
+
clearTimeout(s.timeoutTimer), s.resolve(d(t, s.html, s.css));
|
|
60
|
+
});
|
|
39
61
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
62
|
+
N(
|
|
63
|
+
() => u.isStripoInitialized,
|
|
64
|
+
(e) => {
|
|
65
|
+
e && D();
|
|
66
|
+
},
|
|
67
|
+
{ immediate: !0 }
|
|
68
|
+
);
|
|
69
|
+
const v = (e) => {
|
|
70
|
+
const t = m[e];
|
|
71
|
+
t && (clearTimeout(t.timer), delete m[e], t.resolve({ status: "superseded" }));
|
|
72
|
+
}, E = (e, t, s) => T() ? (y(e), Promise.resolve(d(e, t, s))) : S(e, t, s);
|
|
73
|
+
return { applyStatus: o, markPending: A, applyTemplate: (e, t) => t.html ? (v(e), E(e, t.html, t.css ?? "")) : Promise.resolve({ status: "superseded" }), applyTemplateDebounced: (e, t) => {
|
|
43
74
|
if (!t.html)
|
|
44
|
-
return;
|
|
45
|
-
|
|
46
|
-
const { html:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
75
|
+
return Promise.resolve({ status: "superseded" });
|
|
76
|
+
v(e);
|
|
77
|
+
const { html: s } = t, c = t.css ?? "";
|
|
78
|
+
return new Promise((a) => {
|
|
79
|
+
m[e] = {
|
|
80
|
+
resolve: a,
|
|
81
|
+
timer: setTimeout(() => {
|
|
82
|
+
delete m[e], a(E(e, s, c));
|
|
83
|
+
}, j)
|
|
84
|
+
};
|
|
85
|
+
});
|
|
50
86
|
} };
|
|
51
|
-
},
|
|
52
|
-
Object.values(
|
|
87
|
+
}, I = () => {
|
|
88
|
+
Object.values(m).forEach((r) => {
|
|
89
|
+
clearTimeout(r.timer), r.resolve({ status: "superseded" });
|
|
90
|
+
}), Object.keys(m).forEach((r) => delete m[r]), n.forEach((r) => {
|
|
91
|
+
clearTimeout(r.timeoutTimer), r.resolve({ status: "superseded" });
|
|
92
|
+
}), n.clear(), o.value = {};
|
|
53
93
|
};
|
|
54
94
|
export {
|
|
55
|
-
|
|
56
|
-
|
|
95
|
+
I as resetEmailTemplateApplier,
|
|
96
|
+
b as useEmailTemplateApplier
|
|
57
97
|
};
|
|
@@ -381,7 +381,7 @@ class H {
|
|
|
381
381
|
* Supports all block types by detecting prefix and using appropriate type:
|
|
382
382
|
*
|
|
383
383
|
* Examples:
|
|
384
|
-
* - {{ins_apr_img_1}} → https://
|
|
384
|
+
* - {{ins_apr_img_1}} → https://s3.../img_1.jpeg (CART_ITEMS)
|
|
385
385
|
* - {{browsed_item_name_2}} → 'Set of Sprite Yoga Straps' (BROWSED_ITEMS)
|
|
386
386
|
* - {{purchased_item_formattedprice_5}} → '1,490.49' (PURCHASED_ITEMS)
|
|
387
387
|
*/
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const e = 20,
|
|
1
|
+
const e = 20, s = 320, t = "vertical", m = {
|
|
2
2
|
CART_ABANDONMENT: {
|
|
3
|
-
ins_apr_img_1: "https://web-image.useinsider.com/email-assets/dummyImages/ins_apr_img_1.png",
|
|
4
|
-
ins_apr_img_2: "https://web-image.useinsider.com/email-assets/dummyImages/ins_apr_img_2.png",
|
|
5
|
-
ins_apr_img_3: "https://web-image.useinsider.com/email-assets/dummyImages/ins_apr_img_3.png",
|
|
6
|
-
ins_apr_img_4: "https://web-image.useinsider.com/email-assets/dummyImages/ins_apr_img_4.png"
|
|
3
|
+
ins_apr_img_1: "https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/ins_apr_img_1.png",
|
|
4
|
+
ins_apr_img_2: "https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/ins_apr_img_2.png",
|
|
5
|
+
ins_apr_img_3: "https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/ins_apr_img_3.png",
|
|
6
|
+
ins_apr_img_4: "https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/ins_apr_img_4.png"
|
|
7
7
|
},
|
|
8
8
|
BROWSE_ABANDONMENT: {
|
|
9
|
-
browsed_item_img_1: "https://web-image.useinsider.com/email-assets/dummyImages/browsed_item_img_1.jpg",
|
|
10
|
-
browsed_item_img_2: "https://web-image.useinsider.com/email-assets/dummyImages/browsed_item_img_2.jpg",
|
|
11
|
-
browsed_item_img_3: "https://web-image.useinsider.com/email-assets/dummyImages/browsed_item_img_3.jpg",
|
|
12
|
-
browsed_item_img_4: "https://web-image.useinsider.com/email-assets/dummyImages/browsed_item_img_4.jpg"
|
|
9
|
+
browsed_item_img_1: "https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/browsed_item_img_1.jpg",
|
|
10
|
+
browsed_item_img_2: "https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/browsed_item_img_2.jpg",
|
|
11
|
+
browsed_item_img_3: "https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/browsed_item_img_3.jpg",
|
|
12
|
+
browsed_item_img_4: "https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/browsed_item_img_4.jpg"
|
|
13
13
|
}
|
|
14
14
|
}, i = {
|
|
15
15
|
DISCOUNT: "discount",
|
|
@@ -23,7 +23,7 @@ const e = 20, t = 320, s = "vertical", m = {
|
|
|
23
23
|
},
|
|
24
24
|
ELSE: "{% else %}",
|
|
25
25
|
END_IF: "{% endif %}"
|
|
26
|
-
},
|
|
26
|
+
}, a = {
|
|
27
27
|
ID: /recommendation-id="(.*?)"/gi,
|
|
28
28
|
ATTRIBUTE_PARAGRAPH: /<p[^>]*?product-attr="(discount|omnibus_discount|omnibus_price)"[^>]*>[\S\s]*?<\/p>/gm,
|
|
29
29
|
ATTRIBUTE_PARAGRAPH_START_TAG: /<p[^>]*?product-attr="(discount|omnibus_discount|omnibus_price)"[^>]*>/gm,
|
|
@@ -31,9 +31,9 @@ const e = 20, t = 320, s = "vertical", m = {
|
|
|
31
31
|
CUSTOM_FIELD: /{{(?:reco_)?[0-9]+_[0-8]_(discount|omnibus_discount|omnibus_price)}}/gm,
|
|
32
32
|
CUSTOM_FIELD_INDEXES_PART: /{{(?:reco_)?[0-9]+_[0-8]_/gm,
|
|
33
33
|
CUSTOM_FIELD_NAME_PART: /_(discount|omnibus_discount|omnibus_price)}}/gm
|
|
34
|
-
},
|
|
34
|
+
}, n = {
|
|
35
35
|
PARAGRAPH_END_TAG: "</p>"
|
|
36
|
-
},
|
|
36
|
+
}, o = {
|
|
37
37
|
REGULAR_NAME_HEIGHT: ".ext-product-name.ins-vertical p { height:90px!important;",
|
|
38
38
|
TRIMMED_NAME_HEIGHT: ".ext-product-name.ins-vertical p { height:18px!important;",
|
|
39
39
|
ELLIPSIS: "text-overflow:ellipsis!important; white-space:nowrap!important;",
|
|
@@ -47,11 +47,11 @@ const e = 20, t = 320, s = "vertical", m = {
|
|
|
47
47
|
export {
|
|
48
48
|
i as ATTRIBUTES,
|
|
49
49
|
_ as CONDITIONS,
|
|
50
|
-
|
|
50
|
+
o as CSS,
|
|
51
51
|
m as DUMMY_IMAGE_MAPPINGS,
|
|
52
52
|
e as DefaultPadding,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
n as HTML,
|
|
54
|
+
s as MinDeviceViewport,
|
|
55
|
+
a as REGEX,
|
|
56
|
+
t as VerticalOrientation
|
|
57
57
|
};
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import _ from "../../../../node_modules/lodash-es/flatMap.js";
|
|
2
|
+
import E from "../../../../node_modules/lodash-es/range.js";
|
|
3
|
+
const T = '<td align="center" class="ins-product-td items-block items-block-v2">', a = { PAIRS_FOR_EXTENSION: {
|
|
4
4
|
imageSrc: {
|
|
5
5
|
CART_ITEMS: {
|
|
6
6
|
ATTR: "ins_apr_img",
|
|
7
7
|
DEFAULT: [
|
|
8
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_1.jpeg",
|
|
9
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_2.webp",
|
|
10
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_3.jpeg",
|
|
11
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_4.jpeg",
|
|
12
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_5.jpeg",
|
|
13
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_6.jpeg",
|
|
14
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_7.jpeg",
|
|
15
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_8.jpeg"
|
|
8
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_1.jpeg",
|
|
9
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_2.webp",
|
|
10
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_3.jpeg",
|
|
11
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_4.jpeg",
|
|
12
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_5.jpeg",
|
|
13
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_6.jpeg",
|
|
14
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_7.jpeg",
|
|
15
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_8.jpeg"
|
|
16
16
|
]
|
|
17
17
|
},
|
|
18
18
|
BROWSED_ITEMS: {
|
|
19
19
|
ATTR: "browsed_item_img",
|
|
20
20
|
DEFAULT: [
|
|
21
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_1.jpeg",
|
|
22
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_2.webp",
|
|
23
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_3.jpeg",
|
|
24
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_4.jpeg",
|
|
25
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_5.jpeg",
|
|
26
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_6.jpeg",
|
|
27
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_7.jpeg",
|
|
28
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_8.jpeg"
|
|
21
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_1.jpeg",
|
|
22
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_2.webp",
|
|
23
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_3.jpeg",
|
|
24
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_4.jpeg",
|
|
25
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_5.jpeg",
|
|
26
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_6.jpeg",
|
|
27
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_7.jpeg",
|
|
28
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_8.jpeg"
|
|
29
29
|
]
|
|
30
30
|
},
|
|
31
31
|
PURCHASED_ITEMS: {
|
|
32
32
|
ATTR: "purchased_item_img",
|
|
33
33
|
DEFAULT: [
|
|
34
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_1.jpeg",
|
|
35
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_2.webp",
|
|
36
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_3.jpeg",
|
|
37
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_4.jpeg",
|
|
38
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_5.jpeg",
|
|
39
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_6.jpeg",
|
|
40
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_7.jpeg",
|
|
41
|
-
"https://web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_8.jpeg"
|
|
34
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_1.jpeg",
|
|
35
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_2.webp",
|
|
36
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_3.jpeg",
|
|
37
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_4.jpeg",
|
|
38
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_5.jpeg",
|
|
39
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_6.jpeg",
|
|
40
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_7.jpeg",
|
|
41
|
+
"https://s3-eu-west-1.amazonaws.com/web-image.useinsider.com/email-assets/dummyImages/products/ins_apr_img_8.jpeg"
|
|
42
42
|
]
|
|
43
43
|
}
|
|
44
44
|
},
|
|
@@ -211,27 +211,27 @@ const t = '<td align="center" class="ins-product-td items-block items-block-v2">
|
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
} };
|
|
214
|
-
function
|
|
215
|
-
return
|
|
214
|
+
function m(e, s = 8) {
|
|
215
|
+
return E(1, s + 1).map((i) => `${e}_${i}`);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
const { PAIRS_FOR_EXTENSION: e } =
|
|
219
|
-
return
|
|
217
|
+
function r() {
|
|
218
|
+
const { PAIRS_FOR_EXTENSION: e } = a, s = [];
|
|
219
|
+
return s.push(
|
|
220
220
|
e.imageSrc.CART_ITEMS.ATTR,
|
|
221
221
|
e.imageSrc.BROWSED_ITEMS.ATTR,
|
|
222
222
|
e.imageSrc.PURCHASED_ITEMS.ATTR
|
|
223
|
-
),
|
|
223
|
+
), s.push(
|
|
224
224
|
e.name.CART_ITEMS.ATTR,
|
|
225
225
|
e.name.CART_ITEMS.HREF,
|
|
226
226
|
e.name.BROWSED_ITEMS.ATTR,
|
|
227
227
|
e.name.BROWSED_ITEMS.HREF,
|
|
228
228
|
e.name.PURCHASED_ITEMS.ATTR,
|
|
229
229
|
e.name.PURCHASED_ITEMS.HREF
|
|
230
|
-
),
|
|
230
|
+
), s.push(
|
|
231
231
|
e.quantity.CART_ITEMS.ATTR,
|
|
232
232
|
e.quantity.BROWSED_ITEMS.ATTR,
|
|
233
233
|
e.quantity.PURCHASED_ITEMS.ATTR
|
|
234
|
-
),
|
|
234
|
+
), s.push(
|
|
235
235
|
e.price.CART_ITEMS.PRICE,
|
|
236
236
|
e.price.CART_ITEMS.PRICE_FORMATTED,
|
|
237
237
|
e.price.CART_ITEMS.SINGLE_PRICE,
|
|
@@ -247,7 +247,7 @@ function R() {
|
|
|
247
247
|
e.price.PURCHASED_ITEMS.SINGLE_PRICE,
|
|
248
248
|
e.price.PURCHASED_ITEMS.SINGLE_PRICE_FORMATTED,
|
|
249
249
|
e.price.PURCHASED_ITEMS.CURRENCY
|
|
250
|
-
),
|
|
250
|
+
), s.push(
|
|
251
251
|
e.originalPrice.CART_ITEMS.PRICE,
|
|
252
252
|
e.originalPrice.CART_ITEMS.PRICE_FORMATTED,
|
|
253
253
|
e.originalPrice.CART_ITEMS.SINGLE_PRICE,
|
|
@@ -263,22 +263,22 @@ function R() {
|
|
|
263
263
|
e.originalPrice.PURCHASED_ITEMS.SINGLE_PRICE,
|
|
264
264
|
e.originalPrice.PURCHASED_ITEMS.SINGLE_PRICE_FORMATTED,
|
|
265
265
|
e.originalPrice.PURCHASED_ITEMS.CURRENCY
|
|
266
|
-
),
|
|
266
|
+
), s.push(
|
|
267
267
|
e.button.CART_ITEMS.HREF,
|
|
268
268
|
e.button.BROWSED_ITEMS.HREF,
|
|
269
269
|
e.button.PURCHASED_ITEMS.HREF
|
|
270
|
-
),
|
|
270
|
+
), s.push(
|
|
271
271
|
e.itemLink.CART_ITEMS.HREF,
|
|
272
272
|
e.itemLink.BROWSED_ITEMS.HREF,
|
|
273
273
|
e.itemLink.PURCHASED_ITEMS.HREF
|
|
274
|
-
),
|
|
274
|
+
), s;
|
|
275
275
|
}
|
|
276
|
-
const
|
|
277
|
-
|
|
278
|
-
(e) =>
|
|
276
|
+
const o = _(
|
|
277
|
+
r(),
|
|
278
|
+
(e) => m(e)
|
|
279
279
|
);
|
|
280
280
|
export {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
281
|
+
o as itemsBlockDynamicVariables,
|
|
282
|
+
a as productPairs,
|
|
283
|
+
T as templateFirstLine
|
|
284
284
|
};
|
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-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-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-
|
|
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-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-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-4316a203]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-4316a203]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-4316a203]{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}
|
|
@@ -10,19 +10,26 @@
|
|
|
10
10
|
*
|
|
11
11
|
* - `blueprint` segments with `blueprintType === 'email_template'` are
|
|
12
12
|
* applied to the Stripo editor, but ONLY after the user clicks
|
|
13
|
-
* "Apply to editor" in cortex-fe (which sets `applyRequested`
|
|
14
|
-
* segment). Before that the template is marked
|
|
15
|
-
* written to Stripo. Once applied, refines flow
|
|
16
|
-
* identical-html no-ops.
|
|
13
|
+
* "Apply to editor" in cortex-fe (which sets `applyRequested` +
|
|
14
|
+
* `applyRequestedAt` on the segment). Before that the template is marked
|
|
15
|
+
* `pending` and nothing is written to Stripo. Once applied, refines flow
|
|
16
|
+
* through debounced; identical-html no-ops. A re-click (bumped
|
|
17
|
+
* `applyRequestedAt`) retries a failed apply.
|
|
17
18
|
* - `error` segments (and message-level `isError` / `isCancelled`) trigger
|
|
18
19
|
* a localized toaster.
|
|
19
20
|
*
|
|
21
|
+
* Every accepted apply request is eventually acked (applied/failed) to the
|
|
22
|
+
* `guidoEmailEditor` store's `applyAcks` — cortex-fe has no timeout of its
|
|
23
|
+
* own; Guido is the single authority on the outcome. `bridgeActive` is set at
|
|
24
|
+
* MOUNT (not lazily) so cortex-fe's Apply button enables on the editor page.
|
|
25
|
+
*
|
|
20
26
|
* In dev (`import.meta.env.DEV`) every observed segment + message-level flag
|
|
21
27
|
* change is also `console.debug`-logged with the prefix `[guido:cortex]` so a
|
|
22
28
|
* developer can watch the agent stream in real time. In production this is
|
|
23
29
|
* gated behind `localStorage.guido:debug:ai === '1'`.
|
|
24
30
|
*
|
|
25
31
|
* If cortex-fe isn't loaded the chat store is undefined and the bridge is a
|
|
26
|
-
* no-op (intentional — Guido must still work standalone).
|
|
32
|
+
* no-op (intentional — Guido must still work standalone). `bridgeActive` is
|
|
33
|
+
* still published: the store write is harmless with no reader.
|
|
27
34
|
*/
|
|
28
35
|
export declare const useCortexBlueprintBridge: () => void;
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
type ApplyStatus = 'pending' | 'applying' | 'applied' | 'failed';
|
|
2
|
+
/**
|
|
3
|
+
* Resolution of one apply request. `superseded` means the request was replaced
|
|
4
|
+
* by a newer one for the same blueprint (latest-wins) or dropped at teardown —
|
|
5
|
+
* callers must NOT ack it.
|
|
6
|
+
*/
|
|
7
|
+
export type ApplyOutcome = {
|
|
8
|
+
status: 'applied';
|
|
9
|
+
} | {
|
|
10
|
+
status: 'failed';
|
|
11
|
+
error: string;
|
|
12
|
+
} | {
|
|
13
|
+
status: 'superseded';
|
|
14
|
+
};
|
|
2
15
|
/**
|
|
3
16
|
* Applies email_template blueprints from the chat agent to the Stripo editor.
|
|
4
17
|
*
|
|
@@ -9,6 +22,11 @@ type ApplyStatus = 'pending' | 'applying' | 'applied' | 'failed';
|
|
|
9
22
|
* - manual Apply click (first apply): immediate.
|
|
10
23
|
* - blueprint_update after the user has applied once: debounced 250 ms trailing
|
|
11
24
|
* so rapid mid-stream updates don't thrash updateHtmlAndCss.
|
|
25
|
+
* - editor not ready yet (actionsApi not attached): the request queues
|
|
26
|
+
* (latest-wins per blueprint) and flushes when `isStripoInitialized` flips
|
|
27
|
+
* true; after QUEUE_TIMEOUT_MS it resolves `failed` instead.
|
|
28
|
+
*
|
|
29
|
+
* Every returned promise resolves with an ApplyOutcome — never rejects.
|
|
12
30
|
*/
|
|
13
31
|
export declare const useEmailTemplateApplier: () => {
|
|
14
32
|
applyStatus: import("vue").Ref<Record<string, ApplyStatus>>;
|
|
@@ -16,11 +34,11 @@ export declare const useEmailTemplateApplier: () => {
|
|
|
16
34
|
applyTemplate: (blueprintId: string, data: {
|
|
17
35
|
html?: string;
|
|
18
36
|
css?: string;
|
|
19
|
-
}) =>
|
|
37
|
+
}) => Promise<ApplyOutcome>;
|
|
20
38
|
applyTemplateDebounced: (blueprintId: string, data: {
|
|
21
39
|
html?: string;
|
|
22
40
|
css?: string;
|
|
23
|
-
}) =>
|
|
41
|
+
}) => Promise<ApplyOutcome>;
|
|
24
42
|
};
|
|
25
43
|
export declare const resetEmailTemplateApplier: () => void;
|
|
26
44
|
export {};
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Result of one accepted apply request, keyed by `${blueprintId}:${version ?? 1}`
|
|
3
|
+
* (same key cortex-fe's `isBlueprintApplied` uses). One record per key,
|
|
4
|
+
* latest-wins; written by the blueprint bridge via `$patch`.
|
|
5
|
+
*/
|
|
6
|
+
export interface ApplyAck {
|
|
7
|
+
status: 'applied' | 'failed';
|
|
8
|
+
/** Epoch ms of this ack; strictly increasing per key. */
|
|
9
|
+
ackAt: number;
|
|
10
|
+
/** Echo of the `segment.applyRequestedAt` this ack answers (0 when absent — legacy cortex). */
|
|
11
|
+
requestedAt: number;
|
|
12
|
+
/** Only on `failed`. Cortex never renders it — the error toaster is Guido's. */
|
|
13
|
+
error?: string;
|
|
14
|
+
}
|
|
1
15
|
/**
|
|
2
16
|
* Outbound contract Guido publishes to the host's shared Pinia singleton so
|
|
3
17
|
* cortex-fe can pick up the current editor state and forward it as
|
|
@@ -21,6 +35,14 @@ export declare const useGuidoEmailEditorStore: import("pinia").StoreDefinition<"
|
|
|
21
35
|
lastUpdatedAt: number;
|
|
22
36
|
/** Template id from the editor config, for cortex-fe to scope per-template. */
|
|
23
37
|
templateId: string;
|
|
38
|
+
/**
|
|
39
|
+
* True while useCortexBlueprintBridge is mounted. Cortex-fe gates the
|
|
40
|
+
* "Apply to editor" button on this — it must be set at bridge MOUNT
|
|
41
|
+
* (not lazily on first ack) so the button enables on the editor page.
|
|
42
|
+
*/
|
|
43
|
+
bridgeActive: boolean;
|
|
44
|
+
/** Apply acks per `${blueprintId}:${version ?? 1}` key. Cleared on bridge teardown. */
|
|
45
|
+
applyAcks: Record<string, ApplyAck>;
|
|
24
46
|
}, {
|
|
25
47
|
/** True once the bridge has published at least one snapshot. */
|
|
26
48
|
hasSnapshot: (state: {
|
|
@@ -28,6 +50,8 @@ export declare const useGuidoEmailEditorStore: import("pinia").StoreDefinition<"
|
|
|
28
50
|
css: string;
|
|
29
51
|
lastUpdatedAt: number;
|
|
30
52
|
templateId: string;
|
|
53
|
+
bridgeActive: boolean;
|
|
54
|
+
applyAcks: Record<string, ApplyAck>;
|
|
31
55
|
} & import("pinia").PiniaCustomStateProperties<{
|
|
32
56
|
/** Current Stripo HTML — stripe tables only, no DOCTYPE/wrapper. */
|
|
33
57
|
html: string;
|
|
@@ -37,5 +61,13 @@ export declare const useGuidoEmailEditorStore: import("pinia").StoreDefinition<"
|
|
|
37
61
|
lastUpdatedAt: number;
|
|
38
62
|
/** Template id from the editor config, for cortex-fe to scope per-template. */
|
|
39
63
|
templateId: string;
|
|
64
|
+
/**
|
|
65
|
+
* True while useCortexBlueprintBridge is mounted. Cortex-fe gates the
|
|
66
|
+
* "Apply to editor" button on this — it must be set at bridge MOUNT
|
|
67
|
+
* (not lazily on first ack) so the button enables on the editor page.
|
|
68
|
+
*/
|
|
69
|
+
bridgeActive: boolean;
|
|
70
|
+
/** Apply acks per `${blueprintId}:${version ?? 1}` key. Cleared on bridge teardown. */
|
|
71
|
+
applyAcks: Record<string, ApplyAck>;
|
|
40
72
|
}>) => boolean;
|
|
41
73
|
}, {}>;
|
|
@@ -8,7 +8,15 @@ const d = e("guidoEmailEditor", {
|
|
|
8
8
|
/** Wall-clock ms when html/css were last written by the bridge. */
|
|
9
9
|
lastUpdatedAt: 0,
|
|
10
10
|
/** Template id from the editor config, for cortex-fe to scope per-template. */
|
|
11
|
-
templateId: ""
|
|
11
|
+
templateId: "",
|
|
12
|
+
/**
|
|
13
|
+
* True while useCortexBlueprintBridge is mounted. Cortex-fe gates the
|
|
14
|
+
* "Apply to editor" button on this — it must be set at bridge MOUNT
|
|
15
|
+
* (not lazily on first ack) so the button enables on the editor page.
|
|
16
|
+
*/
|
|
17
|
+
bridgeActive: !1,
|
|
18
|
+
/** Apply acks per `${blueprintId}:${version ?? 1}` key. Cleared on bridge teardown. */
|
|
19
|
+
applyAcks: {}
|
|
12
20
|
}),
|
|
13
21
|
getters: {
|
|
14
22
|
/** 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.15.0-beta.
|
|
3
|
+
"version": "3.15.0-beta.6b05db3",
|
|
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",
|