@useinsider/guido 3.0.0-beta.3068a18 → 3.0.0-beta.39155d9
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 +10 -8
- package/dist/components/Guido.vue.js +3 -3
- package/dist/components/Guido.vue2.js +61 -60
- package/dist/components/organisms/header/EditorActions.vue.js +10 -8
- package/dist/components/organisms/header/EditorActions.vue2.js +41 -31
- package/dist/components/organisms/header/MigrationConfirmModal.vue.js +17 -0
- package/dist/components/organisms/header/MigrationConfirmModal.vue2.js +39 -0
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +1 -1
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +1 -1
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +1 -1
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +2 -2
- package/dist/composables/useCustomFieldAttributes.js +16 -0
- package/dist/composables/useHtmlValidator.js +40 -38
- package/dist/config/compiler/unsubscribeCompilerRules.js +14 -14
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +29 -18
- package/dist/config/i18n/en/labels.json.js +8 -3
- package/dist/config/migrator/itemsBlockMigrator.js +135 -131
- package/dist/config/migrator/recommendationMigrator.js +58 -54
- package/dist/enums/block.js +4 -0
- package/dist/extensions/Blocks/Items/block.js +30 -21
- package/dist/extensions/Blocks/Items/iconsRegistry.js +7 -6
- package/dist/extensions/Blocks/Items/items.css.js +48 -0
- package/dist/extensions/Blocks/Recommendation/block.js +25 -13
- package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +15 -12
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +693 -144
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +78 -0
- package/dist/extensions/Blocks/Recommendation/controls/layout/index.js +27 -24
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +134 -126
- package/dist/extensions/Blocks/Recommendation/extension.js +18 -16
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +5 -4
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +174 -2
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +124 -106
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +8 -7
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +63 -34
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +30 -33
- package/dist/extensions/Blocks/Recommendation/templates/index.js +8 -8
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +28 -13
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +25 -44
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +62 -38
- package/dist/extensions/Blocks/common-control.js +12 -4
- package/dist/guido.css +1 -1
- package/dist/services/customFieldAttributesApi.js +21 -0
- package/dist/src/@types/config/schemas.d.ts +4 -0
- package/dist/src/@types/extensions/block.d.ts +2 -0
- package/dist/src/App.vue.d.ts +3 -1
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/MigrationConfirmModal.vue.d.ts +6 -0
- package/dist/src/components/wrappers/WpModal.vue.d.ts +2 -2
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useCustomFieldAttributes.d.ts +5 -0
- package/dist/src/enums/block.d.ts +4 -0
- package/dist/src/extensions/Blocks/Items/block.d.ts +3 -1
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +4 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +8 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +134 -44
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +105 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +10 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +37 -2
- package/dist/src/extensions/Blocks/common-control.d.ts +5 -0
- package/dist/src/mock/api/custom-field-attributes.d.ts +2 -0
- package/dist/src/services/customFieldAttributesApi.d.ts +3 -0
- package/dist/src/stores/config.d.ts +18 -0
- package/dist/src/stores/template.d.ts +29 -0
- package/dist/src/utils/migrationBannerHtml.d.ts +2 -0
- package/dist/static/assets/info.svg.js +5 -0
- package/dist/static/styles/variables.css.js +3 -0
- package/dist/stores/template.js +15 -0
- package/dist/utils/migrationBannerHtml.js +21 -0
- package/package.json +3 -2
|
@@ -1,54 +1,55 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { useConfig as V } from "./useConfig.js";
|
|
2
|
+
import { useCustomFieldAttributes as _ } from "./useCustomFieldAttributes.js";
|
|
3
|
+
import { TemplateTypes as H } from "../enums/defaults.js";
|
|
4
|
+
import { DISPLAY_CONDITIONS_REGEX as P, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as G, CampaignCouldNotBeSavedKey as M, CanNotMakeAnyChangesForRunningKey as $ } from "../enums/html-validator.js";
|
|
4
5
|
import { ToasterTypeOptions as c } from "../enums/toaster.js";
|
|
5
|
-
import { itemsBlockDynamicVariables as
|
|
6
|
-
import { useRecommendationStore as
|
|
7
|
-
import { base64EncodeWithSpecialChars as
|
|
8
|
-
import { useHttp as
|
|
9
|
-
import { useToaster as
|
|
10
|
-
import { useTranslations as
|
|
11
|
-
const
|
|
12
|
-
function
|
|
13
|
-
return [...i.matchAll(
|
|
6
|
+
import { itemsBlockDynamicVariables as X } from "../extensions/Blocks/Items/enums/productEnums.js";
|
|
7
|
+
import { useRecommendationStore as j } from "../stores/recommendation.js";
|
|
8
|
+
import { base64EncodeWithSpecialChars as q } from "../utils/base64.js";
|
|
9
|
+
import { useHttp as z } from "./useHttp.js";
|
|
10
|
+
import { useToaster as K } from "./useToaster.js";
|
|
11
|
+
import { useTranslations as U } from "./useTranslations.js";
|
|
12
|
+
const Y = /recommendation-id="(\d+)"/g;
|
|
13
|
+
function Z(i) {
|
|
14
|
+
return [...i.matchAll(Y)].map((u) => u[1]);
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
+
function J(i, u) {
|
|
16
17
|
return u.some((d) => i.startsWith(`${d}_`));
|
|
17
18
|
}
|
|
18
|
-
const
|
|
19
|
+
const ue = () => {
|
|
19
20
|
var y, h;
|
|
20
|
-
const { showToaster: i } =
|
|
21
|
+
const { showToaster: i } = K(), { post: u } = z(), { config: d } = V(), r = U(), g = j(), { customFieldAttributes: b } = _(), p = ((h = (y = d.value) == null ? void 0 : y.partner) == null ? void 0 : h.messageType) === H.transactional, w = async (e) => {
|
|
21
22
|
const t = await u(
|
|
22
23
|
"/newsletter/template-library/check-template-html-body",
|
|
23
|
-
{ html:
|
|
24
|
+
{ html: q(e) }
|
|
24
25
|
), { status: n, message: l } = t.data;
|
|
25
26
|
return n || i({
|
|
26
27
|
type: c.Alert,
|
|
27
28
|
message: n === void 0 ? l : r("newsletter.invalid-url-link-for-toaster")
|
|
28
|
-
}), r(
|
|
29
|
+
}), r(M), l === r($) && i({
|
|
29
30
|
type: c.Alert,
|
|
30
31
|
message: r("newsletter.already-in-progress")
|
|
31
32
|
}), n;
|
|
32
|
-
},
|
|
33
|
+
}, S = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), E = (e) => ["if", "endif"].includes(e.toLowerCase()), A = (e, s) => {
|
|
33
34
|
const t = e.match(/({%(.*?)%})/g);
|
|
34
35
|
let n = !0;
|
|
35
36
|
return t !== null && !p && t.forEach((l) => {
|
|
36
37
|
const o = l.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
|
|
37
38
|
if (o && o.length > 0) {
|
|
38
39
|
const [a] = o;
|
|
39
|
-
|
|
40
|
+
S(a) && !s.includes(a) && (i({
|
|
40
41
|
type: c.Warning,
|
|
41
42
|
message: r("custom-fields.invalid-custom-fields")
|
|
42
43
|
}), n = !1);
|
|
43
44
|
}
|
|
44
45
|
}), n;
|
|
45
|
-
},
|
|
46
|
+
}, I = async (e, s, t) => {
|
|
46
47
|
const n = t ? await w(e) : !0;
|
|
47
|
-
return
|
|
48
|
-
},
|
|
48
|
+
return A(e, s) && n;
|
|
49
|
+
}, k = (e) => e.length > 0 ? !0 : (i({
|
|
49
50
|
type: c.Warning,
|
|
50
51
|
message: r("newsletter.html-content-is-empty")
|
|
51
|
-
}), !1),
|
|
52
|
+
}), !1), x = (e) => {
|
|
52
53
|
const s = (e.match(/{/gm) || []).length, t = (e.match(/}/gm) || []).length;
|
|
53
54
|
return s > t && i({
|
|
54
55
|
type: c.Warning,
|
|
@@ -57,7 +58,7 @@ const ce = () => {
|
|
|
57
58
|
type: c.Warning,
|
|
58
59
|
message: r("custom-fields.missing-opening-braces")
|
|
59
60
|
}), s === t;
|
|
60
|
-
},
|
|
61
|
+
}, F = (e) => {
|
|
61
62
|
const s = e.match(/{{\s*(\w+\s+((\w+\|\w+)|(\w+)))\s*}}/gm) === null;
|
|
62
63
|
return s || i({
|
|
63
64
|
type: c.Warning,
|
|
@@ -66,10 +67,10 @@ const ce = () => {
|
|
|
66
67
|
}, T = (e, s) => {
|
|
67
68
|
const t = e.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
|
|
68
69
|
if (t && !p) {
|
|
69
|
-
const n = new Set(s.map((a) => a.toLowerCase())), l =
|
|
70
|
+
const n = new Set(s.map((a) => a.toLowerCase())), l = Z(e), o = [];
|
|
70
71
|
if (t.forEach((a) => {
|
|
71
72
|
const m = a.slice(2, -2).trim().toLowerCase();
|
|
72
|
-
(!n.has(m) || m === "") && !
|
|
73
|
+
(!n.has(m) || m === "") && !J(m, l) && o.push(m);
|
|
73
74
|
}), o.length > 0) {
|
|
74
75
|
const a = `
|
|
75
76
|
<ul>
|
|
@@ -83,11 +84,11 @@ const ce = () => {
|
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
86
|
return !0;
|
|
86
|
-
},
|
|
87
|
+
}, W = (e) => {
|
|
87
88
|
const s = e.match(/{%(.*?)%}/g), t = [];
|
|
88
89
|
let n = !0;
|
|
89
90
|
if (s && s.forEach((l) => {
|
|
90
|
-
const o = l.match(
|
|
91
|
+
const o = l.match(P), a = l.match(G), m = (o == null ? void 0 : o.join("")) || "";
|
|
91
92
|
(!o || l !== m) && !a && (i({
|
|
92
93
|
type: c.Alert,
|
|
93
94
|
message: r("newsletter.display-conditions-invalid-syntax")
|
|
@@ -98,7 +99,7 @@ const ce = () => {
|
|
|
98
99
|
}), n = !1);
|
|
99
100
|
const v = f.match(/^[a-zA-Z]*$/g);
|
|
100
101
|
v && v.forEach((C) => {
|
|
101
|
-
|
|
102
|
+
E(C) && t.push(C);
|
|
102
103
|
});
|
|
103
104
|
});
|
|
104
105
|
}), t.length) {
|
|
@@ -109,25 +110,25 @@ const ce = () => {
|
|
|
109
110
|
}), n = !1);
|
|
110
111
|
}
|
|
111
112
|
return n;
|
|
112
|
-
},
|
|
113
|
+
}, N = (e) => {
|
|
113
114
|
const s = (e.match(/{% /gm) || []).length, t = (e.match(/ %}/gm) || []).length, n = s === t;
|
|
114
115
|
return n || i({
|
|
115
116
|
type: c.Warning,
|
|
116
117
|
message: r("custom-conditions.no-space-after-braces")
|
|
117
118
|
}), n;
|
|
118
|
-
},
|
|
119
|
+
}, O = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (i({
|
|
119
120
|
type: c.Warning,
|
|
120
121
|
message: r("custom-conditions.no-braces-inside-if-tag")
|
|
121
|
-
}), !1) : !0,
|
|
122
|
+
}), !1) : !0, B = () => g.recommendationConfigs && Object.values(g.recommendationConfigs).find((s) => s.filters.find((t) => t.value === "")) !== void 0 ? (i({
|
|
122
123
|
type: c.Alert,
|
|
123
124
|
message: r("newsletter.fill-all-necessary-fields")
|
|
124
|
-
}), !1) : !0,
|
|
125
|
+
}), !1) : !0, R = (e) => {
|
|
125
126
|
const s = /src="[^"]*\.(svg|pst)"/gm;
|
|
126
127
|
return e.match(s) === null ? !0 : (i({
|
|
127
128
|
type: c.Alert,
|
|
128
129
|
message: r("newsletter.invalid-image-type")
|
|
129
130
|
}), !1);
|
|
130
|
-
},
|
|
131
|
+
}, D = (e) => {
|
|
131
132
|
const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".checkbox-block-v2");
|
|
132
133
|
return Array.from(n).find((o) => {
|
|
133
134
|
var a;
|
|
@@ -136,7 +137,7 @@ const ce = () => {
|
|
|
136
137
|
type: c.Alert,
|
|
137
138
|
message: r("unsubscribe-templates.select-checkbox-groups")
|
|
138
139
|
}), !1) : !0;
|
|
139
|
-
},
|
|
140
|
+
}, L = (e) => {
|
|
140
141
|
const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".radio-button-v2");
|
|
141
142
|
return Array.from(n).find((o) => {
|
|
142
143
|
var a;
|
|
@@ -149,11 +150,12 @@ const ce = () => {
|
|
|
149
150
|
return { validateHtml: async (e, s, t = !1) => {
|
|
150
151
|
const n = [
|
|
151
152
|
...s.map((o) => o.value),
|
|
152
|
-
...
|
|
153
|
+
...X,
|
|
154
|
+
...b.value
|
|
153
155
|
];
|
|
154
|
-
return await
|
|
156
|
+
return await I(e, n, t) && k(e) && x(e) && F(e) && T(e, n) && W(e) && N(e) && O(e) && B() && R(e) && D(e) && L(e);
|
|
155
157
|
} };
|
|
156
158
|
};
|
|
157
159
|
export {
|
|
158
|
-
|
|
160
|
+
ue as useHtmlValidator
|
|
159
161
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { usePartner as N } from "../../composables/usePartner.js";
|
|
2
|
-
import { LINK_REGEXES as l, LINK_TYPES as
|
|
2
|
+
import { LINK_REGEXES as l, LINK_TYPES as S, INSIDER_ID as R, URLS as _ } from "../../enums/unsubscribe.js";
|
|
3
3
|
import { parsePageList as U } from "../../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
4
4
|
import { useConfigStore as B } from "../../stores/config.js";
|
|
5
5
|
import { useDynamicContentStore as y } from "../../stores/dynamic-content.js";
|
|
@@ -16,25 +16,25 @@ const D = [
|
|
|
16
16
|
let e = t;
|
|
17
17
|
const r = `/${i()}/email/${a}?user={{iid}}`;
|
|
18
18
|
return new DOMParser().parseFromString(e, "text/html").querySelectorAll(".unsubscribe-block-v2[data-unsubscribe-page-list]").forEach((p) => {
|
|
19
|
-
var
|
|
19
|
+
var g;
|
|
20
20
|
const m = p.getAttribute("data-unsubscribe-page-list");
|
|
21
21
|
if (!m)
|
|
22
22
|
return;
|
|
23
|
-
const
|
|
24
|
-
(o) =>
|
|
25
|
-
)) ?? [],
|
|
26
|
-
let s =
|
|
27
|
-
|
|
28
|
-
text:
|
|
29
|
-
value:
|
|
23
|
+
const I = U(m), d = ((g = u.templates) == null ? void 0 : g.filter(
|
|
24
|
+
(o) => I.includes(o.id)
|
|
25
|
+
)) ?? [], E = d.some((o) => o.type === S.UNSUBSCRIBE_LINK_TYPE), b = d.some((o) => o.type === S.PREFERENCES_LINK_TYPE), f = p.outerHTML;
|
|
26
|
+
let s = f;
|
|
27
|
+
(E || b) && n.selectedDynamicContentList.push({
|
|
28
|
+
text: R,
|
|
29
|
+
value: R,
|
|
30
30
|
fallback: ""
|
|
31
|
-
}), s = s.replace(
|
|
31
|
+
}), E && (s = s.replace(
|
|
32
32
|
l.GLOBAL_UNSUBSCRIBE_LINK_REGEX,
|
|
33
|
-
|
|
34
|
-
)),
|
|
33
|
+
_.UNSUBSCRIBE_URL + r
|
|
34
|
+
)), b && (s = s.replace(
|
|
35
35
|
l.PREFERENCES_UNSUBSCRIBE_LINK_REGEX,
|
|
36
|
-
|
|
37
|
-
)), s = s.replace(l.UNSUBSCRIBE_LINK_REGEX, ""), e = e.replace(
|
|
36
|
+
_.PREFERENCES_URL + r
|
|
37
|
+
)), s = s.replace(l.UNSUBSCRIBE_LINK_REGEX, ""), e = e.replace(f, s);
|
|
38
38
|
}), e;
|
|
39
39
|
},
|
|
40
40
|
priority: 60
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useRecommendation as
|
|
1
|
+
import { useRecommendation as $ } from "../../../composables/useRecommendation.js";
|
|
2
2
|
function b(e, u, r, o) {
|
|
3
3
|
const n = `{{${e}_${u}_${r}}}`, t = `{{${e}_${u}_currency}}`;
|
|
4
4
|
return o === "before" ? `${t} ${n}` : `${n} ${t}`;
|
|
@@ -64,58 +64,69 @@ function p(e, u, r, o, n) {
|
|
|
64
64
|
}
|
|
65
65
|
break;
|
|
66
66
|
}
|
|
67
|
+
default: {
|
|
68
|
+
const t = e.getAttribute("product-attr") ? e : e.querySelector("[product-attr]");
|
|
69
|
+
if (t) {
|
|
70
|
+
const c = t.getAttribute("product-attr"), s = t.querySelector("p");
|
|
71
|
+
if (s) {
|
|
72
|
+
const i = s.querySelector("strong") || s;
|
|
73
|
+
i.textContent = `{{${r}_${o}_${c}}}`;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
67
78
|
}
|
|
68
79
|
}
|
|
69
|
-
function
|
|
80
|
+
function S(e, u, r) {
|
|
70
81
|
e.querySelectorAll(".recommendation-product-row").forEach((n, t) => {
|
|
71
82
|
n.querySelectorAll("[data-attribute-type]").forEach((s) => {
|
|
72
|
-
const i = s.getAttribute("data-attribute-type") || "",
|
|
73
|
-
|
|
74
|
-
p(
|
|
83
|
+
const i = s.getAttribute("data-attribute-type") || "", l = s.querySelectorAll(".attribute-cell");
|
|
84
|
+
l.length > 0 ? l.forEach((a) => {
|
|
85
|
+
p(a, i, u, t, r);
|
|
75
86
|
}) : p(s, i, u, t, r);
|
|
76
87
|
});
|
|
77
88
|
});
|
|
78
89
|
}
|
|
79
|
-
function
|
|
90
|
+
function _(e, u, r) {
|
|
80
91
|
const o = e.querySelectorAll(".recommendation-product-row");
|
|
81
92
|
if (!o.length)
|
|
82
93
|
return;
|
|
83
94
|
const [n] = o, t = n.querySelector("[data-attribute-type]"), c = t ? t.querySelectorAll(".attribute-cell").length : 1;
|
|
84
95
|
o.forEach((s, i) => {
|
|
85
|
-
s.querySelectorAll("[data-attribute-type]").forEach((
|
|
86
|
-
const f =
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
p(y, f, u,
|
|
96
|
+
s.querySelectorAll("[data-attribute-type]").forEach((a) => {
|
|
97
|
+
const f = a.getAttribute("data-attribute-type") || "";
|
|
98
|
+
a.querySelectorAll(".attribute-cell").forEach((y, A) => {
|
|
99
|
+
const m = i * c + A;
|
|
100
|
+
p(y, f, u, m, r);
|
|
90
101
|
});
|
|
91
102
|
});
|
|
92
103
|
});
|
|
93
104
|
}
|
|
94
105
|
function q(e, u, r) {
|
|
95
106
|
e.querySelectorAll(".ins-recommendation-product-container").forEach((n) => {
|
|
96
|
-
|
|
107
|
+
_(n, u, r);
|
|
97
108
|
});
|
|
98
109
|
}
|
|
99
110
|
function d(e, u) {
|
|
100
111
|
const r = e.getAttribute("data-layout") || "grid", o = e.getAttribute("currency-alignment") || "after";
|
|
101
|
-
r === "list" ?
|
|
112
|
+
r === "list" ? S(e, u, o) : q(e, u, o);
|
|
102
113
|
}
|
|
103
|
-
function
|
|
114
|
+
function g(e, u) {
|
|
104
115
|
const r = e.match(/<!DOCTYPE[^>]*>/i);
|
|
105
116
|
return (r ? `${r[0]}
|
|
106
117
|
` : "") + u.documentElement.outerHTML;
|
|
107
118
|
}
|
|
108
|
-
function
|
|
119
|
+
function E(e) {
|
|
109
120
|
const u = e.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), r = new DOMParser().parseFromString(u, "text/html"), o = r.querySelectorAll(".recommendation-block-v2");
|
|
110
121
|
if (!o.length)
|
|
111
122
|
return e;
|
|
112
|
-
const { buildCampaignUrl: n } =
|
|
123
|
+
const { buildCampaignUrl: n } = $();
|
|
113
124
|
return o.forEach((c) => {
|
|
114
125
|
const s = c.getAttribute("recommendation-id");
|
|
115
126
|
s && (n(s), d(c, s));
|
|
116
|
-
}),
|
|
127
|
+
}), g(u, r).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}");
|
|
117
128
|
}
|
|
118
129
|
export {
|
|
119
130
|
b as formatPriceVariable,
|
|
120
|
-
|
|
131
|
+
E as prepareRecommendationBlocks
|
|
121
132
|
};
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e = "Items", o = {
|
|
2
2
|
"Global Styles & Layout": "Global Styles and Layout",
|
|
3
|
-
"Structures & Modules": "Structures and Modules"
|
|
3
|
+
"Structures & Modules": "Structures and Modules",
|
|
4
|
+
"Recommendation Block": "Recommendation",
|
|
5
|
+
Items: e,
|
|
6
|
+
"This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.": "This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.",
|
|
7
|
+
"This block is switched from the Old Version to the New Version. We recommend you check the Items block and test your message to ensure it works properly.": "This block is switched from the Old Version to the New Version. We recommend you check the Items block and test your message to ensure it works properly."
|
|
4
8
|
};
|
|
5
9
|
export {
|
|
6
|
-
|
|
10
|
+
e as Items,
|
|
11
|
+
o as default
|
|
7
12
|
};
|