@useinsider/guido 3.15.0 → 3.16.0-beta.0faee0c
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/@types/config/schemas.js +108 -92
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +78 -75
- package/dist/composables/useActionsApi.js +30 -22
- package/dist/composables/useEmailTemplateApplier.js +25 -23
- package/dist/composables/useHtmlValidator.js +108 -106
- package/dist/composables/useStripo.js +30 -29
- package/dist/composables/useTimerClone.js +21 -19
- package/dist/config/i18n/en/labels.json.js +7 -3
- package/dist/config/migrator/checkboxMigrator.js +20 -19
- package/dist/config/migrator/radioButtonMigrator.js +26 -25
- package/dist/config/migrator/recommendation/compositionMapper.js +26 -23
- package/dist/config/migrator/recommendation/htmlBuilder.js +156 -155
- package/dist/extensions/Blocks/Checkbox/constants/controlIds.js +4 -0
- package/dist/extensions/Blocks/Checkbox/constants/selectors.js +6 -0
- package/dist/extensions/Blocks/Checkbox/controls/blockBackground/index.js +10 -0
- package/dist/extensions/Blocks/Checkbox/extension.js +6 -5
- package/dist/extensions/Blocks/Checkbox/settingsPanel.js +15 -14
- package/dist/extensions/Blocks/Checkbox/template.js +10 -9
- package/dist/extensions/Blocks/Items/block.js +44 -42
- package/dist/extensions/Blocks/Items/template.js +86 -86
- package/dist/extensions/Blocks/RadioButton/constants/controlIds.js +4 -0
- package/dist/extensions/Blocks/RadioButton/constants/selectors.js +6 -0
- package/dist/extensions/Blocks/RadioButton/controls/blockBackground/index.js +10 -0
- package/dist/extensions/Blocks/RadioButton/extension.js +5 -4
- package/dist/extensions/Blocks/RadioButton/settingsPanel.js +12 -11
- package/dist/extensions/Blocks/RadioButton/template.js +16 -9
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +18 -15
- package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +5 -9
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +363 -322
- package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +8 -8
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +271 -231
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +98 -113
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +21 -0
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +16 -16
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +16 -16
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +120 -120
- package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +55 -54
- package/dist/extensions/Blocks/Recommendation/utils/compositionKeys.js +89 -0
- package/dist/extensions/Blocks/common-control.js +42 -35
- package/dist/extensions/Blocks/controlFactories.js +117 -115
- package/dist/guido.css +1 -1
- package/dist/library.js +11 -7
- package/dist/node_modules/valibot/dist/index.js +230 -216
- package/dist/public/trackingIds.js +8 -0
- package/dist/src/@types/config/schemas.d.ts +20 -0
- package/dist/src/composables/useActionsApi.d.ts +1 -1
- package/dist/src/composables/useConfig.d.ts +4 -0
- package/dist/src/composables/useHtmlValidator.d.ts +3 -2
- package/dist/src/config/migrator/recommendation/types.d.ts +1 -0
- package/dist/src/extensions/Blocks/Checkbox/constants/controlIds.d.ts +7 -0
- package/dist/src/extensions/Blocks/Checkbox/constants/index.d.ts +10 -0
- package/dist/src/extensions/Blocks/Checkbox/constants/selectors.d.ts +16 -0
- package/dist/src/extensions/Blocks/Checkbox/controls/blockBackground/index.d.ts +14 -0
- package/dist/src/extensions/Blocks/RadioButton/constants/controlIds.d.ts +7 -0
- package/dist/src/extensions/Blocks/RadioButton/constants/index.d.ts +10 -0
- package/dist/src/extensions/Blocks/RadioButton/constants/selectors.d.ts +16 -0
- package/dist/src/extensions/Blocks/RadioButton/controls/blockBackground/index.d.ts +14 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +27 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +4 -2
- package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +12 -11
- package/dist/src/extensions/Blocks/Recommendation/utils/compositionKeys.d.ts +47 -0
- package/dist/src/extensions/Blocks/_Boilerplate/constants/controlIds.d.ts +7 -0
- package/dist/src/extensions/Blocks/_Boilerplate/constants/index.d.ts +10 -0
- package/dist/src/extensions/Blocks/_Boilerplate/constants/selectors.d.ts +16 -0
- package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +14 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +3 -1
- package/dist/src/library.d.ts +1 -0
- package/dist/src/public/trackingIds.d.ts +9 -0
- package/dist/src/stores/config.d.ts +36 -0
- package/dist/src/stores/editor.d.ts +25 -0
- package/dist/src/utils/linkTrackingIds.d.ts +30 -0
- package/dist/stores/editor.js +4 -1
- package/dist/stores/onboarding.js +11 -7
- package/dist/utils/linkTrackingIds.js +56 -0
- package/dist/utils/pairProductVariables.js +105 -99
- package/dist/utils/templatePreparation.js +72 -61
- package/package.json +5 -1
|
@@ -1,88 +1,100 @@
|
|
|
1
|
-
import { productPairs as
|
|
2
|
-
import { DefaultConfigValues as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { productPairs as L } from "../extensions/Blocks/Items/enums/productEnums.js";
|
|
2
|
+
import { DefaultConfigValues as V } from "../extensions/Blocks/Items/enums/settingsEnums.js";
|
|
3
|
+
import { escapeReplacement as G } from "../extensions/Blocks/Items/utils/nodeConfigUtils.js";
|
|
4
|
+
import { preserveTextStyles as F } from "./preserveTextStyles.js";
|
|
5
|
+
import { unwrapProductNameLinks as X } from "./unwrapProductNameLink.js";
|
|
6
|
+
const x = {
|
|
7
|
+
CART_ITEMS: "ins_apr",
|
|
8
|
+
BROWSED_ITEMS: "browsed_item",
|
|
9
|
+
PURCHASED_ITEMS: "purchased_item"
|
|
10
|
+
}, N = (S) => S.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->");
|
|
11
|
+
function v(S, H, g) {
|
|
12
|
+
let $ = H;
|
|
13
|
+
for (; $ > 0 && /\s/.test(S[$ - 1]); )
|
|
14
|
+
$ -= 1;
|
|
15
|
+
return g.some((I) => S.endsWith(I, $));
|
|
16
|
+
}
|
|
17
|
+
function J(S) {
|
|
18
|
+
const H = N(S), g = new DOMParser().parseFromString(H, "text/html");
|
|
19
|
+
X(g);
|
|
20
|
+
const $ = L.PAIRS_FOR_EXTENSION;
|
|
21
|
+
Object.entries($).forEach(([n, d]) => {
|
|
22
|
+
g.querySelectorAll(".ins-product-td").forEach((r) => {
|
|
23
|
+
const E = r.getAttribute("data-number") || "1", m = r.getAttribute("data-type") || "CART_ITEMS";
|
|
24
|
+
r.querySelectorAll(`[product-attr="${n}"]`).forEach((t) => {
|
|
25
|
+
var T, P, D;
|
|
26
|
+
const R = t.getAttribute("data-type") || m, o = t.getAttribute("data-number") || E, f = d[R];
|
|
27
|
+
if (f)
|
|
28
|
+
switch (n) {
|
|
17
29
|
case "imageSrc": {
|
|
18
|
-
let e = null,
|
|
19
|
-
if (t.tagName === "IMG" ? (e = t,
|
|
30
|
+
let e = null, s = null;
|
|
31
|
+
if (t.tagName === "IMG" ? (e = t, s = e.closest("a")) : (e = t.querySelector("img"), s = t.querySelector("a") || t.closest("a")), !e)
|
|
20
32
|
break;
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
return
|
|
27
|
-
}) && (e.src = `{{${
|
|
33
|
+
const a = f.DEFAULT, l = f.ATTR;
|
|
34
|
+
if (a && e.src) {
|
|
35
|
+
const i = e.src;
|
|
36
|
+
a.some((b) => {
|
|
37
|
+
const u = b.split("/").pop() || "", y = i.split("/").pop() || "";
|
|
38
|
+
return i.includes(b) || i.includes(u) || y === u;
|
|
39
|
+
}) && (e.src = `{{${l}_${o}}}`);
|
|
28
40
|
}
|
|
29
|
-
const
|
|
30
|
-
if (
|
|
31
|
-
const
|
|
32
|
-
if (
|
|
33
|
-
const
|
|
34
|
-
(
|
|
41
|
+
const c = (P = (T = $.name) == null ? void 0 : T[R]) == null ? void 0 : P.ATTR;
|
|
42
|
+
if (c && e.setAttribute("alt", `{{${c}_${o}}}`), s) {
|
|
43
|
+
const i = (D = $.itemLink) == null ? void 0 : D[R];
|
|
44
|
+
if (i) {
|
|
45
|
+
const _ = i.HREF, b = i.DEFAULT_HREF || "#!", u = s.href;
|
|
46
|
+
(u === "#" || u === "" || u.endsWith("#!") || u.endsWith(b) || u === `${window.location.href}${b}` || !u || u === window.location.href) && (s.href = `{{${_}_${o}}}`);
|
|
35
47
|
}
|
|
36
48
|
}
|
|
37
49
|
break;
|
|
38
50
|
}
|
|
39
51
|
case "name": {
|
|
40
|
-
const e =
|
|
41
|
-
t.textContent && (t.innerHTML =
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
const
|
|
45
|
-
(
|
|
52
|
+
const e = f, s = e.ATTR, a = e.DEFAULT_HREF || "#!", l = e.HREF;
|
|
53
|
+
t.textContent && (t.innerHTML = F(t, `{{${s}_${o}}}`));
|
|
54
|
+
const c = t.closest("a") || (t.tagName === "A" ? t : null);
|
|
55
|
+
if (c && l) {
|
|
56
|
+
const i = c.href, _ = `${window.location.href}${a}`;
|
|
57
|
+
(i === _ || i.endsWith(a)) && (c.href = `{{${l}_${o}}}`);
|
|
46
58
|
}
|
|
47
59
|
break;
|
|
48
60
|
}
|
|
49
61
|
case "price":
|
|
50
62
|
case "originalPrice": {
|
|
51
|
-
const e =
|
|
52
|
-
let
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
let
|
|
56
|
-
const
|
|
57
|
-
let
|
|
58
|
-
|
|
63
|
+
const e = f, s = t.getAttribute("data-formated"), a = t.getAttribute("data-single_price"), l = s === "true", c = a === "true", i = t.getAttribute("data-curency") || "before";
|
|
64
|
+
let _;
|
|
65
|
+
c ? _ = l ? e.SINGLE_PRICE_FORMATTED : e.SINGLE_PRICE : _ = l ? e.PRICE_FORMATTED : e.PRICE;
|
|
66
|
+
const b = e.CURRENCY;
|
|
67
|
+
let u = `{{${_}_${o}}}`;
|
|
68
|
+
const y = (t.getAttribute("data-currency_symbol") || "").trim(), W = y !== "" && y !== V.productPriceCurrencySymbolControlValue;
|
|
69
|
+
let C = "";
|
|
70
|
+
W ? C = y : b && (C = `{{${b}_${o}}}`), C && (u = i === "after" ? `${u} ${C}` : `${C} ${u}`), t.innerHTML = F(t, u);
|
|
59
71
|
break;
|
|
60
72
|
}
|
|
61
73
|
case "quantity": {
|
|
62
|
-
const e =
|
|
63
|
-
t.textContent && t.textContent.trim() ===
|
|
74
|
+
const e = f, s = e.ATTR, a = e.DEFAULT;
|
|
75
|
+
t.textContent && t.textContent.trim() === a && (t.innerHTML = F(t, `{{${s}_${o}}}`));
|
|
64
76
|
break;
|
|
65
77
|
}
|
|
66
78
|
case "button": {
|
|
67
|
-
const e =
|
|
68
|
-
if (
|
|
69
|
-
const
|
|
70
|
-
(
|
|
79
|
+
const e = f, s = e.HREF, a = e.DEFAULT_HREF || "#!", l = t.tagName === "A" ? t : t.querySelector("a");
|
|
80
|
+
if (l) {
|
|
81
|
+
const c = l.href || "", i = `${window.location.href}${a}`;
|
|
82
|
+
(c === "" || c === "#" || c === i || c.endsWith(a) || c.endsWith("#!") || c === window.location.href) && (l.href = `{{${s}_${o}}}`);
|
|
71
83
|
}
|
|
72
84
|
break;
|
|
73
85
|
}
|
|
74
86
|
case "itemLink": {
|
|
75
|
-
const e =
|
|
76
|
-
if (
|
|
77
|
-
const
|
|
78
|
-
(
|
|
87
|
+
const e = f, s = e.HREF, a = e.DEFAULT_HREF || "#!", l = t;
|
|
88
|
+
if (l.href) {
|
|
89
|
+
const c = l.href, i = `${window.location.href}${a}`;
|
|
90
|
+
(c === i || c.endsWith(a)) && (l.href = `{{${s}_${o}}}`);
|
|
79
91
|
}
|
|
80
92
|
break;
|
|
81
93
|
}
|
|
82
94
|
default: {
|
|
83
|
-
if ("ATTR" in
|
|
84
|
-
const e =
|
|
85
|
-
t.textContent && (t.innerHTML =
|
|
95
|
+
if ("ATTR" in f) {
|
|
96
|
+
const e = f.ATTR;
|
|
97
|
+
t.textContent && (t.innerHTML = F(t, `{{${e}_${o}}}`));
|
|
86
98
|
}
|
|
87
99
|
break;
|
|
88
100
|
}
|
|
@@ -90,55 +102,49 @@ function Y(L) {
|
|
|
90
102
|
});
|
|
91
103
|
});
|
|
92
104
|
});
|
|
93
|
-
const
|
|
94
|
-
` : "",
|
|
95
|
-
|
|
96
|
-
const
|
|
105
|
+
const I = H.match(/<!DOCTYPE[^>]*>/i), O = I ? `${I[0]}
|
|
106
|
+
` : "", q = g.querySelectorAll(".ins-product-td"), M = [];
|
|
107
|
+
q.forEach((n) => {
|
|
108
|
+
const d = n.getAttribute("data-type") || "CART_ITEMS", p = n.getAttribute("data-number") || "1", r = n.outerHTML;
|
|
97
109
|
M.push({
|
|
98
|
-
element:
|
|
99
|
-
outerHtml:
|
|
100
|
-
type:
|
|
110
|
+
element: n,
|
|
111
|
+
outerHtml: r,
|
|
112
|
+
type: d,
|
|
101
113
|
number: p
|
|
102
114
|
});
|
|
103
115
|
});
|
|
104
|
-
let
|
|
105
|
-
M.reverse().forEach(({ outerHtml:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
break;
|
|
111
|
-
case "BROWSED_ITEMS":
|
|
112
|
-
l = "browsed_item_total_product_kind";
|
|
113
|
-
break;
|
|
114
|
-
case "PURCHASED_ITEMS":
|
|
115
|
-
l = "purchased_item_total_product_kind";
|
|
116
|
-
break;
|
|
117
|
-
}
|
|
118
|
-
if (l) {
|
|
119
|
-
const $ = parseInt(p) - 1, T = `${`{% if ${l} > ${$} %}`}${r}{% endif %}`;
|
|
120
|
-
_ = _.replace(r, T);
|
|
116
|
+
let A = O + g.documentElement.outerHTML;
|
|
117
|
+
M.reverse().forEach(({ outerHtml: n, type: d, number: p }) => {
|
|
118
|
+
const r = x[d], E = r ? `${r}_total_product_kind` : "";
|
|
119
|
+
if (E) {
|
|
120
|
+
const h = parseInt(p) - 1, o = `${`{% if ${E} > ${h} %}`}${n}{% endif %}`;
|
|
121
|
+
A = A.replace(n, G(o));
|
|
121
122
|
}
|
|
122
123
|
});
|
|
123
|
-
const
|
|
124
|
-
return
|
|
125
|
-
var
|
|
126
|
-
const
|
|
127
|
-
if (!
|
|
124
|
+
const U = g.querySelectorAll('[product-attr="originalPrice"][data-type]'), w = /* @__PURE__ */ new Map(), k = /* @__PURE__ */ new Set();
|
|
125
|
+
return U.forEach((n) => {
|
|
126
|
+
var t;
|
|
127
|
+
const d = n.getAttribute("data-number"), p = n.getAttribute("data-type");
|
|
128
|
+
if (!d || !x[p])
|
|
128
129
|
return;
|
|
129
|
-
const
|
|
130
|
-
if (
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
if (
|
|
137
|
-
|
|
138
|
-
|
|
130
|
+
const r = n.closest(".product-original-price-class");
|
|
131
|
+
if (!r || k.has(r))
|
|
132
|
+
return;
|
|
133
|
+
k.add(r);
|
|
134
|
+
const E = r.outerHTML, m = (t = n.closest(".ins-product-td")) == null ? void 0 : t.getAttribute("data-nodup"), h = w.get(E) ?? { number: d, type: p, wrap: [] };
|
|
135
|
+
h.wrap.push(m !== "false"), w.set(E, h);
|
|
136
|
+
}), w.forEach(({ number: n, type: d, wrap: p }, r) => {
|
|
137
|
+
if (r.includes("{% if") || !p.some(Boolean))
|
|
138
|
+
return;
|
|
139
|
+
const E = L.PAIRS_FOR_EXTENSION.price[d].PRICE, m = L.PAIRS_FOR_EXTENSION.originalPrice[d].PRICE, h = `{% if ${E}_${n} != ${m}_${n} %}`, t = [h, N(h)];
|
|
140
|
+
let R = "", o = 0, f = 0, T = A.indexOf(r);
|
|
141
|
+
for (; T !== -1; ) {
|
|
142
|
+
const P = p[f] === !0 && !v(A, T, t);
|
|
143
|
+
R += A.slice(o, T) + (P ? `${h}${r}{% endif %}` : r), o = T + r.length, f += 1, T = A.indexOf(r, o);
|
|
139
144
|
}
|
|
140
|
-
|
|
145
|
+
A = R + A.slice(o);
|
|
146
|
+
}), A.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}");
|
|
141
147
|
}
|
|
142
148
|
export {
|
|
143
|
-
|
|
149
|
+
J as pairProductVariables
|
|
144
150
|
};
|
|
@@ -1,62 +1,65 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { useActionsApi as k } from "../composables/useActionsApi.js";
|
|
2
|
+
import { useConfig as U } from "../composables/useConfig.js";
|
|
3
|
+
import { useHtmlCompiler as x } from "../composables/useHtmlCompiler.js";
|
|
4
|
+
import { DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as s } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
5
|
+
import { useRecommendationExtensionStore as C } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
6
|
+
import { mapLegacyStrategy as L } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
|
|
7
|
+
import { DATA_ATTRIBUTES as A } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
8
|
+
import { parsePageList as R } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
9
|
+
import { useDynamicContentStore as N } from "../stores/dynamic-content.js";
|
|
10
|
+
import { useEditorStore as z } from "../stores/editor.js";
|
|
11
|
+
import { useUnsubscribeStore as _ } from "../stores/unsubscribe.js";
|
|
12
|
+
import { assignTrackingIds as v } from "./linkTrackingIds.js";
|
|
13
|
+
function O(m) {
|
|
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
|
+
o && t.push(...R(o));
|
|
15
18
|
}), [...new Set(t)];
|
|
16
19
|
}
|
|
17
|
-
async function
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
20
|
+
async function M(m) {
|
|
21
|
+
const a = new DOMParser().parseFromString(m, "text/html").querySelectorAll(".recommendation-block-v2");
|
|
22
|
+
if (a.length === 0)
|
|
20
23
|
return;
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
const
|
|
25
|
-
if (!Number.isFinite(
|
|
24
|
+
const n = C();
|
|
25
|
+
a.forEach((t) => {
|
|
26
|
+
var r, l, g, f, c;
|
|
27
|
+
const i = t.getAttribute("recommendation-id"), o = i ? Number(i) : NaN;
|
|
28
|
+
if (!Number.isFinite(o))
|
|
26
29
|
return;
|
|
27
|
-
const
|
|
28
|
-
if (!
|
|
30
|
+
const p = t.getAttribute("esd-ext-config");
|
|
31
|
+
if (!p)
|
|
29
32
|
return;
|
|
30
33
|
let e;
|
|
31
34
|
try {
|
|
32
|
-
e = JSON.parse(
|
|
35
|
+
e = JSON.parse(p);
|
|
33
36
|
} catch {
|
|
34
37
|
return;
|
|
35
38
|
}
|
|
36
39
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
37
40
|
return;
|
|
38
|
-
const
|
|
41
|
+
const h = {
|
|
39
42
|
// Normalize legacy strategy keys (e.g. `mostViewed` → `mostPopular`) so
|
|
40
43
|
// already-saved blocks that never re-run the migrator don't emit a
|
|
41
44
|
// strategy-less campaign URL. `||` also catches '' / undefined (SD-144882).
|
|
42
|
-
strategy:
|
|
43
|
-
language: e.language ??
|
|
44
|
-
size: e.size ??
|
|
45
|
+
strategy: L(e.strategy) || s.strategy,
|
|
46
|
+
language: e.language ?? s.language,
|
|
47
|
+
size: e.size ?? s.size,
|
|
45
48
|
// Spread the default arrays so each block gets a fresh reference
|
|
46
49
|
// instead of sharing the singleton in DEFAULT_NODE_CONFIG.
|
|
47
|
-
productIds: e.productIds ?? [...
|
|
48
|
-
filters: e.filters ?? [...
|
|
49
|
-
shuffleProducts: e.shuffleProducts ??
|
|
50
|
-
currencyCode: ((
|
|
51
|
-
currencyAlignment: ((
|
|
52
|
-
currencyDecimalCount: ((g = e.currency) == null ? void 0 : g.decimalCount) ??
|
|
53
|
-
currencyDecimalSeparator: ((f = e.currency) == null ? void 0 : f.decimalSeparator) ??
|
|
54
|
-
currencyThousandSeparator: ((
|
|
50
|
+
productIds: e.productIds ?? [...s.productIds],
|
|
51
|
+
filters: e.filters ?? [...s.filters],
|
|
52
|
+
shuffleProducts: e.shuffleProducts ?? s.shuffleProducts,
|
|
53
|
+
currencyCode: ((r = e.currency) == null ? void 0 : r.code) ?? d.code,
|
|
54
|
+
currencyAlignment: ((l = e.currency) == null ? void 0 : l.alignment) ?? d.alignment,
|
|
55
|
+
currencyDecimalCount: ((g = e.currency) == null ? void 0 : g.decimalCount) ?? d.decimalCount,
|
|
56
|
+
currencyDecimalSeparator: ((f = e.currency) == null ? void 0 : f.decimalSeparator) ?? d.decimalSeparator,
|
|
57
|
+
currencyThousandSeparator: ((c = e.currency) == null ? void 0 : c.thousandSeparator) ?? d.thousandSeparator
|
|
55
58
|
};
|
|
56
|
-
|
|
59
|
+
n.seedBlockUrlConfig(o, h);
|
|
57
60
|
});
|
|
58
61
|
try {
|
|
59
|
-
await
|
|
62
|
+
await n.fetchRecommendationCreateData();
|
|
60
63
|
} catch (t) {
|
|
61
64
|
console.warn(
|
|
62
65
|
"Recommendation reference data pre-load failed; validator will skip the availability check.",
|
|
@@ -64,43 +67,51 @@ async function R(s) {
|
|
|
64
67
|
);
|
|
65
68
|
}
|
|
66
69
|
}
|
|
67
|
-
const
|
|
68
|
-
const
|
|
70
|
+
const Z = () => {
|
|
71
|
+
const m = N(), u = z(), a = _(), { getCompiledEmail: n, getTemplateData: t, updateHtmlAndCss: i } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
|
|
69
72
|
return {
|
|
70
73
|
prepareTemplateDetails: async () => {
|
|
71
|
-
|
|
74
|
+
let { html: r, css: l, syncModulesIds: g = [] } = await t();
|
|
75
|
+
if (e("linkTrackingIds"))
|
|
76
|
+
try {
|
|
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);
|
|
81
|
+
}
|
|
82
|
+
const { html: f, ampHtml: c = "", ampErrors: T = [] } = await n({
|
|
72
83
|
minimize: !0,
|
|
73
84
|
resetDataSavedFlag: !1
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
const { compiledHtml:
|
|
85
|
+
});
|
|
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);
|
|
77
88
|
return console.debug("HTML Compilation Stats:", {
|
|
78
|
-
originalSize:
|
|
79
|
-
compiledSize:
|
|
80
|
-
reduction: `${
|
|
81
|
-
appliedRules:
|
|
82
|
-
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`
|
|
83
94
|
}), {
|
|
84
|
-
dynamicContentList:
|
|
85
|
-
compiledHtml:
|
|
86
|
-
rawHtml:
|
|
87
|
-
css:
|
|
88
|
-
ampHtml:
|
|
89
|
-
ampErrors:
|
|
95
|
+
dynamicContentList: P,
|
|
96
|
+
compiledHtml: w,
|
|
97
|
+
rawHtml: r,
|
|
98
|
+
css: l,
|
|
99
|
+
ampHtml: E,
|
|
100
|
+
ampErrors: T,
|
|
90
101
|
modules: g.map(Number),
|
|
91
102
|
recommendation: {
|
|
92
|
-
campaignUrls:
|
|
103
|
+
campaignUrls: F.recommendationCampaignUrls,
|
|
93
104
|
configs: {}
|
|
94
105
|
},
|
|
95
106
|
unsubscribe: {
|
|
96
|
-
status:
|
|
97
|
-
config:
|
|
107
|
+
status: b.length > 0,
|
|
108
|
+
config: b
|
|
98
109
|
}
|
|
99
110
|
};
|
|
100
111
|
}
|
|
101
112
|
};
|
|
102
113
|
};
|
|
103
114
|
export {
|
|
104
|
-
|
|
105
|
-
|
|
115
|
+
O as getHtmlReferencedUnsubscribePages,
|
|
116
|
+
Z as useTemplatePreparation
|
|
106
117
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.16.0-beta.0faee0c",
|
|
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",
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
"types": "./dist/components/Guido.vue.d.ts",
|
|
15
15
|
"require": "./dist/components/Guido.vue.js"
|
|
16
16
|
},
|
|
17
|
+
"./tracking-ids": {
|
|
18
|
+
"types": "./dist/src/public/trackingIds.d.ts",
|
|
19
|
+
"import": "./dist/public/trackingIds.js"
|
|
20
|
+
},
|
|
17
21
|
"./style": "./dist/guido.css"
|
|
18
22
|
},
|
|
19
23
|
"scripts": {
|