@useinsider/guido 3.9.1-beta.65a8ac1 → 3.9.1-beta.fdaa66f
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.
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* - `trending` → `trendingProducts` (id 40, path `trending`)
|
|
9
9
|
* - `mostValuable` → `mostValuableOfPartner` (id 46, path `most-valuable`)
|
|
10
10
|
* - `topSellers` → `mostPurchased` (id 62, path `top-sellers`)
|
|
11
|
+
* - `mostViewed` → `mostPopular` (id 61, path `most-popular`)
|
|
11
12
|
*
|
|
12
13
|
* Used at two boundaries:
|
|
13
14
|
* 1. The migrator (`settingsMapper`), so freshly migrated node configs carry
|
|
@@ -2,15 +2,16 @@ import { useActionsApi as P } from "../composables/useActionsApi.js";
|
|
|
2
2
|
import { useHtmlCompiler as w } from "../composables/useHtmlCompiler.js";
|
|
3
3
|
import { DEFAULT_CURRENCY as l, DEFAULT_NODE_CONFIG as i } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
4
4
|
import { useRecommendationExtensionStore as b } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
5
|
+
import { mapLegacyStrategy as E } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
|
|
5
6
|
import { DATA_ATTRIBUTES as h } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
6
|
-
import { parsePageList as
|
|
7
|
-
import { useDynamicContentStore as
|
|
8
|
-
import { useUnsubscribeStore as
|
|
9
|
-
function
|
|
7
|
+
import { parsePageList as H } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
8
|
+
import { useDynamicContentStore as U } from "../stores/dynamic-content.js";
|
|
9
|
+
import { useUnsubscribeStore as F } from "../stores/unsubscribe.js";
|
|
10
|
+
function L(s) {
|
|
10
11
|
const o = new DOMParser().parseFromString(s, "text/html").querySelectorAll(`[${h.PAGE_LIST}]`), t = [];
|
|
11
|
-
return o.forEach((
|
|
12
|
-
const
|
|
13
|
-
|
|
12
|
+
return o.forEach((a) => {
|
|
13
|
+
const n = a.getAttribute(h.PAGE_LIST);
|
|
14
|
+
n && t.push(...H(n));
|
|
14
15
|
}), [...new Set(t)];
|
|
15
16
|
}
|
|
16
17
|
async function R(s) {
|
|
@@ -20,8 +21,8 @@ async function R(s) {
|
|
|
20
21
|
const o = b();
|
|
21
22
|
m.forEach((t) => {
|
|
22
23
|
var c, p, g, f, r;
|
|
23
|
-
const
|
|
24
|
-
if (!Number.isFinite(
|
|
24
|
+
const a = t.getAttribute("recommendation-id"), n = a ? Number(a) : NaN;
|
|
25
|
+
if (!Number.isFinite(n))
|
|
25
26
|
return;
|
|
26
27
|
const d = t.getAttribute("esd-ext-config");
|
|
27
28
|
if (!d)
|
|
@@ -35,7 +36,10 @@ async function R(s) {
|
|
|
35
36
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
36
37
|
return;
|
|
37
38
|
const y = {
|
|
38
|
-
strategy
|
|
39
|
+
// Normalize legacy strategy keys (e.g. `mostViewed` → `mostPopular`) so
|
|
40
|
+
// already-saved blocks that never re-run the migrator don't emit a
|
|
41
|
+
// strategy-less campaign URL. `||` also catches '' / undefined (SD-144882).
|
|
42
|
+
strategy: E(e.strategy) || i.strategy,
|
|
39
43
|
language: e.language ?? i.language,
|
|
40
44
|
size: e.size ?? i.size,
|
|
41
45
|
// Spread the default arrays so each block gets a fresh reference
|
|
@@ -49,7 +53,7 @@ async function R(s) {
|
|
|
49
53
|
currencyDecimalSeparator: ((f = e.currency) == null ? void 0 : f.decimalSeparator) ?? l.decimalSeparator,
|
|
50
54
|
currencyThousandSeparator: ((r = e.currency) == null ? void 0 : r.thousandSeparator) ?? l.thousandSeparator
|
|
51
55
|
};
|
|
52
|
-
o.seedBlockUrlConfig(
|
|
56
|
+
o.seedBlockUrlConfig(n, y);
|
|
53
57
|
});
|
|
54
58
|
try {
|
|
55
59
|
await o.fetchRecommendationCreateData();
|
|
@@ -60,8 +64,8 @@ async function R(s) {
|
|
|
60
64
|
);
|
|
61
65
|
}
|
|
62
66
|
}
|
|
63
|
-
const
|
|
64
|
-
const s =
|
|
67
|
+
const G = () => {
|
|
68
|
+
const s = U(), u = F(), { getCompiledEmail: m, getTemplateData: o } = P(), { compileHtml: t, compileAmpHtml: a } = w();
|
|
65
69
|
return {
|
|
66
70
|
prepareTemplateDetails: async () => {
|
|
67
71
|
const { html: d, ampHtml: e = "", ampErrors: y = [] } = await m({
|
|
@@ -69,7 +73,7 @@ const v = () => {
|
|
|
69
73
|
resetDataSavedFlag: !1
|
|
70
74
|
}), { html: c, css: p, syncModulesIds: g = [] } = await o();
|
|
71
75
|
u.selectedUnsubscribePages.length && await u.fetchTemplates(), await R(c);
|
|
72
|
-
const { compiledHtml: f, stats: r, appliedRules: A } = t(d), C = e &&
|
|
76
|
+
const { compiledHtml: f, stats: r, appliedRules: A } = t(d), C = e && a(e).compiledHtml, T = s.getSelectedDynamicContentList, D = b(), S = L(c);
|
|
73
77
|
return console.debug("HTML Compilation Stats:", {
|
|
74
78
|
originalSize: r.originalSize,
|
|
75
79
|
compiledSize: r.compiledSize,
|
|
@@ -97,6 +101,6 @@ const v = () => {
|
|
|
97
101
|
};
|
|
98
102
|
};
|
|
99
103
|
export {
|
|
100
|
-
|
|
101
|
-
|
|
104
|
+
L as getHtmlReferencedUnsubscribePages,
|
|
105
|
+
G as useTemplatePreparation
|
|
102
106
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.9.1-beta.
|
|
3
|
+
"version": "3.9.1-beta.fdaa66f",
|
|
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",
|