@useinsider/guido 3.17.0-beta.e6704da → 3.17.0-beta.eae947f
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 +5 -6
- package/dist/@types/config/schemas.js +6 -12
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +61 -63
- package/dist/composables/useCustomInterfaceAppearance.js +16 -19
- package/dist/composables/useRecommendation.js +34 -41
- package/dist/config/migrator/recommendationMigrator.js +4 -6
- package/dist/enums/academy.js +1 -2
- package/dist/enums/date.js +3 -4
- package/dist/enums/extensions/recommendationBlock.js +23 -25
- package/dist/extensions/Blocks/Items/block.js +98 -49
- package/dist/extensions/Blocks/Items/constants/currency.js +11 -0
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +25 -24
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +12 -11
- package/dist/extensions/Blocks/Items/template.js +153 -152
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +11 -13
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +95 -96
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +154 -156
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +68 -216
- package/dist/extensions/Blocks/common-control.js +19 -22
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +29 -78
- package/dist/src/@types/config/schemas.d.ts +0 -12
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/composables/useRecommendation.d.ts +0 -1
- package/dist/src/enums/academy.d.ts +0 -1
- package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -2
- package/dist/src/extensions/Blocks/Items/block.d.ts +21 -0
- package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +19 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +3 -14
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +10 -214
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -6
- package/dist/src/extensions/Blocks/common-control.d.ts +1 -4
- package/dist/src/services/recommendationApi.d.ts +1 -4
- package/dist/src/stores/config.d.ts +0 -18
- package/dist/utils/dateUtil.js +10 -23
- package/dist/utils/pairProductVariables.js +60 -59
- package/dist/utils/templatePreparation.js +34 -37
- package/package.json +2 -3
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +0 -18
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +0 -70
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBox.vue.js +0 -20
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBox.vue2.js +0 -55
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +0 -141
- package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +0 -3
- package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBox.vue.d.ts +0 -24
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -29
- package/dist/src/mock/api/recommendation-strategies.d.ts +0 -43
- package/dist/static/styles/components/recommendation-strategy.css.js +0 -171
|
@@ -1,82 +1,83 @@
|
|
|
1
|
+
import { ITEMS_CURRENCY_ATTR as N } from "../extensions/Blocks/Items/constants/currency.js";
|
|
1
2
|
import { productPairs as L } from "../extensions/Blocks/Items/enums/productEnums.js";
|
|
2
|
-
import { DefaultConfigValues as
|
|
3
|
-
import { escapeReplacement as
|
|
3
|
+
import { DefaultConfigValues as G } from "../extensions/Blocks/Items/enums/settingsEnums.js";
|
|
4
|
+
import { escapeReplacement as X } from "../extensions/Blocks/Items/utils/nodeConfigUtils.js";
|
|
4
5
|
import { preserveTextStyles as F } from "./preserveTextStyles.js";
|
|
5
|
-
import { unwrapProductNameLinks as
|
|
6
|
+
import { unwrapProductNameLinks as Y } from "./unwrapProductNameLink.js";
|
|
6
7
|
const x = {
|
|
7
8
|
CART_ITEMS: "ins_apr",
|
|
8
9
|
BROWSED_ITEMS: "browsed_item",
|
|
9
10
|
PURCHASED_ITEMS: "purchased_item"
|
|
10
|
-
},
|
|
11
|
-
function v(S,
|
|
12
|
-
let
|
|
13
|
-
for (;
|
|
14
|
-
|
|
15
|
-
return
|
|
11
|
+
}, O = (S) => S.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->");
|
|
12
|
+
function v(S, I, b) {
|
|
13
|
+
let h = I;
|
|
14
|
+
for (; h > 0 && /\s/.test(S[h - 1]); )
|
|
15
|
+
h -= 1;
|
|
16
|
+
return b.some((P) => S.endsWith(P, h));
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
Object.entries(
|
|
22
|
-
|
|
18
|
+
function Z(S) {
|
|
19
|
+
const I = O(S), b = new DOMParser().parseFromString(I, "text/html");
|
|
20
|
+
Y(b);
|
|
21
|
+
const h = L.PAIRS_FOR_EXTENSION;
|
|
22
|
+
Object.entries(h).forEach(([n, d]) => {
|
|
23
|
+
b.querySelectorAll(".ins-product-td").forEach((r) => {
|
|
23
24
|
const E = r.getAttribute("data-number") || "1", m = r.getAttribute("data-type") || "CART_ITEMS";
|
|
24
25
|
r.querySelectorAll(`[product-attr="${n}"]`).forEach((t) => {
|
|
25
|
-
var
|
|
26
|
-
const
|
|
27
|
-
if (
|
|
26
|
+
var $, H, D;
|
|
27
|
+
const g = t.getAttribute("data-type") || m, o = t.getAttribute("data-number") || E, u = d[g];
|
|
28
|
+
if (u)
|
|
28
29
|
switch (n) {
|
|
29
30
|
case "imageSrc": {
|
|
30
31
|
let e = null, s = null;
|
|
31
32
|
if (t.tagName === "IMG" ? (e = t, s = e.closest("a")) : (e = t.querySelector("img"), s = t.querySelector("a") || t.closest("a")), !e)
|
|
32
33
|
break;
|
|
33
|
-
const a =
|
|
34
|
+
const a = u.DEFAULT, l = u.ATTR;
|
|
34
35
|
if (a && e.src) {
|
|
35
36
|
const i = e.src;
|
|
36
|
-
a.some((
|
|
37
|
-
const
|
|
38
|
-
return i.includes(
|
|
37
|
+
a.some((_) => {
|
|
38
|
+
const f = _.split("/").pop() || "", C = i.split("/").pop() || "";
|
|
39
|
+
return i.includes(_) || i.includes(f) || C === f;
|
|
39
40
|
}) && (e.src = `{{${l}_${o}}}`);
|
|
40
41
|
}
|
|
41
|
-
const c = (
|
|
42
|
+
const c = (H = ($ = h.name) == null ? void 0 : $[g]) == null ? void 0 : H.ATTR;
|
|
42
43
|
if (c && e.setAttribute("alt", `{{${c}_${o}}}`), s) {
|
|
43
|
-
const i = (D =
|
|
44
|
+
const i = (D = h.itemLink) == null ? void 0 : D[g];
|
|
44
45
|
if (i) {
|
|
45
|
-
const
|
|
46
|
-
(
|
|
46
|
+
const R = i.HREF, _ = i.DEFAULT_HREF || "#!", f = s.href;
|
|
47
|
+
(f === "#" || f === "" || f.endsWith("#!") || f.endsWith(_) || f === `${window.location.href}${_}` || !f || f === window.location.href) && (s.href = `{{${R}_${o}}}`);
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
break;
|
|
50
51
|
}
|
|
51
52
|
case "name": {
|
|
52
|
-
const e =
|
|
53
|
+
const e = u, s = e.ATTR, a = e.DEFAULT_HREF || "#!", l = e.HREF;
|
|
53
54
|
t.textContent && (t.innerHTML = F(t, `{{${s}_${o}}}`));
|
|
54
55
|
const c = t.closest("a") || (t.tagName === "A" ? t : null);
|
|
55
56
|
if (c && l) {
|
|
56
|
-
const i = c.href,
|
|
57
|
-
(i ===
|
|
57
|
+
const i = c.href, R = `${window.location.href}${a}`;
|
|
58
|
+
(i === R || i.endsWith(a)) && (c.href = `{{${l}_${o}}}`);
|
|
58
59
|
}
|
|
59
60
|
break;
|
|
60
61
|
}
|
|
61
62
|
case "price":
|
|
62
63
|
case "originalPrice": {
|
|
63
|
-
const e =
|
|
64
|
-
let
|
|
65
|
-
c ?
|
|
66
|
-
const
|
|
67
|
-
let
|
|
68
|
-
const
|
|
69
|
-
let
|
|
70
|
-
|
|
64
|
+
const e = u, s = t.getAttribute("data-formated"), a = t.getAttribute("data-single_price"), l = s === "true", c = a === "true", i = t.getAttribute(N.POSITION) || "before";
|
|
65
|
+
let R;
|
|
66
|
+
c ? R = l ? e.SINGLE_PRICE_FORMATTED : e.SINGLE_PRICE : R = l ? e.PRICE_FORMATTED : e.PRICE;
|
|
67
|
+
const _ = e.CURRENCY;
|
|
68
|
+
let f = `{{${R}_${o}}}`;
|
|
69
|
+
const C = (t.getAttribute(N.SYMBOL) || "").trim(), V = C !== "" && C !== G.productPriceCurrencySymbolControlValue;
|
|
70
|
+
let y = "";
|
|
71
|
+
V ? y = C : _ && (y = `{{${_}_${o}}}`), y && (f = i === "after" ? `${f} ${y}` : `${y} ${f}`), t.innerHTML = F(t, f);
|
|
71
72
|
break;
|
|
72
73
|
}
|
|
73
74
|
case "quantity": {
|
|
74
|
-
const e =
|
|
75
|
+
const e = u, s = e.ATTR, a = e.DEFAULT;
|
|
75
76
|
t.textContent && t.textContent.trim() === a && (t.innerHTML = F(t, `{{${s}_${o}}}`));
|
|
76
77
|
break;
|
|
77
78
|
}
|
|
78
79
|
case "button": {
|
|
79
|
-
const e =
|
|
80
|
+
const e = u, s = e.HREF, a = e.DEFAULT_HREF || "#!", l = t.tagName === "A" ? t : t.querySelector("a");
|
|
80
81
|
if (l) {
|
|
81
82
|
const c = l.href || "", i = `${window.location.href}${a}`;
|
|
82
83
|
(c === "" || c === "#" || c === i || c.endsWith(a) || c.endsWith("#!") || c === window.location.href) && (l.href = `{{${s}_${o}}}`);
|
|
@@ -84,7 +85,7 @@ function J(S) {
|
|
|
84
85
|
break;
|
|
85
86
|
}
|
|
86
87
|
case "itemLink": {
|
|
87
|
-
const e =
|
|
88
|
+
const e = u, s = e.HREF, a = e.DEFAULT_HREF || "#!", l = t;
|
|
88
89
|
if (l.href) {
|
|
89
90
|
const c = l.href, i = `${window.location.href}${a}`;
|
|
90
91
|
(c === i || c.endsWith(a)) && (l.href = `{{${s}_${o}}}`);
|
|
@@ -92,8 +93,8 @@ function J(S) {
|
|
|
92
93
|
break;
|
|
93
94
|
}
|
|
94
95
|
default: {
|
|
95
|
-
if ("ATTR" in
|
|
96
|
-
const e =
|
|
96
|
+
if ("ATTR" in u) {
|
|
97
|
+
const e = u.ATTR;
|
|
97
98
|
t.textContent && (t.innerHTML = F(t, `{{${e}_${o}}}`));
|
|
98
99
|
}
|
|
99
100
|
break;
|
|
@@ -102,9 +103,9 @@ function J(S) {
|
|
|
102
103
|
});
|
|
103
104
|
});
|
|
104
105
|
});
|
|
105
|
-
const
|
|
106
|
-
` : "",
|
|
107
|
-
|
|
106
|
+
const P = I.match(/<!DOCTYPE[^>]*>/i), q = P ? `${P[0]}
|
|
107
|
+
` : "", U = b.querySelectorAll(".ins-product-td"), M = [];
|
|
108
|
+
U.forEach((n) => {
|
|
108
109
|
const d = n.getAttribute("data-type") || "CART_ITEMS", p = n.getAttribute("data-number") || "1", r = n.outerHTML;
|
|
109
110
|
M.push({
|
|
110
111
|
element: n,
|
|
@@ -113,16 +114,16 @@ function J(S) {
|
|
|
113
114
|
number: p
|
|
114
115
|
});
|
|
115
116
|
});
|
|
116
|
-
let A =
|
|
117
|
+
let A = q + b.documentElement.outerHTML;
|
|
117
118
|
M.reverse().forEach(({ outerHtml: n, type: d, number: p }) => {
|
|
118
119
|
const r = x[d], E = r ? `${r}_total_product_kind` : "";
|
|
119
120
|
if (E) {
|
|
120
|
-
const
|
|
121
|
-
A = A.replace(n,
|
|
121
|
+
const T = parseInt(p) - 1, o = `${`{% if ${E} > ${T} %}`}${n}{% endif %}`;
|
|
122
|
+
A = A.replace(n, X(o));
|
|
122
123
|
}
|
|
123
124
|
});
|
|
124
|
-
const
|
|
125
|
-
return
|
|
125
|
+
const W = b.querySelectorAll('[product-attr="originalPrice"][data-type]'), w = /* @__PURE__ */ new Map(), k = /* @__PURE__ */ new Set();
|
|
126
|
+
return W.forEach((n) => {
|
|
126
127
|
var t;
|
|
127
128
|
const d = n.getAttribute("data-number"), p = n.getAttribute("data-type");
|
|
128
129
|
if (!d || !x[p])
|
|
@@ -131,20 +132,20 @@ function J(S) {
|
|
|
131
132
|
if (!r || k.has(r))
|
|
132
133
|
return;
|
|
133
134
|
k.add(r);
|
|
134
|
-
const E = r.outerHTML, m = (t = n.closest(".ins-product-td")) == null ? void 0 : t.getAttribute("data-nodup"),
|
|
135
|
-
|
|
135
|
+
const E = r.outerHTML, m = (t = n.closest(".ins-product-td")) == null ? void 0 : t.getAttribute("data-nodup"), T = w.get(E) ?? { number: d, type: p, wrap: [] };
|
|
136
|
+
T.wrap.push(m !== "false"), w.set(E, T);
|
|
136
137
|
}), w.forEach(({ number: n, type: d, wrap: p }, r) => {
|
|
137
138
|
if (r.includes("{% if") || !p.some(Boolean))
|
|
138
139
|
return;
|
|
139
|
-
const E = L.PAIRS_FOR_EXTENSION.price[d].PRICE, m = L.PAIRS_FOR_EXTENSION.originalPrice[d].PRICE,
|
|
140
|
-
let
|
|
141
|
-
for (;
|
|
142
|
-
const
|
|
143
|
-
|
|
140
|
+
const E = L.PAIRS_FOR_EXTENSION.price[d].PRICE, m = L.PAIRS_FOR_EXTENSION.originalPrice[d].PRICE, T = `{% if ${E}_${n} != ${m}_${n} %}`, t = [T, O(T)];
|
|
141
|
+
let g = "", o = 0, u = 0, $ = A.indexOf(r);
|
|
142
|
+
for (; $ !== -1; ) {
|
|
143
|
+
const H = p[u] === !0 && !v(A, $, t);
|
|
144
|
+
g += A.slice(o, $) + (H ? `${T}${r}{% endif %}` : r), o = $ + r.length, u += 1, $ = A.indexOf(r, o);
|
|
144
145
|
}
|
|
145
|
-
A =
|
|
146
|
+
A = g + A.slice(o);
|
|
146
147
|
}), A.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}");
|
|
147
148
|
}
|
|
148
149
|
export {
|
|
149
|
-
|
|
150
|
+
Z as pairProductVariables
|
|
150
151
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useActionsApi as k } from "../composables/useActionsApi.js";
|
|
2
2
|
import { useConfig as U } from "../composables/useConfig.js";
|
|
3
3
|
import { useHtmlCompiler as x } from "../composables/useHtmlCompiler.js";
|
|
4
|
-
import { DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as
|
|
4
|
+
import { DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as s } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
5
5
|
import { useRecommendationExtensionStore as C } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
6
6
|
import { mapLegacyStrategy as L } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
|
|
7
7
|
import { DATA_ATTRIBUTES as A } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
@@ -11,20 +11,20 @@ import { useEditorStore as z } from "../stores/editor.js";
|
|
|
11
11
|
import { useUnsubscribeStore as _ } from "../stores/unsubscribe.js";
|
|
12
12
|
import { assignTrackingIds as v } from "./linkTrackingIds.js";
|
|
13
13
|
function O(m) {
|
|
14
|
-
const
|
|
15
|
-
return
|
|
16
|
-
const o =
|
|
14
|
+
const n = new DOMParser().parseFromString(m, "text/html").querySelectorAll(`[${A.PAGE_LIST}]`), t = [];
|
|
15
|
+
return n.forEach((i) => {
|
|
16
|
+
const o = i.getAttribute(A.PAGE_LIST);
|
|
17
17
|
o && t.push(...R(o));
|
|
18
18
|
}), [...new Set(t)];
|
|
19
19
|
}
|
|
20
20
|
async function M(m) {
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
21
|
+
const a = new DOMParser().parseFromString(m, "text/html").querySelectorAll(".recommendation-block-v2");
|
|
22
|
+
if (a.length === 0)
|
|
23
23
|
return;
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const n = C();
|
|
25
|
+
a.forEach((t) => {
|
|
26
26
|
var r, l, g, f, c;
|
|
27
|
-
const
|
|
27
|
+
const i = t.getAttribute("recommendation-id"), o = i ? Number(i) : NaN;
|
|
28
28
|
if (!Number.isFinite(o))
|
|
29
29
|
return;
|
|
30
30
|
const p = t.getAttribute("esd-ext-config");
|
|
@@ -42,27 +42,24 @@ async function M(m) {
|
|
|
42
42
|
// Normalize legacy strategy keys (e.g. `mostViewed` → `mostPopular`) so
|
|
43
43
|
// already-saved blocks that never re-run the migrator don't emit a
|
|
44
44
|
// strategy-less campaign URL. `||` also catches '' / undefined (SD-144882).
|
|
45
|
-
strategy: L(e.strategy) ||
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
strategyId: e.strategyId ?? a.strategyId,
|
|
49
|
-
language: e.language ?? a.language,
|
|
50
|
-
size: e.size ?? a.size,
|
|
45
|
+
strategy: L(e.strategy) || s.strategy,
|
|
46
|
+
language: e.language ?? s.language,
|
|
47
|
+
size: e.size ?? s.size,
|
|
51
48
|
// Spread the default arrays so each block gets a fresh reference
|
|
52
49
|
// instead of sharing the singleton in DEFAULT_NODE_CONFIG.
|
|
53
|
-
productIds: e.productIds ?? [...
|
|
54
|
-
filters: e.filters ?? [...
|
|
55
|
-
shuffleProducts: e.shuffleProducts ??
|
|
50
|
+
productIds: e.productIds ?? [...s.productIds],
|
|
51
|
+
filters: e.filters ?? [...s.filters],
|
|
52
|
+
shuffleProducts: e.shuffleProducts ?? s.shuffleProducts,
|
|
56
53
|
currencyCode: ((r = e.currency) == null ? void 0 : r.code) ?? d.code,
|
|
57
54
|
currencyAlignment: ((l = e.currency) == null ? void 0 : l.alignment) ?? d.alignment,
|
|
58
55
|
currencyDecimalCount: ((g = e.currency) == null ? void 0 : g.decimalCount) ?? d.decimalCount,
|
|
59
56
|
currencyDecimalSeparator: ((f = e.currency) == null ? void 0 : f.decimalSeparator) ?? d.decimalSeparator,
|
|
60
57
|
currencyThousandSeparator: ((c = e.currency) == null ? void 0 : c.thousandSeparator) ?? d.thousandSeparator
|
|
61
58
|
};
|
|
62
|
-
|
|
59
|
+
n.seedBlockUrlConfig(o, h);
|
|
63
60
|
});
|
|
64
61
|
try {
|
|
65
|
-
await
|
|
62
|
+
await n.fetchRecommendationCreateData();
|
|
66
63
|
} catch (t) {
|
|
67
64
|
console.warn(
|
|
68
65
|
"Recommendation reference data pre-load failed; validator will skip the availability check.",
|
|
@@ -71,39 +68,39 @@ async function M(m) {
|
|
|
71
68
|
}
|
|
72
69
|
}
|
|
73
70
|
const Z = () => {
|
|
74
|
-
const m = N(), u = z(),
|
|
71
|
+
const m = N(), u = z(), a = _(), { getCompiledEmail: n, getTemplateData: t, updateHtmlAndCss: i } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
|
|
75
72
|
return {
|
|
76
73
|
prepareTemplateDetails: async () => {
|
|
77
74
|
let { html: r, css: l, syncModulesIds: g = [] } = await t();
|
|
78
75
|
if (e("linkTrackingIds"))
|
|
79
76
|
try {
|
|
80
|
-
const { html:
|
|
81
|
-
u.trackIdSessionFloor =
|
|
82
|
-
} catch (
|
|
83
|
-
console.error("Tracking-id step failed, saving anyway:",
|
|
77
|
+
const { html: y, changed: H, nextSeq: I } = v(r, u.trackIdSessionFloor);
|
|
78
|
+
u.trackIdSessionFloor = I, H && (r = y, await i(y, l));
|
|
79
|
+
} catch (y) {
|
|
80
|
+
console.error("Tracking-id step failed, saving anyway:", y);
|
|
84
81
|
}
|
|
85
|
-
const { html: f, ampHtml: c = "", ampErrors: T = [] } = await
|
|
82
|
+
const { html: f, ampHtml: c = "", ampErrors: T = [] } = await n({
|
|
86
83
|
minimize: !0,
|
|
87
84
|
resetDataSavedFlag: !1
|
|
88
85
|
});
|
|
89
|
-
|
|
90
|
-
const { compiledHtml:
|
|
86
|
+
a.selectedUnsubscribePages.length && await a.fetchTemplates(), await M(r);
|
|
87
|
+
const { compiledHtml: w, stats: S, appliedRules: D } = o(f), E = c && p(c).compiledHtml, P = m.getSelectedDynamicContentList, F = C(), b = O(r);
|
|
91
88
|
return console.debug("HTML Compilation Stats:", {
|
|
92
|
-
originalSize:
|
|
93
|
-
compiledSize:
|
|
94
|
-
reduction: `${
|
|
95
|
-
appliedRules:
|
|
96
|
-
executionTime: `${
|
|
89
|
+
originalSize: S.originalSize,
|
|
90
|
+
compiledSize: S.compiledSize,
|
|
91
|
+
reduction: `${S.reductionPercentage.toFixed(2)}%`,
|
|
92
|
+
appliedRules: D,
|
|
93
|
+
executionTime: `${S.executionTime.toFixed(2)}ms`
|
|
97
94
|
}), {
|
|
98
|
-
dynamicContentList:
|
|
99
|
-
compiledHtml:
|
|
95
|
+
dynamicContentList: P,
|
|
96
|
+
compiledHtml: w,
|
|
100
97
|
rawHtml: r,
|
|
101
98
|
css: l,
|
|
102
|
-
ampHtml:
|
|
99
|
+
ampHtml: E,
|
|
103
100
|
ampErrors: T,
|
|
104
101
|
modules: g.map(Number),
|
|
105
102
|
recommendation: {
|
|
106
|
-
campaignUrls:
|
|
103
|
+
campaignUrls: F.recommendationCampaignUrls,
|
|
107
104
|
configs: {}
|
|
108
105
|
},
|
|
109
106
|
unsubscribe: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.17.0-beta.
|
|
3
|
+
"version": "3.17.0-beta.eae947f",
|
|
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",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"start": "vite",
|
|
26
26
|
"build": "vite build && vue-tsc --declaration --emitDeclarationOnly --project tsconfig.app.json",
|
|
27
27
|
"preview": "vite preview",
|
|
28
|
-
"lint": "NODE_OPTIONS=--max-old-space-size=2048 eslint ./ &&
|
|
28
|
+
"lint": "NODE_OPTIONS=--max-old-space-size=2048 eslint ./ && npm run type-check",
|
|
29
29
|
"lint:fix": "NODE_OPTIONS=--max-old-space-size=2048 eslint --fix ./",
|
|
30
30
|
"lint:e2e-quality": "node scripts/lint-e2e-quality.mjs",
|
|
31
31
|
"lint:e2e-quality:ci": "node scripts/lint-e2e-quality.mjs --ci",
|
|
@@ -48,7 +48,6 @@
|
|
|
48
48
|
"license": "ISC",
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@stripoinc/ui-editor-extensions": "3.9.0",
|
|
51
|
-
"@useinsider/design-system-organisms": "0.0.3-beta.fc2c160",
|
|
52
51
|
"@useinsider/design-system-vue": "1.5.0",
|
|
53
52
|
"@vueuse/core": "11.3.0",
|
|
54
53
|
"lodash-es": "4.17.21",
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import a from "./AssignStrategyDrawer.vue2.js";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
-
var n = function() {
|
|
5
|
-
var s = this, e = s._self._c, t = s._self._setupProxy;
|
|
6
|
-
return e(t.WpDrawer, { attrs: { id: "assign-strategy-drawer", "description-status": "", size: "medium", "description-text": t.drawerDescription, "footer-button-group-options": t.footerButtonGroupOptions, status: t.store.assignStrategyDrawerStatus, "title-text": t.trans("gpt-app-builder.assign-recommendation-strategy") }, on: { cancelOrBackButtonEvent: t.closeDrawer, onCloseEvent: t.closeDrawer, primaryButtonEvent: t.assignStrategy } }, [t.store.assignStrategyDrawerStatus ? e("div", { staticClass: "assign-strategy-drawer-content" }, [e(t.InSelect, { staticClass: "assign-strategy-select", attrs: { id: "assign-strategy-select", "search-status": "", "static-child-position": "bottom right", "button-status": !1, "dynamic-child-position": !1, "label-text": t.trans("ds-steps.recommendation-strategy"), options: t.strategyOptions, "placeholder-text": t.trans("ds-steps.select-strategy"), "skeleton-sizing": { width: 240, height: 42 }, "skeleton-status": t.store.strategiesLoading, value: t.selectValue }, on: { select: t.onSelect } }), t.selectedStrategy ? e("div", { key: String(t.selectedStrategy.strategy_id), staticClass: "assign-strategy-detail" }, [e(t.OrgStrategyDetailModal, { attrs: { show: "", "campaign-details-tab-status": t.campaignTabSupported, "footer-status": !1, strategy: t.selectedStrategy } })], 1) : s._e()], 1) : s._e()]);
|
|
7
|
-
}, o = [], i = /* @__PURE__ */ r(
|
|
8
|
-
a,
|
|
9
|
-
n,
|
|
10
|
-
o,
|
|
11
|
-
!1,
|
|
12
|
-
null,
|
|
13
|
-
"710137fe"
|
|
14
|
-
);
|
|
15
|
-
const p = i.exports;
|
|
16
|
-
export {
|
|
17
|
-
p as default
|
|
18
|
-
};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { defineComponent as v, ref as c, computed as o, watch as _ } from "vue";
|
|
2
|
-
import "@useinsider/design-system-organisms/style";
|
|
3
|
-
import w from "../../../wrappers/WpDrawer.vue.js";
|
|
4
|
-
import { useToaster as D } from "../../../../composables/useToaster.js";
|
|
5
|
-
import { useTranslations as T } from "../../../../composables/useTranslations.js";
|
|
6
|
-
import { ToasterTypeOptions as m } from "../../../../enums/toaster.js";
|
|
7
|
-
import { useRecommendationExtensionStore as b } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
8
|
-
import { OrgStrategyDetailModal as h } from "@useinsider/design-system-organisms";
|
|
9
|
-
import { InSelect as x } from "@useinsider/design-system-vue";
|
|
10
|
-
import B from "./StrategyInfoBox.vue.js";
|
|
11
|
-
const W = /* @__PURE__ */ v({
|
|
12
|
-
__name: "AssignStrategyDrawer",
|
|
13
|
-
setup(A) {
|
|
14
|
-
const g = "/discovery/recommendation-strategies", s = T(), e = b(), { showToaster: n } = D(), r = c(null), a = c(!1), u = c(!1), p = o(() => e.assignStrategyDrawerStatus ? s("email-editor.assign-strategy-description", { url: g }) : "");
|
|
15
|
-
_(() => e.assignStrategyDrawerStatus, (t) => {
|
|
16
|
-
if (!t)
|
|
17
|
-
return;
|
|
18
|
-
const { strategyId: l } = e.recommendationConfigs;
|
|
19
|
-
r.value = l || null, u.value = !!window.l10n, e.fetchStrategies().catch((S) => {
|
|
20
|
-
console.error("fetchStrategies error:", S), n({
|
|
21
|
-
type: m.Error,
|
|
22
|
-
message: s("discovery-strategy.error-description")
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
const d = o(() => e.strategies.map((t) => ({
|
|
27
|
-
text: t.name,
|
|
28
|
-
value: t.strategy_id,
|
|
29
|
-
infoBoxProps: {
|
|
30
|
-
id: `strategy-info-${t.strategy_id}`,
|
|
31
|
-
theme: "light",
|
|
32
|
-
variant: "information",
|
|
33
|
-
className: "assign-strategy-info-box",
|
|
34
|
-
slot: B,
|
|
35
|
-
slotProps: { strategy: t }
|
|
36
|
-
}
|
|
37
|
-
}))), y = o(() => [{ value: r.value }]), i = o(() => {
|
|
38
|
-
const t = e.strategies.find((l) => String(l.strategy_id) === String(r.value ?? ""));
|
|
39
|
-
return t ? { ...t, fallback_config: null } : null;
|
|
40
|
-
}), f = o(() => ({
|
|
41
|
-
primaryButton: {
|
|
42
|
-
styling: "solid",
|
|
43
|
-
type: "primary",
|
|
44
|
-
labelText: s("products.assign-btn"),
|
|
45
|
-
loadingStatus: a.value,
|
|
46
|
-
disabledStatus: !i.value
|
|
47
|
-
},
|
|
48
|
-
cancelOrBackButton: {
|
|
49
|
-
styling: "ghost",
|
|
50
|
-
type: "secondary",
|
|
51
|
-
labelText: s("products.cancel"),
|
|
52
|
-
disabledStatus: a.value
|
|
53
|
-
}
|
|
54
|
-
}));
|
|
55
|
-
return { __sfc: !0, RRS_PANEL_PATH: g, trans: s, store: e, showToaster: n, selectedStrategyId: r, isAssigning: a, campaignTabSupported: u, drawerDescription: p, strategyOptions: d, selectValue: y, selectedStrategy: i, footerButtonGroupOptions: f, closeDrawer: () => {
|
|
56
|
-
e.closeAssignStrategyDrawer();
|
|
57
|
-
}, assignStrategy: () => {
|
|
58
|
-
const t = i.value;
|
|
59
|
-
t && (a.value = !0, e.assignStrategy(t), n({
|
|
60
|
-
type: m.Success,
|
|
61
|
-
message: s("email-editor.strategy-assigned-success", { strategyName: t.name })
|
|
62
|
-
}), e.closeAssignStrategyDrawer(), a.value = !1);
|
|
63
|
-
}, onSelect: (t) => {
|
|
64
|
-
r.value = t.value;
|
|
65
|
-
}, WpDrawer: w, OrgStrategyDetailModal: h, InSelect: x };
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
export {
|
|
69
|
-
W as default
|
|
70
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import _ from "./StrategyInfoBox.vue2.js";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
-
var r = function() {
|
|
5
|
-
var t = this, s = t._self._c, a = t._self._setupProxy;
|
|
6
|
-
return s("div", { staticClass: "strategy-info-box" }, [s("div", { staticClass: "strategy-info-box__name" }, [t._v(" " + t._s(t.strategy.name) + " ")]), a.lastUpdated ? s("div", { staticClass: "strategy-info-box__updated" }, [t._v(" " + t._s(a.lastUpdated) + " ")]) : t._e(), s("div", { staticClass: "strategy-info-box__rows" }, t._l(a.rows, function(e) {
|
|
7
|
-
return s("div", { key: e.label, staticClass: "strategy-info-box__row" }, [s("div", { staticClass: "strategy-info-box__label" }, [t._v(" " + t._s(e.label) + " ")]), s("div", { staticClass: "strategy-info-box__value" }, [t._v(" " + t._s(e.value) + " ")])]);
|
|
8
|
-
}), 0)]);
|
|
9
|
-
}, i = [], n = /* @__PURE__ */ o(
|
|
10
|
-
_,
|
|
11
|
-
r,
|
|
12
|
-
i,
|
|
13
|
-
!1,
|
|
14
|
-
null,
|
|
15
|
-
"fe4491e6"
|
|
16
|
-
);
|
|
17
|
-
const d = n.exports;
|
|
18
|
-
export {
|
|
19
|
-
d as default
|
|
20
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { defineComponent as v, computed as s } from "vue";
|
|
2
|
-
import { useTranslations as h } from "../../../../composables/useTranslations.js";
|
|
3
|
-
import { formatShortDate as f } from "../../../../utils/dateUtil.js";
|
|
4
|
-
const A = /* @__PURE__ */ v({
|
|
5
|
-
__name: "StrategyInfoBox",
|
|
6
|
-
props: {
|
|
7
|
-
strategy: null
|
|
8
|
-
},
|
|
9
|
-
setup(g) {
|
|
10
|
-
const t = g, r = h(), n = (e) => e == null ? "" : String(e), y = s(() => {
|
|
11
|
-
const e = n(t.strategy.updated_at || t.strategy.created_at);
|
|
12
|
-
return e ? r("recommendation-strategy.last-updated-on", { value: f(e) }) : "";
|
|
13
|
-
}), c = s(() => {
|
|
14
|
-
const e = n(t.strategy.algorithm) === "MIXED" ? r("discovery-strategy.mixed-algorithm") : r("discovery-strategy.single-algorithm"), a = n(t.strategy.algorithm_used).split(",").map((o) => o.trim()).filter(Boolean).map((o) => r(`recommendation-algorithm-names.${o.replaceAll("_", "-").toLowerCase()}`));
|
|
15
|
-
return a.length ? `${e} · ${a.join(", ")}` : e;
|
|
16
|
-
}), u = s(() => [
|
|
17
|
-
[t.strategy.exclude_view, "discovery-strategy.exclude-recently-view-items"],
|
|
18
|
-
[t.strategy.exclude_purchase, "discovery-strategy.exclude-recently-purchased-items"],
|
|
19
|
-
[t.strategy.exclude_cart, "discovery-strategy.exclude-recently-added-cart-items"]
|
|
20
|
-
].filter(([a]) => Number(a) === 1).map(([, a]) => r(a)).join(", ")), d = s(() => n(
|
|
21
|
-
t.strategy.manual_merchandising || t.strategy.manual_merchandising_products
|
|
22
|
-
).trim()), i = s(() => {
|
|
23
|
-
const e = t.strategy.filters;
|
|
24
|
-
if (!e)
|
|
25
|
-
return 0;
|
|
26
|
-
try {
|
|
27
|
-
const a = typeof e == "string" ? JSON.parse(e) : e;
|
|
28
|
-
return Array.isArray(a) ? a.reduce((o, m) => o + (Array.isArray(m) ? m.length : 1), 0) : 0;
|
|
29
|
-
} catch {
|
|
30
|
-
return 0;
|
|
31
|
-
}
|
|
32
|
-
}), l = s(() => r("recommendation-strategy.none")), p = s(() => [
|
|
33
|
-
{
|
|
34
|
-
label: r("gpt-app-builder.algorithms-and-method"),
|
|
35
|
-
value: c.value
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
label: r("gpt-app-builder.exclusions"),
|
|
39
|
-
value: u.value || l.value
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
label: r("discovery-strategy.filters"),
|
|
43
|
-
value: i.value ? String(i.value) : l.value
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
label: r("action-builder.manual-merchandising"),
|
|
47
|
-
value: d.value || l.value
|
|
48
|
-
}
|
|
49
|
-
]);
|
|
50
|
-
return { __sfc: !0, props: t, trans: r, asText: n, lastUpdated: y, algorithmsAndMethod: c, exclusions: u, manualMerchandising: d, filterCount: i, none: l, rows: p };
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
export {
|
|
54
|
-
A as default
|
|
55
|
-
};
|