@useinsider/guido 3.12.0-beta.841bb6a → 3.12.0-beta.86e34da
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 +9 -4
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +50 -49
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +1 -1
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +8 -8
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +10 -10
- package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.js +38 -0
- package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue2.js +271 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.js +18 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue2.js +42 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.js +20 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue2.js +18 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.js +20 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue2.js +60 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.js +19 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue2.js +19 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.js +22 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue2.js +29 -0
- package/dist/composables/usePreviewInteractionGuard.js +36 -11
- package/dist/composables/useRecommendation.js +56 -40
- package/dist/composables/useRecommendationPreview.js +61 -60
- package/dist/composables/useStrategyFilters.js +16 -0
- package/dist/config/migrator/recommendationMigrator.js +7 -4
- package/dist/enums/date.js +4 -3
- package/dist/enums/extensions/filteringV2.js +1024 -0
- package/dist/enums/extensions/recommendationBlock.js +45 -24
- package/dist/enums/extensions/strategyDetail.js +148 -0
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +12 -11
- package/dist/extensions/Blocks/Recommendation/controls/blockBackground/index.js +10 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +141 -123
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +285 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +23 -21
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +16 -2
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +257 -0
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +41 -40
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +460 -113
- package/dist/extensions/Blocks/Recommendation/utils/strategyHumanizer.js +97 -0
- package/dist/extensions/Blocks/Recommendation/utils/strategyNavigation.js +8 -0
- package/dist/extensions/Blocks/Recommendation/utils/strategySummary.js +95 -0
- package/dist/extensions/Blocks/Recommendation/utils/strategyUrl.js +43 -0
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +24 -10
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +3 -2
- package/dist/extensions/Blocks/common-control.js +2 -1
- package/dist/extensions/Blocks/controlFactories.js +125 -75
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +120 -32
- package/dist/services/stripoApi.js +18 -18
- package/dist/src/@types/config/schemas.d.ts +10 -0
- package/dist/src/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.d.ts +2 -0
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.d.ts +43 -0
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.d.ts +29 -0
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.d.ts +40 -0
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.d.ts +38 -0
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.d.ts +51 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/usePreviewInteractionGuard.d.ts +1 -1
- package/dist/src/composables/useRecommendation.d.ts +2 -0
- package/dist/src/composables/useStrategyFilters.d.ts +24 -0
- package/dist/src/enums/extensions/filteringV2.d.ts +72 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +33 -0
- package/dist/src/enums/extensions/strategyDetail.d.ts +90 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +14 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +10 -4
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +75 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +903 -1
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyHumanizer.d.ts +50 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyNavigation.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/strategySummary.d.ts +34 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyUrl.d.ts +51 -0
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +8 -1
- package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +1 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +2 -1
- package/dist/src/extensions/Blocks/controlFactories.d.ts +36 -0
- package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
- package/dist/src/services/recommendationApi.d.ts +9 -1
- package/dist/src/stores/config.d.ts +18 -0
- package/dist/src/utils/genericUtil.d.ts +9 -0
- package/dist/src/utils/urlSchemes.d.ts +6 -0
- package/dist/static/styles/components/base-input.css.js +6 -7
- package/dist/utils/dateUtil.js +23 -10
- package/dist/utils/genericUtil.js +10 -1
- package/dist/utils/pairProductVariables.js +43 -44
- package/dist/utils/templatePreparation.js +70 -57
- package/dist/utils/urlSchemes.js +4 -0
- package/package.json +1 -1
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import { productPairs as
|
|
2
|
-
import { DefaultConfigValues as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const H = L.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), g = new DOMParser().parseFromString(H, "text/html"), m = N.PAIRS_FOR_EXTENSION;
|
|
1
|
+
import { productPairs as q } from "../extensions/Blocks/Items/enums/productEnums.js";
|
|
2
|
+
import { DefaultConfigValues as N } from "../extensions/Blocks/Items/enums/settingsEnums.js";
|
|
3
|
+
function W(M) {
|
|
4
|
+
const S = M.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), g = new DOMParser().parseFromString(S, "text/html"), m = q.PAIRS_FOR_EXTENSION;
|
|
6
5
|
Object.entries(m).forEach(([r, f]) => {
|
|
7
6
|
g.querySelectorAll(".ins-product-td").forEach((c) => {
|
|
8
|
-
const A = c.getAttribute("data-number") || "1",
|
|
9
|
-
c.querySelectorAll(`[product-attr="${r}"]`).forEach((
|
|
7
|
+
const A = c.getAttribute("data-number") || "1", C = c.getAttribute("data-type") || "CART_ITEMS";
|
|
8
|
+
c.querySelectorAll(`[product-attr="${r}"]`).forEach((e) => {
|
|
10
9
|
var F, I, w;
|
|
11
|
-
const
|
|
10
|
+
const $ = e.getAttribute("data-type") || C, u = e.getAttribute("data-number") || A, d = f[$];
|
|
12
11
|
if (d)
|
|
13
12
|
switch (r) {
|
|
14
13
|
case "imageSrc": {
|
|
15
|
-
let
|
|
16
|
-
if (
|
|
14
|
+
let t = null, i = null;
|
|
15
|
+
if (e.tagName === "IMG" ? (t = e, i = t.closest("a")) : (t = e.querySelector("img"), i = e.querySelector("a") || e.closest("a")), !t)
|
|
17
16
|
break;
|
|
18
17
|
const a = d.DEFAULT, s = d.ATTR;
|
|
19
|
-
if (a &&
|
|
20
|
-
const o =
|
|
18
|
+
if (a && t.src) {
|
|
19
|
+
const o = t.src;
|
|
21
20
|
a.some((h) => {
|
|
22
|
-
const l = h.split("/").pop() || "",
|
|
23
|
-
return o.includes(h) || o.includes(l) ||
|
|
24
|
-
}) && (
|
|
21
|
+
const l = h.split("/").pop() || "", b = o.split("/").pop() || "";
|
|
22
|
+
return o.includes(h) || o.includes(l) || b === l;
|
|
23
|
+
}) && (t.src = `{{${s}_${u}}}`);
|
|
25
24
|
}
|
|
26
|
-
const n = (I = (F = m.name) == null ? void 0 : F[
|
|
27
|
-
if (n &&
|
|
28
|
-
const o = (w = m.itemLink) == null ? void 0 : w[
|
|
25
|
+
const n = (I = (F = m.name) == null ? void 0 : F[$]) == null ? void 0 : I.ATTR;
|
|
26
|
+
if (n && t.setAttribute("alt", `{{${n}_${u}}}`), i) {
|
|
27
|
+
const o = (w = m.itemLink) == null ? void 0 : w[$];
|
|
29
28
|
if (o) {
|
|
30
29
|
const E = o.HREF, h = o.DEFAULT_HREF || "#!", l = i.href;
|
|
31
30
|
(l === "#" || l === "" || l.endsWith("#!") || l.endsWith(h) || l === `${window.location.href}${h}` || !l || l === window.location.href) && (i.href = `{{${E}_${u}}}`);
|
|
@@ -34,9 +33,9 @@ function V(L) {
|
|
|
34
33
|
break;
|
|
35
34
|
}
|
|
36
35
|
case "name": {
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
const n =
|
|
36
|
+
const t = d, i = t.ATTR, a = t.DEFAULT_HREF || "#!", s = t.HREF;
|
|
37
|
+
e.textContent && (e.textContent = `{{${i}_${u}}}`);
|
|
38
|
+
const n = e.closest("a") || (e.tagName === "A" ? e : null);
|
|
40
39
|
if (n && s) {
|
|
41
40
|
const o = n.href, E = `${window.location.href}${a}`;
|
|
42
41
|
(o === E || o.endsWith(a)) && (n.href = `{{${s}_${u}}}`);
|
|
@@ -45,23 +44,23 @@ function V(L) {
|
|
|
45
44
|
}
|
|
46
45
|
case "price":
|
|
47
46
|
case "originalPrice": {
|
|
48
|
-
const
|
|
47
|
+
const t = d, i = e.getAttribute("data-formated"), a = e.getAttribute("data-single_price"), s = i === "true", n = a === "true", o = e.getAttribute("data-curency") || "before";
|
|
49
48
|
let E;
|
|
50
|
-
n ? E = s ?
|
|
51
|
-
const h =
|
|
49
|
+
n ? E = s ? t.SINGLE_PRICE_FORMATTED : t.SINGLE_PRICE : E = s ? t.PRICE_FORMATTED : t.PRICE;
|
|
50
|
+
const h = t.CURRENCY;
|
|
52
51
|
let l = `{{${E}_${u}}}`;
|
|
53
|
-
const
|
|
54
|
-
let
|
|
55
|
-
|
|
52
|
+
const b = (e.getAttribute("data-currency_symbol") || "").trim(), x = b !== "" && b !== N.productPriceCurrencySymbolControlValue;
|
|
53
|
+
let T = "";
|
|
54
|
+
x ? T = b : h && (T = `{{${h}_${u}}}`), T && (l = o === "after" ? `${l} ${T}` : `${T} ${l}`), e.textContent = l;
|
|
56
55
|
break;
|
|
57
56
|
}
|
|
58
57
|
case "quantity": {
|
|
59
|
-
const
|
|
60
|
-
|
|
58
|
+
const t = d, i = t.ATTR, a = t.DEFAULT;
|
|
59
|
+
e.textContent && e.textContent.trim() === a && (e.textContent = `{{${i}_${u}}}`);
|
|
61
60
|
break;
|
|
62
61
|
}
|
|
63
62
|
case "button": {
|
|
64
|
-
const
|
|
63
|
+
const t = d, i = t.HREF, a = t.DEFAULT_HREF || "#!", s = e.tagName === "A" ? e : e.querySelector("a");
|
|
65
64
|
if (s) {
|
|
66
65
|
const n = s.href || "", o = `${window.location.href}${a}`;
|
|
67
66
|
(n === "" || n === "#" || n === o || n.endsWith(a) || n.endsWith("#!") || n === window.location.href) && (s.href = `{{${i}_${u}}}`);
|
|
@@ -69,7 +68,7 @@ function V(L) {
|
|
|
69
68
|
break;
|
|
70
69
|
}
|
|
71
70
|
case "itemLink": {
|
|
72
|
-
const
|
|
71
|
+
const t = d, i = t.HREF, a = t.DEFAULT_HREF || "#!", s = e;
|
|
73
72
|
if (s.href) {
|
|
74
73
|
const n = s.href, o = `${window.location.href}${a}`;
|
|
75
74
|
(n === o || n.endsWith(a)) && (s.href = `{{${i}_${u}}}`);
|
|
@@ -78,8 +77,8 @@ function V(L) {
|
|
|
78
77
|
}
|
|
79
78
|
default: {
|
|
80
79
|
if ("ATTR" in d) {
|
|
81
|
-
const
|
|
82
|
-
|
|
80
|
+
const t = d.ATTR;
|
|
81
|
+
e.textContent && (e.textContent = `{{${t}_${u}}}`);
|
|
83
82
|
}
|
|
84
83
|
break;
|
|
85
84
|
}
|
|
@@ -87,11 +86,11 @@ function V(L) {
|
|
|
87
86
|
});
|
|
88
87
|
});
|
|
89
88
|
});
|
|
90
|
-
const
|
|
91
|
-
` : "", D = g.querySelectorAll(".ins-product-td"),
|
|
89
|
+
const H = S.match(/<!DOCTYPE[^>]*>/i), P = H ? `${H[0]}
|
|
90
|
+
` : "", D = g.querySelectorAll(".ins-product-td"), k = [];
|
|
92
91
|
D.forEach((r) => {
|
|
93
92
|
const f = r.getAttribute("data-type") || "CART_ITEMS", p = r.getAttribute("data-number") || "1", c = r.getAttribute("data-nodup"), A = r.outerHTML;
|
|
94
|
-
|
|
93
|
+
k.push({
|
|
95
94
|
element: r,
|
|
96
95
|
outerHtml: A,
|
|
97
96
|
type: f,
|
|
@@ -100,7 +99,7 @@ function V(L) {
|
|
|
100
99
|
});
|
|
101
100
|
});
|
|
102
101
|
let _ = P + g.documentElement.outerHTML;
|
|
103
|
-
|
|
102
|
+
k.reverse().forEach(({ outerHtml: r, type: f, number: p }) => {
|
|
104
103
|
let c = "";
|
|
105
104
|
switch (f) {
|
|
106
105
|
case "CART_ITEMS":
|
|
@@ -114,21 +113,21 @@ function V(L) {
|
|
|
114
113
|
break;
|
|
115
114
|
}
|
|
116
115
|
if (c) {
|
|
117
|
-
const
|
|
118
|
-
_ = _.replace(r,
|
|
116
|
+
const C = parseInt(p) - 1, $ = `${`{% if ${c} > ${C} %}`}${r}{% endif %}`;
|
|
117
|
+
_ = _.replace(r, $);
|
|
119
118
|
}
|
|
120
119
|
});
|
|
121
|
-
const
|
|
122
|
-
return
|
|
120
|
+
const L = g.querySelectorAll('[product-attr="originalPrice"][data-type="CART_ITEMS"]'), y = [];
|
|
121
|
+
return L.forEach((r) => {
|
|
123
122
|
const f = r.getAttribute("data-number"), p = r.getAttribute("data-type");
|
|
124
123
|
if (!f || p !== "CART_ITEMS")
|
|
125
124
|
return;
|
|
126
125
|
const c = r.closest(".product-original-price-class");
|
|
127
126
|
if (c) {
|
|
128
127
|
const A = c.outerHTML;
|
|
129
|
-
|
|
128
|
+
y.some((R) => R.tdOuterHtml === A) || y.push({ tdOuterHtml: A, number: f });
|
|
130
129
|
}
|
|
131
|
-
}),
|
|
130
|
+
}), y.reverse().forEach(({ tdOuterHtml: r, number: f }) => {
|
|
132
131
|
const p = `{% if ins_apr_price_${f} != ins_apr_originalprice_${f} %}`;
|
|
133
132
|
if (!_.includes(p) && !r.includes("{% if")) {
|
|
134
133
|
const A = `${p}${r}{% endif %}`;
|
|
@@ -137,5 +136,5 @@ function V(L) {
|
|
|
137
136
|
}), _.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}");
|
|
138
137
|
}
|
|
139
138
|
export {
|
|
140
|
-
|
|
139
|
+
W as pairProductVariables
|
|
141
140
|
};
|
|
@@ -1,106 +1,119 @@
|
|
|
1
1
|
import { useActionsApi as P } from "../composables/useActionsApi.js";
|
|
2
|
-
import { useHtmlCompiler as
|
|
3
|
-
import { DEFAULT_CURRENCY as
|
|
4
|
-
import { useRecommendationExtensionStore as
|
|
5
|
-
import { mapLegacyStrategy as
|
|
6
|
-
import { DATA_ATTRIBUTES as
|
|
7
|
-
import { parsePageList as
|
|
8
|
-
import { useDynamicContentStore as
|
|
9
|
-
import { useUnsubscribeStore as
|
|
10
|
-
function
|
|
11
|
-
const
|
|
12
|
-
return
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
}), [...new Set(
|
|
2
|
+
import { useHtmlCompiler as D } from "../composables/useHtmlCompiler.js";
|
|
3
|
+
import { DEFAULT_CURRENCY as u, DEFAULT_NODE_CONFIG as n } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
4
|
+
import { useRecommendationExtensionStore as w } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
5
|
+
import { mapLegacyStrategy as I } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
|
|
6
|
+
import { DATA_ATTRIBUTES as b } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
7
|
+
import { parsePageList as U } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
8
|
+
import { useDynamicContentStore as E } from "../stores/dynamic-content.js";
|
|
9
|
+
import { useUnsubscribeStore as H } from "../stores/unsubscribe.js";
|
|
10
|
+
function R(m) {
|
|
11
|
+
const a = new DOMParser().parseFromString(m, "text/html").querySelectorAll(`[${b.PAGE_LIST}]`), r = [];
|
|
12
|
+
return a.forEach((t) => {
|
|
13
|
+
const i = t.getAttribute(b.PAGE_LIST);
|
|
14
|
+
i && r.push(...U(i));
|
|
15
|
+
}), [...new Set(r)];
|
|
16
16
|
}
|
|
17
|
-
async function
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
17
|
+
async function F(m) {
|
|
18
|
+
const l = new DOMParser().parseFromString(m, "text/html").querySelectorAll(".recommendation-block-v2");
|
|
19
|
+
if (l.length === 0)
|
|
20
20
|
return;
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
const
|
|
25
|
-
if (!Number.isFinite(
|
|
21
|
+
const a = w(), r = /* @__PURE__ */ new Set();
|
|
22
|
+
l.forEach((t) => {
|
|
23
|
+
var f, y, d, S, o;
|
|
24
|
+
const i = t.getAttribute("recommendation-id"), g = i ? Number(i) : NaN;
|
|
25
|
+
if (!Number.isFinite(g))
|
|
26
26
|
return;
|
|
27
|
-
const
|
|
28
|
-
if (!
|
|
27
|
+
const c = t.getAttribute("esd-ext-config");
|
|
28
|
+
if (!c)
|
|
29
29
|
return;
|
|
30
30
|
let e;
|
|
31
31
|
try {
|
|
32
|
-
e = JSON.parse(
|
|
32
|
+
e = JSON.parse(c);
|
|
33
33
|
} catch {
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
36
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
37
37
|
return;
|
|
38
|
-
const
|
|
38
|
+
const s = {
|
|
39
39
|
// Normalize legacy strategy keys (e.g. `mostViewed` → `mostPopular`) so
|
|
40
40
|
// already-saved blocks that never re-run the migrator don't emit a
|
|
41
41
|
// strategy-less campaign URL. `||` also catches '' / undefined (SD-144882).
|
|
42
|
-
strategy:
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
strategy: I(e.strategy) || n.strategy,
|
|
43
|
+
strategyId: e.strategyId ?? n.strategyId,
|
|
44
|
+
language: e.language ?? n.language,
|
|
45
|
+
size: e.size ?? n.size,
|
|
45
46
|
// Spread the default arrays so each block gets a fresh reference
|
|
46
47
|
// 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: ((
|
|
53
|
-
currencyDecimalSeparator: ((
|
|
54
|
-
currencyThousandSeparator: ((
|
|
48
|
+
productIds: e.productIds ?? [...n.productIds],
|
|
49
|
+
filters: e.filters ?? [...n.filters],
|
|
50
|
+
shuffleProducts: e.shuffleProducts ?? n.shuffleProducts,
|
|
51
|
+
currencyCode: ((f = e.currency) == null ? void 0 : f.code) ?? u.code,
|
|
52
|
+
currencyAlignment: ((y = e.currency) == null ? void 0 : y.alignment) ?? u.alignment,
|
|
53
|
+
currencyDecimalCount: ((d = e.currency) == null ? void 0 : d.decimalCount) ?? u.decimalCount,
|
|
54
|
+
currencyDecimalSeparator: ((S = e.currency) == null ? void 0 : S.decimalSeparator) ?? u.decimalSeparator,
|
|
55
|
+
currencyThousandSeparator: ((o = e.currency) == null ? void 0 : o.thousandSeparator) ?? u.thousandSeparator
|
|
55
56
|
};
|
|
56
|
-
|
|
57
|
+
a.seedBlockUrlConfig(g, s), r.add(s.strategyId);
|
|
57
58
|
});
|
|
58
59
|
try {
|
|
59
|
-
await
|
|
60
|
+
await a.fetchRecommendationCreateData();
|
|
60
61
|
} catch (t) {
|
|
61
62
|
console.warn(
|
|
62
63
|
"Recommendation reference data pre-load failed; validator will skip the availability check.",
|
|
63
64
|
t
|
|
64
65
|
);
|
|
65
66
|
}
|
|
67
|
+
if (r.delete(""), !!r.size) {
|
|
68
|
+
try {
|
|
69
|
+
await a.fetchRecommendationStrategies();
|
|
70
|
+
} catch (t) {
|
|
71
|
+
console.warn("Strategy listing pre-load failed; the deleted-strategy save check will be skipped.", t);
|
|
72
|
+
}
|
|
73
|
+
await Promise.all(
|
|
74
|
+
[...r].map((t) => a.fetchStrategyUrlTemplate(t))
|
|
75
|
+
);
|
|
76
|
+
}
|
|
66
77
|
}
|
|
67
78
|
const G = () => {
|
|
68
|
-
const
|
|
79
|
+
const m = E(), p = H(), { getCompiledEmail: l, getTemplateData: a } = P(), { compileHtml: r, compileAmpHtml: t } = D();
|
|
69
80
|
return {
|
|
70
81
|
prepareTemplateDetails: async () => {
|
|
71
|
-
const { html:
|
|
82
|
+
const { html: g, ampHtml: c = "", ampErrors: e = [] } = await l({
|
|
72
83
|
minimize: !0,
|
|
73
84
|
resetDataSavedFlag: !1
|
|
74
|
-
}), { html:
|
|
75
|
-
|
|
76
|
-
const
|
|
85
|
+
}), { html: s, css: f, syncModulesIds: y = [] } = await a();
|
|
86
|
+
p.selectedUnsubscribePages.length && await p.fetchTemplates(), await F(s);
|
|
87
|
+
const d = w();
|
|
88
|
+
await d.awaitPendingStrategyUrls();
|
|
89
|
+
const { compiledHtml: S, stats: o, appliedRules: A } = r(g), C = c && t(c).compiledHtml, T = m.getSelectedDynamicContentList, h = R(s);
|
|
77
90
|
return console.debug("HTML Compilation Stats:", {
|
|
78
|
-
originalSize:
|
|
79
|
-
compiledSize:
|
|
80
|
-
reduction: `${
|
|
91
|
+
originalSize: o.originalSize,
|
|
92
|
+
compiledSize: o.compiledSize,
|
|
93
|
+
reduction: `${o.reductionPercentage.toFixed(2)}%`,
|
|
81
94
|
appliedRules: A,
|
|
82
|
-
executionTime: `${
|
|
95
|
+
executionTime: `${o.executionTime.toFixed(2)}ms`
|
|
83
96
|
}), {
|
|
84
97
|
dynamicContentList: T,
|
|
85
|
-
compiledHtml:
|
|
86
|
-
rawHtml:
|
|
87
|
-
css:
|
|
98
|
+
compiledHtml: S,
|
|
99
|
+
rawHtml: s,
|
|
100
|
+
css: f,
|
|
88
101
|
ampHtml: C,
|
|
89
|
-
ampErrors:
|
|
90
|
-
modules:
|
|
102
|
+
ampErrors: e,
|
|
103
|
+
modules: y.map(Number),
|
|
91
104
|
recommendation: {
|
|
92
|
-
campaignUrls:
|
|
105
|
+
campaignUrls: d.recommendationCampaignUrls,
|
|
93
106
|
configs: {}
|
|
94
107
|
},
|
|
95
108
|
unsubscribe: {
|
|
96
|
-
status:
|
|
97
|
-
config:
|
|
109
|
+
status: h.length > 0,
|
|
110
|
+
config: h
|
|
98
111
|
}
|
|
99
112
|
};
|
|
100
113
|
}
|
|
101
114
|
};
|
|
102
115
|
};
|
|
103
116
|
export {
|
|
104
|
-
|
|
117
|
+
R as getHtmlReferencedUnsubscribePages,
|
|
105
118
|
G as useTemplatePreparation
|
|
106
119
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.12.0-beta.
|
|
3
|
+
"version": "3.12.0-beta.86e34da",
|
|
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",
|