@useinsider/guido 3.9.0-beta.fd95a10 → 3.9.1-beta.5af6229
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/organisms/header/EditorToolbar.vue.js +2 -2
- package/dist/components/organisms/header/EditorToolbar.vue2.js +6 -7
- package/dist/composables/useCortexBlueprintBridge.js +41 -58
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +118 -110
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +15 -15
- package/dist/guido.css +1 -1
- package/package.json +1 -1
- package/dist/components/organisms/header/AiStatusPill.vue.js +0 -18
- package/dist/components/organisms/header/AiStatusPill.vue2.js +0 -17
- package/dist/composables/useAiStatus.js +0 -12
- package/dist/src/components/organisms/header/AiStatusPill.vue.d.ts +0 -2
- package/dist/src/composables/useAiStatus.d.ts +0 -25
- package/dist/src/stores/ai-status.d.ts +0 -24
- package/dist/stores/ai-status.js +0 -15
|
@@ -3,14 +3,14 @@ import i from "./EditorToolbar.vue2.js";
|
|
|
3
3
|
import s from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var n = function() {
|
|
5
5
|
var e = this, o = e._self._c, t = e._self._setupProxy;
|
|
6
|
-
return o("div", { staticClass: "d-f editor-toolbar" }, [o(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isUndoButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__undo-button"), "tooltip-text": t.trans("action-builder.undo") } }), o(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isRedoButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__redo-button"), "tooltip-text": t.trans("action-builder.redo") } }), o(t.InButtonV2, { attrs: { id: "guido__code-button", "data-testid": "Code Editor", "left-icon": "line-code", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isCodeEditorButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isCodeEditorOpen, "tooltip-options": t.getTooltipOptions("guido__code-button"), "tooltip-text": t.codeEditorTooltipText } }), o(t.InButtonV2, { attrs: { id: "guido__preview-button", "left-icon": "line-show-on", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isPreviewButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isPreviewModeOpen, "tooltip-options": t.getTooltipOptions("guido__preview-button"), "tooltip-text": t.previewTooltipText }, on: { click: t.handlePreviewToggle } }), o(t.ViewOptions, { staticClass: "ml-2" })
|
|
6
|
+
return o("div", { staticClass: "d-f editor-toolbar" }, [o(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isUndoButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__undo-button"), "tooltip-text": t.trans("action-builder.undo") } }), o(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isRedoButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__redo-button"), "tooltip-text": t.trans("action-builder.redo") } }), o(t.InButtonV2, { attrs: { id: "guido__code-button", "data-testid": "Code Editor", "left-icon": "line-code", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isCodeEditorButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isCodeEditorOpen, "tooltip-options": t.getTooltipOptions("guido__code-button"), "tooltip-text": t.codeEditorTooltipText } }), o(t.InButtonV2, { attrs: { id: "guido__preview-button", "left-icon": "line-show-on", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isPreviewButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isPreviewModeOpen, "tooltip-options": t.getTooltipOptions("guido__preview-button"), "tooltip-text": t.previewTooltipText }, on: { click: t.handlePreviewToggle } }), o(t.ViewOptions, { staticClass: "ml-2" })], 1);
|
|
7
7
|
}, d = [], l = /* @__PURE__ */ s(
|
|
8
8
|
i,
|
|
9
9
|
n,
|
|
10
10
|
d,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
|
-
"
|
|
13
|
+
"173c3a40"
|
|
14
14
|
);
|
|
15
15
|
const _ = l.exports;
|
|
16
16
|
export {
|
|
@@ -4,15 +4,14 @@ import { useTranslations as l } from "../../../composables/useTranslations.js";
|
|
|
4
4
|
import { useEditorStore as d } from "../../../stores/editor.js";
|
|
5
5
|
import { getTooltipOptions as w } from "../../../utils/tooltipUtils.js";
|
|
6
6
|
import { InButtonV2 as c } from "@useinsider/design-system-vue";
|
|
7
|
-
import a from "./
|
|
8
|
-
|
|
9
|
-
const x = /* @__PURE__ */ p({
|
|
7
|
+
import a from "./ViewOptions.vue.js";
|
|
8
|
+
const h = /* @__PURE__ */ p({
|
|
10
9
|
__name: "EditorToolbar",
|
|
11
|
-
setup(
|
|
12
|
-
const o = d(), e = l(), { openPreviewMode: t, closePreviewMode: r } = m(),
|
|
13
|
-
return { __sfc: !0, editorStore: o, trans: e, openPreviewMode: t, closePreviewMode: r, previewTooltipText:
|
|
10
|
+
setup(f) {
|
|
11
|
+
const o = d(), e = l(), { openPreviewMode: t, closePreviewMode: r } = m(), n = i(() => o.isPreviewModeOpen ? e("newsletter.close-email-preview") : e("newsletter.email-preview")), s = i(() => o.isCodeEditorOpen ? e("newsletter.close-html-editor") : e("newsletter.html-editor"));
|
|
12
|
+
return { __sfc: !0, editorStore: o, trans: e, openPreviewMode: t, closePreviewMode: r, previewTooltipText: n, codeEditorTooltipText: s, handlePreviewToggle: () => o.isPreviewModeOpen ? r() : t(), getTooltipOptions: w, InButtonV2: c, ViewOptions: a };
|
|
14
13
|
}
|
|
15
14
|
});
|
|
16
15
|
export {
|
|
17
|
-
|
|
16
|
+
h as default
|
|
18
17
|
};
|
|
@@ -1,83 +1,66 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
const C = "email_template", G = "chat", R = "guido:debug:ai", U = /* @__PURE__ */ new Set(["done", "error", "cancelled"]), Y = () => {
|
|
1
|
+
import { useEmailTemplateApplier as m, resetEmailTemplateApplier as w } from "./useEmailTemplateApplier.js";
|
|
2
|
+
import { useToaster as _ } from "./useToaster.js";
|
|
3
|
+
import { useTranslations as I } from "./useTranslations.js";
|
|
4
|
+
import { ToasterTypeOptions as S } from "../enums/toaster.js";
|
|
5
|
+
import { getActivePinia as v } from "pinia";
|
|
6
|
+
import { watch as B, onUnmounted as D } from "vue";
|
|
7
|
+
const P = "email_template", x = "chat", L = "guido:debug:ai", M = () => {
|
|
9
8
|
if (typeof window > "u")
|
|
10
9
|
return !1;
|
|
11
10
|
try {
|
|
12
|
-
return window.localStorage.getItem(
|
|
11
|
+
return window.localStorage.getItem(L) === "1";
|
|
13
12
|
} catch {
|
|
14
13
|
return !1;
|
|
15
14
|
}
|
|
16
|
-
},
|
|
17
|
-
const
|
|
18
|
-
if (!
|
|
15
|
+
}, O = () => {
|
|
16
|
+
const a = v();
|
|
17
|
+
if (!a)
|
|
19
18
|
return;
|
|
20
|
-
const
|
|
19
|
+
const l = a._s, p = l == null ? void 0 : l.get(x);
|
|
21
20
|
if (!p)
|
|
22
21
|
return;
|
|
23
|
-
const { applyTemplate:
|
|
24
|
-
const
|
|
25
|
-
return
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
if (
|
|
22
|
+
const { applyTemplate: d, applyTemplateDebounced: f } = m(), { showToaster: T } = _(), h = I(), A = (e, t) => {
|
|
23
|
+
const r = h(e);
|
|
24
|
+
return r === e ? t : r;
|
|
25
|
+
}, i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set(), u = M(), E = (e, t) => {
|
|
26
|
+
u && console.debug(`[guido:cortex] msg=${e ?? "?"} type=${(t == null ? void 0 : t.type) ?? "?"}`, t);
|
|
27
|
+
}, y = (e) => {
|
|
28
|
+
if (e.blueprintType !== P)
|
|
30
29
|
return;
|
|
31
|
-
const t =
|
|
32
|
-
if (!t || !(
|
|
30
|
+
const t = e.blueprintId, r = e.blueprintData;
|
|
31
|
+
if (!t || !(r != null && r.html))
|
|
33
32
|
return;
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
type:
|
|
38
|
-
message:
|
|
39
|
-
}), !0),
|
|
40
|
-
const t = r.toolName ?? r.name ?? r.tool;
|
|
41
|
-
return typeof t == "string" ? t : "";
|
|
42
|
-
}, _ = (r) => {
|
|
43
|
-
const t = r[r.length - 1];
|
|
44
|
-
if (!t) {
|
|
45
|
-
l.stop();
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
const e = Array.isArray(t.segments) ? t.segments : [];
|
|
49
|
-
if (t.isError === !0 || t.isCancelled === !0 || e.some((i) => !!i && U.has(i.type ?? ""))) {
|
|
50
|
-
l.stop();
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const o = [...e].reverse().find((i) => (i == null ? void 0 : i.type) === "tool_call");
|
|
54
|
-
o && l.start(S(o));
|
|
55
|
-
}, w = N(
|
|
33
|
+
const o = i.get(t);
|
|
34
|
+
o === void 0 ? (i.set(t, r.html), d(t, r)) : o !== r.html && (i.set(t, r.html), f(t, r));
|
|
35
|
+
}, s = (e) => e === void 0 || c.has(e) ? !1 : (c.add(e), T({
|
|
36
|
+
type: S.Alert,
|
|
37
|
+
message: A("newsletter.ai-template-failed", "AI couldn't generate the template. Please try again.")
|
|
38
|
+
}), !0), b = B(
|
|
56
39
|
() => p.messages,
|
|
57
|
-
(
|
|
58
|
-
Array.isArray(
|
|
59
|
-
const
|
|
60
|
-
(t == null ? void 0 : t.isError) === !0 &&
|
|
61
|
-
const
|
|
62
|
-
Array.isArray(
|
|
63
|
-
if (
|
|
64
|
-
switch (
|
|
40
|
+
(e) => {
|
|
41
|
+
Array.isArray(e) && e.forEach((t) => {
|
|
42
|
+
const r = t == null ? void 0 : t.id;
|
|
43
|
+
(t == null ? void 0 : t.isError) === !0 && s(r) && u && console.debug(`[guido:cortex] message-level error id=${r}`, t);
|
|
44
|
+
const o = t == null ? void 0 : t.segments;
|
|
45
|
+
Array.isArray(o) && o.forEach((n) => {
|
|
46
|
+
if (n)
|
|
47
|
+
switch (E(r, n), n.type) {
|
|
65
48
|
case "blueprint":
|
|
66
|
-
|
|
49
|
+
y(n);
|
|
67
50
|
break;
|
|
68
51
|
case "error":
|
|
69
|
-
|
|
52
|
+
s(r);
|
|
70
53
|
break;
|
|
71
54
|
}
|
|
72
55
|
});
|
|
73
|
-
})
|
|
56
|
+
});
|
|
74
57
|
},
|
|
75
58
|
{ deep: !0, immediate: !0 }
|
|
76
59
|
);
|
|
77
|
-
|
|
78
|
-
|
|
60
|
+
D(() => {
|
|
61
|
+
b(), i.clear(), c.clear(), w();
|
|
79
62
|
});
|
|
80
63
|
};
|
|
81
64
|
export {
|
|
82
|
-
|
|
65
|
+
O as useCortexBlueprintBridge
|
|
83
66
|
};
|
|
@@ -1,181 +1,189 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import { useRecommendation as
|
|
3
|
-
import { CSS_CLASS_RECO_BUTTON as
|
|
4
|
-
import { useRecommendationExtensionStore as
|
|
5
|
-
import { isIgnoredRecommendationBlock as
|
|
6
|
-
function
|
|
7
|
-
const i = `{{${
|
|
8
|
-
return
|
|
1
|
+
import { useConfig as q } from "../../../composables/useConfig.js";
|
|
2
|
+
import { useRecommendation as C } from "../../../composables/useRecommendation.js";
|
|
3
|
+
import { CSS_CLASS_RECO_BUTTON as E } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
|
|
4
|
+
import { useRecommendationExtensionStore as w } from "../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
5
|
+
import { isIgnoredRecommendationBlock as P } from "./recommendationIgnoreUtils.js";
|
|
6
|
+
function f(t, o, e, n, s = "") {
|
|
7
|
+
const i = `{{${s}${t}_${o}_${e}}}`, r = `{{${s}${t}_${o}_currency}}`;
|
|
8
|
+
return n === "before" ? `${r} ${i}` : `${i} ${r}`;
|
|
9
9
|
}
|
|
10
|
-
function m(
|
|
11
|
-
let
|
|
12
|
-
for (;
|
|
13
|
-
[
|
|
14
|
-
return
|
|
10
|
+
function m(t) {
|
|
11
|
+
let o = t;
|
|
12
|
+
for (; o.children.length === 1; )
|
|
13
|
+
[o] = o.children;
|
|
14
|
+
return o;
|
|
15
15
|
}
|
|
16
|
-
function h(
|
|
17
|
-
switch (
|
|
16
|
+
function h(t, o, e, n, s, i) {
|
|
17
|
+
switch (o) {
|
|
18
18
|
case "productImage": {
|
|
19
|
-
const r =
|
|
20
|
-
r && (r.setAttribute("src", `{{${i}${
|
|
21
|
-
const
|
|
22
|
-
|
|
19
|
+
const r = t.querySelector("img");
|
|
20
|
+
r && (r.setAttribute("src", `{{${i}${e}_${n}_image_url}}`), r.setAttribute("alt", `{{${i}${e}_${n}_name}}`));
|
|
21
|
+
const c = t.querySelector("a");
|
|
22
|
+
c && (c.setAttribute("href", `{{${i}${e}_${n}_url}}`), c.classList.add(E));
|
|
23
23
|
break;
|
|
24
24
|
}
|
|
25
25
|
case "productName": {
|
|
26
|
-
const r =
|
|
27
|
-
r && (m(r).textContent = `{{${i}${
|
|
26
|
+
const r = t.querySelector("p");
|
|
27
|
+
r && (m(r).textContent = `{{${i}${e}_${n}_name}}`);
|
|
28
28
|
break;
|
|
29
29
|
}
|
|
30
30
|
case "productPrice": {
|
|
31
|
-
const r =
|
|
32
|
-
r && (m(r).textContent =
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
const r = t.querySelector(".product-price p") ?? t.querySelector("p");
|
|
32
|
+
r && (m(r).textContent = f(
|
|
33
|
+
e,
|
|
34
|
+
n,
|
|
35
35
|
"price",
|
|
36
|
-
|
|
36
|
+
s,
|
|
37
37
|
i
|
|
38
38
|
));
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
const c = t.querySelector(".product-old-price p");
|
|
40
|
+
c && (m(c).textContent = f(
|
|
41
|
+
e,
|
|
42
|
+
n,
|
|
43
43
|
"original_price",
|
|
44
|
-
|
|
44
|
+
s,
|
|
45
45
|
i
|
|
46
46
|
));
|
|
47
47
|
break;
|
|
48
48
|
}
|
|
49
49
|
case "productOldPrice": {
|
|
50
|
-
const r =
|
|
51
|
-
r && (m(r).textContent =
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
const r = t.querySelector("p");
|
|
51
|
+
r && (m(r).textContent = f(
|
|
52
|
+
e,
|
|
53
|
+
n,
|
|
54
54
|
"original_price",
|
|
55
|
-
|
|
55
|
+
s,
|
|
56
56
|
i
|
|
57
57
|
));
|
|
58
58
|
break;
|
|
59
59
|
}
|
|
60
60
|
case "productButton": {
|
|
61
|
-
const r =
|
|
62
|
-
r && r.setAttribute("href", `{{${i}${
|
|
61
|
+
const r = t.querySelector("a");
|
|
62
|
+
r && r.setAttribute("href", `{{${i}${e}_${n}_url}}`);
|
|
63
63
|
break;
|
|
64
64
|
}
|
|
65
65
|
case "productOmnibusPrice": {
|
|
66
|
-
const r =
|
|
66
|
+
const r = t.querySelector(".omnibus-price-value");
|
|
67
67
|
if (r) {
|
|
68
|
-
r.textContent = `{{${i}${
|
|
69
|
-
const
|
|
70
|
-
|
|
68
|
+
r.textContent = `{{${i}${e}_${n}_omnibus_price}}`;
|
|
69
|
+
const c = r.closest("p");
|
|
70
|
+
c && (c.setAttribute("product-attr", "omnibus_price"), c.setAttribute("composition", "true"));
|
|
71
71
|
}
|
|
72
72
|
break;
|
|
73
73
|
}
|
|
74
74
|
case "productOmnibusDiscount": {
|
|
75
|
-
const r =
|
|
75
|
+
const r = t.querySelector(".omnibus-discount-value");
|
|
76
76
|
if (r) {
|
|
77
|
-
r.textContent = `{{${i}${
|
|
78
|
-
const
|
|
79
|
-
|
|
77
|
+
r.textContent = `{{${i}${e}_${n}_omnibus_discount}}`;
|
|
78
|
+
const c = r.closest("p");
|
|
79
|
+
c && (c.setAttribute("product-attr", "omnibus_discount"), c.setAttribute("composition", "true"));
|
|
80
80
|
}
|
|
81
81
|
break;
|
|
82
82
|
}
|
|
83
83
|
default: {
|
|
84
|
-
const r =
|
|
84
|
+
const r = t.getAttribute("product-attr") ? t : t.querySelector("[product-attr]");
|
|
85
85
|
if (r) {
|
|
86
|
-
const
|
|
87
|
-
|
|
86
|
+
const c = r.getAttribute("product-attr"), l = r.querySelector("p");
|
|
87
|
+
l && (m(l).textContent = `{{${i}${e}_${n}_${c}}}`);
|
|
88
88
|
}
|
|
89
89
|
break;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
|
|
95
|
-
i.querySelectorAll("[data-attribute-type]").forEach((
|
|
96
|
-
const u =
|
|
97
|
-
p.length > 0 ? p.forEach((
|
|
98
|
-
h(
|
|
99
|
-
}) : h(
|
|
93
|
+
function R(t, o, e, n) {
|
|
94
|
+
t.querySelectorAll(".recommendation-product-row").forEach((i, r) => {
|
|
95
|
+
i.querySelectorAll("[data-attribute-type]").forEach((l) => {
|
|
96
|
+
const u = l.getAttribute("data-attribute-type") || "", p = l.querySelectorAll(".attribute-cell");
|
|
97
|
+
p.length > 0 ? p.forEach((a) => {
|
|
98
|
+
h(a, u, o, r, e, n);
|
|
99
|
+
}) : h(l, u, o, r, e, n);
|
|
100
100
|
});
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
|
-
function
|
|
104
|
-
const
|
|
105
|
-
if (!
|
|
103
|
+
function W(t, o, e, n) {
|
|
104
|
+
const s = t.querySelectorAll(".recommendation-product-row");
|
|
105
|
+
if (!s.length)
|
|
106
106
|
return;
|
|
107
|
-
const [i] =
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
const d =
|
|
111
|
-
|
|
112
|
-
const
|
|
113
|
-
h(
|
|
107
|
+
const [i] = s, r = i.querySelector("[data-attribute-type]"), c = r ? r.querySelectorAll(".attribute-cell").length : 1;
|
|
108
|
+
s.forEach((l, u) => {
|
|
109
|
+
l.querySelectorAll("[data-attribute-type]").forEach((a) => {
|
|
110
|
+
const d = a.getAttribute("data-attribute-type") || "";
|
|
111
|
+
a.querySelectorAll(".attribute-cell").forEach((S, _) => {
|
|
112
|
+
const g = u * c + _;
|
|
113
|
+
h(S, d, o, g, e, n);
|
|
114
114
|
});
|
|
115
115
|
});
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
|
-
function
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
function v(t, o, e, n) {
|
|
119
|
+
t.querySelectorAll(".ins-recommendation-product-container").forEach((i) => {
|
|
120
|
+
W(i, o, e, n);
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
|
-
function O(
|
|
124
|
-
const
|
|
125
|
-
|
|
123
|
+
function O(t, o, e) {
|
|
124
|
+
const n = t.getAttribute("data-layout") || "grid", s = t.getAttribute("currency-alignment") || "after";
|
|
125
|
+
n === "list" ? R(t, o, s, e) : v(t, o, s, e);
|
|
126
126
|
}
|
|
127
|
-
function
|
|
128
|
-
const
|
|
129
|
-
return
|
|
127
|
+
function b(t, o, e) {
|
|
128
|
+
const n = new RegExp(`${o}\\s*:\\s*(\\d+)\\s*px`, "i"), s = t.match(n);
|
|
129
|
+
return s ? parseInt(s[1]) : e;
|
|
130
130
|
}
|
|
131
|
-
function
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
131
|
+
function A(t) {
|
|
132
|
+
const o = t.trim();
|
|
133
|
+
return o.endsWith("%") ? parseFloat(o) < 100 : /^\d+(?:\.\d+)?(?:px)?$/.test(o) && parseInt(o) > 0;
|
|
134
|
+
}
|
|
135
|
+
function $(t) {
|
|
136
|
+
const o = t.getAttribute("width");
|
|
137
|
+
if (o && A(o))
|
|
138
|
+
return o.trim();
|
|
139
|
+
const e = (t.getAttribute("style") || "").match(/(?:^|[;\s])width\s*:\s*(\d+(?:\.\d+)?(?:px|%))/i);
|
|
140
|
+
return e && A(e[1]) ? e[1] : null;
|
|
141
|
+
}
|
|
142
|
+
function T(t, o) {
|
|
143
|
+
let e = t.parentElement;
|
|
144
|
+
for (; e && e !== o; ) {
|
|
145
|
+
if (e.tagName === "TD" && $(e))
|
|
146
|
+
return e;
|
|
147
|
+
e = e.parentElement;
|
|
140
148
|
}
|
|
141
149
|
return null;
|
|
142
150
|
}
|
|
143
|
-
function
|
|
144
|
-
const
|
|
145
|
-
|
|
151
|
+
function M(t) {
|
|
152
|
+
const o = t.getAttribute("style") || "", e = b(o, "width", 600), n = b(o, "padding", 0) * 2, s = Math.max(0, e - n);
|
|
153
|
+
s !== 0 && t.querySelectorAll("img.adapt-img").forEach((i) => {
|
|
146
154
|
if (i.hasAttribute("width"))
|
|
147
155
|
return;
|
|
148
|
-
const r = T(i,
|
|
156
|
+
const r = T(i, t);
|
|
149
157
|
if (!r)
|
|
150
158
|
return;
|
|
151
|
-
const
|
|
152
|
-
i.setAttribute("width", String(
|
|
153
|
-
const
|
|
154
|
-
if (!/\bwidth\s*:\s*\d/i.test(
|
|
155
|
-
const
|
|
156
|
-
i.setAttribute("style", `${
|
|
159
|
+
const c = $(r), l = b(r.getAttribute("style") || "", "padding", 0) * 2, u = c.endsWith("%") ? Math.floor(s * parseFloat(c) / 100) : parseInt(c), p = Math.max(1, u - l);
|
|
160
|
+
i.setAttribute("width", String(p));
|
|
161
|
+
const a = i.getAttribute("style") || "";
|
|
162
|
+
if (!/\bwidth\s*:\s*\d/i.test(a)) {
|
|
163
|
+
const d = a && !a.trim().endsWith(";") ? "; " : "";
|
|
164
|
+
i.setAttribute("style", `${a}${d}width: ${p}px`);
|
|
157
165
|
}
|
|
158
166
|
});
|
|
159
167
|
}
|
|
160
|
-
function
|
|
161
|
-
const
|
|
162
|
-
return (
|
|
163
|
-
` : "") +
|
|
168
|
+
function B(t, o) {
|
|
169
|
+
const e = t.match(/<!DOCTYPE[^>]*>/i);
|
|
170
|
+
return (e ? `${e[0]}
|
|
171
|
+
` : "") + o.documentElement.outerHTML;
|
|
164
172
|
}
|
|
165
|
-
function
|
|
166
|
-
const
|
|
167
|
-
if (!
|
|
168
|
-
return
|
|
169
|
-
const { buildCampaignUrl:
|
|
173
|
+
function G(t) {
|
|
174
|
+
const o = t.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), e = new DOMParser().parseFromString(o, "text/html"), n = e.querySelectorAll(".recommendation-block-v2");
|
|
175
|
+
if (!n.length)
|
|
176
|
+
return t;
|
|
177
|
+
const { buildCampaignUrl: s } = C(), i = w();
|
|
170
178
|
i.recommendationCampaignUrls = {};
|
|
171
|
-
const { isFeatureEnabled: r } =
|
|
172
|
-
return
|
|
173
|
-
var
|
|
179
|
+
const { isFeatureEnabled: r } = q(), c = r("liquidSyntax") ? "reco_" : "";
|
|
180
|
+
return n.forEach((u) => {
|
|
181
|
+
var a, d;
|
|
174
182
|
const p = u.getAttribute("recommendation-id");
|
|
175
|
-
p && ((
|
|
176
|
-
}),
|
|
183
|
+
p && ((a = u.parentNode) == null || a.insertBefore(e.createComment("REC_START"), u), (d = u.parentNode) == null || d.insertBefore(e.createComment("REC_END"), u.nextSibling), u.querySelectorAll('[data-visibility="0"]').forEach((y) => y.remove()), s(p), P(u) || O(u, p, c), M(u));
|
|
184
|
+
}), B(o, e).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}");
|
|
177
185
|
}
|
|
178
186
|
export {
|
|
179
|
-
|
|
180
|
-
|
|
187
|
+
f as formatPriceVariable,
|
|
188
|
+
G as prepareRecommendationBlocks
|
|
181
189
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ATTR_PRODUCT_IMAGE as p, ATTR_PRODUCT_BUTTON as C, ATTR_PRODUCT_OLD_PRICE as
|
|
2
|
-
import { buildSpacer as I, DEFAULT_CARD_COMPOSITION as g, buildElementRenderer as E, buildCellOptions as
|
|
1
|
+
import { ATTR_PRODUCT_IMAGE as p, ATTR_PRODUCT_BUTTON as C, ATTR_PRODUCT_OLD_PRICE as A, ATTR_PRODUCT_PRICE as m } from "../../constants/selectors.js";
|
|
2
|
+
import { buildSpacer as I, DEFAULT_CARD_COMPOSITION as g, buildElementRenderer as E, buildCellOptions as i, resolveInlinePriceOrder as w, DEFAULT_CARD_VISIBILITY as y } from "../utils.js";
|
|
3
3
|
import { listElementRenderer as L, renderInlineListPriceRow as O } from "./elementRenderer.js";
|
|
4
4
|
const S = "0 5px";
|
|
5
5
|
function U(l, r, n) {
|
|
@@ -27,40 +27,40 @@ const N = `
|
|
|
27
27
|
</td>
|
|
28
28
|
</tr>
|
|
29
29
|
`;
|
|
30
|
-
function
|
|
30
|
+
function x(l, r = g, n = {}, e = {}) {
|
|
31
31
|
const {
|
|
32
32
|
cellPadding: o = S,
|
|
33
33
|
cardBackgroundColor: d,
|
|
34
34
|
visibility: c,
|
|
35
|
-
priceInline:
|
|
36
|
-
} = e, u = d ? ` style="background-color: ${d};"` : "", s = E(L, r, n), P = s[p](l,
|
|
35
|
+
priceInline: a = !1
|
|
36
|
+
} = e, u = d ? ` style="table-layout: fixed; background-color: ${d};"` : ' style="table-layout: fixed;"', s = E(L, r, n), P = s[p](l, i(p, e)), R = w(r), T = `
|
|
37
37
|
<td class="product-info-cell" valign="middle" style="padding: 15px;">
|
|
38
38
|
<table cellpadding="0" cellspacing="0" role="presentation" width="100%" style="table-layout: fixed;">
|
|
39
39
|
<tbody>
|
|
40
|
-
${r.filter((t) => t !== p && t !== C).filter((t) => !(
|
|
41
|
-
const b = (c == null ? void 0 : c[t]) ?? y[t] ?? !0,
|
|
40
|
+
${r.filter((t) => t !== p && t !== C).filter((t) => !(a && t === R.skip)).filter((t) => s[t]).map((t) => {
|
|
41
|
+
const b = (c == null ? void 0 : c[t]) ?? y[t] ?? !0, f = a && t === R.anchor ? O(
|
|
42
42
|
l,
|
|
43
43
|
R.originalFirst,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
) : s[t](l,
|
|
47
|
-
return U(
|
|
44
|
+
i(m, e),
|
|
45
|
+
i(A, e)
|
|
46
|
+
) : s[t](l, i(t, e));
|
|
47
|
+
return U(f, t, b);
|
|
48
48
|
}).join(`
|
|
49
49
|
`)}
|
|
50
50
|
</tbody>
|
|
51
51
|
</table>
|
|
52
52
|
</td>
|
|
53
|
-
`, _ = s[C](l,
|
|
53
|
+
`, _ = s[C](l, i(C, e)), D = P + T + _;
|
|
54
54
|
return N.replace("{-{-CARD_PADDING-}-}", o).replace("{-{-WRAPPER_STYLE-}-}", u).replace("{-{-PRODUCT_CONTENT-}-}", D);
|
|
55
55
|
}
|
|
56
56
|
function W(l, r, n = {}, e = {}) {
|
|
57
57
|
const o = I(e.rowSpacingPx);
|
|
58
58
|
return l.map((d, c) => {
|
|
59
|
-
const
|
|
60
|
-
return c > 0 ? o +
|
|
59
|
+
const a = x(d, r, n, e);
|
|
60
|
+
return c > 0 ? o + a : a;
|
|
61
61
|
}).join("");
|
|
62
62
|
}
|
|
63
63
|
export {
|
|
64
|
-
|
|
64
|
+
x as getListProductCard,
|
|
65
65
|
W as prepareProductRows
|
|
66
66
|
};
|
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}.
|
|
1
|
+
.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-64c52560]{gap:8px}.version-history__toolbar[data-v-64c52560]{gap:4px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-82128f7d]{gap:4px}.header-wrapper[data-v-5c02dcc7]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-50dac6de]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-50dac6de]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-50dac6de]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-669fe7cf]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-669fe7cf]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-669fe7cf]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-669fe7cf]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-669fe7cf]{object-fit:cover;transform:scale(1)}[data-v-7a305bb2] .guido__verion-history-view-option-selection-desktop svg,[data-v-7a305bb2] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-7a305bb2] .in-segments-wrapper__button_selected,[data-v-7a305bb2] .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-06afaecb]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-06afaecb]{min-height:504px}.iframe-wrapper[data-v-cbafc185]{width:258px}.iframe-scaled[data-v-cbafc185]{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-7419ae06] .vueperslides__bullets,[data-v-796d193b] .vueperslides__bullets{pointer-events:none!important}[data-v-796d193b] .vueperslides__parallax-wrapper{height:110px!important}[data-v-cadfc82d] .vueperslides__bullets{pointer-events:none!important}[data-v-cadfc82d] .vueperslides__parallax-wrapper{height:110px!important}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.1-beta.5af6229",
|
|
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",
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import i from "./AiStatusPill.vue2.js";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import e from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
-
var l = function() {
|
|
5
|
-
var t = this, s = t._self._c, a = t._self._setupProxy;
|
|
6
|
-
return a.aiStatusStore.isGenerating ? s("div", { staticClass: "d-f a-i-c ml-2 ai-status-pill", attrs: { id: "guido__ai-status-pill", "data-testid": "AI Status Pill" } }, [s(a.InLoading, { attrs: { "color-class": "i-c-53", size: "16" } }), s("span", { staticClass: "ml-1 f-s-1 t-c-53 ai-status-pill__label" }, [t._v(" " + t._s(a.label) + " ")])], 1) : t._e();
|
|
7
|
-
}, r = [], _ = /* @__PURE__ */ e(
|
|
8
|
-
i,
|
|
9
|
-
l,
|
|
10
|
-
r,
|
|
11
|
-
!1,
|
|
12
|
-
null,
|
|
13
|
-
"1ed36cb3"
|
|
14
|
-
);
|
|
15
|
-
const u = _.exports;
|
|
16
|
-
export {
|
|
17
|
-
u as default
|
|
18
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { defineComponent as s, computed as a } from "vue";
|
|
2
|
-
import { useTranslations as i } from "../../../composables/useTranslations.js";
|
|
3
|
-
import { useAiStatusStore as m } from "../../../stores/ai-status.js";
|
|
4
|
-
import { InLoading as u } from "@useinsider/design-system-vue";
|
|
5
|
-
const d = /* @__PURE__ */ s({
|
|
6
|
-
__name: "AiStatusPill",
|
|
7
|
-
setup(p) {
|
|
8
|
-
const n = m(), t = i(), r = a(() => {
|
|
9
|
-
const e = "newsletter.ai-generating", o = t(e);
|
|
10
|
-
return o === e ? "AI is generating…" : o;
|
|
11
|
-
});
|
|
12
|
-
return { __sfc: !0, aiStatusStore: n, trans: t, label: r, InLoading: u };
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
export {
|
|
16
|
-
d as default
|
|
17
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { useAiStatusStore as r } from "../stores/ai-status.js";
|
|
2
|
-
const a = () => {
|
|
3
|
-
const t = r();
|
|
4
|
-
return { store: t, start: (e = "") => {
|
|
5
|
-
t.isGenerating && t.activeTool === e || t.$patch({ isGenerating: !0, activeTool: e });
|
|
6
|
-
}, stop: () => {
|
|
7
|
-
!t.isGenerating && t.activeTool === "" || t.$patch({ isGenerating: !1, activeTool: "" });
|
|
8
|
-
} };
|
|
9
|
-
};
|
|
10
|
-
export {
|
|
11
|
-
a as useAiStatus
|
|
12
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
-
export default _default;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Thin mutation API over the `guidoAiStatus` store. The cortex bridge calls
|
|
3
|
-
* `start`/`stop` as it observes `tool_call` and terminal (`done`/`error`/
|
|
4
|
-
* `cancelled`) segments; the toolbar pill reads the store directly.
|
|
5
|
-
*
|
|
6
|
-
* Both mutations are idempotent: the bridge re-evaluates status on every
|
|
7
|
-
* stream tick, so guarding against no-op writes keeps the store (and any
|
|
8
|
-
* reactive consumers) from churning.
|
|
9
|
-
*/
|
|
10
|
-
export declare const useAiStatus: () => {
|
|
11
|
-
store: import("pinia").Store<"guidoAiStatus", {
|
|
12
|
-
isGenerating: boolean;
|
|
13
|
-
activeTool: string;
|
|
14
|
-
}, {
|
|
15
|
-
isBusy: (state: {
|
|
16
|
-
isGenerating: boolean;
|
|
17
|
-
activeTool: string;
|
|
18
|
-
} & import("pinia").PiniaCustomStateProperties<{
|
|
19
|
-
isGenerating: boolean;
|
|
20
|
-
activeTool: string;
|
|
21
|
-
}>) => boolean;
|
|
22
|
-
}, {}>;
|
|
23
|
-
start: (tool?: string) => void;
|
|
24
|
-
stop: () => void;
|
|
25
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tracks whether the AI agent (cortex-fe) is mid-generation so the editor
|
|
3
|
-
* toolbar can surface a status pill. Written by `useAiStatus` via `$patch` —
|
|
4
|
-
* state + getters only, mirroring `guido-email-editor` (architecture invariant).
|
|
5
|
-
*
|
|
6
|
-
* Store id `guidoAiStatus` is intentionally cross-MFE readable for debugging,
|
|
7
|
-
* same convention as `guidoEmailEditor`.
|
|
8
|
-
*/
|
|
9
|
-
export declare const useAiStatusStore: import("pinia").StoreDefinition<"guidoAiStatus", {
|
|
10
|
-
/** True while a qmechanics tool_call is in flight and no terminal segment seen. */
|
|
11
|
-
isGenerating: boolean;
|
|
12
|
-
/** Best-effort name of the tool that flipped the pill on — for debug/telemetry. */
|
|
13
|
-
activeTool: string;
|
|
14
|
-
}, {
|
|
15
|
-
isBusy: (state: {
|
|
16
|
-
isGenerating: boolean;
|
|
17
|
-
activeTool: string;
|
|
18
|
-
} & import("pinia").PiniaCustomStateProperties<{
|
|
19
|
-
/** True while a qmechanics tool_call is in flight and no terminal segment seen. */
|
|
20
|
-
isGenerating: boolean;
|
|
21
|
-
/** Best-effort name of the tool that flipped the pill on — for debug/telemetry. */
|
|
22
|
-
activeTool: string;
|
|
23
|
-
}>) => boolean;
|
|
24
|
-
}, {}>;
|
package/dist/stores/ai-status.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { defineStore as e } from "pinia";
|
|
2
|
-
const s = e("guidoAiStatus", {
|
|
3
|
-
state: () => ({
|
|
4
|
-
/** True while a qmechanics tool_call is in flight and no terminal segment seen. */
|
|
5
|
-
isGenerating: !1,
|
|
6
|
-
/** Best-effort name of the tool that flipped the pill on — for debug/telemetry. */
|
|
7
|
-
activeTool: ""
|
|
8
|
-
}),
|
|
9
|
-
getters: {
|
|
10
|
-
isBusy: (t) => t.isGenerating
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
export {
|
|
14
|
-
s as useAiStatusStore
|
|
15
|
-
};
|