@useinsider/guido 3.18.3-beta.ec88281 → 3.19.0-beta.5355c3f
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 +20 -0
- package/dist/components/Guido.vue.js +3 -3
- package/dist/components/Guido.vue2.js +67 -61
- package/dist/composables/useActionsApi.js +24 -20
- package/dist/composables/useCortexBlueprintBridge.js +115 -54
- package/dist/composables/useEmailTemplateApplier.js +93 -50
- package/dist/composables/useGuidoStateBridge.js +29 -24
- package/dist/composables/useStripo.js +7 -7
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +4 -4
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +6 -3
- package/dist/guido.css +1 -1
- package/dist/library.js +15 -13
- package/dist/package.json.js +1 -1
- package/dist/public/editorState.js +4 -0
- package/dist/src/composables/useCortexBlueprintBridge.d.ts +4 -3
- package/dist/src/composables/useEmailTemplateApplier.d.ts +22 -2
- package/dist/src/composables/useGuidoStateBridge.d.ts +11 -7
- package/dist/src/library.d.ts +2 -0
- package/dist/src/public/editorState.d.ts +14 -0
- package/dist/src/public/trackingIds.d.ts +6 -2
- package/dist/src/stores/editor.d.ts +25 -0
- package/dist/src/stores/guido-email-editor.d.ts +49 -27
- package/dist/src/utils/liquidDynamicContent.d.ts +20 -0
- package/dist/stores/editor.js +4 -0
- package/dist/stores/guido-email-editor.js +3 -5
- package/dist/utils/genericUtil.js +64 -61
- package/dist/utils/liquidDynamicContent.js +15 -0
- package/package.json +10 -6
|
@@ -1,59 +1,102 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useConfig as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { useActionsApi as Q } from "./useActionsApi.js";
|
|
2
|
+
import { useConfig as x } from "./useConfig.js";
|
|
3
|
+
import { useEditorLock as z } from "./useEditorLock.js";
|
|
4
|
+
import { useToaster as N } from "./useToaster.js";
|
|
5
|
+
import { useTranslations as q } from "./useTranslations.js";
|
|
6
|
+
import { ToasterTypeOptions as D } from "../enums/toaster.js";
|
|
7
|
+
import { useDynamicContentStore as R } from "../stores/dynamic-content.js";
|
|
8
|
+
import { useEditorStore as F } from "../stores/editor.js";
|
|
9
|
+
import { flattenDynamicContentList as G } from "../utils/genericUtil.js";
|
|
10
|
+
import { extractUsedDynamicContent as $ } from "../utils/registerUsedDynamicContent.js";
|
|
11
|
+
import { ref as j, watch as J } from "vue";
|
|
12
|
+
const K = 250, S = 12e4, c = { status: "superseded" }, h = { status: "failed", error: new Error("Blueprint has no html to apply") }, i = j({}), v = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), ie = () => {
|
|
13
|
+
const { updateHtmlAndCss: a } = Q(), { runExclusive: M } = z(), { showToaster: d } = N(), y = q(), { template: U } = x(), A = R(), E = F(), T = (e, t) => {
|
|
14
|
+
u.get(e) !== t && (u.set(e, t), d({
|
|
15
|
+
type: D.Error,
|
|
16
|
+
message: y("newsletter.ai-template-failed-apply")
|
|
17
|
+
}));
|
|
18
|
+
}, O = () => {
|
|
19
|
+
var e, t;
|
|
20
|
+
return E.isStripoInitialized && typeof ((t = (e = window.StripoEditorApi) == null ? void 0 : e.actionsApi) == null ? void 0 : t.updateHtmlAndCss) == "function";
|
|
21
|
+
}, P = (e) => {
|
|
22
|
+
i.value[e] === void 0 && (i.value = { ...i.value, [e]: "pending" });
|
|
23
|
+
}, m = (e, t) => {
|
|
24
|
+
i.value = { ...i.value, [e]: t };
|
|
25
|
+
}, _ = (e) => {
|
|
26
|
+
var t;
|
|
19
27
|
try {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
const o = G((t = U.value) == null ? void 0 : t.dynamicContentList), s = $(e, o);
|
|
29
|
+
s.length > 0 && A.registerDynamicContent(s);
|
|
30
|
+
} catch {
|
|
31
|
+
}
|
|
32
|
+
}, H = (e, t) => {
|
|
33
|
+
u.delete(e), v.get(e) !== t && (v.set(e, t), d({
|
|
34
|
+
type: D.Success,
|
|
35
|
+
message: y("newsletter.ai-template-applied")
|
|
36
|
+
}));
|
|
37
|
+
}, g = async (e, t, o) => {
|
|
38
|
+
const s = (l.get(e) ?? 0) + 1;
|
|
39
|
+
l.set(e, s), m(e, "applying");
|
|
40
|
+
try {
|
|
41
|
+
await M(() => a(t, o));
|
|
32
42
|
} catch (n) {
|
|
33
|
-
|
|
34
|
-
type: f.Error,
|
|
35
|
-
message: n instanceof Error ? n.message : "Failed to apply template"
|
|
36
|
-
});
|
|
43
|
+
return l.get(e) !== s ? c : (console.error("[guido:apply] editor did not acknowledge the template apply", n), m(e, "failed"), T(e, t), { status: "failed", error: n });
|
|
37
44
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
t
|
|
45
|
+
return l.get(e) !== s ? c : (m(e, "applied"), _(t), H(e, t), { status: "applied" });
|
|
46
|
+
}, k = (e) => {
|
|
47
|
+
const t = r.get(e);
|
|
48
|
+
t && (clearTimeout(t.timer), r.delete(e), t.settle(c));
|
|
49
|
+
}, w = (e) => {
|
|
50
|
+
const t = p.get(e);
|
|
51
|
+
t && (clearTimeout(t.timer), p.delete(e), t.settle(c));
|
|
52
|
+
}, B = (e, t, o) => new Promise((s) => {
|
|
53
|
+
k(e);
|
|
54
|
+
const n = setTimeout(() => {
|
|
55
|
+
r.delete(e), m(e, "failed"), T(e, t), s({
|
|
56
|
+
status: "failed",
|
|
57
|
+
error: new Error(`Editor did not become ready within ${S}ms`)
|
|
58
|
+
});
|
|
59
|
+
}, S);
|
|
60
|
+
r.set(e, { html: t, css: o, timer: n, settle: s }), m(e, "applying");
|
|
61
|
+
}), C = (e, t, o) => O() ? g(e, t, o) : B(e, t, o), L = async () => {
|
|
62
|
+
if (r.size === 0)
|
|
63
|
+
return;
|
|
64
|
+
const e = [...r.entries()];
|
|
65
|
+
r.clear(), e.forEach(([, n]) => clearTimeout(n.timer));
|
|
66
|
+
const t = e.pop();
|
|
67
|
+
if (e.forEach(([n, f]) => {
|
|
68
|
+
m(n, "pending"), f.settle(c);
|
|
69
|
+
}), !t)
|
|
70
|
+
return;
|
|
71
|
+
const [o, s] = t;
|
|
72
|
+
s.settle(await g(o, s.html, s.css));
|
|
41
73
|
};
|
|
42
|
-
return
|
|
43
|
-
|
|
74
|
+
return J(() => E.isStripoInitialized, (e) => {
|
|
75
|
+
e && L();
|
|
76
|
+
}, { immediate: !0 }), { applyStatus: i, markPending: P, applyTemplate: (e, t) => {
|
|
77
|
+
const { html: o } = t;
|
|
78
|
+
return o ? (w(e), C(e, o, t.css ?? "")) : Promise.resolve(h);
|
|
44
79
|
}, applyTemplateDebounced: (e, t) => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
80
|
+
const { html: o } = t;
|
|
81
|
+
if (!o)
|
|
82
|
+
return Promise.resolve(h);
|
|
83
|
+
const s = t.css ?? "";
|
|
84
|
+
return new Promise((n) => {
|
|
85
|
+
w(e);
|
|
86
|
+
const f = setTimeout(() => {
|
|
87
|
+
p.delete(e), C(e, o, s).then(n);
|
|
88
|
+
}, K);
|
|
89
|
+
p.set(e, { timer: f, settle: n });
|
|
90
|
+
});
|
|
52
91
|
} };
|
|
53
|
-
},
|
|
54
|
-
|
|
92
|
+
}, ce = () => {
|
|
93
|
+
p.forEach((a) => {
|
|
94
|
+
clearTimeout(a.timer), a.settle(c);
|
|
95
|
+
}), p.clear(), r.forEach((a) => {
|
|
96
|
+
clearTimeout(a.timer), a.settle(c);
|
|
97
|
+
}), r.clear(), l.clear(), u.clear(), i.value = {};
|
|
55
98
|
};
|
|
56
99
|
export {
|
|
57
|
-
|
|
58
|
-
|
|
100
|
+
ce as resetEmailTemplateApplier,
|
|
101
|
+
ie as useEmailTemplateApplier
|
|
59
102
|
};
|
|
@@ -1,54 +1,59 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useEditorLock as
|
|
1
|
+
import { useActionsApi as v } from "./useActionsApi.js";
|
|
2
|
+
import { useEditorLock as C } from "./useEditorLock.js";
|
|
3
3
|
import { useConfigStore as T } from "../stores/config.js";
|
|
4
4
|
import { useEditorStore as w } from "../stores/editor.js";
|
|
5
5
|
import { useGuidoEmailEditorStore as y } from "../stores/guido-email-editor.js";
|
|
6
|
-
import { watch as
|
|
7
|
-
const
|
|
8
|
-
const i = w(), u = y(),
|
|
9
|
-
let o = null,
|
|
10
|
-
const
|
|
6
|
+
import { watch as c, onUnmounted as z } from "vue";
|
|
7
|
+
const B = 500, G = () => {
|
|
8
|
+
const i = w(), u = y(), d = T(), { getTemplateData: l } = v(), { runExclusive: m, isEditorBusy: p } = C();
|
|
9
|
+
let o = null, n = !1;
|
|
10
|
+
const r = () => {
|
|
11
11
|
o && (clearTimeout(o), o = null);
|
|
12
|
-
},
|
|
13
|
-
|
|
12
|
+
}, a = (t) => {
|
|
13
|
+
r(), o = setTimeout(() => {
|
|
14
14
|
o = null, t();
|
|
15
|
-
},
|
|
15
|
+
}, B);
|
|
16
16
|
}, e = async () => {
|
|
17
|
-
var t,
|
|
18
|
-
if (!(
|
|
17
|
+
var t, s;
|
|
18
|
+
if (!(n || !i.isStripoInitialized)) {
|
|
19
19
|
if (p()) {
|
|
20
|
-
|
|
20
|
+
a(() => void e());
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
try {
|
|
24
|
-
const { html: E, css:
|
|
25
|
-
if (
|
|
24
|
+
const { html: E, css: I } = await m(l), b = ((s = (t = d.config) == null ? void 0 : t.identity) == null ? void 0 : s.templateId) ?? "";
|
|
25
|
+
if (n)
|
|
26
26
|
return;
|
|
27
27
|
u.$patch({
|
|
28
28
|
html: E ?? "",
|
|
29
|
-
css:
|
|
30
|
-
templateId:
|
|
29
|
+
css: I ?? "",
|
|
30
|
+
templateId: b,
|
|
31
31
|
lastUpdatedAt: Date.now()
|
|
32
32
|
});
|
|
33
33
|
} catch {
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
}, f = () =>
|
|
36
|
+
}, f = () => a(() => void e()), h = c(
|
|
37
37
|
() => i.isStripoInitialized,
|
|
38
38
|
(t) => {
|
|
39
39
|
t && e();
|
|
40
40
|
},
|
|
41
41
|
{ immediate: !0 }
|
|
42
|
-
), S =
|
|
42
|
+
), S = c(
|
|
43
|
+
() => i.changeSeq,
|
|
44
|
+
() => {
|
|
45
|
+
i.isStripoInitialized && f();
|
|
46
|
+
}
|
|
47
|
+
), g = c(
|
|
43
48
|
() => i.hasChanges,
|
|
44
|
-
(t,
|
|
45
|
-
|
|
49
|
+
(t, s) => {
|
|
50
|
+
!t && s && i.isStripoInitialized && (r(), e());
|
|
46
51
|
}
|
|
47
52
|
);
|
|
48
|
-
|
|
49
|
-
|
|
53
|
+
z(() => {
|
|
54
|
+
n = !0, r(), h(), S(), g();
|
|
50
55
|
});
|
|
51
56
|
};
|
|
52
57
|
export {
|
|
53
|
-
|
|
58
|
+
G as useGuidoStateBridge
|
|
54
59
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useBlocksConfig as
|
|
3
|
-
import { useConfig as
|
|
1
|
+
import { useActionsApi as x } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as L } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as O } from "./useConfig.js";
|
|
4
4
|
import { useCustomInterfaceAppearance as H } from "./useCustomInterfaceAppearance.js";
|
|
5
5
|
import { useFullStoryBridge as N } from "./useFullStoryBridge.js";
|
|
6
6
|
import { useModuleRepair as j } from "./useModuleRepair.js";
|
|
@@ -17,7 +17,7 @@ import { buildMergeTagEntries as W, flattenDynamicContentList as Y } from "../ut
|
|
|
17
17
|
import Z from "../package.json.js";
|
|
18
18
|
let n = null;
|
|
19
19
|
const Ce = () => {
|
|
20
|
-
const { features: c, template: u, isFeatureEnabled: m } =
|
|
20
|
+
const { features: c, template: u, isFeatureEnabled: m } = O(), { handleError: p, showToaster: k } = G(), { getToken: B, getCustomFonts: M, getSyncModulesStatus: T } = K(), { handleEvent: v } = z(), { handleModuleAdd: F } = j(), { getStripoBlocksConfig: A } = L(), { getStripoNotifications: V } = $(), f = () => n || (n = new Promise((i, s) => {
|
|
21
21
|
var d;
|
|
22
22
|
if (document.getElementById("UiEditorScript")) {
|
|
23
23
|
i();
|
|
@@ -88,8 +88,8 @@ const Ce = () => {
|
|
|
88
88
|
},
|
|
89
89
|
onTemplateLoaded() {
|
|
90
90
|
try {
|
|
91
|
-
const { importCss: t } = H(), { activateCustomViewStyles: l, updateTimerInClonedTemplate: I } =
|
|
92
|
-
t(), l(),
|
|
91
|
+
const { importCss: t } = H(), { activateCustomViewStyles: l, updateTimerInClonedTemplate: I } = x(), { injectFullStory: q } = N();
|
|
92
|
+
t(), l(), q(), I(), o.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
|
|
93
93
|
e.hasChanges = !1;
|
|
94
94
|
}, 1e3);
|
|
95
95
|
} catch (t) {
|
|
@@ -106,7 +106,7 @@ const Ce = () => {
|
|
|
106
106
|
e.isVersionHistoryOpen = t;
|
|
107
107
|
},
|
|
108
108
|
onDataChanged() {
|
|
109
|
-
e.hasChanges = !0;
|
|
109
|
+
e.hasChanges = !0, e.changeSeq += 1;
|
|
110
110
|
},
|
|
111
111
|
onEvent: v,
|
|
112
112
|
onModuleAdd: F,
|
|
@@ -67,7 +67,7 @@ class se extends ut {
|
|
|
67
67
|
(d, c) => `
|
|
68
68
|
<div data-reorder-icon-key="${P}${c}" style="display: none;">
|
|
69
69
|
<${_.BUTTON}
|
|
70
|
-
class="drag-handle-btn flat-inline flat-white"
|
|
70
|
+
class="guido-drag-handle-btn flat-inline flat-white"
|
|
71
71
|
${O.BUTTON.name}="${P}${c}"
|
|
72
72
|
>
|
|
73
73
|
<${_.ICON}
|
|
@@ -328,7 +328,7 @@ class se extends ut {
|
|
|
328
328
|
_createBuiltInItemHtml(t, e) {
|
|
329
329
|
return `
|
|
330
330
|
<div class="orderable-item" draggable="true" data-key="${t.key}">
|
|
331
|
-
<span class="drag-handle" data-reorder-icon-slot="${e}"></span>
|
|
331
|
+
<span class="guido-drag-handle" data-reorder-icon-slot="${e}"></span>
|
|
332
332
|
<span class="item-label">${this.api.translate(t.label)}</span>
|
|
333
333
|
<div class="item-action" data-action-for="${t.key}"></div>
|
|
334
334
|
</div>
|
|
@@ -353,7 +353,7 @@ class se extends ut {
|
|
|
353
353
|
<div class="orderable-item price-group-item" draggable="true"
|
|
354
354
|
data-key="${C}" data-group="prices">
|
|
355
355
|
<div class="price-group-header">
|
|
356
|
-
<span class="drag-handle" data-reorder-icon-slot="${t}"></span>
|
|
356
|
+
<span class="guido-drag-handle" data-reorder-icon-slot="${t}"></span>
|
|
357
357
|
<span class="item-label">${this.api.translate("Product Prices")}</span>
|
|
358
358
|
<div class="item-action" data-action-for="${C}"></div>
|
|
359
359
|
</div>
|
|
@@ -365,7 +365,7 @@ class se extends ut {
|
|
|
365
365
|
return `
|
|
366
366
|
<div class="orderable-item" draggable="true"
|
|
367
367
|
data-key="${t}" data-custom-index="${e}">
|
|
368
|
-
<span class="drag-handle" data-reorder-icon-slot="${r}"></span>
|
|
368
|
+
<span class="guido-drag-handle" data-reorder-icon-slot="${r}"></span>
|
|
369
369
|
<div class="custom-attr-select-wrap"
|
|
370
370
|
data-custom-select-slot="${e}"></div>
|
|
371
371
|
<div class="item-action"
|
|
@@ -134,7 +134,10 @@ ue-orderable.orderable-disabled .droppable-icon {
|
|
|
134
134
|
border-top: 2px solid var(--guido-color-primary-500, #0A2ECC);
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
/* Namespaced: Stripo ships a global \`.drag-handle { position: absolute }\` for its
|
|
138
|
+
floating popups, which knocked this handle out of flow (SD-151734). */
|
|
139
|
+
.guido-drag-handle {
|
|
140
|
+
cursor: move;
|
|
138
141
|
user-select: none;
|
|
139
142
|
display: flex;
|
|
140
143
|
align-items: center;
|
|
@@ -144,13 +147,13 @@ ue-orderable.orderable-disabled .droppable-icon {
|
|
|
144
147
|
flex-shrink: 0;
|
|
145
148
|
}
|
|
146
149
|
|
|
147
|
-
.drag-handle .drag-handle-btn .button {
|
|
150
|
+
.guido-drag-handle .guido-drag-handle-btn .button {
|
|
148
151
|
padding: 0;
|
|
149
152
|
min-width: auto;
|
|
150
153
|
cursor: move;
|
|
151
154
|
}
|
|
152
155
|
|
|
153
|
-
.drag-handle .drag-handle-btn .button .icon-button {
|
|
156
|
+
.guido-drag-handle .guido-drag-handle-btn .button .icon-button {
|
|
154
157
|
color: var(--guido-color-gray-600);
|
|
155
158
|
}
|
|
156
159
|
|
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-7674b645]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-7674b645]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-7674b645]{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}
|
package/dist/library.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
import { MessageType as
|
|
1
|
+
import { default as a } from "./components/Guido.vue.js";
|
|
2
|
+
import { MessageType as t, ProductType as d } from "./@types/config/schemas.js";
|
|
3
3
|
import "./@types/config/defaults.js";
|
|
4
|
-
import { getValidationErrors as
|
|
5
|
-
import { assignTrackingIds as
|
|
4
|
+
import { getValidationErrors as s, isValidConfig as p, parseConfig as g, parseConfigSafe as m, validateConfig as n } from "./@types/config/validator.js";
|
|
5
|
+
import { assignTrackingIds as u, readTrackFloor as x, readTrackSeq as T } from "./utils/linkTrackingIds.js";
|
|
6
|
+
import { useGuidoEmailEditorStore as C } from "./stores/guido-email-editor.js";
|
|
6
7
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
a as Guido,
|
|
9
|
+
t as MessageType,
|
|
10
|
+
d as ProductType,
|
|
11
|
+
u as assignTrackingIds,
|
|
12
|
+
s as getValidationErrors,
|
|
12
13
|
p as isValidConfig,
|
|
13
14
|
g as parseConfig,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
m as parseConfigSafe,
|
|
16
|
+
x as readTrackFloor,
|
|
17
|
+
T as readTrackSeq,
|
|
18
|
+
C as useGuidoEmailEditorStore,
|
|
19
|
+
n as validateConfig
|
|
18
20
|
};
|
package/dist/package.json.js
CHANGED
|
@@ -17,12 +17,13 @@
|
|
|
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 public store, so
|
|
21
|
+
* cortex can move its Apply button on the truth of the editor write rather than
|
|
22
|
+
* on the click.
|
|
23
|
+
*
|
|
20
24
|
* In dev (`import.meta.env.DEV`) every observed segment + message-level flag
|
|
21
25
|
* change is also `console.debug`-logged with the prefix `[guido:cortex]` so a
|
|
22
26
|
* developer can watch the agent stream in real time. In production this is
|
|
23
27
|
* gated behind `localStorage.guido:debug:ai === '1'`.
|
|
24
|
-
*
|
|
25
|
-
* 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).
|
|
27
28
|
*/
|
|
28
29
|
export declare const useCortexBlueprintBridge: () => void;
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
type ApplyStatus = 'pending' | 'applying' | 'applied' | 'failed';
|
|
2
|
+
/**
|
|
3
|
+
* Terminal outcome of an apply. Every promise this composable hands out settles
|
|
4
|
+
* with exactly one of these — callers (the cortex bridge) ack on it, so a
|
|
5
|
+
* never-settling promise would strand cortex's Apply button forever.
|
|
6
|
+
*
|
|
7
|
+
* `superseded` means a newer payload for the same blueprint replaced this one:
|
|
8
|
+
* not a success, not a failure, and deliberately never acked.
|
|
9
|
+
*/
|
|
10
|
+
export type ApplyOutcome = {
|
|
11
|
+
status: 'applied';
|
|
12
|
+
} | {
|
|
13
|
+
status: 'failed';
|
|
14
|
+
error: unknown;
|
|
15
|
+
} | {
|
|
16
|
+
status: 'superseded';
|
|
17
|
+
};
|
|
2
18
|
/**
|
|
3
19
|
* Applies email_template blueprints from the chat agent to the Stripo editor.
|
|
4
20
|
*
|
|
@@ -9,6 +25,10 @@ type ApplyStatus = 'pending' | 'applying' | 'applied' | 'failed';
|
|
|
9
25
|
* - manual Apply click (first apply): immediate.
|
|
10
26
|
* - blueprint_update after the user has applied once: debounced 250 ms trailing
|
|
11
27
|
* so rapid mid-stream updates don't thrash updateHtmlAndCss.
|
|
28
|
+
*
|
|
29
|
+
* A click that lands before Stripo finished initializing is queued rather than
|
|
30
|
+
* dropped, and flushed when `isStripoInitialized` flips — the user does not
|
|
31
|
+
* have to click again.
|
|
12
32
|
*/
|
|
13
33
|
export declare const useEmailTemplateApplier: () => {
|
|
14
34
|
applyStatus: import("vue").Ref<Record<string, ApplyStatus>>;
|
|
@@ -16,11 +36,11 @@ export declare const useEmailTemplateApplier: () => {
|
|
|
16
36
|
applyTemplate: (blueprintId: string, data: {
|
|
17
37
|
html?: string;
|
|
18
38
|
css?: string;
|
|
19
|
-
}) =>
|
|
39
|
+
}) => Promise<ApplyOutcome>;
|
|
20
40
|
applyTemplateDebounced: (blueprintId: string, data: {
|
|
21
41
|
html?: string;
|
|
22
42
|
css?: string;
|
|
23
|
-
}) =>
|
|
43
|
+
}) => Promise<ApplyOutcome>;
|
|
24
44
|
};
|
|
25
45
|
export declare const resetEmailTemplateApplier: () => void;
|
|
26
46
|
export {};
|
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Outbound bridge — publishes the current editor's html/css to the shared
|
|
3
|
-
* Pinia store `guidoEmailEditor
|
|
4
|
-
*
|
|
3
|
+
* Pinia store `guidoEmailEditor`. cortex-fe reads it at chat-stream submit
|
|
4
|
+
* time and forwards it as `clientState.editor`, which is what enables
|
|
5
5
|
* sub-case 1.3 (refine an already-loaded template via the email-agent).
|
|
6
6
|
*
|
|
7
7
|
* The bridge writes on three triggers:
|
|
8
8
|
*
|
|
9
9
|
* 1. Stripo finishes initializing — first snapshot.
|
|
10
|
-
* 2.
|
|
11
|
-
* Stripo edit doesn't thrash the store.
|
|
10
|
+
* 2. Every document change, via the `changeSeq` counter — debounced 500 ms
|
|
11
|
+
* so a streaming Stripo edit doesn't thrash the store.
|
|
12
12
|
* 3. Editor `hasChanges` flips back to false (post-save / autosave) —
|
|
13
13
|
* immediate, since this is the canonical "saved" snapshot.
|
|
14
14
|
*
|
|
15
15
|
* `getTemplateData()` is a Stripo iframe call; it must not run before
|
|
16
16
|
* `isStripoInitialized` is true. The bridge guards against that.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* The store is written even with no reader attached — it has zero overhead,
|
|
19
|
+
* and a late reader still finds consistent state.
|
|
20
|
+
*
|
|
21
|
+
* Readers are not optional any more, so treat the publish timing as part of
|
|
22
|
+
* the contract: the store ships as `@useinsider/guido/editor-state`, and
|
|
23
|
+
* email-fe imports it to scan the live html for its Array of Objects lock.
|
|
24
|
+
* Weakening a trigger here silently breaks that lock in the consumer.
|
|
21
25
|
*/
|
|
22
26
|
export declare const useGuidoStateBridge: () => void;
|
package/dist/src/library.d.ts
CHANGED
|
@@ -2,5 +2,7 @@ export { default as Guido } from './components/Guido.vue';
|
|
|
2
2
|
export type { GuidoConfig, GuidoConfigInput, IdentityConfig, PartnerConfig, TemplateConfig, TemplateMigrationConfig, LegacyRecommendationConfig, EditorConfig, UIConfig, FeaturesConfig, BlocksConfig, CompilerConfig, DynamicContent, EmailHeader, DefaultBlockType, CustomBlockType, ValidationResult, ValidationError, } from './@types/config';
|
|
3
3
|
export { validateConfig, parseConfig, parseConfigSafe, isValidConfig, getValidationErrors, MessageType, ProductType, } from './@types/config';
|
|
4
4
|
export { assignTrackingIds, readTrackFloor, readTrackSeq } from './public/trackingIds';
|
|
5
|
+
export { useGuidoEmailEditorStore } from './public/editorState';
|
|
6
|
+
export type { GuidoEmailEditorState } from './public/editorState';
|
|
5
7
|
export type { StripoEventType } from './@types/events';
|
|
6
8
|
export type { PositionData, DynamicContentEvent, MergeTagClickEvent, MergeTag, BaseDynamicContent, DynamicContentNode, DynamicContentList, TooltipOptions, TextValueObject, L10n, } from './@types/generic';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Published as `@useinsider/guido/editor-state` — the live editor snapshot Guido
|
|
3
|
+
* writes into the host's shared Pinia singleton.
|
|
4
|
+
*
|
|
5
|
+
* Importing from here pulls in nothing but pinia, so the editor never enters a
|
|
6
|
+
* consumer's module graph. Re-export surface only: this is the contract,
|
|
7
|
+
* `stores/guido-email-editor` is the implementation and stays free to move.
|
|
8
|
+
*
|
|
9
|
+
* Consumers read the store by importing it; the id `guidoEmailEditor` remains
|
|
10
|
+
* part of the contract for cortex-fe, which probes `pinia._s` at runtime instead
|
|
11
|
+
* of taking a build-time dependency on this package.
|
|
12
|
+
*/
|
|
13
|
+
export { useGuidoEmailEditorStore } from '../stores/guido-email-editor';
|
|
14
|
+
export type { GuidoEmailEditorState } from '../stores/guido-email-editor';
|
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
* Importing from here pulls in nothing else, so the editor never enters a
|
|
5
5
|
* consumer's module graph. Re-export surface only: this is the contract,
|
|
6
6
|
* `utils/linkTrackingIds` is the implementation and stays free to move.
|
|
7
|
+
*
|
|
8
|
+
* Relative, not the `@@/Utils/` alias: vue-tsc copies the specifier into the emitted
|
|
9
|
+
* .d.ts verbatim, and a consumer's TypeScript cannot resolve our alias table. A relative
|
|
10
|
+
* path resolves against dist/src/, so the published types actually load.
|
|
7
11
|
*/
|
|
8
|
-
export { assignTrackingIds, readTrackFloor, readTrackSeq, TRACK_ID_ATTRIBUTE, TRACK_SEQ_ATTRIBUTE, } from '
|
|
9
|
-
export type { TrackingIdResult } from '
|
|
12
|
+
export { assignTrackingIds, readTrackFloor, readTrackSeq, TRACK_ID_ATTRIBUTE, TRACK_SEQ_ATTRIBUTE, } from '../utils/linkTrackingIds';
|
|
13
|
+
export type { TrackingIdResult } from '../utils/linkTrackingIds';
|