@useinsider/guido 3.9.1-beta.a6465cf → 3.9.1-beta.bde1a34
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/config/compiler/utils/recommendationCompilerUtils.js +106 -119
- package/dist/config/i18n/en/labels.json.js +4 -1
- package/dist/enums/unsubscribe.js +41 -36
- package/dist/extensions/Blocks/Checkbox/block.js +5 -3
- package/dist/extensions/Blocks/Checkbox/control.js +41 -27
- package/dist/extensions/Blocks/RadioButton/block.js +9 -7
- package/dist/extensions/Blocks/RadioButton/control.js +63 -49
- package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +75 -69
- package/dist/src/enums/unsubscribe.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/captureStyleTemplates.d.ts +6 -0
- package/dist/static/styles/components/dropdown-menu.css.js +12 -0
- package/package.json +1 -1
|
@@ -1,189 +1,176 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import { useRecommendation as
|
|
3
|
-
import { CSS_CLASS_RECO_BUTTON as
|
|
4
|
-
import { useRecommendationExtensionStore as
|
|
5
|
-
import { isIgnoredRecommendationBlock as
|
|
6
|
-
function
|
|
7
|
-
const
|
|
8
|
-
return n === "before" ? `${
|
|
1
|
+
import { useConfig as _ } from "../../../composables/useConfig.js";
|
|
2
|
+
import { useRecommendation as q } from "../../../composables/useRecommendation.js";
|
|
3
|
+
import { CSS_CLASS_RECO_BUTTON as C } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
|
|
4
|
+
import { useRecommendationExtensionStore as E } from "../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
5
|
+
import { isIgnoredRecommendationBlock as w } from "./recommendationIgnoreUtils.js";
|
|
6
|
+
function P(t, r, e, n, s = "") {
|
|
7
|
+
const c = `{{${s}${t}_${r}_${e}}}`, o = `{{${s}${t}_${r}_currency}}`;
|
|
8
|
+
return n === "before" ? `${o} ${c}` : `${c} ${o}`;
|
|
9
9
|
}
|
|
10
10
|
function m(t) {
|
|
11
|
-
let
|
|
12
|
-
for (;
|
|
13
|
-
[
|
|
14
|
-
return
|
|
11
|
+
let r = t;
|
|
12
|
+
for (; r.children.length === 1; )
|
|
13
|
+
[r] = r.children;
|
|
14
|
+
return r;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
switch (
|
|
16
|
+
function b(t, r, e, n, s, c) {
|
|
17
|
+
switch (r) {
|
|
18
18
|
case "productImage": {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
19
|
+
const o = t.querySelector("img");
|
|
20
|
+
o && (o.setAttribute("src", `{{${c}${e}_${n}_image_url}}`), o.setAttribute("alt", `{{${c}${e}_${n}_name}}`));
|
|
21
|
+
const i = t.querySelector("a");
|
|
22
|
+
i && (i.setAttribute("href", `{{${c}${e}_${n}_url}}`), i.classList.add(C));
|
|
23
23
|
break;
|
|
24
24
|
}
|
|
25
25
|
case "productName": {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
break;
|
|
29
|
-
}
|
|
30
|
-
case "productPrice": {
|
|
31
|
-
const r = t.querySelector(".product-price p") ?? t.querySelector("p");
|
|
32
|
-
r && (m(r).textContent = f(
|
|
33
|
-
e,
|
|
34
|
-
n,
|
|
35
|
-
"price",
|
|
36
|
-
s,
|
|
37
|
-
i
|
|
38
|
-
));
|
|
39
|
-
const c = t.querySelector(".product-old-price p");
|
|
40
|
-
c && (m(c).textContent = f(
|
|
41
|
-
e,
|
|
42
|
-
n,
|
|
43
|
-
"original_price",
|
|
44
|
-
s,
|
|
45
|
-
i
|
|
46
|
-
));
|
|
26
|
+
const o = t.querySelector("p");
|
|
27
|
+
o && (m(o).textContent = `{{${c}${e}_${n}_name}}`);
|
|
47
28
|
break;
|
|
48
29
|
}
|
|
30
|
+
// Inline mode ("Move to next line" OFF) merges BOTH prices into one row
|
|
31
|
+
// anchored on whichever attribute comes first in the composition, so
|
|
32
|
+
// substitute by cell content, not by the row's anchor (SD-145161).
|
|
33
|
+
case "productPrice":
|
|
49
34
|
case "productOldPrice": {
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
35
|
+
const o = (d, l) => {
|
|
36
|
+
d && (m(d).textContent = P(
|
|
37
|
+
e,
|
|
38
|
+
n,
|
|
39
|
+
l,
|
|
40
|
+
s,
|
|
41
|
+
c
|
|
42
|
+
));
|
|
43
|
+
}, i = t.querySelector(".product-price p"), a = t.querySelector(".product-old-price p"), u = !i && !a ? t.querySelector("p") : null;
|
|
44
|
+
o(i ?? (r === "productPrice" ? u : null), "price"), o(a ?? (r === "productOldPrice" ? u : null), "original_price");
|
|
58
45
|
break;
|
|
59
46
|
}
|
|
60
47
|
case "productButton": {
|
|
61
|
-
const
|
|
62
|
-
|
|
48
|
+
const o = t.querySelector("a");
|
|
49
|
+
o && o.setAttribute("href", `{{${c}${e}_${n}_url}}`);
|
|
63
50
|
break;
|
|
64
51
|
}
|
|
65
52
|
case "productOmnibusPrice": {
|
|
66
|
-
const
|
|
67
|
-
if (
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
|
|
53
|
+
const o = t.querySelector(".omnibus-price-value");
|
|
54
|
+
if (o) {
|
|
55
|
+
o.textContent = `{{${c}${e}_${n}_omnibus_price}}`;
|
|
56
|
+
const i = o.closest("p");
|
|
57
|
+
i && (i.setAttribute("product-attr", "omnibus_price"), i.setAttribute("composition", "true"));
|
|
71
58
|
}
|
|
72
59
|
break;
|
|
73
60
|
}
|
|
74
61
|
case "productOmnibusDiscount": {
|
|
75
|
-
const
|
|
76
|
-
if (
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
|
|
62
|
+
const o = t.querySelector(".omnibus-discount-value");
|
|
63
|
+
if (o) {
|
|
64
|
+
o.textContent = `{{${c}${e}_${n}_omnibus_discount}}`;
|
|
65
|
+
const i = o.closest("p");
|
|
66
|
+
i && (i.setAttribute("product-attr", "omnibus_discount"), i.setAttribute("composition", "true"));
|
|
80
67
|
}
|
|
81
68
|
break;
|
|
82
69
|
}
|
|
83
70
|
default: {
|
|
84
|
-
const
|
|
85
|
-
if (
|
|
86
|
-
const
|
|
87
|
-
|
|
71
|
+
const o = t.getAttribute("product-attr") ? t : t.querySelector("[product-attr]");
|
|
72
|
+
if (o) {
|
|
73
|
+
const i = o.getAttribute("product-attr"), a = o.querySelector("p");
|
|
74
|
+
a && (m(a).textContent = `{{${c}${e}_${n}_${i}}}`);
|
|
88
75
|
}
|
|
89
76
|
break;
|
|
90
77
|
}
|
|
91
78
|
}
|
|
92
79
|
}
|
|
93
|
-
function R(t,
|
|
94
|
-
t.querySelectorAll(".recommendation-product-row").forEach((
|
|
95
|
-
|
|
96
|
-
const u =
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}) :
|
|
80
|
+
function R(t, r, e, n) {
|
|
81
|
+
t.querySelectorAll(".recommendation-product-row").forEach((c, o) => {
|
|
82
|
+
c.querySelectorAll("[data-attribute-type]").forEach((a) => {
|
|
83
|
+
const u = a.getAttribute("data-attribute-type") || "", d = a.querySelectorAll(".attribute-cell");
|
|
84
|
+
d.length > 0 ? d.forEach((l) => {
|
|
85
|
+
b(l, u, r, o, e, n);
|
|
86
|
+
}) : b(a, u, r, o, e, n);
|
|
100
87
|
});
|
|
101
88
|
});
|
|
102
89
|
}
|
|
103
|
-
function W(t,
|
|
90
|
+
function W(t, r, e, n) {
|
|
104
91
|
const s = t.querySelectorAll(".recommendation-product-row");
|
|
105
92
|
if (!s.length)
|
|
106
93
|
return;
|
|
107
|
-
const [
|
|
108
|
-
s.forEach((
|
|
109
|
-
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
const g = u *
|
|
113
|
-
|
|
94
|
+
const [c] = s, o = c.querySelector("[data-attribute-type]"), i = o ? o.querySelectorAll(".attribute-cell").length : 1;
|
|
95
|
+
s.forEach((a, u) => {
|
|
96
|
+
a.querySelectorAll("[data-attribute-type]").forEach((l) => {
|
|
97
|
+
const p = l.getAttribute("data-attribute-type") || "";
|
|
98
|
+
l.querySelectorAll(".attribute-cell").forEach(($, S) => {
|
|
99
|
+
const g = u * i + S;
|
|
100
|
+
b($, p, r, g, e, n);
|
|
114
101
|
});
|
|
115
102
|
});
|
|
116
103
|
});
|
|
117
104
|
}
|
|
118
|
-
function v(t,
|
|
119
|
-
t.querySelectorAll(".ins-recommendation-product-container").forEach((
|
|
120
|
-
W(
|
|
105
|
+
function v(t, r, e, n) {
|
|
106
|
+
t.querySelectorAll(".ins-recommendation-product-container").forEach((c) => {
|
|
107
|
+
W(c, r, e, n);
|
|
121
108
|
});
|
|
122
109
|
}
|
|
123
|
-
function O(t,
|
|
110
|
+
function O(t, r, e) {
|
|
124
111
|
const n = t.getAttribute("data-layout") || "grid", s = t.getAttribute("currency-alignment") || "after";
|
|
125
|
-
n === "list" ? R(t,
|
|
112
|
+
n === "list" ? R(t, r, s, e) : v(t, r, s, e);
|
|
126
113
|
}
|
|
127
|
-
function
|
|
128
|
-
const n = new RegExp(`${
|
|
114
|
+
function f(t, r, e) {
|
|
115
|
+
const n = new RegExp(`${r}\\s*:\\s*(\\d+)\\s*px`, "i"), s = t.match(n);
|
|
129
116
|
return s ? parseInt(s[1]) : e;
|
|
130
117
|
}
|
|
131
|
-
function
|
|
132
|
-
const
|
|
133
|
-
return
|
|
118
|
+
function y(t) {
|
|
119
|
+
const r = t.trim();
|
|
120
|
+
return r.endsWith("%") ? parseFloat(r) < 100 : /^\d+(?:\.\d+)?(?:px)?$/.test(r) && parseInt(r) > 0;
|
|
134
121
|
}
|
|
135
|
-
function
|
|
136
|
-
const
|
|
137
|
-
if (
|
|
138
|
-
return
|
|
122
|
+
function A(t) {
|
|
123
|
+
const r = t.getAttribute("width");
|
|
124
|
+
if (r && y(r))
|
|
125
|
+
return r.trim();
|
|
139
126
|
const e = (t.getAttribute("style") || "").match(/(?:^|[;\s])width\s*:\s*(\d+(?:\.\d+)?(?:px|%))/i);
|
|
140
|
-
return e &&
|
|
127
|
+
return e && y(e[1]) ? e[1] : null;
|
|
141
128
|
}
|
|
142
|
-
function
|
|
129
|
+
function M(t, r) {
|
|
143
130
|
let e = t.parentElement;
|
|
144
|
-
for (; e && e !==
|
|
145
|
-
if (e.tagName === "TD" &&
|
|
131
|
+
for (; e && e !== r; ) {
|
|
132
|
+
if (e.tagName === "TD" && A(e))
|
|
146
133
|
return e;
|
|
147
134
|
e = e.parentElement;
|
|
148
135
|
}
|
|
149
136
|
return null;
|
|
150
137
|
}
|
|
151
|
-
function
|
|
152
|
-
const
|
|
153
|
-
s !== 0 && t.querySelectorAll("img.adapt-img").forEach((
|
|
154
|
-
if (
|
|
138
|
+
function T(t) {
|
|
139
|
+
const r = t.getAttribute("style") || "", e = f(r, "width", 600), n = f(r, "padding", 0) * 2, s = Math.max(0, e - n);
|
|
140
|
+
s !== 0 && t.querySelectorAll("img.adapt-img").forEach((c) => {
|
|
141
|
+
if (c.hasAttribute("width"))
|
|
155
142
|
return;
|
|
156
|
-
const
|
|
157
|
-
if (!
|
|
143
|
+
const o = M(c, t);
|
|
144
|
+
if (!o)
|
|
158
145
|
return;
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
const
|
|
162
|
-
if (!/\bwidth\s*:\s*\d/i.test(
|
|
163
|
-
const
|
|
164
|
-
|
|
146
|
+
const i = A(o), a = f(o.getAttribute("style") || "", "padding", 0) * 2, u = i.endsWith("%") ? Math.floor(s * parseFloat(i) / 100) : parseInt(i), d = Math.max(1, u - a);
|
|
147
|
+
c.setAttribute("width", String(d));
|
|
148
|
+
const l = c.getAttribute("style") || "";
|
|
149
|
+
if (!/\bwidth\s*:\s*\d/i.test(l)) {
|
|
150
|
+
const p = l && !l.trim().endsWith(";") ? "; " : "";
|
|
151
|
+
c.setAttribute("style", `${l}${p}width: ${d}px`);
|
|
165
152
|
}
|
|
166
153
|
});
|
|
167
154
|
}
|
|
168
|
-
function B(t,
|
|
155
|
+
function B(t, r) {
|
|
169
156
|
const e = t.match(/<!DOCTYPE[^>]*>/i);
|
|
170
157
|
return (e ? `${e[0]}
|
|
171
|
-
` : "") +
|
|
158
|
+
` : "") + r.documentElement.outerHTML;
|
|
172
159
|
}
|
|
173
160
|
function G(t) {
|
|
174
|
-
const
|
|
161
|
+
const r = t.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), e = new DOMParser().parseFromString(r, "text/html"), n = e.querySelectorAll(".recommendation-block-v2");
|
|
175
162
|
if (!n.length)
|
|
176
163
|
return t;
|
|
177
|
-
const { buildCampaignUrl: s } =
|
|
178
|
-
|
|
179
|
-
const { isFeatureEnabled:
|
|
164
|
+
const { buildCampaignUrl: s } = q(), c = E();
|
|
165
|
+
c.recommendationCampaignUrls = {};
|
|
166
|
+
const { isFeatureEnabled: o } = _(), i = o("liquidSyntax") ? "reco_" : "";
|
|
180
167
|
return n.forEach((u) => {
|
|
181
|
-
var
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
}), B(
|
|
168
|
+
var l, p;
|
|
169
|
+
const d = u.getAttribute("recommendation-id");
|
|
170
|
+
d && ((l = u.parentNode) == null || l.insertBefore(e.createComment("REC_START"), u), (p = u.parentNode) == null || p.insertBefore(e.createComment("REC_END"), u.nextSibling), u.querySelectorAll('[data-visibility="0"]').forEach((h) => h.remove()), s(d), w(u) || O(u, d, i), T(u));
|
|
171
|
+
}), B(r, e).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}");
|
|
185
172
|
}
|
|
186
173
|
export {
|
|
187
|
-
|
|
174
|
+
P as formatPriceVariable,
|
|
188
175
|
G as prepareRecommendationBlocks
|
|
189
176
|
};
|
|
@@ -4,7 +4,10 @@ const e = "Items", o = {
|
|
|
4
4
|
"Recommendation Block": "Recommendation",
|
|
5
5
|
Items: e,
|
|
6
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."
|
|
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.",
|
|
8
|
+
"Pixel Tracking Opt-in": "Pixel Tracking Opt-in",
|
|
9
|
+
"OPT-IN SELECTION": "OPT-IN SELECTION",
|
|
10
|
+
"UNSUBSCRIBE GROUPS": "UNSUBSCRIBE GROUPS"
|
|
8
11
|
};
|
|
9
12
|
export {
|
|
10
13
|
e as Items,
|
|
@@ -1,35 +1,38 @@
|
|
|
1
1
|
import { useTranslations as R } from "../composables/useTranslations.js";
|
|
2
|
-
import { ProductType as
|
|
2
|
+
import { ProductType as s } from "../@types/config/schemas.js";
|
|
3
3
|
import "../@types/config/defaults.js";
|
|
4
|
-
import { getEnvironmentPrefix as
|
|
5
|
-
const
|
|
4
|
+
import { getEnvironmentPrefix as _ } from "../utils/environmentUtil.js";
|
|
5
|
+
const B = {
|
|
6
6
|
UNSUBSCRIBE_LINK_TYPE: 1,
|
|
7
7
|
PREFERENCES_LINK_TYPE: 3
|
|
8
|
-
},
|
|
8
|
+
}, C = {
|
|
9
9
|
UNSUBSCRIBE_LINK_REGEX: /{{ins-unsubscribe-link}}/g,
|
|
10
10
|
DATA_OGSB_BUTTON_CSS_REGEX: "\\[data-ogsb\\]\\s*\\.es-button\\.es-button-[0-9]+\\s*\\{(?:[^\\}]*)\\}",
|
|
11
11
|
GLOBAL_UNSUBSCRIBE_LINK_REGEX: /{{ins-global-unsubscribe-link}}/g,
|
|
12
12
|
PREFERENCES_UNSUBSCRIBE_LINK_REGEX: /{{ins-preferences-unsubscribe-link}}/g
|
|
13
|
-
},
|
|
14
|
-
UNSUBSCRIBE_URL: `https://mail.${
|
|
15
|
-
PREFERENCES_URL: `https://mail.${
|
|
16
|
-
},
|
|
17
|
-
[
|
|
18
|
-
[
|
|
19
|
-
[
|
|
20
|
-
},
|
|
13
|
+
}, e = _(), U = {
|
|
14
|
+
UNSUBSCRIBE_URL: `https://mail.${e}.com/user/v1/unsub`,
|
|
15
|
+
PREFERENCES_URL: `https://mail.${e}.com/user/v1/prefs`
|
|
16
|
+
}, o = {
|
|
17
|
+
[s.EMAIL]: "email",
|
|
18
|
+
[s.ARCHITECT]: "journey",
|
|
19
|
+
[s.UNSUBSCRIBE_PAGES]: "email"
|
|
20
|
+
}, c = "iid", S = "G", N = "P", u = [
|
|
21
|
+
S,
|
|
22
|
+
N
|
|
23
|
+
], T = () => ({
|
|
21
24
|
name: R()("onboarding-center.email-subscribers-global-unsub-card-title"),
|
|
22
|
-
sendGridId:
|
|
23
|
-
}),
|
|
25
|
+
sendGridId: S
|
|
26
|
+
}), b = "/email/unsubscribe-pages", E = {
|
|
24
27
|
GLOBAL_UNSUBSCRIBE: 1,
|
|
25
28
|
GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE: 2,
|
|
26
29
|
SUBSCRIPTION_PREFERENCE_CENTER: 3,
|
|
27
30
|
SUBSCRIPTION_PREFERENCE_CONFIRMATION: 4,
|
|
28
31
|
RESUBSCRIBE: 5
|
|
29
|
-
},
|
|
32
|
+
}, P = {
|
|
30
33
|
[E.GLOBAL_UNSUBSCRIBE]: "custom-unsubscribe",
|
|
31
34
|
[E.SUBSCRIPTION_PREFERENCE_CENTER]: "custom-preferences"
|
|
32
|
-
},
|
|
35
|
+
}, L = {
|
|
33
36
|
[E.GLOBAL_UNSUBSCRIBE]: [
|
|
34
37
|
E.GLOBAL_UNSUBSCRIBE,
|
|
35
38
|
E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE,
|
|
@@ -39,32 +42,34 @@ const i = {
|
|
|
39
42
|
E.SUBSCRIPTION_PREFERENCE_CENTER,
|
|
40
43
|
E.SUBSCRIPTION_PREFERENCE_CONFIRMATION
|
|
41
44
|
]
|
|
42
|
-
},
|
|
43
|
-
const
|
|
45
|
+
}, O = () => {
|
|
46
|
+
const n = R();
|
|
44
47
|
return {
|
|
45
|
-
[E.GLOBAL_UNSUBSCRIBE]:
|
|
46
|
-
[E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]:
|
|
47
|
-
[E.RESUBSCRIBE]:
|
|
48
|
-
[E.SUBSCRIPTION_PREFERENCE_CENTER]:
|
|
49
|
-
[E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]:
|
|
48
|
+
[E.GLOBAL_UNSUBSCRIBE]: n("unsubscription-preference.type-global-unsubscribe"),
|
|
49
|
+
[E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: n("unsubscription-preference.type-global-unsubscription-confirmation"),
|
|
50
|
+
[E.RESUBSCRIBE]: n("unsubscription-preference.type-resubscribe"),
|
|
51
|
+
[E.SUBSCRIPTION_PREFERENCE_CENTER]: n("unsubscription-preference.type-subscription-preferences-center"),
|
|
52
|
+
[E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: n("unsubscription-preference.type-subscription-preferences-confirmation")
|
|
50
53
|
};
|
|
51
|
-
},
|
|
54
|
+
}, p = {
|
|
52
55
|
default: "{{ins-unsubscribe-link}}",
|
|
53
56
|
[E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
|
|
54
57
|
[E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
|
|
55
58
|
};
|
|
56
59
|
export {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
S as DEFAULT_UNSUBSCRIBE_GROUP_SEND_GRID_ID,
|
|
61
|
+
c as INSIDER_ID,
|
|
62
|
+
C as LINK_REGEXES,
|
|
63
|
+
B as LINK_TYPES,
|
|
64
|
+
p as MERGE_TAGS,
|
|
62
65
|
E as PAGE_TYPES,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
b as
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
N as PIXEL_TRACKING_SEND_GRID_ID,
|
|
67
|
+
o as PRODUCT_TYPE_URL_SEGMENTS,
|
|
68
|
+
L as TYPE_COLLECTIONS,
|
|
69
|
+
b as UNSUBSCRIBE_PAGES_LINK,
|
|
70
|
+
u as UNSUBSCRIBE_SENTINEL_SEND_GRID_IDS,
|
|
71
|
+
P as UNSUBSCRIBE_SYNC_MODULE_TYPES,
|
|
72
|
+
U as URLS,
|
|
73
|
+
T as getDefaultUnsubscribeGroup,
|
|
74
|
+
O as getTypeTranslations
|
|
70
75
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Block as e, BlockCompositionType as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { getDefaultTemplate as o } from "./template.js";
|
|
3
3
|
const r = "checkbox-block";
|
|
4
|
-
class
|
|
4
|
+
class l extends e {
|
|
5
5
|
constructor() {
|
|
6
6
|
super();
|
|
7
7
|
}
|
|
@@ -18,7 +18,9 @@ class s extends e {
|
|
|
18
18
|
return this.api.translate("Checkbox Block");
|
|
19
19
|
}
|
|
20
20
|
getDescription() {
|
|
21
|
-
return this.api.translate(
|
|
21
|
+
return this.api.translate(
|
|
22
|
+
"Checkbox lets you select Unsubscribe and Preference Type for users to manage their opt-in or opt-out preferences."
|
|
23
|
+
);
|
|
22
24
|
}
|
|
23
25
|
getTemplate() {
|
|
24
26
|
return o();
|
|
@@ -29,5 +31,5 @@ class s extends e {
|
|
|
29
31
|
}
|
|
30
32
|
export {
|
|
31
33
|
r as CHECKBOX_BLOCK_ID,
|
|
32
|
-
|
|
34
|
+
l as CheckboxBlock
|
|
33
35
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { useHttp as
|
|
5
|
-
import { getDefaultUnsubscribeGroup as
|
|
6
|
-
import { Control as
|
|
7
|
-
const b = "ui-elements-checkbox",
|
|
8
|
-
class
|
|
1
|
+
var p = Object.defineProperty;
|
|
2
|
+
var L = (i, n, e) => n in i ? p(i, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[n] = e;
|
|
3
|
+
var a = (i, n, e) => L(i, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { useHttp as h } from "../../../composables/useHttp.js";
|
|
5
|
+
import { getDefaultUnsubscribeGroup as T, PIXEL_TRACKING_SEND_GRID_ID as C, UNSUBSCRIBE_SENTINEL_SEND_GRID_IDS as I } from "../../../enums/unsubscribe.js";
|
|
6
|
+
import { Control as m, UIElementType as r, UEAttr as t, ModificationDescription as S } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
+
const b = "ui-elements-checkbox", E = "select", { get: _ } = h();
|
|
8
|
+
class G extends m {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
a(this, "currentNode");
|
|
12
|
+
a(this, "selectedUnsubGroup");
|
|
13
|
+
a(this, "unsubList", []);
|
|
14
14
|
}
|
|
15
15
|
getId() {
|
|
16
16
|
return b;
|
|
@@ -19,12 +19,12 @@ class I extends p {
|
|
|
19
19
|
if (this.selectedUnsubGroup = "", this.currentNode && "getAttribute" in this.currentNode) {
|
|
20
20
|
const e = this.currentNode.getAttribute("id");
|
|
21
21
|
if (e) {
|
|
22
|
-
const s = e
|
|
22
|
+
const s = I.includes(e) ? e : Number(e);
|
|
23
23
|
s && (this.selectedUnsubGroup = s);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
this.api.updateValues({
|
|
27
|
-
[
|
|
27
|
+
[E]: this.selectedUnsubGroup
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
_getLabel(e, s = `${Math.random()}`) {
|
|
@@ -46,17 +46,19 @@ class I extends p {
|
|
|
46
46
|
return this.unsubList.map((e) => this._getSelectItem(e.name, e.sendGridId)).join("");
|
|
47
47
|
}
|
|
48
48
|
getTemplate() {
|
|
49
|
+
const e = this.api.translate("Unsubscribe & Preference Center Type"), s = this.api.translate("Select Unsubscribe and Preference Type");
|
|
49
50
|
return `
|
|
50
51
|
<div class="checkbox-controls-container">
|
|
51
52
|
<div class="checkbox-select-container container two-columns stretch">
|
|
52
53
|
<${r.LABEL}
|
|
53
|
-
${t.LABEL.text}="${
|
|
54
|
+
${t.LABEL.text}="${e}"
|
|
54
55
|
${t.LABEL.name}="${Math.random()}">
|
|
55
56
|
</${r.LABEL}>
|
|
56
57
|
|
|
57
58
|
<${r.SELECTPICKER}
|
|
58
|
-
${t.SELECTPICKER.name}="${
|
|
59
|
-
${t.SELECTPICKER.
|
|
59
|
+
${t.SELECTPICKER.name}="${E}"
|
|
60
|
+
${t.SELECTPICKER.searchable}="true"
|
|
61
|
+
${t.SELECTPICKER.placeholder}="${s}">
|
|
60
62
|
${this._getSelect()}
|
|
61
63
|
</${r.SELECTPICKER}>
|
|
62
64
|
</div>
|
|
@@ -64,30 +66,42 @@ class I extends p {
|
|
|
64
66
|
`;
|
|
65
67
|
}
|
|
66
68
|
_onSelectChange(e) {
|
|
67
|
-
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", e.toString()).apply(new
|
|
69
|
+
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", e.toString()).apply(new S(`Updated text to ${e}`));
|
|
68
70
|
}
|
|
69
71
|
_listenToFormUpdates() {
|
|
70
|
-
this.api.onValueChanged(
|
|
72
|
+
this.api.onValueChanged(E, (e) => this._onSelectChange(e));
|
|
71
73
|
}
|
|
72
74
|
onTemplateNodeUpdated(e) {
|
|
73
75
|
this.currentNode = e, this._setFormValues();
|
|
74
76
|
}
|
|
75
77
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
76
78
|
async onRender() {
|
|
77
|
-
const e = await
|
|
79
|
+
const e = await _(
|
|
78
80
|
"/unsubscribe-groups/unsubscribe-list"
|
|
79
|
-
), s =
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}))
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
), s = {
|
|
82
|
+
name: this.api.translate("Pixel Tracking Opt-in"),
|
|
83
|
+
sendGridId: C
|
|
84
|
+
}, c = [T(), ...e.data], u = (o) => ({
|
|
85
|
+
[t.SELECT_ITEM.text]: o.name,
|
|
86
|
+
[t.SELECT_ITEM.value]: o.sendGridId
|
|
87
|
+
}), l = (o) => ({
|
|
88
|
+
[t.SELECT_ITEM.text]: o,
|
|
89
|
+
[t.SELECT_ITEM.value]: `header:${o}`,
|
|
90
|
+
[t.SELECT_ITEM.disabled]: !0
|
|
91
|
+
}), d = [
|
|
92
|
+
l(this.api.translate("OPT-IN SELECTION")),
|
|
93
|
+
u(s),
|
|
94
|
+
l(this.api.translate("UNSUBSCRIBE GROUPS")),
|
|
95
|
+
...c.map(u)
|
|
96
|
+
];
|
|
97
|
+
this.unsubList = [s, ...c], this.api.setUIEAttribute(
|
|
98
|
+
E,
|
|
85
99
|
t.SELECTPICKER.items,
|
|
86
|
-
|
|
100
|
+
d
|
|
87
101
|
), this._setFormValues(), this._listenToFormUpdates();
|
|
88
102
|
}
|
|
89
103
|
}
|
|
90
104
|
export {
|
|
91
105
|
b as CHECKBOX_CONTROL_BLOCK_ID,
|
|
92
|
-
|
|
106
|
+
G as CheckboxControl
|
|
93
107
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Block as t, BlockCompositionType as
|
|
2
|
-
import { getDefaultTemplate as
|
|
1
|
+
import { Block as t, BlockCompositionType as e } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { getDefaultTemplate as o } from "./template.js";
|
|
3
3
|
const r = "radio-button-block";
|
|
4
|
-
class
|
|
4
|
+
class i extends t {
|
|
5
5
|
constructor() {
|
|
6
6
|
super();
|
|
7
7
|
}
|
|
@@ -12,16 +12,18 @@ class l extends t {
|
|
|
12
12
|
return "radio-button-icon";
|
|
13
13
|
}
|
|
14
14
|
getBlockCompositionType() {
|
|
15
|
-
return
|
|
15
|
+
return e.CONTAINER;
|
|
16
16
|
}
|
|
17
17
|
getName() {
|
|
18
18
|
return this.api.translate("Radio Button Block");
|
|
19
19
|
}
|
|
20
20
|
getDescription() {
|
|
21
|
-
return this.api.translate(
|
|
21
|
+
return this.api.translate(
|
|
22
|
+
"Radio button lets you select Unsubscribe and Preference Type for users to manage their opt-in or opt-out preferences."
|
|
23
|
+
);
|
|
22
24
|
}
|
|
23
25
|
getTemplate() {
|
|
24
|
-
return
|
|
26
|
+
return o();
|
|
25
27
|
}
|
|
26
28
|
allowInnerBlocksDND() {
|
|
27
29
|
return !1;
|
|
@@ -29,5 +31,5 @@ class l extends t {
|
|
|
29
31
|
}
|
|
30
32
|
export {
|
|
31
33
|
r as BLOCK_ID,
|
|
32
|
-
|
|
34
|
+
i as RadioButtonCustomBlock
|
|
33
35
|
};
|
|
@@ -1,93 +1,107 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { useHttp as
|
|
5
|
-
import { getDefaultUnsubscribeGroup as
|
|
6
|
-
import { Control as
|
|
7
|
-
const b = "ui-elements-radio-button",
|
|
8
|
-
class
|
|
1
|
+
var p = Object.defineProperty;
|
|
2
|
+
var L = (i, n, e) => n in i ? p(i, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[n] = e;
|
|
3
|
+
var a = (i, n, e) => L(i, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { useHttp as T } from "../../../composables/useHttp.js";
|
|
5
|
+
import { getDefaultUnsubscribeGroup as h, PIXEL_TRACKING_SEND_GRID_ID as I, UNSUBSCRIBE_SENTINEL_SEND_GRID_IDS as m } from "../../../enums/unsubscribe.js";
|
|
6
|
+
import { Control as C, UIElementType as r, UEAttr as t, ModificationDescription as S } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
+
const b = "ui-elements-radio-button", E = "select", { get: _ } = T();
|
|
8
|
+
class G extends C {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
a(this, "currentNode");
|
|
12
|
+
a(this, "selectedUnsubGroup");
|
|
13
|
+
a(this, "unsubList", []);
|
|
14
14
|
}
|
|
15
15
|
getId() {
|
|
16
16
|
return b;
|
|
17
17
|
}
|
|
18
18
|
_setFormValues() {
|
|
19
19
|
if (this.selectedUnsubGroup = "", this.currentNode && "getAttribute" in this.currentNode) {
|
|
20
|
-
const
|
|
21
|
-
if (
|
|
22
|
-
const s =
|
|
20
|
+
const e = this.currentNode.getAttribute("id");
|
|
21
|
+
if (e) {
|
|
22
|
+
const s = m.includes(e) ? e : Number(e);
|
|
23
23
|
s && (this.selectedUnsubGroup = s);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
this.api.updateValues({
|
|
27
|
-
[
|
|
27
|
+
[E]: this.selectedUnsubGroup
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
-
_getLabel(
|
|
30
|
+
_getLabel(e, s = `${Math.random()}`) {
|
|
31
31
|
return `
|
|
32
|
-
<${
|
|
33
|
-
${
|
|
34
|
-
${
|
|
35
|
-
</${
|
|
32
|
+
<${r.LABEL}
|
|
33
|
+
${t.LABEL.text}="${e}"
|
|
34
|
+
${t.LABEL.name}="${s}">
|
|
35
|
+
</${r.LABEL}>
|
|
36
36
|
`;
|
|
37
37
|
}
|
|
38
|
-
_getSelectItem(
|
|
38
|
+
_getSelectItem(e, s) {
|
|
39
39
|
return `
|
|
40
|
-
<${
|
|
41
|
-
${
|
|
42
|
-
${
|
|
43
|
-
</${
|
|
40
|
+
<${r.SELECT_ITEM}
|
|
41
|
+
${t.SELECT_ITEM.text}="${e}"
|
|
42
|
+
${t.SELECT_ITEM.value}="${s}">
|
|
43
|
+
</${r.SELECT_ITEM}>`;
|
|
44
44
|
}
|
|
45
45
|
_getSelect() {
|
|
46
|
-
return this.unsubList.map((
|
|
46
|
+
return this.unsubList.map((e) => this._getSelectItem(e.name, e.sendGridId)).join("");
|
|
47
47
|
}
|
|
48
48
|
getTemplate() {
|
|
49
|
+
const e = this.api.translate("Unsubscribe & Preference Center Type"), s = this.api.translate("Select Unsubscribe and Preference Type");
|
|
49
50
|
return `
|
|
50
51
|
<div class="checkbox-controls-container">
|
|
51
52
|
<div class="checkbox-select-container container two-columns stretch">
|
|
52
|
-
<${
|
|
53
|
-
${
|
|
54
|
-
${
|
|
55
|
-
</${
|
|
53
|
+
<${r.LABEL}
|
|
54
|
+
${t.LABEL.text}="${e}"
|
|
55
|
+
${t.LABEL.name}="${Math.random()}">
|
|
56
|
+
</${r.LABEL}>
|
|
56
57
|
|
|
57
|
-
<${
|
|
58
|
-
${
|
|
59
|
-
${
|
|
58
|
+
<${r.SELECTPICKER}
|
|
59
|
+
${t.SELECTPICKER.name}="${E}"
|
|
60
|
+
${t.SELECTPICKER.searchable}="true"
|
|
61
|
+
${t.SELECTPICKER.placeholder}="${s}">
|
|
60
62
|
${this._getSelect()}
|
|
61
|
-
</${
|
|
63
|
+
</${r.SELECTPICKER}>
|
|
62
64
|
</div>
|
|
63
65
|
</div>
|
|
64
66
|
`;
|
|
65
67
|
}
|
|
66
|
-
_onSelectChange(
|
|
67
|
-
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id",
|
|
68
|
+
_onSelectChange(e) {
|
|
69
|
+
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", e.toString()).apply(new S(`Updated text to ${e}`));
|
|
68
70
|
}
|
|
69
71
|
_listenToFormUpdates() {
|
|
70
|
-
this.api.onValueChanged(
|
|
72
|
+
this.api.onValueChanged(E, (e) => this._onSelectChange(e));
|
|
71
73
|
}
|
|
72
|
-
onTemplateNodeUpdated(
|
|
73
|
-
this.currentNode =
|
|
74
|
+
onTemplateNodeUpdated(e) {
|
|
75
|
+
this.currentNode = e, this._setFormValues();
|
|
74
76
|
}
|
|
75
77
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
76
78
|
async onRender() {
|
|
77
|
-
const
|
|
79
|
+
const e = await _(
|
|
78
80
|
"/unsubscribe-groups/unsubscribe-list"
|
|
79
|
-
), s =
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}))
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
), s = {
|
|
82
|
+
name: this.api.translate("Pixel Tracking Opt-in"),
|
|
83
|
+
sendGridId: I
|
|
84
|
+
}, u = [h(), ...e.data], c = (o) => ({
|
|
85
|
+
[t.SELECT_ITEM.text]: o.name,
|
|
86
|
+
[t.SELECT_ITEM.value]: o.sendGridId
|
|
87
|
+
}), d = (o) => ({
|
|
88
|
+
[t.SELECT_ITEM.text]: o,
|
|
89
|
+
[t.SELECT_ITEM.value]: `header:${o}`,
|
|
90
|
+
[t.SELECT_ITEM.disabled]: !0
|
|
91
|
+
}), l = [
|
|
92
|
+
d(this.api.translate("OPT-IN SELECTION")),
|
|
93
|
+
c(s),
|
|
94
|
+
d(this.api.translate("UNSUBSCRIBE GROUPS")),
|
|
95
|
+
...u.map(c)
|
|
96
|
+
];
|
|
97
|
+
this.unsubList = [s, ...u], this.api.setUIEAttribute(
|
|
98
|
+
E,
|
|
99
|
+
t.SELECTPICKER.items,
|
|
100
|
+
l
|
|
87
101
|
), this._setFormValues(), this._listenToFormUpdates();
|
|
88
102
|
}
|
|
89
103
|
}
|
|
90
104
|
export {
|
|
91
105
|
b as CONTROL_BLOCK_ID,
|
|
92
|
-
|
|
106
|
+
G as RadioButtonControl
|
|
93
107
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { RecommendationBlockId as c } from "../constants/blockIds.js";
|
|
2
|
-
import { DESKTOP_CONTAINER_SELECTOR as S, ATTR_PRODUCT_NAME as
|
|
2
|
+
import { DESKTOP_CONTAINER_SELECTOR as S, ATTR_PRODUCT_NAME as E, ATTR_PRODUCT_PRICE as p, ATTR_PRODUCT_OLD_PRICE as y, ATTR_PRODUCT_OMNIBUS_PRICE as C, ATTR_PRODUCT_OMNIBUS_DISCOUNT as A, ATTR_PRODUCT_BUTTON as P, ATTR_PRODUCT_IMAGE as q, ATTR_PRODUCT_ATTR as x } from "../constants/selectors.js";
|
|
3
3
|
import { CSS_CLASS_TEXT_TRIM as B } from "../controls/shared/textTrimCssRules.js";
|
|
4
|
-
import { toCustomCompositionKey as
|
|
5
|
-
import { extractWrapperTags as
|
|
6
|
-
import { hasQuerySelectorAll as
|
|
4
|
+
import { toCustomCompositionKey as v } from "../templates/utils.js";
|
|
5
|
+
import { extractWrapperTags as R } from "./preserveTextStyles.js";
|
|
6
|
+
import { hasQuerySelectorAll as _, hasGetAttribute as l, hasGetStyle as I, hasGetComputedStyle as U } from "./tagName.js";
|
|
7
7
|
const s = [
|
|
8
8
|
"font-size",
|
|
9
9
|
"font-family",
|
|
@@ -39,94 +39,94 @@ const s = [
|
|
|
39
39
|
"border-radius",
|
|
40
40
|
"margin"
|
|
41
41
|
], b = /* @__PURE__ */ new Set(["transparent", "rgba(0, 0, 0, 0)"]), G = [
|
|
42
|
-
{ attrKey:
|
|
43
|
-
{ attrKey:
|
|
44
|
-
{ attrKey:
|
|
45
|
-
{ attrKey:
|
|
46
|
-
{ attrKey:
|
|
42
|
+
{ attrKey: E, blockId: c.NAME, kind: "text" },
|
|
43
|
+
{ attrKey: p, blockId: c.PRICE, kind: "text" },
|
|
44
|
+
{ attrKey: y, blockId: c.OLD_PRICE, kind: "text" },
|
|
45
|
+
{ attrKey: C, blockId: c.OMNIBUS_PRICE, kind: "text" },
|
|
46
|
+
{ attrKey: A, blockId: c.OMNIBUS_DISCOUNT, kind: "text" },
|
|
47
47
|
{ attrKey: P, blockId: c.BUTTON, kind: "button" },
|
|
48
|
-
{ attrKey:
|
|
48
|
+
{ attrKey: q, blockId: c.IMAGE, kind: "image" }
|
|
49
49
|
];
|
|
50
|
-
function
|
|
50
|
+
function O(t) {
|
|
51
51
|
return t && "getInnerHTML" in t && typeof t.getInnerHTML == "function" ? t.getInnerHTML().trim() : "";
|
|
52
52
|
}
|
|
53
53
|
function L(t) {
|
|
54
54
|
return t && "getInnerText" in t && typeof t.getInnerText == "function" ? t.getInnerText().trim() : "";
|
|
55
55
|
}
|
|
56
56
|
function a(t, e, r) {
|
|
57
|
-
!e || !
|
|
58
|
-
const
|
|
59
|
-
|
|
57
|
+
!e || !I(e) || r.forEach((n) => {
|
|
58
|
+
const o = e.getStyle(n);
|
|
59
|
+
o && o !== "inherit" && o !== "initial" && (t[n] = o);
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function h(t) {
|
|
63
63
|
return Object.entries(t).map(([e, r]) => `${e}: ${r};`).join(" ");
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
if (!t || !
|
|
65
|
+
function k(t) {
|
|
66
|
+
if (!t || !I(t))
|
|
67
67
|
return;
|
|
68
68
|
const e = t.getStyle("background-color") || t.getStyle("background");
|
|
69
69
|
return e && !b.has(e) ? e : void 0;
|
|
70
70
|
}
|
|
71
71
|
function g(t, e) {
|
|
72
72
|
const r = {};
|
|
73
|
-
return a(r, t, e),
|
|
73
|
+
return a(r, t, e), h(r);
|
|
74
74
|
}
|
|
75
75
|
function w(t) {
|
|
76
76
|
const e = t.querySelector("p"), r = {};
|
|
77
77
|
a(r, t, s), a(r, e, s), a(r, t.querySelector("strong"), s), a(r, t.querySelector("em"), s), a(r, t.querySelector("s"), s);
|
|
78
|
-
const n =
|
|
79
|
-
return !n && !
|
|
78
|
+
const n = h(r), { openTags: o, closeTags: i } = R(O(e));
|
|
79
|
+
return !n && !o ? null : { pStyle: n || void 0, openTags: o, closeTags: i };
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
const e = t.querySelector(".es-button-border"), r = t.querySelector("a.es-button") ?? t.querySelector("a"), n = g(e, N),
|
|
83
|
-
return !n && !
|
|
81
|
+
function $(t) {
|
|
82
|
+
const e = t.querySelector(".es-button-border"), r = t.querySelector("a.es-button") ?? t.querySelector("a"), n = g(e, N), o = g(r, M), i = e && "getAttribute" in e ? e.getAttribute("class") ?? "" : "", u = /\bes-fw\b/.test(i), { openTags: T, closeTags: d } = R(O(r)), m = L(r);
|
|
83
|
+
return !n && !o && !u && !T && !m ? null : {
|
|
84
84
|
buttonBorderStyle: n || void 0,
|
|
85
|
-
buttonAnchorStyle:
|
|
85
|
+
buttonAnchorStyle: o || void 0,
|
|
86
86
|
buttonFitToContainer: u || void 0,
|
|
87
|
-
buttonText:
|
|
87
|
+
buttonText: m || void 0,
|
|
88
88
|
openTags: T,
|
|
89
89
|
closeTags: d
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function K(t) {
|
|
93
93
|
const e = g(t.querySelector("img"), D);
|
|
94
94
|
return e ? { imgStyle: e } : null;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
97
|
-
return e === "button" ?
|
|
96
|
+
function H(t, e) {
|
|
97
|
+
return e === "button" ? $(t) : e === "image" ? K(t) : w(t);
|
|
98
98
|
}
|
|
99
99
|
function f(t, e) {
|
|
100
100
|
if (!t || !("querySelector" in t))
|
|
101
101
|
return;
|
|
102
102
|
const r = t.querySelector(S) ?? t;
|
|
103
|
-
if (G.forEach(({ attrKey:
|
|
103
|
+
if (G.forEach(({ attrKey: i, blockId: u, kind: T }) => {
|
|
104
104
|
const d = r.querySelector(`[esd-extension-block-id="${u}"]`);
|
|
105
|
-
d && e(d,
|
|
106
|
-
}), !
|
|
105
|
+
d && e(d, i, T);
|
|
106
|
+
}), !_(r))
|
|
107
107
|
return;
|
|
108
108
|
const n = /* @__PURE__ */ new Set();
|
|
109
109
|
r.querySelectorAll(
|
|
110
110
|
`[esd-extension-block-id="${c.CUSTOM_ATTRIBUTE}"]`
|
|
111
|
-
).forEach((
|
|
112
|
-
const u = l(
|
|
113
|
-
!u || n.has(u) || (n.add(u), e(
|
|
111
|
+
).forEach((i) => {
|
|
112
|
+
const u = l(i) ? i.getAttribute(x) : null;
|
|
113
|
+
!u || n.has(u) || (n.add(u), e(i, v(u), "text"));
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
function F(t) {
|
|
117
117
|
const e = {};
|
|
118
|
-
return f(t, (r, n,
|
|
118
|
+
return f(t, (r, n, o) => {
|
|
119
119
|
if (!("querySelector" in r))
|
|
120
120
|
return;
|
|
121
|
-
const
|
|
122
|
-
|
|
121
|
+
const i = H(r, o);
|
|
122
|
+
i && (e[n] = i);
|
|
123
123
|
}), e;
|
|
124
124
|
}
|
|
125
125
|
function j(t) {
|
|
126
126
|
if (!t || !("querySelector" in t))
|
|
127
127
|
return;
|
|
128
128
|
const e = t.querySelector(S) ?? t, r = e.querySelector(".product-card-segment") ?? e.querySelector(".product-card-wrapper");
|
|
129
|
-
return
|
|
129
|
+
return k(r);
|
|
130
130
|
}
|
|
131
131
|
function X(t) {
|
|
132
132
|
if (!t)
|
|
@@ -134,28 +134,28 @@ function X(t) {
|
|
|
134
134
|
const e = l(t) ? t.getAttribute("bgcolor") : null;
|
|
135
135
|
if (e && !b.has(e))
|
|
136
136
|
return e;
|
|
137
|
-
const r =
|
|
137
|
+
const r = k(t);
|
|
138
138
|
if (r)
|
|
139
139
|
return r;
|
|
140
|
-
const n =
|
|
140
|
+
const n = U(t) ? t.getComputedStyle("background-color") : void 0;
|
|
141
141
|
return n && !b.has(n) ? n : void 0;
|
|
142
142
|
}
|
|
143
143
|
function z(t) {
|
|
144
144
|
const e = {};
|
|
145
|
-
return f(t, (r, n,
|
|
146
|
-
if (
|
|
145
|
+
return f(t, (r, n, o) => {
|
|
146
|
+
if (o !== "text")
|
|
147
147
|
return;
|
|
148
|
-
const
|
|
149
|
-
|
|
148
|
+
const i = X(r);
|
|
149
|
+
i && (e[n] = i);
|
|
150
150
|
}), e;
|
|
151
151
|
}
|
|
152
152
|
function Q(t) {
|
|
153
153
|
const e = {};
|
|
154
|
-
return f(t, (r, n,
|
|
155
|
-
if (
|
|
154
|
+
return f(t, (r, n, o) => {
|
|
155
|
+
if (o === "image")
|
|
156
156
|
return;
|
|
157
|
-
const
|
|
158
|
-
|
|
157
|
+
const i = l(r) ? r.getAttribute("align") : null;
|
|
158
|
+
i && (e[n] = i);
|
|
159
159
|
}), e;
|
|
160
160
|
}
|
|
161
161
|
const V = /^es-[pm]\d+[trbl]?$/;
|
|
@@ -167,44 +167,50 @@ function W(t) {
|
|
|
167
167
|
return r.length ? r.join(" ") : void 0;
|
|
168
168
|
}
|
|
169
169
|
function Y(t) {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
170
|
+
if (!t || !("querySelector" in t))
|
|
171
|
+
return !1;
|
|
172
|
+
const e = t.querySelector(S) ?? t, r = (n) => !!(n && "querySelector" in n && n.querySelector(".product-price") && n.querySelector(".product-old-price"));
|
|
173
|
+
return r(e.querySelector(`[data-attribute-type="${p}"]`)) || r(e.querySelector(`[data-attribute-type="${y}"]`));
|
|
174
|
+
}
|
|
175
|
+
function J(t) {
|
|
176
|
+
const e = {}, r = Y(t);
|
|
177
|
+
return f(t, (n, o, i) => {
|
|
178
|
+
if (i === "image" || r && (o === p || o === y))
|
|
173
179
|
return;
|
|
174
|
-
const
|
|
175
|
-
|
|
180
|
+
const u = W(n);
|
|
181
|
+
u && (e[o] = u);
|
|
176
182
|
}), e;
|
|
177
183
|
}
|
|
178
|
-
function
|
|
184
|
+
function Z(t) {
|
|
179
185
|
const e = {};
|
|
180
186
|
return f(t, (r, n) => {
|
|
181
|
-
if (n !==
|
|
187
|
+
if (n !== C && n !== A || !l(r))
|
|
182
188
|
return;
|
|
183
|
-
const
|
|
184
|
-
(
|
|
189
|
+
const o = r.getAttribute("data-text-before"), i = r.getAttribute("data-text-after");
|
|
190
|
+
(o != null || i != null) && (e[n] = { before: o ?? void 0, after: i ?? void 0 });
|
|
185
191
|
}), e;
|
|
186
192
|
}
|
|
187
|
-
function
|
|
193
|
+
function tt(t) {
|
|
188
194
|
const e = {};
|
|
189
195
|
if (!t || !("querySelector" in t))
|
|
190
196
|
return e;
|
|
191
197
|
const r = t.querySelector(S) ?? t;
|
|
192
|
-
return
|
|
198
|
+
return _(r) && r.querySelectorAll(".recommendation-attribute-row").forEach((n) => {
|
|
193
199
|
if (!l(n))
|
|
194
200
|
return;
|
|
195
|
-
const
|
|
196
|
-
|
|
201
|
+
const o = n.getAttribute("data-attribute-type"), i = n.getAttribute("data-visibility");
|
|
202
|
+
o && i != null && (e[o] = i !== "0");
|
|
197
203
|
}), e;
|
|
198
204
|
}
|
|
199
|
-
function
|
|
205
|
+
function ct(t) {
|
|
200
206
|
return {
|
|
201
207
|
styleTemplates: F(t),
|
|
202
208
|
cardBackgroundColor: j(t),
|
|
203
209
|
cellBackgroundColors: z(t),
|
|
204
210
|
cellAlignments: Q(t),
|
|
205
|
-
cellClasses:
|
|
206
|
-
omnibusTexts:
|
|
207
|
-
visibility:
|
|
211
|
+
cellClasses: J(t),
|
|
212
|
+
omnibusTexts: Z(t),
|
|
213
|
+
visibility: tt(t)
|
|
208
214
|
};
|
|
209
215
|
}
|
|
210
216
|
export {
|
|
@@ -212,8 +218,8 @@ export {
|
|
|
212
218
|
j as captureCardBackgroundColor,
|
|
213
219
|
Q as captureCellAlignments,
|
|
214
220
|
z as captureCellBackgroundColors,
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
221
|
+
J as captureCellClasses,
|
|
222
|
+
Z as captureOmnibusTexts,
|
|
223
|
+
ct as captureStyles,
|
|
224
|
+
tt as captureVisibility
|
|
219
225
|
};
|
|
@@ -19,6 +19,8 @@ export declare const PRODUCT_TYPE_URL_SEGMENTS: {
|
|
|
19
19
|
};
|
|
20
20
|
export declare const INSIDER_ID = "iid";
|
|
21
21
|
export declare const DEFAULT_UNSUBSCRIBE_GROUP_SEND_GRID_ID = "G";
|
|
22
|
+
export declare const PIXEL_TRACKING_SEND_GRID_ID = "P";
|
|
23
|
+
export declare const UNSUBSCRIBE_SENTINEL_SEND_GRID_IDS: string[];
|
|
22
24
|
/**
|
|
23
25
|
* Get the default unsubscribe group lazily so the translated name resolves at access time.
|
|
24
26
|
* Must be called within a Vue component context or after Pinia is initialized.
|
|
@@ -51,6 +51,12 @@ export declare function captureCellAlignments(node: ImmutableHtmlNode | null | u
|
|
|
51
51
|
* text-trim) keyed by composition key, so a regeneration can re-bake them
|
|
52
52
|
* instead of resetting to the renderer's hardcoded spacing classes. Stripo stores padding
|
|
53
53
|
* and margin as these classes (NOT inline style), so an inline-style capture misses them.
|
|
54
|
+
*
|
|
55
|
+
* Inline price mode: the merged columns carry POSITIONAL spacing classes
|
|
56
|
+
* (`es-p15l es-p5r` / `es-p5l es-p15r`) that build the side-by-side gap — layout
|
|
57
|
+
* mechanics, not user padding. Skip the price cells then, so toggling back to
|
|
58
|
+
* stacked resets them to the renderer defaults instead of baking the lopsided
|
|
59
|
+
* inline paddings (SD-145161).
|
|
54
60
|
*/
|
|
55
61
|
export declare function captureCellClasses(node: ImmutableHtmlNode | null | undefined): Record<string, string>;
|
|
56
62
|
/**
|
|
@@ -39,6 +39,18 @@ ue-dropdown .service-element.padding-t-3 {
|
|
|
39
39
|
color: var(--guido-color-primary-500);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
/*
|
|
43
|
+
* SD-145233: the pixel-tracking preference dropdown has no native option groups,
|
|
44
|
+
* so its section titles are rendered as disabled items. Present them as
|
|
45
|
+
* non-interactive group headers instead of options: no hover/cursor affordance
|
|
46
|
+
* and a little extra vertical spacing.
|
|
47
|
+
*/
|
|
48
|
+
.dropdown__menu .dropdown__item.disabled {
|
|
49
|
+
padding-top: 14px;
|
|
50
|
+
padding-bottom: 8px;
|
|
51
|
+
pointer-events: none;
|
|
52
|
+
}
|
|
53
|
+
|
|
42
54
|
.menu {
|
|
43
55
|
padding: 8px 0px;
|
|
44
56
|
}
|
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.bde1a34",
|
|
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",
|